aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2011-11-08 03:20:30 +0000
committerAldy Hernandez <aldyh@redhat.com>2011-11-08 03:20:30 +0000
commit47180e1668b0766d1e473fed8d9385c0e765285d (patch)
tree1eb48ad31d05a9ce117bedc17115de96dffa2f0b
parent80b9b1c40004ddf7dd74248b642d489384f37ace (diff)
parenteb6a1d75b768b663579adeb2a50828cf679b6f12 (diff)
* Merge from mainline rev 181122.transactional-memory
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/transactional-memory@181148 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.tm4
-rw-r--r--Makefile.in7
-rw-r--r--Makefile.tpl7
-rwxr-xr-xconfig.sub6
-rw-r--r--config/ChangeLog4
-rw-r--r--config/mh-interix5
-rw-r--r--contrib/ChangeLog4
-rw-r--r--contrib/config-list.mk3
-rw-r--r--gcc/ChangeLog1883
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in180
-rw-r--r--gcc/ada/ChangeLog400
-rw-r--r--gcc/ada/Makefile.rtl10
-rw-r--r--gcc/ada/a-cbdlli.adb16
-rw-r--r--gcc/ada/a-cdlili.adb48
-rw-r--r--gcc/ada/a-cdlili.ads4
-rw-r--r--gcc/ada/a-cgaaso.adb104
-rw-r--r--gcc/ada/a-cidlli.adb48
-rw-r--r--gcc/ada/a-cidlli.ads4
-rw-r--r--gcc/ada/a-cihama.adb65
-rw-r--r--gcc/ada/a-cihama.ads4
-rw-r--r--gcc/ada/a-cihase.adb38
-rw-r--r--gcc/ada/a-cihase.ads4
-rw-r--r--gcc/ada/a-ciorma.adb44
-rw-r--r--gcc/ada/a-ciorma.ads4
-rw-r--r--gcc/ada/a-ciormu.adb29
-rw-r--r--gcc/ada/a-ciormu.ads6
-rw-r--r--gcc/ada/a-ciorse.adb27
-rw-r--r--gcc/ada/a-ciorse.ads4
-rw-r--r--gcc/ada/a-cobove.adb18
-rw-r--r--gcc/ada/a-cogeso.adb127
-rw-r--r--gcc/ada/a-cogeso.ads40
-rw-r--r--gcc/ada/a-cohama.adb97
-rw-r--r--gcc/ada/a-cohama.ads25
-rw-r--r--gcc/ada/a-cohase.adb40
-rw-r--r--gcc/ada/a-cohase.ads6
-rw-r--r--gcc/ada/a-coinve.adb60
-rw-r--r--gcc/ada/a-coinve.ads4
-rw-r--r--gcc/ada/a-convec.adb60
-rw-r--r--gcc/ada/a-convec.ads5
-rw-r--r--gcc/ada/a-coorma.adb44
-rw-r--r--gcc/ada/a-coorma.ads4
-rw-r--r--gcc/ada/a-coormu.adb29
-rw-r--r--gcc/ada/a-coormu.ads6
-rw-r--r--gcc/ada/a-coorse.adb27
-rw-r--r--gcc/ada/a-coorse.ads4
-rw-r--r--gcc/ada/a-sbecin.adb (renamed from gcc/ada/i-forbla-darwin.adb)28
-rw-r--r--gcc/ada/a-sbecin.ads (renamed from gcc/ada/i-forbla.adb)34
-rw-r--r--gcc/ada/a-sbhcin.adb38
-rw-r--r--gcc/ada/a-sbhcin.ads (renamed from gcc/ada/i-forbla-unimplemented.ads)33
-rw-r--r--gcc/ada/a-sblcin.adb40
-rw-r--r--gcc/ada/a-sblcin.ads42
-rw-r--r--gcc/ada/a-sfecin.ads40
-rw-r--r--gcc/ada/a-sfhcin.ads41
-rw-r--r--gcc/ada/a-sflcin.ads40
-rw-r--r--gcc/ada/a-suecin.adb47
-rw-r--r--gcc/ada/a-suecin.ads38
-rw-r--r--gcc/ada/a-suhcin.adb43
-rw-r--r--gcc/ada/a-suhcin.ads40
-rw-r--r--gcc/ada/a-sulcin.adb47
-rw-r--r--gcc/ada/a-sulcin.ads38
-rwxr-xr-xgcc/ada/aspects.adb14
-rwxr-xr-xgcc/ada/aspects.ads12
-rw-r--r--gcc/ada/atree.adb9
-rw-r--r--gcc/ada/atree.ads22
-rw-r--r--gcc/ada/bindgen.adb76
-rw-r--r--gcc/ada/checks.adb19
-rw-r--r--gcc/ada/errout.adb2
-rw-r--r--gcc/ada/exp_alfa.adb63
-rw-r--r--gcc/ada/exp_attr.adb6
-rw-r--r--gcc/ada/exp_ch11.adb12
-rw-r--r--gcc/ada/exp_ch2.adb43
-rw-r--r--gcc/ada/exp_ch4.adb77
-rw-r--r--gcc/ada/exp_ch5.adb39
-rw-r--r--gcc/ada/exp_ch6.adb15
-rw-r--r--gcc/ada/exp_ch8.adb116
-rw-r--r--gcc/ada/exp_ch8.ads2
-rw-r--r--gcc/ada/exp_util.adb253
-rw-r--r--gcc/ada/exp_util.ads13
-rw-r--r--gcc/ada/freeze.adb10
-rw-r--r--gcc/ada/g-excact.adb4
-rw-r--r--gcc/ada/g-socket.adb38
-rw-r--r--gcc/ada/g-socket.ads13
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in138
-rw-r--r--gcc/ada/gcc-interface/Makefile.in8
-rw-r--r--gcc/ada/gcc-interface/decl.c3
-rw-r--r--gcc/ada/gnat_rm.texi34
-rw-r--r--gcc/ada/gnat_ugn.texi454
-rw-r--r--gcc/ada/i-forbla.ads261
-rw-r--r--gcc/ada/i-forlap.ads414
-rw-r--r--gcc/ada/impunit.adb16
-rw-r--r--gcc/ada/par-labl.adb5
-rw-r--r--gcc/ada/prj-env.adb154
-rw-r--r--gcc/ada/prj-env.ads11
-rw-r--r--gcc/ada/projects.texi6
-rw-r--r--gcc/ada/s-atocou.ads1
-rw-r--r--gcc/ada/s-gecobl.adb350
-rw-r--r--gcc/ada/s-gecobl.ads102
-rw-r--r--gcc/ada/s-gecola.adb493
-rw-r--r--gcc/ada/s-gecola.ads131
-rw-r--r--gcc/ada/s-gerebl.adb311
-rw-r--r--gcc/ada/s-gerebl.ads96
-rw-r--r--gcc/ada/s-gerela.adb564
-rw-r--r--gcc/ada/s-gerela.ads128
-rw-r--r--gcc/ada/s-tassta.adb2
-rw-r--r--gcc/ada/sem_ch10.adb8
-rw-r--r--gcc/ada/sem_ch12.adb10
-rw-r--r--gcc/ada/sem_ch13.adb27
-rw-r--r--gcc/ada/sem_ch4.adb51
-rw-r--r--gcc/ada/sem_ch5.adb26
-rw-r--r--gcc/ada/sem_ch6.adb16
-rw-r--r--gcc/ada/sem_prag.adb214
-rw-r--r--gcc/ada/sem_res.adb12
-rw-r--r--gcc/ada/sem_util.adb9
-rw-r--r--gcc/ada/sem_warn.adb70
-rw-r--r--gcc/ada/sigtramp-ppcvxw.c47
-rw-r--r--gcc/ada/sinfo.adb10
-rw-r--r--gcc/ada/sinfo.ads9
-rw-r--r--gcc/ada/sinput.adb3
-rw-r--r--gcc/ada/sprint.adb10
-rw-r--r--gcc/builtin-types.def53
-rw-r--r--gcc/builtins.c837
-rw-r--r--gcc/c-decl.c83
-rw-r--r--gcc/c-family/ChangeLog69
-rw-r--r--gcc/c-family/c-common.c623
-rw-r--r--gcc/c-family/c-common.h7
-rw-r--r--gcc/c-family/c-cppbuiltin.c50
-rw-r--r--gcc/c-family/c-opts.c18
-rw-r--r--gcc/c-family/c.opt8
-rw-r--r--gcc/c-parser.c70
-rw-r--r--gcc/c-tree.h8
-rw-r--r--gcc/c-typeck.c9
-rw-r--r--gcc/cfglayout.c6
-rw-r--r--gcc/collect2.c54
-rw-r--r--gcc/common.opt8
-rw-r--r--gcc/common/config/alpha/alpha-common.c14
-rw-r--r--gcc/common/config/epiphany/epiphany-common.c46
-rw-r--r--gcc/config.gcc316
-rw-r--r--gcc/config/alpha/alpha-protos.h3
-rw-r--r--gcc/config/alpha/alpha.c246
-rw-r--r--gcc/config/alpha/alpha.md20
-rw-r--r--gcc/config/alpha/t-alpha2
-rw-r--r--gcc/config/alpha/t-ieee2
-rw-r--r--gcc/config/alpha/t-vms45
-rw-r--r--gcc/config/alpha/vms.h61
-rw-r--r--gcc/config/alpha/vms64.h51
-rw-r--r--gcc/config/arm/arm.c4
-rw-r--r--gcc/config/arm/bpabi.h1
-rw-r--r--gcc/config/arm/linux-eabi.h2
-rw-r--r--gcc/config/arm/rtems-eabi.h29
-rw-r--r--gcc/config/arm/rtems-elf.h2
-rw-r--r--gcc/config/arm/t-arm3
-rw-r--r--gcc/config/arm/t-arm-elf37
-rw-r--r--gcc/config/arm/t-bpabi30
-rw-r--r--gcc/config/arm/t-linux34
-rw-r--r--gcc/config/arm/t-linux-eabi15
-rw-r--r--gcc/config/arm/t-netbsd47
-rw-r--r--gcc/config/arm/t-rtems41
-rw-r--r--gcc/config/arm/t-rtems-eabi8
-rw-r--r--gcc/config/arm/t-strongarm-elf20
-rw-r--r--gcc/config/arm/t-symbian23
-rw-r--r--gcc/config/arm/t-vxworks2
-rw-r--r--gcc/config/arm/t-wince-pe6
-rw-r--r--gcc/config/avr/avr-c.c4
-rw-r--r--gcc/config/avr/avr-modes.def1
-rw-r--r--gcc/config/avr/avr-protos.h8
-rw-r--r--gcc/config/avr/avr.c859
-rw-r--r--gcc/config/avr/avr.md599
-rw-r--r--gcc/config/avr/constraints.md20
-rw-r--r--gcc/config/avr/t-avr59
-rw-r--r--gcc/config/bfin/t-bfin34
-rw-r--r--gcc/config/bfin/t-bfin-elf23
-rw-r--r--gcc/config/bfin/t-bfin-linux11
-rw-r--r--gcc/config/bfin/t-bfin-uclinux15
-rw-r--r--gcc/config/c6x/t-c6x-elf37
-rw-r--r--gcc/config/c6x/t-c6x-uclinux4
-rw-r--r--gcc/config/cris/constraints.md164
-rw-r--r--gcc/config/cris/cris.c13
-rw-r--r--gcc/config/cris/cris.h137
-rw-r--r--gcc/config/cris/cris.md69
-rw-r--r--gcc/config/cris/cris_abi_symbol.c45
-rw-r--r--gcc/config/cris/t-cris12
-rw-r--r--gcc/config/cris/t-elfmulti4
-rw-r--r--gcc/config/cris/t-linux4
-rw-r--r--gcc/config/epiphany/constraints.md125
-rw-r--r--gcc/config/epiphany/epiphany-modes.def40
-rw-r--r--gcc/config/epiphany/epiphany-protos.h55
-rw-r--r--gcc/config/epiphany/epiphany-sched.md135
-rw-r--r--gcc/config/epiphany/epiphany.c2751
-rw-r--r--gcc/config/epiphany/epiphany.h881
-rw-r--r--gcc/config/epiphany/epiphany.md2447
-rw-r--r--gcc/config/epiphany/epiphany.opt140
-rw-r--r--gcc/config/epiphany/epiphany_intrinsics.h27
-rw-r--r--gcc/config/epiphany/mode-switch-use.c91
-rw-r--r--gcc/config/epiphany/predicates.md352
-rw-r--r--gcc/config/epiphany/resolve-sw-modes.c182
-rw-r--r--gcc/config/epiphany/t-epiphany32
-rw-r--r--gcc/config/fr30/t-fr3044
-rw-r--r--gcc/config/frv/t-frv63
-rw-r--r--gcc/config/frv/t-linux11
-rw-r--r--gcc/config/h8300/t-elf6
-rw-r--r--gcc/config/h8300/t-h830017
-rw-r--r--gcc/config/i386/avx2intrin.h6
-rw-r--r--gcc/config/i386/cygwin.h2
-rw-r--r--gcc/config/i386/f16cintrin.h92
-rw-r--r--gcc/config/i386/i386-builtin-types.def5
-rw-r--r--gcc/config/i386/i386-protos.h4
-rw-r--r--gcc/config/i386/i386.c367
-rw-r--r--gcc/config/i386/i386.md201
-rw-r--r--gcc/config/i386/immintrin.h63
-rw-r--r--gcc/config/i386/mingw32.h2
-rw-r--r--gcc/config/i386/predicates.md2
-rw-r--r--gcc/config/i386/sse.md181
-rw-r--r--gcc/config/i386/sync.md455
-rw-r--r--gcc/config/i386/t-crtstuff7
-rw-r--r--gcc/config/i386/t-cygming71
-rw-r--r--gcc/config/i386/t-darwin3
-rw-r--r--gcc/config/i386/t-darwin646
-rw-r--r--gcc/config/i386/t-dlldir6
-rw-r--r--gcc/config/i386/t-dlldir-x9
-rw-r--r--gcc/config/i386/t-i386elf4
-rw-r--r--gcc/config/i386/t-interix3
-rw-r--r--gcc/config/i386/t-linux647
-rw-r--r--gcc/config/i386/t-mingw-w326
-rw-r--r--gcc/config/i386/t-mingw-w646
-rw-r--r--gcc/config/i386/t-nto4
-rw-r--r--gcc/config/i386/t-openbsd2
-rw-r--r--gcc/config/ia64/t-glibc1
-rw-r--r--gcc/config/ia64/t-hpux44
-rw-r--r--gcc/config/ia64/t-ia6425
-rw-r--r--gcc/config/ia64/t-vms47
-rw-r--r--gcc/config/ia64/vms.h28
-rw-r--r--gcc/config/ia64/vms_symvec_libgcc_s.opt89
-rw-r--r--gcc/config/iq2000/t-iq200038
-rw-r--r--gcc/config/lm32/t-rtems21
-rw-r--r--gcc/config/m32c/m32c.c2
-rw-r--r--gcc/config/m32c/t-m32c14
-rw-r--r--gcc/config/m32r/t-linux25
-rw-r--r--gcc/config/m32r/t-m32r39
-rw-r--r--gcc/config/m68k/t-crtstuff10
-rw-r--r--gcc/config/m68k/t-floatlib31
-rw-r--r--gcc/config/m68k/t-linux4
-rw-r--r--gcc/config/m68k/t-m68kelf4
-rw-r--r--gcc/config/m68k/t-mlibs3
-rw-r--r--gcc/config/m68k/t-uclinux5
-rw-r--r--gcc/config/mcore/t-mcore27
-rw-r--r--gcc/config/mep/t-mep24
-rw-r--r--gcc/config/microblaze/t-microblaze12
-rw-r--r--gcc/config/mips/t-elf22
-rw-r--r--gcc/config/mips/t-isa326422
-rw-r--r--gcc/config/mips/t-libgcc-mips1642
-rw-r--r--gcc/config/mips/t-linux642
-rw-r--r--gcc/config/mips/t-mips2
-rw-r--r--gcc/config/mips/t-r390013
-rw-r--r--gcc/config/mips/t-sde20
-rw-r--r--gcc/config/mips/t-sr71k26
-rw-r--r--gcc/config/mips/t-st4
-rw-r--r--gcc/config/mips/t-vr26
-rw-r--r--gcc/config/mmix/t-mmix13
-rw-r--r--gcc/config/mn10300/t-mn103003
-rw-r--r--gcc/config/moxie/crti.asm40
-rw-r--r--gcc/config/moxie/crtn.asm34
-rw-r--r--gcc/config/pa/pa.c95
-rw-r--r--gcc/config/pa/t-dce-thr3
-rw-r--r--gcc/config/pa/t-hpux-shlib46
-rw-r--r--gcc/config/pa/t-linux37
-rw-r--r--gcc/config/pa/t-linux6432
-rw-r--r--gcc/config/pa/t-pa-hpux7
-rw-r--r--gcc/config/pa/t-pa-hpux102
-rw-r--r--gcc/config/pa/t-pa-hpux1131
-rw-r--r--gcc/config/pa/t-pa6467
-rw-r--r--gcc/config/pdp11/t-pdp115
-rw-r--r--gcc/config/picochip/libgccExtras/fake_libgcc.asm6
-rw-r--r--gcc/config/picochip/t-picochip39
-rw-r--r--gcc/config/rs6000/rs6000.c30
-rw-r--r--gcc/config/rs6000/rtems.h17
-rw-r--r--gcc/config/rs6000/t-aix4332
-rw-r--r--gcc/config/rs6000/t-aix5231
-rw-r--r--gcc/config/rs6000/t-darwin39
-rw-r--r--gcc/config/rs6000/t-darwin649
-rw-r--r--gcc/config/rs6000/t-fprules5
-rw-r--r--gcc/config/rs6000/t-linux642
-rw-r--r--gcc/config/rs6000/t-lynx17
-rw-r--r--gcc/config/rs6000/t-netbsd56
-rw-r--r--gcc/config/rs6000/t-ppccomm51
-rw-r--r--gcc/config/rs6000/t-rtems40
-rw-r--r--gcc/config/rs6000/t-spe3
-rw-r--r--gcc/config/rs6000/t-vxworks11
-rw-r--r--gcc/config/rx/t-rx5
-rw-r--r--gcc/config/score/t-score-elf26
-rw-r--r--gcc/config/sh/sh.h2
-rw-r--r--gcc/config/sh/t-elf10
-rw-r--r--gcc/config/sh/t-linux6
-rw-r--r--gcc/config/sh/t-linux641
-rw-r--r--gcc/config/sh/t-sh58
-rw-r--r--gcc/config/sh/t-sh649
-rw-r--r--gcc/config/sh/t-superh33
-rw-r--r--gcc/config/sh/t-vxworks3
-rw-r--r--gcc/config/sparc/lb1spl.asm246
-rw-r--r--gcc/config/sparc/sparc.c430
-rw-r--r--gcc/config/sparc/sparc.h1
-rw-r--r--gcc/config/sparc/sparc.md120
-rw-r--r--gcc/config/sparc/t-elf6
-rw-r--r--gcc/config/sparc/t-leon6
-rw-r--r--gcc/config/sparc/t-leon33
-rw-r--r--gcc/config/sparc/t-linux649
-rw-r--r--gcc/config/sparc/t-netbsd645
-rw-r--r--gcc/config/spu/t-spu-elf65
-rw-r--r--gcc/config/stormy16/stormy16-lib2-ashlsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-ashrsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-clzhi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-cmpsi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-ctzhi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-divsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-ffshi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-lshrsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-modsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-ucmpsi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-udivsi3.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2-umodsi3.c2
-rw-r--r--gcc/config/stormy16/t-stormy1639
-rw-r--r--gcc/config/t-darwin6
-rw-r--r--gcc/config/t-freebsd5
-rw-r--r--gcc/config/t-libc-ok1
-rw-r--r--gcc/config/t-libgcc-pic2
-rw-r--r--gcc/config/t-libunwind6
-rw-r--r--gcc/config/t-linux27
-rw-r--r--gcc/config/t-lynx11
-rw-r--r--gcc/config/t-netbsd2
-rw-r--r--gcc/config/t-rtems5
-rw-r--r--gcc/config/t-slibgcc2
-rw-r--r--gcc/config/t-slibgcc-dummy3
-rw-r--r--gcc/config/t-slibgcc-elf-ver56
-rw-r--r--gcc/config/t-sol23
-rw-r--r--gcc/config/t-svr48
-rw-r--r--gcc/config/t-vxworks30
-rw-r--r--gcc/config/v850/t-v85062
-rw-r--r--gcc/config/vms/t-vms19
-rw-r--r--gcc/config/vms/vms-c.c248
-rw-r--r--gcc/config/vms/vms-protos.h3
-rw-r--r--gcc/config/vms/vms.c8
-rw-r--r--gcc/config/vms/vms.h60
-rw-r--r--gcc/config/vms/vms64.h (renamed from gcc/config/ia64/vms64.h)22
-rw-r--r--gcc/config/xtensa/t-linux3
-rw-r--r--gcc/config/xtensa/t-xtensa21
-rwxr-xr-xgcc/configure97
-rw-r--r--gcc/configure.ac43
-rw-r--r--gcc/coretypes.h13
-rw-r--r--gcc/coverage.c649
-rw-r--r--gcc/cp/ChangeLog219
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c219
-rw-r--r--gcc/cp/class.c6
-rw-r--r--gcc/cp/cp-tree.h59
-rw-r--r--gcc/cp/cvt.c5
-rw-r--r--gcc/cp/decl.c131
-rw-r--r--gcc/cp/decl2.c64
-rw-r--r--gcc/cp/error.c55
-rw-r--r--gcc/cp/init.c85
-rw-r--r--gcc/cp/mangle.c7
-rw-r--r--gcc/cp/parser.c161
-rw-r--r--gcc/cp/pt.c212
-rw-r--r--gcc/cp/search.c6
-rw-r--r--gcc/cp/semantics.c23
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/cp/typeck.c82
-rw-r--r--gcc/cp/typeck2.c29
-rw-r--r--gcc/cppbuiltin.c6
-rw-r--r--gcc/cprop.c16
-rw-r--r--gcc/doc/contrib.texi2
-rw-r--r--gcc/doc/extend.texi240
-rw-r--r--gcc/doc/install.texi12
-rw-r--r--gcc/doc/invoke.texi208
-rw-r--r--gcc/doc/md.texi222
-rw-r--r--gcc/doc/tm.texi8
-rw-r--r--gcc/doc/tm.texi.in8
-rw-r--r--gcc/dse.c141
-rw-r--r--gcc/dwarf2cfi.c3
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--gcc/expr.h13
-rw-r--r--gcc/final.c9
-rw-r--r--gcc/fortran/ChangeLog561
-rw-r--r--gcc/fortran/Make-lang.in2
-rw-r--r--gcc/fortran/array.c1
-rw-r--r--gcc/fortran/class.c4
-rw-r--r--gcc/fortran/dependency.c11
-rw-r--r--gcc/fortran/frontend-passes.c7
-rw-r--r--gcc/fortran/gfortran.h5
-rw-r--r--gcc/fortran/interface.c28
-rw-r--r--gcc/fortran/intrinsic.texi12
-rw-r--r--gcc/fortran/matchexp.c1
-rw-r--r--gcc/fortran/resolve.c71
-rw-r--r--gcc/fortran/trans-array.c1441
-rw-r--r--gcc/fortran/trans-array.h9
-rw-r--r--gcc/fortran/trans-const.c18
-rw-r--r--gcc/fortran/trans-decl.c4
-rw-r--r--gcc/fortran/trans-expr.c137
-rw-r--r--gcc/fortran/trans-intrinsic.c388
-rw-r--r--gcc/fortran/trans-io.c24
-rw-r--r--gcc/fortran/trans-stmt.c129
-rw-r--r--gcc/fortran/trans.h93
-rw-r--r--gcc/fortran/types.def56
-rw-r--r--gcc/gcc.c11
-rw-r--r--gcc/gcov-dump.c29
-rw-r--r--gcc/gcov-io.h65
-rw-r--r--gcc/gcov.c126
-rw-r--r--gcc/gcse.c261
-rw-r--r--gcc/gengtype.c1
-rw-r--r--gcc/genopinit.c22
-rw-r--r--gcc/gimple-fold.c100
-rw-r--r--gcc/gimple.h1
-rw-r--r--gcc/ginclude/stdalign.h39
-rw-r--r--gcc/ginclude/stddef.h16
-rw-r--r--gcc/go/ChangeLog4
-rw-r--r--gcc/go/Make-lang.in2
-rw-r--r--gcc/go/gofrontend/statements.cc24
-rw-r--r--gcc/godump.c155
-rw-r--r--gcc/ifcvt.c6
-rw-r--r--gcc/insn-notes.def4
-rw-r--r--gcc/ipa-inline.c2
-rw-r--r--gcc/ipa-prop.c123
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/Make-lang.in2
-rw-r--r--gcc/lto-opts.c437
-rw-r--r--gcc/lto-streamer.h5
-rw-r--r--gcc/lto-wrapper.c247
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto-lang.c2
-rw-r--r--gcc/lto/lto.c55
-rw-r--r--gcc/mkconfig.sh8
-rw-r--r--gcc/omp-low.c89
-rw-r--r--gcc/optabs.c858
-rw-r--r--gcc/optabs.h89
-rw-r--r--gcc/opts-common.c3
-rw-r--r--gcc/opts-global.c19
-rw-r--r--gcc/opts.h4
-rw-r--r--gcc/params.def15
-rw-r--r--gcc/params.h7
-rw-r--r--gcc/po/ChangeLog15
-rw-r--r--gcc/po/EXCLUDES16
-rw-r--r--gcc/postreload.c8
-rw-r--r--gcc/print-rtl.c11
-rw-r--r--gcc/reginfo.c14
-rw-r--r--gcc/regset.h5
-rw-r--r--gcc/reload1.c4
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/sched-vis.c6
-rw-r--r--gcc/sync-builtins.def338
-rw-r--r--gcc/target.def8
-rw-r--r--gcc/testsuite/ChangeLog391
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-1.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-1.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-10.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-10.c)3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-12.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-12.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-13.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-13.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-14.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-14.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-15.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-15.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-2.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-2.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-3.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-3.c)3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-4.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-4.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-7.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-7.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-8.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-8.c)0
-rw-r--r--gcc/testsuite/c-c++-common/gomp/atomic-9.c (renamed from gcc/testsuite/gcc.dg/gomp/atomic-9.c)3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C161
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-0.C37
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C33
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C42
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-5.C34
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-6.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-7.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-8.C32
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-9.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alignof3.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket3.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum21a.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum21b.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-lifetime1.C34
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-lifetime2.C64
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-list2.C32
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/udlit-string-length.C46
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/warn_cxx0x2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/warn_cxx0x3.C4
-rw-r--r--gcc/testsuite/g++.dg/dg.exp1
-rw-r--r--gcc/testsuite/g++.dg/eh/array1.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/alias-decl-attr1.C19
-rw-r--r--gcc/testsuite/g++.dg/ext/alias-decl-attr2.C42
-rw-r--r--gcc/testsuite/g++.dg/ext/alias-decl-attr3.C21
-rw-r--r--gcc/testsuite/g++.dg/ext/alias-decl-attr4.C34
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/template7.C29
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/template8.C26
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-1.C99
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-10.C24
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-11.C306
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-12.C9
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-13.C43
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-15.C46
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-2.C23
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-3.C13
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-4.C24
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-7.C23
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-8.C21
-rw-r--r--gcc/testsuite/g++.dg/gomp/atomic-9.C13
-rw-r--r--gcc/testsuite/g++.dg/gomp/gomp.exp2
-rw-r--r--gcc/testsuite/g++.dg/init/copy7.C39
-rw-r--r--gcc/testsuite/g++.dg/init/lifetime1.C29
-rw-r--r--gcc/testsuite/g++.dg/init/lifetime2.C23
-rw-r--r--gcc/testsuite/g++.dg/init/ref21.C7
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-c-1.C7
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-c-2.C7
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-c-7.C87
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-c-8.C82
-rw-r--r--gcc/testsuite/g++.dg/opt/devirt2.C3
-rw-r--r--gcc/testsuite/g++.dg/other/offsetof7.C17
-rw-r--r--gcc/testsuite/g++.dg/parse/pragma3.C3
-rw-r--r--gcc/testsuite/g++.dg/pr50672.C101
-rw-r--r--gcc/testsuite/g++.dg/pr50763-3.C57
-rw-r--r--gcc/testsuite/g++.dg/pr50763-4.C34
-rw-r--r--gcc/testsuite/g++.dg/simulate-thread/atomics-1.C73
-rw-r--r--gcc/testsuite/g++.dg/simulate-thread/atomics-2.C58
-rw-r--r--gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C77
-rw-r--r--gcc/testsuite/g++.dg/simulate-thread/bitfields.C80
-rw-r--r--gcc/testsuite/g++.dg/warn/Wcast-qual2.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-null-3.C8
-rw-r--r--gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-1.C100
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20101011-1.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x5
-rw-r--r--gcc/testsuite/gcc.dg/20020312-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c85
-rw-r--r--gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c85
-rw-r--r--gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c85
-rw-r--r--gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c86
-rw-r--r--gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c86
-rw-r--r--gcc/testsuite/gcc.dg/atomic-exchange-1.c62
-rw-r--r--gcc/testsuite/gcc.dg/atomic-exchange-2.c62
-rw-r--r--gcc/testsuite/gcc.dg/atomic-exchange-3.c62
-rw-r--r--gcc/testsuite/gcc.dg/atomic-exchange-4.c63
-rw-r--r--gcc/testsuite/gcc.dg/atomic-exchange-5.c63
-rw-r--r--gcc/testsuite/gcc.dg/atomic-fence.c27
-rw-r--r--gcc/testsuite/gcc.dg/atomic-generic-aux.c45
-rw-r--r--gcc/testsuite/gcc.dg/atomic-generic.c56
-rw-r--r--gcc/testsuite/gcc.dg/atomic-invalid.c29
-rw-r--r--gcc/testsuite/gcc.dg/atomic-load-1.c66
-rw-r--r--gcc/testsuite/gcc.dg/atomic-load-2.c68
-rw-r--r--gcc/testsuite/gcc.dg/atomic-load-3.c65
-rw-r--r--gcc/testsuite/gcc.dg/atomic-load-4.c65
-rw-r--r--gcc/testsuite/gcc.dg/atomic-load-5.c65
-rw-r--r--gcc/testsuite/gcc.dg/atomic-lockfree-aux.c17
-rw-r--r--gcc/testsuite/gcc.dg/atomic-lockfree.c120
-rw-r--r--gcc/testsuite/gcc.dg/atomic-noinline-aux.c51
-rw-r--r--gcc/testsuite/gcc.dg/atomic-noinline.c56
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-1.c554
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-2.c555
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-3.c554
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-4.c555
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-5.c555
-rw-r--r--gcc/testsuite/gcc.dg/atomic-param.c13
-rw-r--r--gcc/testsuite/gcc.dg/atomic-store-1.c47
-rw-r--r--gcc/testsuite/gcc.dg/atomic-store-2.c46
-rw-r--r--gcc/testsuite/gcc.dg/atomic-store-3.c47
-rw-r--r--gcc/testsuite/gcc.dg/atomic-store-4.c48
-rw-r--r--gcc/testsuite/gcc.dg/atomic-store-5.c48
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply2.c2
-rw-r--r--gcc/testsuite/gcc.dg/c1x-align-1.c41
-rw-r--r--gcc/testsuite/gcc.dg/c1x-align-2.c92
-rw-r--r--gcc/testsuite/gcc.dg/c1x-align-3.c42
-rw-r--r--gcc/testsuite/gcc.dg/c1x-align-4.c8
-rw-r--r--gcc/testsuite/gcc.dg/c90-align-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/c99-align-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/gnu89-const-expr-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gnu90-const-expr-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gnu99-const-expr-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gnu99-static-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/atomic-11.c17
-rw-r--r--gcc/testsuite/gcc.dg/gomp/gomp.exp3
-rw-r--r--gcc/testsuite/gcc.dg/pr50763-5.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr50908-2.c80
-rw-r--r--gcc/testsuite/gcc.dg/pr50908-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr50908.c175
-rw-r--r--gcc/testsuite/gcc.dg/pragma-align-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/pragma-pack-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c116
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c132
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c117
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c116
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c118
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c116
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c117
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c117
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c57
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c52
-rw-r--r--gcc/testsuite/gcc.dg/simulate-thread/subfields.c93
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-22.c7
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-22g.c14
-rw-r--r--gcc/testsuite/gcc.dg/tls/thr-cse-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr50890.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr50902.c9
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/torture/vec-cvt-1.c211
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c46
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-cond-1.c126
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-cond-2.c127
-rw-r--r--gcc/testsuite/gcc.dg/weak/typeof-2.c3
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-12.c17
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-13.c18
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-14.c24
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov.exp2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcovpart-13b.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/stack-red-zone.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/wmul-1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/wmul-2.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/wmul-3.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/wmul-4.c2
-rw-r--r--gcc/testsuite/gcc.target/epiphany/epiphany.exp41
-rw-r--r--gcc/testsuite/gcc.target/epiphany/fmadd-1.c17
-rw-r--r--gcc/testsuite/gcc.target/epiphany/fmsub-1.c17
-rw-r--r--gcc/testsuite/gcc.target/epiphany/interrupt.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/47698.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-cvt-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-cvt-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-gather-1.c215
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-gather-2.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-gather-3.c167
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-gather-4.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/pr49781-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-cvt-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize4-avx.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/20111102-1.c17
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-1-vis1.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-1-vis2.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-1-vis3.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-1.inc85
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-2-vis1.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-2-vis2.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-2-vis3.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-2.inc94
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-3-vis1.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-3-vis2.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-3-vis3.c5
-rw-r--r--gcc/testsuite/gcc.target/sparc/vec-init-3.inc105
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_dts_5.f9054
-rw-r--r--gcc/testsuite/gfortran.dg/function_optimize_7.f903
-rw-r--r--gcc/testsuite/gfortran.dg/inline_product_1.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/inline_sum_1.f90194
-rw-r--r--gcc/testsuite/gfortran.dg/inline_sum_2.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/inline_sum_bounds_check_1.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/inline_sum_bounds_check_2.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/module_parameter_array_refs_2.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/open_dev_null.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr50769.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/quad_2.f9063
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_21.f0339
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization10.adb18
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization10.ads11
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization10_pkg.ads12
-rw-r--r--gcc/testsuite/gnat.dg/specs/private1-sub.ads13
-rw-r--r--gcc/testsuite/gnat.dg/specs/private1.ads5
-rw-r--r--gcc/testsuite/go.test/test/closedchan.go29
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp21
-rw-r--r--gcc/testsuite/lib/scanasm.exp10
-rw-r--r--gcc/testsuite/lib/target-supports.exp62
-rw-r--r--gcc/tree-cfg.c19
-rw-r--r--gcc/tree-data-ref.c6
-rw-r--r--gcc/tree-data-ref.h5
-rw-r--r--gcc/tree-vect-data-refs.c346
-rw-r--r--gcc/tree-vect-loop.c15
-rw-r--r--gcc/tree-vect-slp.c766
-rw-r--r--gcc/tree-vect-stmts.c2167
-rw-r--r--gcc/tree-vectorizer.h49
-rw-r--r--gcc/tree.h5
-rw-r--r--gcc/var-tracking.c23
-rw-r--r--libcpp/ChangeLog17
-rw-r--r--libcpp/Makefile.in4
-rwxr-xr-xlibcpp/configure44
-rw-r--r--libcpp/configure.ac6
-rw-r--r--libcpp/internal.h12
-rw-r--r--libgcc/ChangeLog1026
-rw-r--r--libgcc/Makefile.in206
-rw-r--r--libgcc/config.host585
-rw-r--r--libgcc/config/alpha/gthr-posix.c (renamed from gcc/gthr-posix.c)6
-rw-r--r--libgcc/config/alpha/libgcc-alpha-ldbl.ver (renamed from gcc/config/alpha/libgcc-alpha-ldbl.ver)0
-rw-r--r--libgcc/config/alpha/qrnnd.S (renamed from gcc/config/alpha/qrnnd.asm)0
-rw-r--r--libgcc/config/alpha/t-alpha2
-rw-r--r--libgcc/config/alpha/t-linux (renamed from gcc/config/alpha/t-linux)0
-rw-r--r--libgcc/config/alpha/t-osf-pthread2
-rw-r--r--libgcc/config/alpha/t-slibgcc-osf2
-rw-r--r--libgcc/config/alpha/t-vms9
-rw-r--r--libgcc/config/alpha/vms-dwarf2.S (renamed from gcc/config/alpha/vms-dwarf2.asm)0
-rw-r--r--libgcc/config/alpha/vms-dwarf2eh.S (renamed from gcc/config/alpha/vms-dwarf2eh.asm)0
-rw-r--r--libgcc/config/alpha/vms-gcc_shell_handler.c (renamed from gcc/config/alpha/vms-gcc_shell_handler.c)0
-rw-r--r--libgcc/config/arm/bpabi-v6m.S (renamed from gcc/config/arm/bpabi-v6m.S)0
-rw-r--r--libgcc/config/arm/bpabi.S (renamed from gcc/config/arm/bpabi.S)0
-rw-r--r--libgcc/config/arm/bpabi.c (renamed from gcc/config/arm/bpabi.c)0
-rw-r--r--libgcc/config/arm/crti.S (renamed from gcc/config/arm/crti.asm)6
-rw-r--r--libgcc/config/arm/crtn.S (renamed from gcc/config/arm/crtn.asm)7
-rw-r--r--libgcc/config/arm/fp16.c (renamed from gcc/config/arm/fp16.c)0
-rw-r--r--libgcc/config/arm/ieee754-df.S (renamed from gcc/config/arm/ieee754-df.S)0
-rw-r--r--libgcc/config/arm/ieee754-sf.S (renamed from gcc/config/arm/ieee754-sf.S)0
-rw-r--r--libgcc/config/arm/lib1funcs.S (renamed from gcc/config/arm/lib1funcs.asm)0
-rw-r--r--libgcc/config/arm/libgcc-bpabi.ver (renamed from gcc/config/arm/libgcc-bpabi.ver)0
-rw-r--r--libgcc/config/arm/libunwind.S2
-rw-r--r--libgcc/config/arm/linux-atomic-64bit.c (renamed from gcc/config/arm/linux-atomic-64bit.c)0
-rw-r--r--libgcc/config/arm/linux-atomic.c (renamed from gcc/config/arm/linux-atomic.c)0
-rw-r--r--libgcc/config/arm/t-arm3
-rw-r--r--libgcc/config/arm/t-bpabi12
-rw-r--r--libgcc/config/arm/t-elf18
-rw-r--r--libgcc/config/arm/t-linux7
-rw-r--r--libgcc/config/arm/t-linux-eabi5
-rw-r--r--libgcc/config/arm/t-netbsd7
-rw-r--r--libgcc/config/arm/t-strongarm-elf6
-rw-r--r--libgcc/config/arm/t-symbian17
-rw-r--r--libgcc/config/arm/t-vxworks1
-rw-r--r--libgcc/config/arm/t-wince-pe1
-rw-r--r--libgcc/config/arm/unaligned-funcs.c (renamed from gcc/config/arm/unaligned-funcs.c)0
-rw-r--r--libgcc/config/avr/lib1funcs.S (renamed from gcc/config/avr/libgcc.S)241
-rw-r--r--libgcc/config/avr/t-avr57
-rw-r--r--libgcc/config/avr/t-rtems2
-rw-r--r--libgcc/config/bfin/crti.S (renamed from gcc/config/bfin/crti.s)0
-rw-r--r--libgcc/config/bfin/crtlibid.S (renamed from gcc/config/bfin/crtlibid.s)0
-rw-r--r--libgcc/config/bfin/crtn.S (renamed from gcc/config/bfin/crtn.s)0
-rw-r--r--libgcc/config/bfin/lib1funcs.S (renamed from gcc/config/bfin/lib1funcs.asm)0
-rw-r--r--libgcc/config/bfin/libgcc-glibc.ver (renamed from gcc/config/bfin/libgcc-bfin.ver)0
-rw-r--r--libgcc/config/bfin/t-bfin3
-rw-r--r--libgcc/config/bfin/t-crtlibid3
-rw-r--r--libgcc/config/bfin/t-crtstuff1
-rw-r--r--libgcc/config/bfin/t-linux1
-rw-r--r--libgcc/config/c6x/crti.S (renamed from gcc/config/c6x/crti.s)0
-rw-r--r--libgcc/config/c6x/crtn.S (renamed from gcc/config/c6x/crtn.s)0
-rw-r--r--libgcc/config/c6x/eqd.c (renamed from gcc/config/c6x/eqd.c)0
-rw-r--r--libgcc/config/c6x/eqf.c (renamed from gcc/config/c6x/eqf.c)0
-rw-r--r--libgcc/config/c6x/ged.c (renamed from gcc/config/c6x/ged.c)0
-rw-r--r--libgcc/config/c6x/gef.c (renamed from gcc/config/c6x/gef.c)0
-rw-r--r--libgcc/config/c6x/gtd.c (renamed from gcc/config/c6x/gtd.c)0
-rw-r--r--libgcc/config/c6x/gtf.c (renamed from gcc/config/c6x/gtf.c)0
-rw-r--r--libgcc/config/c6x/led.c (renamed from gcc/config/c6x/led.c)0
-rw-r--r--libgcc/config/c6x/lef.c (renamed from gcc/config/c6x/lef.c)0
-rw-r--r--libgcc/config/c6x/lib1funcs.S (renamed from gcc/config/c6x/lib1funcs.asm)0
-rw-r--r--libgcc/config/c6x/libgcc-eabi.ver (renamed from gcc/config/c6x/libgcc-c6xeabi.ver)0
-rw-r--r--libgcc/config/c6x/ltd.c (renamed from gcc/config/c6x/ltd.c)0
-rw-r--r--libgcc/config/c6x/ltf.c (renamed from gcc/config/c6x/ltf.c)0
-rw-r--r--libgcc/config/c6x/t-c6x-elf4
-rw-r--r--libgcc/config/c6x/t-elf40
-rw-r--r--libgcc/config/c6x/t-uclinux3
-rw-r--r--libgcc/config/cris/arit.c (renamed from gcc/config/cris/arit.c)0
-rw-r--r--libgcc/config/cris/libgcc-glibc.ver (renamed from gcc/config/cris/libgcc.ver)0
-rw-r--r--libgcc/config/cris/mulsi3.S (renamed from gcc/config/cris/mulsi3.asm)0
-rw-r--r--libgcc/config/cris/t-cris10
-rw-r--r--libgcc/config/cris/t-elfmulti3
-rw-r--r--libgcc/config/cris/t-linux2
-rw-r--r--libgcc/config/darwin-64.c (renamed from gcc/config/darwin-64.c)0
-rw-r--r--libgcc/config/darwin-crt3.c6
-rw-r--r--libgcc/config/epiphany/crti.S34
-rw-r--r--libgcc/config/epiphany/crtint.S27
-rw-r--r--libgcc/config/epiphany/crtm1reg-r43.S26
-rw-r--r--libgcc/config/epiphany/crtm1reg-r63.S26
-rw-r--r--libgcc/config/epiphany/crtn.S32
-rw-r--r--libgcc/config/epiphany/crtrunc.S26
-rw-r--r--libgcc/config/epiphany/divsi3-float.S77
-rw-r--r--libgcc/config/epiphany/divsi3.S92
-rw-r--r--libgcc/config/epiphany/divsi3.c120
-rw-r--r--libgcc/config/epiphany/epiphany-asm.h53
-rw-r--r--libgcc/config/epiphany/ieee-754/eqsf2.S50
-rw-r--r--libgcc/config/epiphany/ieee-754/fast_div.S124
-rw-r--r--libgcc/config/epiphany/ieee-754/gtesf2.S66
-rw-r--r--libgcc/config/epiphany/ieee-754/ordsf2.S50
-rw-r--r--libgcc/config/epiphany/ieee-754/uneqsf2.S45
-rw-r--r--libgcc/config/epiphany/modsi3-float.S65
-rw-r--r--libgcc/config/epiphany/modsi3.S77
-rw-r--r--libgcc/config/epiphany/modsi3.c106
-rw-r--r--libgcc/config/epiphany/mulsi3.c39
-rw-r--r--libgcc/config/epiphany/t-custom-eqsf1
-rw-r--r--libgcc/config/epiphany/t-epiphany35
-rw-r--r--libgcc/config/epiphany/udivsi3-float.S83
-rw-r--r--libgcc/config/epiphany/udivsi3-float.c125
-rw-r--r--libgcc/config/epiphany/udivsi3.S85
-rw-r--r--libgcc/config/epiphany/udivsi3.c114
-rw-r--r--libgcc/config/epiphany/umodsi3-float.S63
-rw-r--r--libgcc/config/epiphany/umodsi3.S70
-rw-r--r--libgcc/config/epiphany/umodsi3.c101
-rw-r--r--libgcc/config/fr30/crti.S (renamed from gcc/config/fr30/crti.asm)0
-rw-r--r--libgcc/config/fr30/crtn.S (renamed from gcc/config/fr30/crtn.asm)4
-rw-r--r--libgcc/config/fr30/lib1funcs.S (renamed from gcc/config/fr30/lib1funcs.asm)0
-rw-r--r--libgcc/config/fr30/t-fr302
-rw-r--r--libgcc/config/frv/cmovd.c (renamed from gcc/config/frv/cmovd.c)0
-rw-r--r--libgcc/config/frv/cmovh.c (renamed from gcc/config/frv/cmovh.c)0
-rw-r--r--libgcc/config/frv/cmovw.c (renamed from gcc/config/frv/cmovw.c)0
-rw-r--r--libgcc/config/frv/frvbegin.c (renamed from gcc/config/frv/frvbegin.c)0
-rw-r--r--libgcc/config/frv/frvend.c (renamed from gcc/config/frv/frvend.c)0
-rw-r--r--libgcc/config/frv/lib1funcs.S (renamed from gcc/config/frv/lib1funcs.asm)0
-rw-r--r--libgcc/config/frv/libgcc-glibc.ver (renamed from gcc/config/frv/libgcc-frv.ver)0
-rw-r--r--libgcc/config/frv/modi.c (renamed from gcc/config/frv/modi.c)0
-rw-r--r--libgcc/config/frv/t-frv22
-rw-r--r--libgcc/config/frv/t-linux3
-rw-r--r--libgcc/config/frv/uitod.c (renamed from gcc/config/frv/uitod.c)0
-rw-r--r--libgcc/config/frv/uitof.c (renamed from gcc/config/frv/uitof.c)0
-rw-r--r--libgcc/config/frv/ulltod.c (renamed from gcc/config/frv/ulltod.c)0
-rw-r--r--libgcc/config/frv/ulltof.c (renamed from gcc/config/frv/ulltof.c)0
-rw-r--r--libgcc/config/frv/umodi.c (renamed from gcc/config/frv/umodi.c)0
-rw-r--r--libgcc/config/gthr-lynx.h (renamed from gcc/gthr-lynx.h)2
-rw-r--r--libgcc/config/gthr-rtems.h (renamed from gcc/gthr-rtems.h)0
-rw-r--r--libgcc/config/gthr-vxworks.h (renamed from gcc/gthr-vxworks.h)3
-rw-r--r--libgcc/config/h8300/clzhi2.c (renamed from gcc/config/h8300/clzhi2.c)0
-rw-r--r--libgcc/config/h8300/crti.S (renamed from gcc/config/h8300/crti.asm)8
-rw-r--r--libgcc/config/h8300/crtn.S (renamed from gcc/config/h8300/crtn.asm)4
-rw-r--r--libgcc/config/h8300/ctzhi2.c (renamed from gcc/config/h8300/ctzhi2.c)0
-rw-r--r--libgcc/config/h8300/fixunssfsi.c (renamed from gcc/config/h8300/fixunssfsi.c)4
-rw-r--r--libgcc/config/h8300/lib1funcs.S (renamed from gcc/config/h8300/lib1funcs.asm)0
-rw-r--r--libgcc/config/h8300/parityhi2.c (renamed from gcc/config/h8300/parityhi2.c)0
-rw-r--r--libgcc/config/h8300/popcounthi2.c (renamed from gcc/config/h8300/popcounthi2.c)0
-rw-r--r--libgcc/config/h8300/t-h830013
-rw-r--r--libgcc/config/i386/crti.S (renamed from libgcc/config/i386/sol2-ci.S)2
-rw-r--r--libgcc/config/i386/crtn.S (renamed from libgcc/config/i386/sol2-cn.S)2
-rw-r--r--libgcc/config/i386/cygming-crtbegin.c (renamed from gcc/config/i386/cygming-crtbegin.c)3
-rw-r--r--libgcc/config/i386/cygming-crtend.c (renamed from gcc/config/i386/cygming-crtend.c)3
-rw-r--r--libgcc/config/i386/cygwin.S (renamed from gcc/config/i386/cygwin.asm)0
-rw-r--r--libgcc/config/i386/gthr-win32.c (renamed from gcc/config/i386/gthr-win32.c)5
-rw-r--r--libgcc/config/i386/gthr-win32.h (renamed from gcc/gthr-win32.h)0
-rw-r--r--libgcc/config/i386/libgcc-darwin.10.4.ver (renamed from gcc/config/i386/darwin-libgcc.10.4.ver)0
-rw-r--r--libgcc/config/i386/libgcc-darwin.10.5.ver (renamed from gcc/config/i386/darwin-libgcc.10.5.ver)0
-rw-r--r--libgcc/config/i386/libgcc-glibc.ver (renamed from gcc/config/i386/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/i386/t-chkstk2
-rw-r--r--libgcc/config/i386/t-cygming15
-rw-r--r--libgcc/config/i386/t-cygwin (renamed from gcc/config/i386/t-cygwin)20
-rw-r--r--libgcc/config/i386/t-darwin4
-rw-r--r--libgcc/config/i386/t-darwin643
-rw-r--r--libgcc/config/i386/t-dlldir2
-rw-r--r--libgcc/config/i386/t-dlldir-x3
-rw-r--r--libgcc/config/i386/t-dw2-eh (renamed from gcc/config/i386/t-dw2-eh)0
-rw-r--r--libgcc/config/i386/t-gthr-win32 (renamed from gcc/config/i386/t-gthr-win32)2
-rw-r--r--libgcc/config/i386/t-interix3
-rw-r--r--libgcc/config/i386/t-linux (renamed from gcc/config/i386/t-linux)3
-rw-r--r--libgcc/config/i386/t-mingw-pthread (renamed from gcc/config/i386/t-mingw-pthread)0
-rw-r--r--libgcc/config/i386/t-mingw32 (renamed from gcc/config/i386/t-mingw32)0
-rw-r--r--libgcc/config/i386/t-nto3
-rw-r--r--libgcc/config/i386/t-sjlj-eh (renamed from gcc/config/i386/t-sjlj-eh)0
-rw-r--r--libgcc/config/i386/t-slibgcc-cygming58
-rw-r--r--libgcc/config/i386/t-sol22
-rw-r--r--libgcc/config/ia64/__divxf3.S (renamed from libgcc/config/ia64/__divxf3.asm)2
-rw-r--r--libgcc/config/ia64/_fixtfdi.S (renamed from libgcc/config/ia64/_fixtfdi.asm)2
-rw-r--r--libgcc/config/ia64/_fixunstfdi.S (renamed from libgcc/config/ia64/_fixunstfdi.asm)2
-rw-r--r--libgcc/config/ia64/_floatditf.S (renamed from libgcc/config/ia64/_floatditf.asm)2
-rw-r--r--libgcc/config/ia64/crtbegin.S (renamed from gcc/config/ia64/crtbegin.asm)0
-rw-r--r--libgcc/config/ia64/crtend.S (renamed from gcc/config/ia64/crtend.asm)0
-rw-r--r--libgcc/config/ia64/crti.S (renamed from gcc/config/ia64/crti.asm)4
-rw-r--r--libgcc/config/ia64/crtn.S (renamed from gcc/config/ia64/crtn.asm)4
-rw-r--r--libgcc/config/ia64/fde-vms.c2
-rw-r--r--libgcc/config/ia64/lib1funcs.S (renamed from gcc/config/ia64/lib1funcs.asm)0
-rw-r--r--libgcc/config/ia64/libgcc-glibc.ver (renamed from gcc/config/ia64/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/ia64/libgcc-ia64.ver (renamed from gcc/config/ia64/libgcc-ia64.ver)0
-rw-r--r--libgcc/config/ia64/quadlib.c (renamed from gcc/config/ia64/quadlib.c)0
-rw-r--r--libgcc/config/ia64/t-hpux8
-rw-r--r--libgcc/config/ia64/t-ia6441
-rw-r--r--libgcc/config/ia64/t-linux (renamed from libgcc/config/ia64/t-glibc)2
-rw-r--r--libgcc/config/ia64/t-linux-libunwind (renamed from libgcc/config/ia64/t-glibc-libunwind)0
-rw-r--r--libgcc/config/ia64/t-slibgcc-hpux6
-rw-r--r--libgcc/config/ia64/t-softfp-compat2
-rw-r--r--libgcc/config/ia64/t-vms6
-rw-r--r--libgcc/config/ia64/unwind-ia64.c1
-rw-r--r--libgcc/config/ia64/vms-crtinit.S (renamed from gcc/config/ia64/vms-crtinit.asm)0
-rw-r--r--libgcc/config/iq2000/lib2funcs.c (renamed from gcc/config/iq2000/lib2extra-funcs.c)0
-rw-r--r--libgcc/config/iq2000/t-iq20005
-rw-r--r--libgcc/config/libbid/bid_gcc_intrinsics.h3
-rw-r--r--libgcc/config/libgcc-glibc.ver (renamed from gcc/config/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/libgcc-libsystem.ver (renamed from gcc/libgcc-libsystem.ver)0
-rw-r--r--libgcc/config/lm32/t-elf12
-rw-r--r--libgcc/config/lm32/t-uclinux4
-rw-r--r--libgcc/config/m32c/lib1funcs.S (renamed from gcc/config/m32c/m32c-lib1.S)0
-rw-r--r--libgcc/config/m32c/lib2funcs.c (renamed from gcc/config/m32c/m32c-lib2.c)0
-rw-r--r--libgcc/config/m32c/t-m32c13
-rw-r--r--libgcc/config/m32c/trapv.c (renamed from gcc/config/m32c/m32c-lib2-trapv.c)6
-rw-r--r--libgcc/config/m32r/initfini.c (renamed from gcc/config/m32r/initfini.c)2
-rw-r--r--libgcc/config/m32r/libgcc-glibc.ver (renamed from gcc/config/m32r/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/m32r/t-linux5
-rw-r--r--libgcc/config/m32r/t-m32r23
-rw-r--r--libgcc/config/m68k/crti.S (renamed from gcc/config/m68k/crti.s)0
-rw-r--r--libgcc/config/m68k/crtn.S (renamed from gcc/config/m68k/crtn.s)0
-rw-r--r--libgcc/config/m68k/fpgnulib.c (renamed from gcc/config/m68k/fpgnulib.c)2
-rw-r--r--libgcc/config/m68k/lb1sf68.S (renamed from gcc/config/m68k/lb1sf68.asm)0
-rw-r--r--libgcc/config/m68k/t-floatlib11
-rw-r--r--libgcc/config/m68k/t-slibgcc-elf-ver (renamed from gcc/config/m68k/t-slibgcc-elf-ver)0
-rw-r--r--libgcc/config/mcore/crti.S (renamed from gcc/config/mcore/crti.asm)5
-rw-r--r--libgcc/config/mcore/crtn.S (renamed from gcc/config/mcore/crtn.asm)7
-rw-r--r--libgcc/config/mcore/lib1funcs.S (renamed from gcc/config/mcore/lib1.asm)0
-rw-r--r--libgcc/config/mcore/t-mcore5
-rw-r--r--libgcc/config/mep/lib1funcs.S (renamed from gcc/config/mep/mep-lib1.asm)0
-rw-r--r--libgcc/config/mep/lib2funcs.c (renamed from gcc/config/mep/mep-lib2.c)0
-rw-r--r--libgcc/config/mep/t-mep16
-rw-r--r--libgcc/config/mep/tramp.c (renamed from gcc/config/mep/mep-tramp.c)0
-rw-r--r--libgcc/config/microblaze/crti.S (renamed from gcc/config/microblaze/crti.s)0
-rw-r--r--libgcc/config/microblaze/crtn.S (renamed from gcc/config/microblaze/crtn.s)0
-rw-r--r--libgcc/config/microblaze/divsi3.S (renamed from libgcc/config/microblaze/divsi3.asm)4
-rw-r--r--libgcc/config/microblaze/moddi3.S (renamed from libgcc/config/microblaze/moddi3.asm)4
-rw-r--r--libgcc/config/microblaze/modsi3.S (renamed from libgcc/config/microblaze/modsi3.asm)4
-rw-r--r--libgcc/config/microblaze/muldi3_hard.S (renamed from libgcc/config/microblaze/muldi3_hard.asm)4
-rw-r--r--libgcc/config/microblaze/mulsi3.S (renamed from libgcc/config/microblaze/mulsi3.asm)4
-rw-r--r--libgcc/config/microblaze/stack_overflow_exit.S (renamed from libgcc/config/microblaze/stack_overflow_exit.asm)4
-rw-r--r--libgcc/config/microblaze/t-microblaze18
-rw-r--r--libgcc/config/microblaze/udivsi3.S (renamed from libgcc/config/microblaze/udivsi3.asm)4
-rw-r--r--libgcc/config/microblaze/umodsi3.S (renamed from libgcc/config/microblaze/umodsi3.asm)4
-rw-r--r--libgcc/config/mips/crti.S (renamed from gcc/config/mips/crti.asm)0
-rw-r--r--libgcc/config/mips/crtn.S (renamed from gcc/config/mips/crtn.asm)0
-rw-r--r--libgcc/config/mips/gthr-mipssde.h (renamed from gcc/gthr-mipssde.h)0
-rw-r--r--libgcc/config/mips/libgcc-mips16.ver (renamed from gcc/config/mips/libgcc-mips16.ver)0
-rw-r--r--libgcc/config/mips/mips16.S (renamed from gcc/config/mips/mips16.S)0
-rw-r--r--libgcc/config/mips/t-crtstuff2
-rw-r--r--libgcc/config/mips/t-elf3
-rw-r--r--libgcc/config/mips/t-mips2
-rw-r--r--libgcc/config/mips/t-mips1643
-rw-r--r--libgcc/config/mips/t-slibgcc-irix2
-rw-r--r--libgcc/config/mips/t-vr2
-rw-r--r--libgcc/config/mips/vr4120-div.S (renamed from gcc/config/mips/vr4120-div.S)0
-rw-r--r--libgcc/config/mmix/crti.S (renamed from gcc/config/mmix/crti.asm)4
-rw-r--r--libgcc/config/mmix/crtn.S (renamed from gcc/config/mmix/crtn.asm)0
-rw-r--r--libgcc/config/mmix/t-mmix24
-rw-r--r--libgcc/config/moxie/crti.S (renamed from libgcc/config/moxie/crti.asm)6
-rw-r--r--libgcc/config/moxie/crtn.S (renamed from libgcc/config/moxie/crtn.asm)6
-rw-r--r--libgcc/config/moxie/t-moxie9
-rw-r--r--libgcc/config/pa/fptr.c (renamed from gcc/config/pa/fptr.c)0
-rw-r--r--libgcc/config/pa/gthr-dce.h (renamed from gcc/gthr-dce.h)0
-rw-r--r--libgcc/config/pa/lib2funcs.S (renamed from gcc/config/pa/lib2funcs.asm)0
-rw-r--r--libgcc/config/pa/linux-atomic.c (renamed from gcc/config/pa/linux-atomic.c)0
-rw-r--r--libgcc/config/pa/milli64.S (renamed from gcc/config/pa/milli64.S)0
-rw-r--r--libgcc/config/pa/quadlib.c (renamed from gcc/config/pa/quadlib.c)0
-rw-r--r--libgcc/config/pa/stublib.c (renamed from gcc/config/pa/stublib.c)0
-rw-r--r--libgcc/config/pa/t-hpux3
-rw-r--r--libgcc/config/pa/t-hpux101
-rw-r--r--libgcc/config/pa/t-linux10
-rw-r--r--libgcc/config/pa/t-linux648
-rw-r--r--libgcc/config/pa/t-pa643
-rw-r--r--libgcc/config/pa/t-slibgcc-dwarf-ver (renamed from gcc/config/pa/t-slibgcc-dwarf-ver)0
-rw-r--r--libgcc/config/pa/t-slibgcc-hpux (renamed from gcc/config/sh/t-netbsd)13
-rw-r--r--libgcc/config/pa/t-slibgcc-sjlj-ver (renamed from gcc/config/pa/t-slibgcc-sjlj-ver)0
-rw-r--r--libgcc/config/pa/t-stublib21
-rw-r--r--libgcc/config/pa/t-stublib6413
-rw-r--r--libgcc/config/pdp11/t-pdp118
-rw-r--r--libgcc/config/picochip/adddi3.S (renamed from gcc/config/picochip/libgccExtras/adddi3.asm)0
-rw-r--r--libgcc/config/picochip/ashlsi3.S (renamed from gcc/config/picochip/libgccExtras/ashlsi3.asm)0
-rw-r--r--libgcc/config/picochip/ashlsi3.c (renamed from gcc/config/picochip/libgccExtras/ashlsi3.c)0
-rw-r--r--libgcc/config/picochip/ashrsi3.S (renamed from gcc/config/picochip/libgccExtras/ashrsi3.asm)0
-rw-r--r--libgcc/config/picochip/ashrsi3.c (renamed from gcc/config/picochip/libgccExtras/ashrsi3.c)0
-rw-r--r--libgcc/config/picochip/clzsi2.S (renamed from gcc/config/picochip/libgccExtras/clzsi2.asm)4
-rw-r--r--libgcc/config/picochip/cmpsi2.S (renamed from gcc/config/picochip/libgccExtras/cmpsi2.asm)0
-rw-r--r--libgcc/config/picochip/divmod15.S (renamed from gcc/config/picochip/libgccExtras/divmod15.asm)0
-rw-r--r--libgcc/config/picochip/divmodhi4.S (renamed from gcc/config/picochip/libgccExtras/divmodhi4.asm)0
-rw-r--r--libgcc/config/picochip/divmodsi4.S (renamed from gcc/config/picochip/libgccExtras/divmodsi4.asm)0
-rw-r--r--libgcc/config/picochip/lib1funcs.S4
-rw-r--r--libgcc/config/picochip/longjmp.S (renamed from gcc/config/picochip/libgccExtras/longjmp.asm)0
-rw-r--r--libgcc/config/picochip/lshrsi3.S (renamed from gcc/config/picochip/libgccExtras/lshrsi3.asm)0
-rw-r--r--libgcc/config/picochip/lshrsi3.c (renamed from gcc/config/picochip/libgccExtras/lshrsi3.c)0
-rw-r--r--libgcc/config/picochip/parityhi2.S (renamed from gcc/config/picochip/libgccExtras/parityhi2.asm)0
-rw-r--r--libgcc/config/picochip/popcounthi2.S (renamed from gcc/config/picochip/libgccExtras/popcounthi2.asm)0
-rw-r--r--libgcc/config/picochip/setjmp.S (renamed from gcc/config/picochip/libgccExtras/setjmp.asm)0
-rw-r--r--libgcc/config/picochip/subdi3.S (renamed from gcc/config/picochip/libgccExtras/subdi3.asm)0
-rw-r--r--libgcc/config/picochip/t-picochip37
-rw-r--r--libgcc/config/picochip/ucmpsi2.S (renamed from gcc/config/picochip/libgccExtras/ucmpsi2.asm)0
-rw-r--r--libgcc/config/picochip/udivmodhi4.S (renamed from gcc/config/picochip/libgccExtras/udivmodhi4.asm)0
-rw-r--r--libgcc/config/picochip/udivmodsi4.S (renamed from gcc/config/picochip/libgccExtras/udivmodsi4.asm)0
-rw-r--r--libgcc/config/rs6000/crtresfpr.S (renamed from gcc/config/rs6000/crtresfpr.asm)0
-rw-r--r--libgcc/config/rs6000/crtresgpr.S (renamed from gcc/config/rs6000/crtresgpr.asm)0
-rw-r--r--libgcc/config/rs6000/crtresxfpr.S (renamed from gcc/config/rs6000/crtresxfpr.asm)0
-rw-r--r--libgcc/config/rs6000/crtresxgpr.S (renamed from gcc/config/rs6000/crtresxgpr.asm)0
-rw-r--r--libgcc/config/rs6000/crtsavfpr.S (renamed from gcc/config/rs6000/crtsavfpr.asm)0
-rw-r--r--libgcc/config/rs6000/crtsavgpr.S (renamed from gcc/config/rs6000/crtsavgpr.asm)0
-rw-r--r--libgcc/config/rs6000/darwin-asm.h (renamed from gcc/config/rs6000/darwin-asm.h)0
-rw-r--r--libgcc/config/rs6000/darwin-fallback.c3
-rw-r--r--libgcc/config/rs6000/darwin-fpsave.S (renamed from gcc/config/rs6000/darwin-fpsave.asm)0
-rw-r--r--libgcc/config/rs6000/darwin-gpsave.S (renamed from gcc/config/rs6000/darwin-gpsave.asm)0
-rw-r--r--libgcc/config/rs6000/darwin-tramp.S (renamed from gcc/config/rs6000/darwin-tramp.asm)0
-rw-r--r--libgcc/config/rs6000/darwin-vecsave.S (renamed from gcc/config/rs6000/darwin-vecsave.asm)0
-rw-r--r--libgcc/config/rs6000/darwin-world.S (renamed from gcc/config/rs6000/darwin-world.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtres32gpr.S (renamed from gcc/config/rs6000/e500crtres32gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtres64gpr.S (renamed from gcc/config/rs6000/e500crtres64gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtres64gprctr.S (renamed from gcc/config/rs6000/e500crtres64gprctr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtrest32gpr.S (renamed from gcc/config/rs6000/e500crtrest32gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtrest64gpr.S (renamed from gcc/config/rs6000/e500crtrest64gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtresx32gpr.S (renamed from gcc/config/rs6000/e500crtresx32gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtresx64gpr.S (renamed from gcc/config/rs6000/e500crtresx64gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsav32gpr.S (renamed from gcc/config/rs6000/e500crtsav32gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsav64gpr.S (renamed from gcc/config/rs6000/e500crtsav64gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsav64gprctr.S (renamed from gcc/config/rs6000/e500crtsav64gprctr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsavg32gpr.S (renamed from gcc/config/rs6000/e500crtsavg32gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsavg64gpr.S (renamed from gcc/config/rs6000/e500crtsavg64gpr.asm)0
-rw-r--r--libgcc/config/rs6000/e500crtsavg64gprctr.S (renamed from gcc/config/rs6000/e500crtsavg64gprctr.asm)0
-rw-r--r--libgcc/config/rs6000/eabi-ci.S (renamed from gcc/config/rs6000/eabi-ci.asm)0
-rw-r--r--libgcc/config/rs6000/eabi-cn.S (renamed from gcc/config/rs6000/eabi-cn.asm)0
-rw-r--r--libgcc/config/rs6000/eabi.S (renamed from gcc/config/rs6000/eabi.asm)0
-rw-r--r--libgcc/config/rs6000/gthr-aix.h (renamed from gcc/gthr-aix.h)2
-rw-r--r--libgcc/config/rs6000/libgcc-darwin.10.4.ver (renamed from gcc/config/rs6000/darwin-libgcc.10.4.ver)0
-rw-r--r--libgcc/config/rs6000/libgcc-darwin.10.5.ver (renamed from gcc/config/rs6000/darwin-libgcc.10.5.ver)0
-rw-r--r--libgcc/config/rs6000/libgcc-glibc.ver (renamed from libgcc/config/rs6000/libgcc-ppc-glibc.ver)0
-rw-r--r--libgcc/config/rs6000/libgcc-ibm-ldouble.ver (renamed from libgcc/config/rs6000/libgcc-ppc64.ver)0
-rw-r--r--libgcc/config/rs6000/sol-ci.S (renamed from gcc/config/rs6000/sol-ci.asm)0
-rw-r--r--libgcc/config/rs6000/sol-cn.S (renamed from gcc/config/rs6000/sol-cn.asm)0
-rw-r--r--libgcc/config/rs6000/t-crtstuff3
-rw-r--r--libgcc/config/rs6000/t-darwin19
-rw-r--r--libgcc/config/rs6000/t-darwin646
-rw-r--r--libgcc/config/rs6000/t-ibm-ldouble2
-rw-r--r--libgcc/config/rs6000/t-ldbl1283
-rw-r--r--libgcc/config/rs6000/t-linux3
-rw-r--r--libgcc/config/rs6000/t-linux642
-rw-r--r--libgcc/config/rs6000/t-lynx1
-rw-r--r--libgcc/config/rs6000/t-netbsd9
-rw-r--r--libgcc/config/rs6000/t-ppccomm132
-rw-r--r--libgcc/config/rs6000/t-slibgcc-aix44
-rw-r--r--libgcc/config/rs6000/tramp.S (renamed from gcc/config/rs6000/tramp.asm)0
-rw-r--r--libgcc/config/s390/gthr-tpf.h (renamed from gcc/gthr-tpf.h)0
-rw-r--r--libgcc/config/s390/t-crtstuff3
-rw-r--r--libgcc/config/s390/t-tpf2
-rw-r--r--libgcc/config/score/crti.S (renamed from gcc/config/score/crti.asm)4
-rw-r--r--libgcc/config/score/crtn.S (renamed from gcc/config/score/crtn.asm)4
-rw-r--r--libgcc/config/sh/crt1.S (renamed from gcc/config/sh/crt1.asm)4
-rw-r--r--libgcc/config/sh/crti.S (renamed from gcc/config/sh/crti.asm)8
-rw-r--r--libgcc/config/sh/crtn.S (renamed from gcc/config/sh/crtn.asm)4
-rw-r--r--libgcc/config/sh/lib1funcs-4-300.S (renamed from gcc/config/sh/lib1funcs-4-300.asm)0
-rw-r--r--libgcc/config/sh/lib1funcs-Os-4-200.S (renamed from gcc/config/sh/lib1funcs-Os-4-200.asm)0
-rw-r--r--libgcc/config/sh/lib1funcs.S (renamed from gcc/config/sh/lib1funcs.asm)0
-rw-r--r--libgcc/config/sh/lib1funcs.h (renamed from gcc/config/sh/lib1funcs.h)0
-rw-r--r--libgcc/config/sh/libgcc-excl.ver (renamed from gcc/config/sh/libgcc-excl.ver)0
-rw-r--r--libgcc/config/sh/libgcc-glibc.ver (renamed from gcc/config/sh/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/sh/linux-atomic.S (renamed from gcc/config/sh/linux-atomic.asm)0
-rw-r--r--libgcc/config/sh/t-linux37
-rw-r--r--libgcc/config/sh/t-netbsd5
-rw-r--r--libgcc/config/sh/t-sh63
-rw-r--r--libgcc/config/sh/t-sh646
-rw-r--r--libgcc/config/sh/t-superh11
-rw-r--r--libgcc/config/sparc/crti.S (renamed from libgcc/config/sparc/sol2-ci.S)2
-rw-r--r--libgcc/config/sparc/crtn.S (renamed from libgcc/config/sparc/sol2-cn.S)2
-rw-r--r--libgcc/config/sparc/lb1spc.S (renamed from gcc/config/sparc/lb1spc.asm)0
-rw-r--r--libgcc/config/sparc/libgcc-glibc.ver (renamed from gcc/config/sparc/libgcc-sparc-glibc.ver)0
-rw-r--r--libgcc/config/sparc/t-linux (renamed from gcc/config/sparc/t-linux)3
-rw-r--r--libgcc/config/sparc/t-linux641
-rw-r--r--libgcc/config/sparc/t-softmul2
-rw-r--r--libgcc/config/sparc/t-sol22
-rw-r--r--libgcc/config/spu/cache.S (renamed from gcc/config/spu/cache.S)0
-rw-r--r--libgcc/config/spu/cachemgr.c (renamed from gcc/config/spu/cachemgr.c)0
-rw-r--r--libgcc/config/spu/divmodti4.c (renamed from gcc/config/spu/divmodti4.c)4
-rw-r--r--libgcc/config/spu/divv2df3.c (renamed from gcc/config/spu/divv2df3.c)0
-rw-r--r--libgcc/config/spu/float_disf.c (renamed from gcc/config/spu/float_disf.c)0
-rw-r--r--libgcc/config/spu/float_unsdidf.c (renamed from gcc/config/spu/float_unsdidf.c)0
-rw-r--r--libgcc/config/spu/float_unsdisf.c (renamed from gcc/config/spu/float_unsdisf.c)0
-rw-r--r--libgcc/config/spu/float_unssidf.c (renamed from gcc/config/spu/float_unssidf.c)0
-rw-r--r--libgcc/config/spu/mfc_multi_tag_release.c (renamed from gcc/config/spu/mfc_multi_tag_release.c)0
-rw-r--r--libgcc/config/spu/mfc_multi_tag_reserve.c (renamed from gcc/config/spu/mfc_multi_tag_reserve.c)0
-rw-r--r--libgcc/config/spu/mfc_tag_release.c (renamed from gcc/config/spu/mfc_tag_release.c)0
-rw-r--r--libgcc/config/spu/mfc_tag_reserve.c (renamed from gcc/config/spu/mfc_tag_reserve.c)0
-rw-r--r--libgcc/config/spu/mfc_tag_table.c (renamed from gcc/config/spu/mfc_tag_table.c)0
-rw-r--r--libgcc/config/spu/multi3.c (renamed from gcc/config/spu/multi3.c)0
-rw-r--r--libgcc/config/spu/t-elf56
-rw-r--r--libgcc/config/stormy16/ashlsi3.c2
-rw-r--r--libgcc/config/stormy16/ashrsi3.c2
-rw-r--r--libgcc/config/stormy16/clzhi2.c2
-rw-r--r--libgcc/config/stormy16/cmpsi2.c2
-rw-r--r--libgcc/config/stormy16/ctzhi2.c2
-rw-r--r--libgcc/config/stormy16/divsi3.c2
-rw-r--r--libgcc/config/stormy16/ffshi2.c2
-rw-r--r--libgcc/config/stormy16/lib2funcs.c (renamed from gcc/config/stormy16/stormy16-lib2.c)3
-rw-r--r--libgcc/config/stormy16/lshrsi3.c2
-rw-r--r--libgcc/config/stormy16/modsi3.c2
-rw-r--r--libgcc/config/stormy16/parityhi2.c (renamed from gcc/config/stormy16/stormy16-lib2-parityhi2.c)2
-rw-r--r--libgcc/config/stormy16/popcounthi2.c (renamed from gcc/config/stormy16/stormy16-lib2-popcounthi2.c)2
-rw-r--r--libgcc/config/stormy16/t-stormy1639
-rw-r--r--libgcc/config/stormy16/ucmpsi2.c2
-rw-r--r--libgcc/config/stormy16/udivmodsi4.c (renamed from gcc/config/stormy16/stormy16-lib2-udivmodsi4.c)2
-rw-r--r--libgcc/config/stormy16/udivsi3.c2
-rw-r--r--libgcc/config/stormy16/umodsi3.c2
-rw-r--r--libgcc/config/t-crtin4
-rw-r--r--libgcc/config/t-crtstuff-pic2
-rw-r--r--libgcc/config/t-darwin6
-rw-r--r--libgcc/config/t-freebsd-thread (renamed from gcc/config/t-freebsd-thread)2
-rw-r--r--libgcc/config/t-libgcc-pic2
-rw-r--r--libgcc/config/t-libunwind9
-rw-r--r--libgcc/config/t-linux3
-rw-r--r--libgcc/config/t-openbsd-thread (renamed from gcc/config/t-openbsd-thread)2
-rw-r--r--libgcc/config/t-rtems2
-rw-r--r--libgcc/config/t-slibgcc5
-rw-r--r--libgcc/config/t-slibgcc-darwin5
-rw-r--r--libgcc/config/t-slibgcc-elf-ver2
-rw-r--r--libgcc/config/t-slibgcc-gld-nover3
-rw-r--r--libgcc/config/t-slibgcc-hpux7
-rw-r--r--libgcc/config/t-slibgcc-libgcc (renamed from gcc/config/t-slibgcc-libgcc)4
-rw-r--r--libgcc/config/t-slibgcc-nolc-override (renamed from gcc/config/t-slibgcc-nolc-override)0
-rw-r--r--libgcc/config/t-slibgcc-vms28
-rw-r--r--libgcc/config/t-sol22
-rw-r--r--libgcc/config/t-vxworks14
-rw-r--r--libgcc/config/v850/lib1funcs.S (renamed from gcc/config/v850/lib1funcs.asm)0
-rw-r--r--libgcc/config/v850/t-v85060
-rw-r--r--libgcc/config/vax/lib1funcs.S (renamed from gcc/config/vax/lib1funcs.asm)0
-rw-r--r--libgcc/config/vax/t-linux (renamed from gcc/config/vax/t-linux)2
-rw-r--r--libgcc/config/vms/t-vms6
-rw-r--r--libgcc/config/vms/vms-ucrt0.c (renamed from gcc/config/vms/vms-ucrt0.c)0
-rw-r--r--libgcc/config/vxlib-tls.c (renamed from gcc/config/vxlib-tls.c)0
-rw-r--r--libgcc/config/vxlib.c (renamed from gcc/config/vxlib.c)0
-rw-r--r--libgcc/config/xtensa/crti.S (renamed from gcc/config/xtensa/crti.asm)0
-rw-r--r--libgcc/config/xtensa/crtn.S (renamed from gcc/config/xtensa/crtn.asm)0
-rw-r--r--libgcc/config/xtensa/ieee754-df.S (renamed from gcc/config/xtensa/ieee754-df.S)0
-rw-r--r--libgcc/config/xtensa/ieee754-sf.S (renamed from gcc/config/xtensa/ieee754-sf.S)0
-rw-r--r--libgcc/config/xtensa/lib1funcs.S (renamed from gcc/config/xtensa/lib1funcs.asm)0
-rw-r--r--libgcc/config/xtensa/lib2funcs.S (renamed from gcc/config/xtensa/lib2funcs.S)0
-rw-r--r--libgcc/config/xtensa/libgcc-glibc.ver (renamed from gcc/config/xtensa/libgcc-xtensa.ver)0
-rw-r--r--libgcc/config/xtensa/t-elf (renamed from gcc/config/xtensa/t-elf)3
-rw-r--r--libgcc/config/xtensa/t-linux1
-rw-r--r--libgcc/config/xtensa/t-xtensa14
-rw-r--r--libgcc/config/xtensa/unwind-dw2-xtensa.c1
-rw-r--r--libgcc/configure347
-rw-r--r--libgcc/configure.ac97
-rw-r--r--libgcc/crtstuff.c651
-rw-r--r--libgcc/dfp-bit.h3
-rw-r--r--libgcc/divmod.c (renamed from gcc/config/divmod.c)0
-rw-r--r--libgcc/emutls.c3
-rw-r--r--libgcc/fixed-bit.c3
-rw-r--r--libgcc/floatunsidf.c (renamed from gcc/config/floatunsidf.c)0
-rw-r--r--libgcc/floatunsisf.c (renamed from gcc/config/floatunsisf.c)0
-rw-r--r--libgcc/floatunsitf.c (renamed from gcc/config/floatunsitf.c)0
-rw-r--r--libgcc/floatunsixf.c (renamed from gcc/config/floatunsixf.c)0
-rw-r--r--libgcc/fp-bit.c1
-rw-r--r--libgcc/gbl-ctors.h (renamed from gcc/gbl-ctors.h)0
-rw-r--r--libgcc/generic-morestack-thread.c1
-rw-r--r--libgcc/generic-morestack.c1
-rw-r--r--libgcc/gthr-posix.h (renamed from gcc/gthr-posix.h)0
-rw-r--r--libgcc/gthr-single.h (renamed from gcc/gthr-single.h)0
-rw-r--r--libgcc/gthr.h (renamed from gcc/gthr.h)20
-rw-r--r--libgcc/libgcc2.c (renamed from gcc/libgcc2.c)1
-rw-r--r--libgcc/libgcc2.h (renamed from gcc/libgcc2.h)0
-rw-r--r--libgcc/libgcov.c440
-rw-r--r--libgcc/longlong.h (renamed from gcc/longlong.h)0
-rw-r--r--libgcc/memcmp.c (renamed from gcc/config/memcmp.c)0
-rw-r--r--libgcc/memcpy.c (renamed from gcc/config/memcpy.c)0
-rw-r--r--libgcc/memmove.c (renamed from gcc/config/memmove.c)0
-rw-r--r--libgcc/memset.c (renamed from gcc/config/memset.c)0
-rwxr-xr-xlibgcc/mkheader.sh41
-rw-r--r--libgcc/mkmap-flat.awk (renamed from gcc/mkmap-flat.awk)0
-rw-r--r--libgcc/mkmap-symver.awk (renamed from gcc/mkmap-symver.awk)0
-rw-r--r--libgcc/siditi-object.mk8
-rw-r--r--libgcc/udivmod.c (renamed from gcc/config/udivmod.c)0
-rw-r--r--libgcc/udivmodsi4.c (renamed from gcc/config/udivmodsi4.c)0
-rw-r--r--libgcc/unwind-dw2-fde-dip.c3
-rw-r--r--libgcc/unwind-dw2-fde.c3
-rw-r--r--libgcc/unwind-dw2.c1
-rw-r--r--libgcc/unwind-sjlj.c3
-rw-r--r--libgfortran/ChangeLog16
-rw-r--r--libgfortran/Makefile.am4
-rw-r--r--libgfortran/Makefile.in4
-rw-r--r--libgfortran/acinclude.m411
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure19
-rw-r--r--libgfortran/configure.ac3
-rw-r--r--libgfortran/io/open.c2
-rw-r--r--libgo/Makefile.am2
-rw-r--r--libgo/Makefile.in2
-rw-r--r--libgo/go/exp/terminal/terminal.go15
-rw-r--r--libgo/go/syscall/libcall_linux.go15
-rw-r--r--libgo/go/syscall/libcall_posix.go6
-rw-r--r--libiberty/ChangeLog17
-rw-r--r--libiberty/Makefile.in16
-rw-r--r--libiberty/cp-demangle.c11
-rw-r--r--libobjc/ChangeLog7
-rw-r--r--libobjc/Makefile.in1
-rw-r--r--libobjc/config.h.in3
-rwxr-xr-xlibobjc/configure14
-rw-r--r--libobjc/configure.ac9
-rw-r--r--libquadmath/ChangeLog4
-rw-r--r--libquadmath/printf/gmp-impl.h4
-rw-r--r--libstdc++-v3/ChangeLog243
-rw-r--r--libstdc++-v3/Makefile.in2
-rw-r--r--libstdc++-v3/acinclude.m4121
-rw-r--r--libstdc++-v3/config.h.in16
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver9
-rwxr-xr-xlibstdc++-v3/configure308
-rw-r--r--libstdc++-v3/configure.ac3
-rw-r--r--libstdc++-v3/doc/Makefile.am2
-rw-r--r--libstdc++-v3/doc/Makefile.in4
-rw-r--r--libstdc++-v3/doc/doxygen/doxygroups.cc8
-rw-r--r--libstdc++-v3/doc/html/api.html2
-rw-r--r--libstdc++-v3/doc/html/faq.html8
-rw-r--r--libstdc++-v3/doc/html/index.html28
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html16
-rw-r--r--libstdc++-v3/doc/html/manual/algorithms.html2
-rw-r--r--libstdc++-v3/doc/html/manual/api.html6
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_contributing.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_free.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gpl.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_porting.html26
-rw-r--r--libstdc++-v3/doc/html/manual/atomics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html226
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch21s03.html50
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html41
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch28s03.html36
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03pr01.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt04.html22
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html14
-rw-r--r--libstdc++-v3/doc/html/manual/concurrency.html2
-rw-r--r--libstdc++-v3/doc/html/manual/configure.html2
-rw-r--r--libstdc++-v3/doc/html/manual/containers.html2
-rw-r--r--libstdc++-v3/doc/html/manual/diagnostics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/documentation_hacking.html8
-rw-r--r--libstdc++-v3/doc/html/manual/extensions.html2
-rw-r--r--libstdc++-v3/doc/html/manual/facets.html54
-rw-r--r--libstdc++-v3/doc/html/manual/index.html44
-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/iterators.html2
-rw-r--r--libstdc++-v3/doc/html/manual/localization.html18
-rw-r--r--libstdc++-v3/doc/html/manual/memory.html70
-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/policy_data_structures.html12
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_design.html66
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_using.html4
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode.html2
-rw-r--r--libstdc++-v3/doc/html/manual/setup.html15
-rw-r--r--libstdc++-v3/doc/html/manual/status.html26
-rw-r--r--libstdc++-v3/doc/html/manual/strings.html4
-rw-r--r--libstdc++-v3/doc/html/manual/support.html2
-rw-r--r--libstdc++-v3/doc/html/manual/test.html12
-rw-r--r--libstdc++-v3/doc/html/manual/using.html4
-rw-r--r--libstdc++-v3/doc/html/manual/using_concurrency.html97
-rw-r--r--libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using_exceptions.html16
-rw-r--r--libstdc++-v3/doc/html/manual/using_headers.html35
-rw-r--r--libstdc++-v3/doc/html/manual/using_macros.html2
-rw-r--r--libstdc++-v3/doc/html/manual/utilities.html4
-rw-r--r--libstdc++-v3/doc/xml/faq.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/backwards_compatibility.xml223
-rw-r--r--libstdc++-v3/doc/xml/manual/configure.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/debug_mode.xml8
-rw-r--r--libstdc++-v3/doc/xml/manual/diagnostics.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/evolution.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/extensions.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml18
-rw-r--r--libstdc++-v3/doc/xml/manual/policy_data_structures.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/shared_ptr.xml32
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx2011.xml (renamed from libstdc++-v3/doc/xml/manual/status_cxx200x.xml)38
-rw-r--r--libstdc++-v3/doc/xml/manual/strings.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/test.xml8
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml41
-rw-r--r--libstdc++-v3/include/Makefile.am28
-rw-r--r--libstdc++-v3/include/Makefile.in30
-rw-r--r--libstdc++-v3/include/backward/hashtable.h26
-rw-r--r--libstdc++-v3/include/bits/atomic_0.h677
-rw-r--r--libstdc++-v3/include/bits/atomic_2.h685
-rw-r--r--libstdc++-v3/include/bits/atomic_base.h721
-rw-r--r--libstdc++-v3/include/bits/basic_string.h51
-rw-r--r--libstdc++-v3/include/bits/c++config5
-rw-r--r--libstdc++-v3/include/bits/random.h11
-rw-r--r--libstdc++-v3/include/bits/random.tcc8
-rw-r--r--libstdc++-v3/include/c_global/cstdalign44
-rw-r--r--libstdc++-v3/include/debug/string10
-rw-r--r--libstdc++-v3/include/ext/vstring.h11
-rw-r--r--libstdc++-v3/include/std/atomic101
-rw-r--r--libstdc++-v3/include/std/complex11
-rw-r--r--libstdc++-v3/include/std/future53
-rw-r--r--libstdc++-v3/include/std/mutex6
-rw-r--r--libstdc++-v3/include/tr1/complex11
-rw-r--r--libstdc++-v3/include/tr2/bool_set22
-rw-r--r--libstdc++-v3/include/tr2/dynamic_bitset22
-rw-r--r--libstdc++-v3/include/tr2/type_traits20
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in2
-rw-r--r--libstdc++-v3/po/Makefile.in2
-rw-r--r--libstdc++-v3/python/Makefile.in2
-rw-r--r--libstdc++-v3/scripts/run_doxygen6
-rw-r--r--libstdc++-v3/src/Makefile.am12
-rw-r--r--libstdc++-v3/src/Makefile.in20
-rw-r--r--libstdc++-v3/src/compatibility-atomic-c++0x.cc (renamed from libstdc++-v3/src/atomic.cc)20
-rw-r--r--libstdc++-v3/src/thread.cc18
-rw-r--r--libstdc++-v3/testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc24
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/char/pop_back.cc41
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/wchar_t/pop_back.cc41
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/range_access/char/1.cc31
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/range_access/wchar_t/1.cc (renamed from libstdc++-v3/testsuite/21_strings/basic_string/range_access.cc)6
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc30
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc6
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc2
-rw-r--r--libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc79
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc56
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc40
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc42
-rw-r--r--libstdc++-v3/testsuite/Makefile.in2
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc45
-rw-r--r--libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc45
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp11
-rw-r--r--libstdc++-v3/testsuite/performance/23_containers/insert_erase/41975.cc175
1305 files changed, 46220 insertions, 17117 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c92d0d91ba..49ba74f4f0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.tpl (EXTRA_GCC_FLAGS): Remove LIBGCC2_CFLAGS,
+ LIBGCC2_DEBUG_CFLAGS, LIBGCC2_INCLUDES.
+ * Makefile.in: Regenerate.
+
+2011-11-01 DJ Delorie <dj@redhat.com>
+
+ * config.sub: Update to version 2011-10-29 (added rl78)
+
2011-10-27 Nick Clifton <nickc@redhat.com>
* config.sub: Import these changes from the config project:
diff --git a/ChangeLog.tm b/ChangeLog.tm
index 8fdcd57f226..ec6a1bf7c16 100644
--- a/ChangeLog.tm
+++ b/ChangeLog.tm
@@ -1,5 +1,9 @@
2011-11-07 Aldy Hernandez <aldyh@redhat.com>
+ * Merge from mainline rev 181122.
+
+2011-11-07 Aldy Hernandez <aldyh@redhat.com>
+
* Fix leading tabs and trailing whitespace throughout entire
branch.
diff --git a/Makefile.in b/Makefile.in
index 9d59b3c1f81..900c325849b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,7 @@
#
# Makefile for directory with subdirs to build.
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
@@ -875,10 +875,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
EXTRA_GCC_FLAGS = \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
+ "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index 4dd23915bed..2944d60d642 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -6,7 +6,7 @@ in
#
# Makefile for directory with subdirs to build.
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
@@ -668,10 +668,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
EXTRA_GCC_FLAGS = \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
- "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
+ "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
diff --git a/config.sub b/config.sub
index 5b8736823d4..78176a44029 100755
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011 Free Software Foundation, Inc.
-timestamp='2011-10-08'
+timestamp='2011-10-29'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -295,7 +295,7 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
- | rx \
+ | rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
@@ -407,7 +407,7 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* | rx-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
diff --git a/config/ChangeLog b/config/ChangeLog
index 047cdf5f007..7737f99b2bd 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * mh-interix (LIBGCC2_DEBUG_CFLAGS): Remove.
+
2011-08-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* picflag.m4: New file.
diff --git a/config/mh-interix b/config/mh-interix
index 67dff5c4432..3be195b51ec 100644
--- a/config/mh-interix
+++ b/config/mh-interix
@@ -1,7 +1,2 @@
# The shell may not be in /bin.
SHELL = sh
-
-# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
-# built without debugging information
-
-LIBGCC2_DEBUG_CFLAGS=
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index eddf6ecfe58..1336a6fa786 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * contrib-list.mk: Add Epiphany configurations.
+
2011-09-13 Diego Novillo <dnovillo@google.com>
* testsuite-management: New.
diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 23b37160136..31e0237b62d 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -18,7 +18,8 @@ LIST = alpha-linux-gnu alpha-freebsd6 alpha-netbsd alpha-openbsd \
arm-linux-androideabi arm-uclinux_eabi arm-ecos-elf arm-eabi \
arm-symbianelf arm-rtems arm-elf arm-wince-pe avr-rtems avr-elf \
bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
- c6x-elf c6x-uclinux cris-elf cris-linux crisv32-elf crisv32-linux fido-elf \
+ c6x-elf c6x-uclinux cris-elf cris-linux crisv32-elf crisv32-linux \
+ epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \
fr30-elf frv-elf frv-linux h8300-elf h8300-rtems hppa-linux-gnu \
hppa-linux-gnuOPT-enable-sjlj-exceptions=yes hppa64-linux-gnu \
hppa2.0-hpux10.1 hppa64-hpux11.3 \
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5f334336458..279d795a119 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,18 +1,1886 @@
+2011-11-07 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386-bultin-types.def (V8SI_FTYPE_V4DF_V4DF): Add.
+ * config/i386/i386.c (enum ix86_builtins): Add
+ IX86_BUILTIN_VEC_PACK_SFIX256.
+ (bdesc_args): Add __builtin_ia32_vec_pack_sfix256.
+ (ix86_expand_args_builtin): Handle V8SI_FTYPE_V4DF_V4DF.
+ (ix86_builtin_vectorized_function): Also vectorize lrint using
+ 256-bit vectors for -mavx.
+
+2011-11-07 Anatoly Sokolov <aesok@post.ru>
+
+ * config/cris/constraints.md: New file.
+ * config/cris/cris.h (REG_CLASS_FROM_LETTER, CONSTRAINT_LEN,
+ CRIS_CONST_OK_FOR_LETTER_P, CONST_OK_FOR_CONSTRAINT_P,
+ CONST_DOUBLE_OK_FOR_LETTER_P, EXTRA_MEMORY_CONSTRAINT,
+ EXTRA_CONSTRAINT, EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_R,
+ EXTRA_CONSTRAINT_T, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_U): Remove.
+ * config/cris/cris.c: Incule "tm-constrs.h".
+ (cris_print_operand): Use satisfies_constraint_O.
+ (cris_normal_notice_update_cc, cris_rtx_costs): Use
+ satisfies_constraint_I.
+ (cris_address_cost): Use satisfies_constraint_L.
+ * config/cris/cris.md: Include "constraints.md".
+ (*mov_side<mode>, *mov_sidesisf, *mov_side<mode>_mem,
+ *mov_sidesisf_mem, *clear_side<mode>, *ext_sideqihi,
+ *ext_side<mode>si, *op_side<mode>, *op_swap_side<mode>,
+ *extopqihi_side, *extop<mode>si_side, *extopqihi_swap_side,
+ *extop<mode>si_swap_side): Use satisfies_constraint_N and
+ satisfies_constraint_J.
+ (moversideqi movemsideqi mover2side peephole2): Use
+ satisfies_constraint_N and satisfies_constraint_J.
+ (andu peephole2): Use satisfies_constraint_I and
+ satisfies_constraint_O.
+
+2011-11-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_builtin_vectorized_function): Handle
+ BUILT_IN_IRINT, BUILT_IN_IRINTF, BUILT_IN_LLRINT and BUILT_IN_LLRINTF.
+
+2011-11-07 Andrew MacLeod <amacleod@redhat.com>
+
+ * optabs.c (get_atomic_op_for_code): Fill in optab table at runtime so
+ SWITCHABLE_TARGET can change the values during compilation.
+ (expand_atomic_fetch_op): Handle parameter change ripples for
+ get_atomic_op_for_code call.
+
+2011-11-07 Andrew MacLeod <amacleod@redhat.com>
+
+ * doc/extend.texi: Docuemnt behaviour change for __atomic_exchange and
+ __atomic_store.
+ * optabs.c (expand_atomic_exchange): Expand to __sync_lock_test_and_set
+ only when originated from that builtin.
+ (expand_atomic_store): Expand to __sync_lock_release when originated
+ from that builtin.
+ * builtins.c (expand_builtin_sync_lock_test_and_set): Add flag that
+ expand_atomic_exchange call originated from here.
+ (expand_builtin_sync_lock_release): Add flag that expand_atomic_store
+ call originated from here.
+ (expand_builtin_atomic_exchange): Add origination flag.
+ (expand_builtin_atomic_store): Add origination flag.
+ * expr.h (expand_atomic_exchange, expand_atomic_store): Add boolean
+ parameters to indicate implementation fall back options.
+
+2011-11-07 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (output_reload_in_const): Can handle CONSTANT_P
+ now, not only CONST_INT and CONST_DOUBLE.
+ (output_movqi): Use output_reload_in_const.
+ (output_reload_inhi): Ditto.
+ (output_reload_insisf): Move assertion to output_reload_in_const.
+ (avr_out_reload_inpsi): Ditto.
+
+2011-11-07 Nathan Sidwell <nathan@acm.org>
+
+ * gcov.c (object_summary): Replace with ...
+ (object_runs): ... this.
+ (process_file): Remove functions with no data.
+ (generate_results): Ignore files with no lines.
+ (release_function): New helper, broken out of ...
+ (release_structures): ... here. Use it.
+ (read_count_file): Adjust for new data file format.
+ (output_lines): Use object_runs.
+ * gcov-io.h (GCOV_TAG_OBJECT_SUMMARY): Obsolete.
+ (struct gcov_ctr_info): Move definition.
+ (struct gcov_fn_info): Add key field, use gcov_ctr_info for
+ trailing array.
+ (struct gcov_info): Add merge function array, remove mask and
+ counts. Trailing array is array of pointers to function info.
+ * coverage.c (struct function_list): Replace counter numbers with
+ counter arrays. Add fndecl field. GTYify.
+ (counts_entry): Remove chain workspace.
+ (functions_head): GTYify.
+ (prg_n_ctrs): Remove.
+ (fn_v_ctrs): New.
+ (tree_ctr_tables): Remove.
+ (read_counts_file): Cope with blank entries and expect program
+ summaries before functions. Don't warn on missing entries.
+ (coverage_counter_alloc): Allocate individual function arrays.
+ (tree_coverage_counter_ref, tree_coverage_counter_addr): Adjust
+ for individual function arrays.
+ (coverage_end_function): GTYify function list object. Finalize
+ function's counter arrays.
+ (build_var): New. Create a counter-related variable with
+ appropriate linkage.
+ (build_fn_info_type): Adjust for new runtime structure.
+ (build_fn_info_value): Rename to ...
+ (build_fn_info): ... here. Build new format data.
+ (build_ctr_info_type, build_ctr_info_value): Remove.
+ (build_info_type): New. Build new format data structure.
+ (build_info): Adjust for new format data.
+ (create_coverage): Likewise.
+ * gcov-dump.c (tag_function): Recognize placeholders.
+
+2011-11-07 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/constraints.md (Cm2): New constraint for int -2.
+ * config/avr/avr.md (addqi3): Use it. New alternatives for +/-2.
+ (*negqihi2): New insn.
+
+2011-11-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf2cfi.c (dwarf2out_frame_debug_expr): Check
+ HARD_FRAME_POINTER_REGNUM instead of hard_frame_pointer_rtx
+ in Rule 18.
+
+2011-11-07 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_builtin): If gather mask
+ argument is known to have all high bits set, pass pc_rtx as
+ second argument to the expander instead of op0.
+ * config/i386/sse.md (*avx2_gathersi<mode>_2,
+ *avx2_gatherdi<mode>_2): New patterns.
+ * config/i386/avx2intrin.h (_mm256_i32gather_pd,
+ _mm256_i64gather_pd, _mm256_i32gather_ps): Set mask using
+ _mm256_cmp_pd with zero vector arguments and _CMP_EQ_OQ instead of
+ _mm256_set1_pd.
+
+ PR tree-optimization/50789
+ * tree-vect-stmts.c (process_use): Add force argument, avoid
+ exist_non_indexing_operands_for_use_p check if true.
+ (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle
+ STMT_VINFO_GATHER_P.
+ (gen_perm_mask): New function.
+ (perm_mask_for_reverse): Use it.
+ (reverse_vec_element): Rename to...
+ (permute_vec_elements): ... this. Add Y and MASK_VEC arguments,
+ generalize for any permutations.
+ (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P.
+ * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook.
+ * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it.
+ * doc/tm.texi: Regenerate.
+ * tree-data-ref.c (initialize_data_dependence_relation,
+ compute_self_dependence): No longer static.
+ * tree-data-ref.h (initialize_data_dependence_relation,
+ compute_self_dependence): New prototypes.
+ * tree-vect-data-refs.c (vect_check_gather): New function.
+ (vect_analyze_data_refs): Detect possible gather load data
+ refs.
+ * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field.
+ (STMT_VINFO_GATHER_P): Define.
+ (vect_check_gather): New prototype.
+ * config/i386/i386-builtin-types.def: Add types for alternate
+ gather builtins.
+ * config/i386/sse.md (AVXMODE48P_DI): Remove.
+ (VEC_GATHER_MODE): Rename mode_attr to...
+ (VEC_GATHER_IDXSI): ... this.
+ (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs.
+ (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI>
+ instead of <VEC_GATHER_MODE>.
+ (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of
+ <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE
+ on src and mask operands.
+ (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator
+ instead of AVXMODE48P_DI.
+ (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed.
+ * config/i386/i386.c (enum ix86_builtins): Add
+ IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF,
+ IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI.
+ (ix86_init_mmx_sse_builtins): Create those builtins.
+ (ix86_expand_builtin): Handle those builtins and adjust expansions
+ of other gather builtins.
+ (ix86_vectorize_builtin_gather): New function.
+ (TARGET_VECTORIZE_BUILTIN_GATHER): Define.
+
+2011-11-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/f16cintrin: Remove extra _X86INTRIN_H_INCLUDED check.
+
+2011-11-07 Tristan Gingold <gingold@adacore.com>
+
+ * config.gcc (*-*-*vms*): Set c_target_objs, cxx_target_objs.
+ * config/vms/t-vms: Add vms-c.o rule.
+ * config/vms/vms-c.c: New file.
+ * config/vms/vms-protos.h (vms_c_register_pragma): New prototype.
+ * config/vms/vms.h (REGISTER_TARGET_PRAGMAS): Define.
+
+2011-11-07 Tristan Gingold <gingold@adacore.com>
+
+ * config/alpha/vms.h (TARGET_OBJECT_SUFFIX,
+ TARGET_EXECUTABLE_SUFFIX, TARGET_OS_CPP_BUILTINS,
+ TARGET_ABI_OPEN_VMS, LONG_TYPE_SIZE, ADA_LONG_TYPE_SIZE,
+ POINTER_SIZE, POINTERS_EXTEND_UNSIGNED): Move to config/vms/vms.h
+ (SUBTARGET_OS_CPP_BUILTINS): Define.
+ (TARGET_DEFAULT): Tune according to POINTER_SIZE.
+ (MASK_RETURN_ADDR): Define in 64 bit mode.
+ * config/ia64/vms.h: Likewise.
+ * config/vms/vms.h: New file.
+ * config/vms/vms64.h: New file.
+ * config/alpha/vms64.h: Removed.
+ * config/ia64/vms64.h: Removed.
+ * config.gcc (alpha64-dec-*vms*, alpha*-dec-*vms*, ia64-hp-*vms*):
+ Adjust for above change.
+
+2011-11-07 Enkovich Ilya <ilya.enkovich@intel.com>
+
+ PR target/50962
+ * config/i386/i386-protos.h (ix86_use_lea_for_mov): New.
+ * config/i386/i386.c (ix86_use_lea_for_mov): Likewise.
+ * config/i386/i386.md (movsi_internal): Emit lea if profitable.
+ (movdi_internal_rex64): Likewise.
+
+2011-11-07 Sergey Ostanevich <sergos.gnu@gmail.com>
+
+ PR rtl-optimization/47698
+ * ifconv.c (noce_operand_ok): prevent CMOV generation for volatile mem.
+
+2011-11-07 Tristan Gingold <gingold@adacore.com>
+
+ * common/config/alpha/alpha-common.c (alpha_option_init_struct):
+ New function.
+ (TARGET_OPTION_INIT_STRUCT): Define.
+ * config/alpha/alpha.c (TARGET_MIN_ANCHOR_OFFSET)
+ (TARGET_MAX_ANCHOR_OFFSET)
+ (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Redefine.
+
+2011-11-06 Quentin Neill <quentin.neill@amd.com>
+
+ Fix r180999, update ChangeLog
+ * config.gcc: Add f16cintrin.h.
+ * config/i386/f16cintrin.h: Add missing endif.
+
+2011-11-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config.gcc (arm*-*-rtemseabi*): New target.
+ * config/arm/rtems-eabi.h: New.
+ * config/arm/t-rtems-eabi: New.
+
+2011-11-06 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (UNSPEC_SHORT_LOAD): Delete.
+ (zero_extend_v8qi_vis, zero_extend_v4hi_vis,
+ *zero_extend_v8qi_<P:mode>_insn,
+ *zero_extend_v4hi_<P:mode>_insn): Express using vec_merge
+ and vec_duplicate instead of using an UNSPEC.
+
+2011-11-07 Alan Modra <amodra@gmail.com>
+
+ PR target/30282
+ * config/rs6000/rs6000.c (rs6000_emit_stack_reset): Always emit
+ blockage for ABI_V4.
+
+2011-11-06 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * config/i386/cygwin.h (LIBGCJ_SONAME): Updated to match recent
+ libgcj version bump.
+ * config/i386/mingw32.h (LIBGCJ_SONAME): Likewise.
+
+2011-11-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcse.c: Adjust outdated comments throughout.
+ (struct mem_conflict_info): New structure.
+ (mems_conflict_for_gcse_p): Use it to communicate with caller.
+ (load_killed_in_block_p): Pass it to note_stores.
+ (hash_expr): Remove superfluous line break.
+ (hash_scan_set): Rename PAT parameter into SET.
+ (hash_scan_insn): Reorder cases.
+ (canon_list_insert): Fix long line.
+ (edge_list): Delete.
+ (prune_expressions): Rename E local variable into EXPR.
+ (compute_pre_data): Return struct edge_list * object.
+ (pre_expr_reaches_here_p_work): Fix formatting.
+ (process_insert_insn): Move around comment.
+ (pre_edge_insert): Fix long line.
+ (pre_insert_copies): Likewise.
+ (gcse_emit_move_after): Swap SRC and DEST parameters.
+ (pre_delete): Adjust call to gcse_emit_move_after.
+ (pre_gcse): Take struct edge_list * parameter. Fix long line.
+ (one_pre_gcse_pass): Use flag_gcse_lm condition for all routines.
+ Use a local list of edges.
+ (hoist_code): Fix long line. Adjust call to gcse_emit_move_after.
+ (pre_ldst_expr_hash): Fix long line.
+ (free_ldst_mems): Rename into...
+ (free_ld_motion_mems): ...this.
+ (first_ls_expr): Delete.
+ (next_ls_expr): Likewise.
+ (print_ldst_list): Do not use above two functions.
+ (simple_mem): Adjust interface.
+ (compute_ld_motion_mems): Fix formatting.
+ (update_ld_motion_stores): Reuse local variable.
+
+2011-11-06 Joseph Myers <joseph@codesourcery.com>
+
+ * c-decl.c (shadow_tag_warned, grokdeclarator): Handle _Alignas
+ specifiers.
+ (build_null_declspecs): Initialize align_log and alignas_p fields.
+ (declspecs_add_alignas): New.
+ * c-parser.c (c_token_starts_declspecs): Handle RID_ALIGNAS.
+ (c_parser_declspecs): Handle _Alignas specifiers.
+ (c_parser_alignas_specifier): New.
+ (c_parser_alignof_expression): Diagnose alignof use for non-C1X.
+ Diagnose _Alignof (expression).
+ * c-tree.h (struct c_declspecs): Add align_log and alignas_p fields.
+ (declspecs_add_alignas): Declare.
+ * ginclude/stddef.h (max_align_t): Define for C1X and C++11.
+ * ginclude/stdalign.h: New.
+ * Makefile.in (USER_H): Add stdalign.h.
+
+2011-11-06 Joern Rennecke <joern.rennecke@embecosm.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ * regset.h (fixed_reg_set_regset): Declare.
+ * dse.c: Include regset.h .
+ (struct insn_info): Add member fixed_regs_live.
+ (note_add_store_info): New typedef.
+ (note_add_store): New function.
+ (emit_inc_dec_insn_before): Expect arg to be of type insn_info_t.
+ Use gen_add3_insn / gen_move_insn.
+ Check new insn for unwanted clobbers before emitting it.
+ (check_for_inc_dec): Rename to...
+ (check_for_inc_dec_1:) ... this. Return bool. Take insn_info
+ parameter. Changed all callers in file.
+ (check_for_inc_dec, copy_fixed_regs): New functions.
+ (scan_insn): Set fixed_regs_live field of insn_info.
+ * rtl.h (check_for_inc_dec): Update prototype.
+ * postreload.c (reload_cse_simplify): Take new signature of
+ check_ind_dec into account.
+ * reginfo.c (fixed_reg_set_regset): New variable.
+ (init_reg_sets_1): Initialize it.
+
+2011-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-cfg.c (gimple_can_merge_blocks_p): For -O0 don't remove
+ any user labels.
+
+2011-11-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config/pa/pa.c (pa_hpux_init_libfuncs): Rename to pa_init_libfuncs.
+ Remove dependence of declaration and target define on definition of
+ HPUX_LONG_DOUBLE_LIBRARY. Update implementation.
+
+2011-11-06 Andrew Macleod <amacleod@redhat.com>
+ Richard Henderson <rth@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ Merged from cxx-mem-model.
+
+ * cppbuiltin.c (define__GNUC__): Define __ATOMIC memory models
+ * coretypes.h (enum memmodel): New. enumerated memory model type.
+ * Makefile.in (cppbuiltin.o) Add missing dependency on $(TREE_H)
+ * genopinit,c (optabs): Add atomic direct optab handlers.
+ * sync-builtins.def (BUILT_IN_ATOMIC_*): New builtins.
+ * builtin-types.def (BT_CONST_VOLATILE_PTR,
+ BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
+ BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
+ BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT,
+ BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
+ BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
+ BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT): New builtin types.
+ * expr.h (expand_atomic_*): Add prototypes.
+ (expand_{bool,val}_compare_and_swap): Remove prototypes.
+ * c-typeck.c (build_function_call_vec): Don't reprocess __atomic
+ parameters.
+ * common.opt (Winvalid-memory-model): New warning flag.
+ (finline-atomics): New. Flag to disable atomic inlining.
+ * params.h (ALLOW_LOAD_DATA_RACES): New.
+ (ALLOW_PACKED_LOAD_DATA_RACES): New.
+ (ALLOW_PACKED_STORE_DATA_RACES): New.
+ * params.def (PARAM_ALLOW_LOAD_DATA_RACES): New.
+ (PARAM_ALLOW_PACKED_LOAD_DATA_RACES): New.
+ (PARAM_ALLOW_PACKED_STORE_DATA_RACES): New.
+ * builtins.c (is_builtin_name): Handle __atomic.
+ (get_memmodel): New. Extract memory model.
+ (expand_expr_force_mode): New. Factor out common code for ensuring an
+ integer argument is in the proper mode.
+ (expand_builtin_sync_operation): Remove ignore param. Always call
+ expand_atomic_fetch_op instead of the old expanders.
+ (expand_builtin_compare_and_swap,
+ expand_builtin_sync_lock_test_and_set): Use expand_expr_force_mode,
+ call atomic expanders instead of sync expanders.
+ (expand_builtin_sync_lock_release): Call atomic_store expander.
+ (expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load,
+ expand_builtin_atomic_store, expand_builtin_atomic_fetch_op): New.
+ (expand_builtin_atomic_exchange): New.
+ (fold_builtin_atomic_always_lock_free,
+ expand_builtin_atomic_always_lock_free,
+ fold_builtin_atomic_is_lock_free, expand_builtin_atomic_is_lock_free):
+ New.
+ (expand_builtin_mem_thread_fence, expand_builtin_atomic_thread_fence,
+ expand_builtin_atomic_signal_fence): New.
+ (expand_builtin_mem_signal_fence): New.
+ (expand_builtin): Add cases for BUILT_IN_ATOMIC_*.
+ (fold_builtin_2): Add cases for BUILT_IN_ATOMIC_{IS,ALWAYS}_LOCK_FREE.
+ * optabs.h (DOI_atomic_*): Define new atomics.
+ (atomic_*_optab): Define.
+ (can_compare_and_swap_p, expand_atomic_compare_and_swap): New
+ prototypes.
+ * optabs.c (expand_sync_operation, expand_sync_fetch_operation): Remove.
+ (expand_sync_lock_test_and_set): Remove.
+ (expand_atomic_load, expand_atomic_store): New.
+ (expand_atomic_exchange): New.
+ (expand_atomic_compare_and_swap): New. Implements
+ atomic_compare_exchange via compare and swap.
+ (struct atomic_op_functions): Opcode table struct for fetch ops.
+ (get_atomic_op_for_code): New. Return an opcode table entry.
+ (maybe_emit_op): New. Try to emit a fetch op.
+ (expand_atomic_fetch_op): New.
+ (expand_val_compare_and_swap_1): Remove.
+ (expand_val_compare_and_swap, expand_bool_compare_and_swap): Remove.
+ (expand_atomic_compare_and_swap): Rename from
+ expand_atomic_compare_exchange. Rewrite to return both success and
+ oldval return values; expand via both atomic and sync optabs.
+ (can_compare_and_swap_p): New.
+ (expand_compare_and_swap_loop): Use expand_atomic_compare_and_swap.
+ (maybe_gen_insn): Handle 7 and 8 operands.
+ * omp-low.c (expand_omp_atomic_fetch_op): Don't test individual
+ fetch_op optabs, only test can_compare_and_swap_p. Use __atomic
+ builtins instead of __sync builtins.
+ (expand_omp_atomic_pipeline): Use can_compare_and_swap_p.
+ * doc/extend.texi: Document __atomic built-in functions.
+ * doc/invoke.texi: Document data race parameters.
+ * doc/md.texi: Document atomic patterns.
+ * config/i386/i386.md (UNSPEC_MOVA): New.
+ (UNSPECV_CMPXCHG): Split into ...
+ (UNSPECV_CMPXCHG_1, UNSPECV_CMPXCHG_2,
+ UNSPECV_CMPXCHG_3, UNSPECV_CMPXCHG_4): New.
+ * config/i386/sync.md (ATOMIC): New mode iterator.
+ (atomic_load<ATOMIC>, atomic_store<ATOMIC>): New.
+ (atomic_loaddi_fpu, atomic_storedi_fpu, movdi_via_fpu): New.
+ (mem_thread_fence): Rename from memory_barrier.
+ Handle the added memory model parameter.
+ (mfence_nosse): Rename from memory_barrier_nosse.
+ (sync_compare_and_swap<CASMODE>): Split into ...
+ (atomic_compare_and_swap<SWI124>): this and ...
+ (atomic_compare_and_swap<CASMODE>): this. Handle the new parameters.
+ (atomic_compare_and_swap_single<SWI>): Rename from
+ sync_compare_and_swap<SWI>; rewrite to use split unspecs.
+ (atomic_compare_and_swap_double<DCASMODE>): Rename from
+ sync_double_compare_and_swap<DCASMODE>; rewrite to use split unspecs.
+ (*atomic_compare_and_swap_doubledi_pic): Rename from
+ sync_double_compare_and_swapdi_pic; rewrite to use split unspecs.
+ (atomic_fetch_add<SWI>): Rename from sync_old_add<SWI>; add memory
+ model parameter.
+ (*atomic_fetch_add_cmp<SWI>): Similarly.
+ (atomic_add<SWI>, atomic<any_logic><SWI>): Similarly.
+ (atomic_sub<SWI>): Similarly. Use x86_maybe_negate_const_int.
+ (sync_lock_test_and_set<SWI>): Merge with ...
+ (atomic_exchange<SWI>): ... this.
+
+2011-11-6 Richard Guenther <rguenther@suse.de>
+
+ * ipa-prop.c (ipa_modify_call_arguments): Re-compute
+ inlinable flag.
+
+2011-11-06 Ira Rosen <ira.rosen@linaro.org>
+
+ * tree-vectorizer.h (vectorizable_condition): Add argument.
+ * tree-vect-loop.c (vectorizable_reduction): Fail for condition
+ in SLP. Update calls to vectorizable_condition.
+ * tree-vect-stmts.c (vect_is_simple_cond): Add basic block info to
+ the arguments. Pass it to vect_is_simple_use_1.
+ (vectorizable_condition): Add slp_node to the arguments. Support
+ vectorization of basic blocks. Fail for reduction in SLP. Update
+ calls to vect_is_simple_cond and vect_is_simple_use. Support SLP:
+ call vect_get_slp_defs to get vector operands.
+ (vect_analyze_stmt): Update calls to vectorizable_condition.
+ (vect_transform_stmt): Likewise.
+ * tree-vect-slp.c (vect_create_new_slp_node): Handle COND_EXPR.
+ (vect_get_and_check_slp_defs): Handle COND_EXPR. Allow pattern
+ def stmts.
+ (vect_build_slp_tree): Handle COND_EXPR.
+ (vect_analyze_slp_instance): Push pattern statements to root node.
+ (vect_get_constant_vectors): Fix comments. Handle COND_EXPR.
+
+2011-11-05 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (UNSPEC_SHORT_LOAD): New unspec.
+ (zero-extend_v8qi_vis, zero_extend_v4hi_vis): New expanders.
+ (*zero_extend_v8qi_<P:mode>_insn,
+ *zero_extend_v4hi_<P:mode>_insn): New insns.
+ * config/sparc/sparc.c (vector_init_move_words,
+ vector_init_prepare_elts, sparc_expand_vector_init_vis2,
+ sparc_expand_vector_init_vis1): New functions.
+ (vector_init_bshuffle): Rewrite to handle more cases and make use
+ of locs[] array prepared by vector_init_prepare_elts.
+ (vector_init_fpmerge, vector_init_faligndata): Delete.
+ (sparc_expand_vector_init): Rewrite using new infrastructure.
+
+2011-11-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * config.gcc (epiphany-*-*): New architecture.
+ (epiphany-*-elf): New configuration.
+ * config/epiphany, common/config/epiphany : New directories.
+ * doc/extend.texi (disinterrupt attribute): Add Epiphany.
+ (interrupt attribute): Add Epiphany.
+ (long_call, short_call attribute): Add Epiphany.
+ * doc/invoke.texi (Options): Add Epiphany options.
+ * doc/md.texi (Machine Constraints): Add Epiphany constraints.
+ * doc/install.texi (Options specification):
+ Add --with-stack-offset=@var{num} description.
+ (host/target specific issues): Add epiphany-*-elf.
+ * doc/contrib.texi (Contributors): Mention Epiphany port.
+
+2011-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/50693
+ * tree-cfg.c (gimple_can_merge_blocks_p): Allow merging with
+ non-forced user labels.
+ (gimple_merge_blocks): Turn non-forced user labels into
+ debug bind stmt with the label as first operand and reset value.
+ (gimple_duplicate_bb): Don't duplicate label debug stmts.
+ * dwarf2out.c (gen_label_die): Handle NOTE_INSN_DELETED_DEBUG_LABEL.
+ * final.c (final_scan_insn): Likewise.
+ (rest_of_clean_state): Don't dump NOTE_INSN_DELETED_DEBUG_LABEL.
+ * var-tracking.c (debug_label_num): New variable.
+ (delete_debug_insns): Don't delete DEBUG_INSNs for LABEL_DECLs,
+ instead turn them into NOTE_INSN_DELETED_DEBUG_LABEL notes.
+ * cfglayout.c (skip_insns_after_block, duplicate_insn_chain): Handle
+ NOTE_INSN_DELETED_DEBUG_LABEL.
+ (duplicate_insn_chain): Don't duplicate LABEL_DECL DEBUG_INSNs.
+ * insn-notes.def (DELETED_DEBUG_LABEL): New note kind.
+ * print-rtl.c (print_rtx): Handle NOTE_INSN_DELETED_DEBUG_LABEL.
+ * gengtype.c (adjust_field_rtx_def): Likewise.
+ * config/i386/i386.c (ix86_output_function_epilogue): For MachO
+ clear CODE_LABEL_NUMBER of NOTE_INSN_DELETED_DEBUG_LABEL
+ if their are at the end of function and nop hasn't been emitted.
+ * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Likewise.
+
+2011-11-05 Georg-Johann Lay <avr@gjlay.de>
+
+ PR rtl-optimization/50448
+ * cprop.c (try_replace_reg): Also try to replace uses of FROM that
+ appear in SET_DEST.
+
+2011-11-05 Peter Dufault <dufault@hda.com>,
+ Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rs6000/rtems.h (SUBSUBTARGET_OVERRIDE_OPTIONS):
+ Extend rs6000_spe handling.
+
+2011-11-05 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/rs6000/t-rtems: Add -mcpu=8540/-mfloat-gprs=double multilib.
+ Remove -mcpu=601 multilib.
+ Remove -Dmpc8260 multilib.
+ * config/rs6000/rtems.h: Allow --float-gprs=... to override grps
+ on E500 targets.
+
+2011-11-05 Quentin Neill <quentin.neill@amd.com>
+
+ Piledriver f16cintrin.h fix.
+ * config/i386/f16cintrin.h: Contents moved from immintrin.h.
+ * config/i386/immintrin.h: Include f16cintrin.h.
+ * config.gcc (i[34567]86-*-*, x86_64-*-*): Add f16cintrin.h.
+
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR c++/50608
+ * c-parser.c (c_parser_postfix_expression) <RID_OFFSETOF>: Adjust call
+ to fold_offsetof.
+ * c-typeck.c (build_unary_op) <ADDR_EXPR>: Call fold_offsetof_1.
+
+2011-11-04 Alan Modra <amodra@gmail.com>
+
+ * reload1.c (gen_reload): Don't use REGNO on SUBREGs.
+ * print-rtl.c (print_rtx): Don't segfault on negative regno.
+
+2011-11-04 David S. Miller <davem@davemloft.net>
+
+ PR target/49965
+ * config/sparc/sparc.c (sparc_expand_conditional_move): Handle the
+ fact that sparc_emit_float_lib_cmp modifies the comparison in
+ operands[1].
+
+2011-11-04 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/lm32/t-rtems: New.
+ * config.gcc (lm32-*-rtems*): Add t-rtems.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/50979
+ * config/sparc/sparc.h (ASM_CPU_SPEC): Pass -Av8 if -mcpu=v8.
+
+2011-11-04 Jiangning Liu <jiangning.liu@arm.com>
+
+ PR rtl-optimization/38644
+ * config/arm/arm.c (thumb1_expand_epilogue): Add memory barrier
+ for epilogue having stack adjustment.
+
+2011-11-04 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50931
+ * config/avr/avr-modes.def: New file defining PSImode.
+ * config/avr/avr-c.c (__INT24_MAX__, __INT24_MIN__,
+ __UINT24_MAX__): New built-in defines.
+ * config/avr/avr.md (adjust_len): Add tstpsi, mov24, reload_in24,
+ ashlpsi, ashrpsi, lshrpsi.
+ (QISI, QIDI, HISI, HIDI, MPUSH, rotx, rotsmode): Add PSI.
+ (MOVMODE): New mode iterator.
+ (movpsi): New expander.
+ (movqi, movhi, movsi, movsf, movpsi): Write as one using MOVMODE.
+ (*reload_inpsi, *movpsi): New insns.
+ (*reload_inpsi): New RTL peephole.
+ (addpsi3, *addpsi3_zero_extend.qi, *addpsi3_zero_extend.hi,
+ *addpsi3_sign_extend.hi): New insns.
+ (subpsi3, *subpsi3_zero_extend.qi, *subpsi3_zero_extend.hi,
+ *subpsi3_sign_extend.hi): New insns.
+ (divmodpsi4, udivmodpsi4): New define insn-and-split.
+ (*divmodpsi4_call, *udivmodpsi4_call): New insns.
+ (andpsi3, iorpsi3, xorpsi3): New insns.
+ (*rotlpsi2.1, *rotlpsi2.23): New insns.
+ (*rotw<mode>): Insn condition only allow even-sized modes.
+ (*rotb<mode>): Insn condition allows odd-sized modes.
+ (ashlpsi3, ashrpsi3, lshrpsi3, *addpsi3.lt0): New insns.
+ (negpsi2, one_cmplpsi2): New insns.
+ (extendqipsi2, extendhipsi2, extendpsisi2): New insns.
+ (zero_extendqipsi2, zero_extendhipsi2, zero_extendpsisi2): New
+ insn-and-splits.
+ (*cmppsi, *negated_tstpsi, *reversed_tstpsi): New insns.
+ (cbranchpsi4): New expander.
+ * config/avr/constraints.md (Ca3, Co3, Cx3): New constraints.
+ * config/avr/avr-protos.h (avr_out_tstpsi, avr_out_movpsi,
+ avr_out_ashlpsi3, avr_out_ashrpsi3, avr_out_lshrpsi3,
+ avr_out_reload_inpsi): New prototypes.
+
+ * config/avr/avr.c (TARGET_SCALAR_MODE_SUPPORTED_P): Define to...
+ (avr_scalar_mode_supported_p): ...this new static function.
+ (avr_asm_len): Always return "".
+ (avr_out_load_psi, avr_out_store_psi): New static functions.
+ (avr_out_movpsi, avr_out_reload_inpsi): New functions.
+ (avr_out_tstpsi): New function.
+ (avr_out_ashlpsi3, avr_out_ashrpsi3, avr_out_lshrpsi3): New functions.
+ (avr_out_plus_1, output_reload_in_const): Handle 3-byte types.
+ (avr_simplify_comparison_p): Ditto.
+ (adjust_insn_length): Handle ADJUST_LEN_RELOAD_IN24,
+ ADJUST_LEN_MOV24, ADJUST_LEN_TSTPSI, ADJUST_LEN_ASHLPSI,
+ ADJUST_LEN_ASHRPSI, ADJUST_LEN_LSHRPSI.
+ (avr_rtx_costs_1): Report PSI costs.
+ (avr_libcall_value): Handle odd-sized parameters.
+ (avr_init_builtin_int24): New static function to define built-in
+ 24-bit types __int24 and __uint24.
+ (avr_init_builtins): Use it.
+
+2011-11-04 Thomas Doerfler <thomas.doerfler@embedded-brains.de>
+
+ PR target/50989
+ * config/arm/rtems-elf.h, config/arm/t-rtems: Add optional
+ support for VFP floating point model.
+
+2011-11-04 Tristan Gingold <gingold@adacore.com>
+
+ * config/alpha/vms.h (ASM_OUTPUT_DEF): Do not switch section.
+
+2011-11-04 Ira Rosen <ira.rosen@linaro.org>
+
+ Unrevert:
+ 2011-10-24 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/50730
+ * tree-vect-data-refs.c (vect_analyze_data_refs): Stop basic block
+ analysis if encountered unsupported data-ref.
+
+2011-11-04 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_vector_convert_uns_vsivsf): New
+ function.
+ * config/i386/i386-protos.h (ix86_expand_vector_convert_uns_vsivsf):
+ New prototype.
+ * config/i386/sse.md (floatuns<sseintvecmodelower><mode>2): Use it.
+ For floatunsv8siv8sf2 require TARGET_AVX2.
+
+ * config/i386/i386.c (ix86_expand_adjust_ufix_to_sfix_si): Add
+ XORP argument. Subtract 0x1p31 instead of 0x1p32. Use normal
+ signalling comparison instead of non-signalling. Store into
+ *XORP pseudo holding 0x80000000 integers if 0x1p31 has been
+ subtracted and 0 otherwise.
+ * config/i386/i386-protos.h (ix86_expand_adjust_ufix_to_sfix_si):
+ Adjust prototype.
+ * config/i386/sse.md (fixuns_trunc<mode><sseintvecmodelower>2): Enable
+ already for TARGET_SSE2. Xor in vector initialized by
+ ix86_expand_adjust_ufix_to_sfix_si at the end.
+ (vec_pack_ufix_trunc_<mode>): Likewise.
+
+ * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle
+ not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P,
+ WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what
+ vectorizable_type_demotion and vectorizable_type_promotion did.
+ Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer
+ is {,un}signed {char,short}.
+ (vect_create_vectorized_demotion_stmts): Fix comment typo. For
+ recursive calls unconditionally use VEC_PACK_TRUNC_EXPR.
+ Push vec_dest back to the vec_dsts vector at the end.
+ (vect_create_vectorized_promotion_stmts): Don't recurse, do just
+ one step. Removed multi_step_cvt, vec_dsts, slp_node and
+ prev_stmt_info arguments, add vec_dest argument. Push always
+ into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0
+ with vec_tmp at the end after freeing old *vec_oprnd0 vector.
+ (vectorizable_type_demotion, vectorizable_type_promotion): Removed.
+ (vect_analyze_stmt): Don't call vectorizable_type_demotion and
+ vectorizable_type_promotion. Call vectorizable_conversion even
+ for SLP bb vectorization.
+ (vect_transform_stmt): Call vectorizable_conversion instead of
+ vectorizable_type_demotion and vectorizable_type_promotion.
+ (supportable_widening_operation): Clear *multi_step_cvt first,
+ simplify c1/c2 computation, free *interm_types vector on failure.
+ (supportable_narrowing_operation): Clear *multi_step_cvt first,
+ free *interm_types vector on failure, handle multi-step
+ FIX_TRUNC_EXPR.
+
+2011-11-04 Tristan Gingold <gingold@adacore.com>
+
+ * config/alpha/alpha.c (alpha_write_linkage): Remove fundecl
+ argument. Conditionally generate crash debug info. Adjust
+ for alpha_funcs_tree removal.
+ (machine_function): Add links field.
+ (alpha_start_function): Conditionally generate crash debug info.
+ (alpha_end_function): Adjust call to alpha_write_linkage.
+ (alpha_funcs): Remove.
+ (links_kind): Remove.
+ (alpha_links): Remove num, target and lkind field. Add func field.
+ (alpha_links_tree): Remove.
+ (alpha_funcs_tree): Remove.
+ (alpha_need_linkage): Remove.
+ (alpha_use_linkage): Change prototype. Adjust.
+ (alpha_write_one_linkage): Use ASM_OUTPUT_INTERNAL_LABEL.
+ Use SYMBOL_REF_EXTERNAL_P and SYMBOL_REF_LOCAL_P macro.
+ * config/alpha/alpha-protos.h (alpha_use_linkage): Update.
+ (alpha_need_linkage): Remove.
+ * config/alpha/alpha.md: Update calls to alpha_use_linkage.
+ Adjust calls to alpha_need_linkage.
+
+2011-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * sched-vis.c (print_value): Handle STRICT_LOW_PART.
+
+2011-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (lround<X87MODEF:mode><SWI248x:mode>2,
+ rint<mode>2, floor<mode>2, lfloor<MODEF:mode><SWI48:mode>2,
+ btrunc<mode>2, lwp_lwpval<mode>3): Use operands[N] instead of operandN.
+
+2011-11-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/50978
+ * config/arm/t-bpabi: New file.
+ * config.gcc (arm*-*-linux*): Add arm/t-bpabi to tmake_file for
+ arm*-*-linux-*eabi.
+ (arm*-*-uclinux*): Add arm/t-bpabi to tmake_file for
+ arm*-*-uclinux*eabi.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Add arm/t-bpabi to tmake_file
+ for arm*-*-eabi*.
+
+2011-11-03 Michael Matz <matz@suse.de>
+
+ PR bootstrap/50857
+ * configure.ac: Check for -fno-exceptions -fno-rtti.
+ * configure: Regenerate.
+ * Makefile.in (NOEXCEPTION_FLAGS): New flag.
+ (ALL_CXXFLAGS): Use it.
+
+2011-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md: Use {} for multi-line preparation statements.
+
+2011-11-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/sparc/sparc.md (movtf_insn_sp32_no_fpu): Consolidate into...
+ (movtf_insn_sp32): ...this.
+ (movtf_insn_sp64_no_fpu): Consolidate into...
+ (movtf_insn_sp64): ...this.
+ (movtf_insn_sp64_hq): Do not test TARGET_FPU.
+ * config/sparc/sparc.c (sparc_legitimate_address_p): Likewise.
+
+2011-11-03 Tristan Gingold <gingold@adacore.com>
+
+ * config/vms/vms.c (vms_patch_builtins): Fix typo.
+
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR lto/44965
+ * lto-opts.c: Re-implement.
+ * lto-streamer.h (lto_register_user_option): Remove.
+ (lto_read_file_options): Likewise.
+ (lto_reissue_options): Likewise.
+ (lto_clear_user_options): Likewise.
+ (lto_clear_file_options): Likewise.
+ * opts-global.c (post_handling_callback): Remove.
+ (set_default_handlers): Do not set post_handling_callback.
+ (decode_options): Remove LTO specific code.
+ * lto-wrapper.c (merge_and_complain): New function.
+ (run_gcc): Read all input file options and
+ prepend a merged set before the linker driver options.
+ * gcc.c (driver_post_handling_callback): Remove.
+ (set_option_handlers): Do not set post_handling_callback.
+ * opts-common.c (handle_option): Do not call post_handling_callback.
+ * opts.h (struct cl_option_handlers): Remove post_handling_callback.
+
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ * collect2.c (main): Guard object_nbr variable with TARGET_AIX_VERSION.
+
+2011-11-03 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.c (type_change_info): New fields offset, object,
+ known_current_type and multiple_types_encountered.
+ (extr_type_from_vtbl_ptr_store): New function.
+ (check_stmt_for_type_change): Use it, set multiple_types_encountered if
+ the result is different from the previous one.
+ (detect_type_change): Renamed to detect_type_change_1. New parameter
+ comp_type. Set up new fields in tci, build known type jump
+ functions if the new type can be identified.
+ (detect_type_change): New function.
+ * tree.h (DECL_CONTEXT): Comment new use.
+
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR lto/48217
+ * lto-wrapper.c (get_options_from_collect_gcc_options): Properly
+ decode an encoded literal '.
+
+2011-11-03 Tristan Gingold <gingold@adacore.com>
+
+ * collect2.c (main): Add support of -f (response file) on AIX.
+
+2011-11-03 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/50912
+ * tree-vectorizer.h (slp_void_p): New.
+ (struct _slp_tree): Replace left and right with children. Update
+ documentation.
+ (struct _slp_oprnd_info): New.
+ (vect_get_vec_defs): Declare.
+ (vect_get_slp_defs): Update arguments.
+ * tree-vect-loop.c (vect_create_epilog_for_reduction): Call
+ vect_get_vec_defs instead of vect_get_slp_defs.
+ (vectorizable_reduction): Likewise.
+ * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument.
+ Update call to vect_get_slp_defs.
+ (vectorizable_conversion): Update call to vect_get_vec_defs.
+ (vectorizable_assignment, vectorizable_shift,
+ vectorizable_operation): Likewise.
+ (vectorizable_type_demotion): Call vect_get_vec_defs instead of
+ vect_get_slp_defs.
+ (vectorizable_type_promotion, vectorizable_store): Likewise.
+ (vect_analyze_stmt): Fix typo.
+ * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal.
+ (vect_print_slp_tree, vect_mark_slp_stmts,
+ vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts,
+ vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations,
+ vect_schedule_slp_instance): Likewise.
+ (vect_create_new_slp_node): New.
+ (vect_create_oprnd_info, vect_free_oprnd_info): Likewise.
+ (vect_get_and_check_slp_defs): Pass information about defs using
+ oprnds_info, allow any number of operands.
+ (vect_build_slp_tree): Likewise. Update calls to
+ vect_get_and_check_slp_defs. Fix comments.
+ (vect_analyze_slp_instance): Move node creation to
+ vect_create_new_slp_node.
+ (vect_get_slp_defs): Allow any number of operands.
+
+2011-11-02 Peter Bergner <bergner@vnet.ibm.com>
+ Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/rs6000/rs6000.c (USE_HIDDEN_LINKONCE): New define.
+ (get_ppc476_thunk_name): Use it.
+ (rs6000_code_end): Likewise.
+ (macho_branch_islands): Fix typo.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/50810
+ * configure.ac: Add -Wno-narrowing to warning options.
+ * doc/invoke.texi ([-Wnarrowing], [-Wc++0x-compat]): Update.
+
+2011-11-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/50945
+ * config/sparc/sparc.md (movsf_insn): Reindent constraints.
+ (movdf_insn_sp32): Likewise. Remove redundant G constraint.
+ (movdf_insn_sp64): Likewise.
+ (DFmode splitter): Do not test TARGET_FPU.
+ (movtf_insn_sp32): Reindent constraints.
+ (movtf_insn_sp32_no_fpu): Likewise.
+ (movtf_insn_sp64): Likewise.
+ (movtf_insn_sp64_hq): Likewise.
+ (movtf_insn_sp64_no_fpu): Likewise.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50956
+ * builtins.c (fold_builtin_memchr): Fix cast.
+
+2011-11-02 Teresa Johnson <tejohnson@google.com>
+
+ * config/i386/predicates.md (promotable_binary_operator): Add minus
+ to the list of promotable operators.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gthr-single.h, gthr.h: Move to ../libgcc.
+ * gthr-aix.h: Move to ../libgcc/config/rs6000.
+ * gthr-dce.h: Move to ../libgcc/config/pa.
+ * gthr-lynx.h: Move to ../libgcc/config.
+ * gthr-mipssde.h: Move to ../libgcc/config/mips.
+ * gthr-posix.h: Move to ../libgcc/config.
+ * gthr-rtems.h: Likewise.
+ * gthr-tpf.h: Move to ../libgcc/config/s390.
+ * gthr-vxworks.h: Move to ../libgcc/config.
+ * gthr-win32.h: Move to ../libgcc/config/i386.
+ * configure.ac (gthread_flags): Remove
+ (gthr-default.h): Don't create.
+ (thread_file): Don't substitute.
+ * configure: Regenerate.
+ * Makefile.in (GCC_THREAD_FILE): Remove.
+ (GTHREAD_FLAGS): Remove.
+ (libgcc.mvars): Remove GTHREAD_FLAGS.
+ * config/t-vxworks (EXTRA_HEADERS): Remove.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac (libgcc_tm_file_list, libgcc_tm_include_list): Remove.
+ * configure: Regenerate.
+ * Makefile.in (libgcc_tm_file_list, libgcc_tm_include_list): Remove.
+ (TM_H): Remove libgcc_tm.h, $(libgcc_tm_file_list).
+ (libgcc_tm.h, cs-libgcc_tm.h): Remove.
+ (clean): Remove libgcc_tm.h
+ * mkconfig.sh: Don't include libgcc_tm.h in tm.h.
+ * config.gcc (libgcc_tm_file): Remove.
+ (arm*-*-linux*): Remove libgcc_tm_file for arm*-*-linux-*eabi.
+ (arm*-*-uclinux*): Remove libgcc_tm_file for arm*-*-uclinux*eabi.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Remove libgcc_tm_file.
+ (avr-*-rtems*): Likewise.
+ (avr-*-*): Likewise.
+ (frv-*-elf): Likewise.
+ (frv-*-*linux*): Likewise.
+ (h8300-*-rtems*): Likewise.
+ (h8300-*-elf*): Likewise.
+ (i[34567]86-*-darwin*): Likewise.
+ (x86_64-*-darwin*): Likewise.
+ (rx-*-elf*): Likewise.
+ (tic6x-*-elf): Likewise.
+ (tic6x-*-uclinux): Likewise.
+ (i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.in (LIBGCC2_DEBUG_CFLAGS LIBGCC2_CFLAGS)
+ (LIBGCC2_INCLUDES, TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXTRA)
+ (LIB2FUNCS_STATIC_EXTRA, LIB2FUNCS_EXCLUDE, T, T_TARGET)
+ (INCLUDES_FOR_TARGET): Remove.
+ (LIBGCC2_CFLAGS): Don't export.
+ (LIB2FUNCS_ST, LIB2_DIVMOD_FUNCS, LIB2ADD, LIB2ADD_ST, srcdirify):
+ Remove.
+ (libgcc-support): Remove $(LIB2ADD), $(LIB2ADD_ST) dependencies.
+ (libgcc.mvars): Likewise.
+ Don't emit LIB2FUNCS_ST, LIB2FUNCS_EXCLUDE, LIB2ADD, LIB2ADD_ST,
+ LIB2_SIDITI_CONV_FUNCS, LIB2_DIVMOD_FUNCS, LIBGCC2_CFLAGS,
+ TARGET_LIBGCC2_CFLAGS.
+ Emit GTHREAD_FLAGS.
+ * libgcc2.c, libgcc2.h, gbl-ctors.h, longlong.h: Move to ../libgcc.
+ * config/darwin-64.c: Move to ../libgcc/config.
+ * config/divmod.c, config/floatunsidf.c, config/floatunsisf.c,
+ config/floatunsitf.c, config/floatunsixf.c, config/udivmod.c,
+ config/udivmodsi4.c: Move to ../libgcc/config.
+ * config/gthr-posix.c: Move to ../libgcc/config/alpha.
+ * config/memcmp.c, config/memcpy.c, config/memmove.c,
+ config/memset.c: Move to ../libgcc/config.
+ * config/t-darwin (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/t-freebsd: Remove.
+ * config/t-freebsd-thread: Move to ../libgcc/config.
+ * config/t-libgcc-pic: Move to ../libgcc/config.
+ * config/t-libunwind (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/t-linux: Remove.
+ * config/t-lynx (TARGET_LIBGCC2_CFLAGS, LIBGCC, INSTALL_LIBGCC):
+ Remove.
+ * config/t-openbsd-thread: Move to ../libgcc/config.
+ * config/t-rtems (LIBGCC2_INCLUDES): Remove.
+ * config/t-sol2 (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/t-svr4: Remove.
+ * config/t-vxworks (LIBGCC, INSTALL_LIBGCC, TARGET_LIBGCC2_CFLAGS)
+ (LIBGCC2_DEBUG_CFLAGS, LIB2FUNCS_EXTRA, LIBGCC2_INCLUDES): Remove.
+ * config/vxlib.c, config/vxlib-tls.c: Move to ../libgcc/config.
+ * config/alpha/qrnnd.asm: Move to ../libgcc/config/alpha/qrnnd.S.
+ * config/alpha/t-alpha, config/alpha/t-ieee: Remove.
+ * config/alpha/t-vms (LIB2FUNCS_EXTRA, LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/alpha/vms-gcc_shell_handler.c: Move to ../libgcc/config/alpha.
+ * config/arm/bpabi.c, config/arm/unaligned-funcs.c,
+ config/arm/fp16.c, config/arm/linux-atomic.c,
+ config/arm/linux-atomic-64bit.c: Move to ../libgcc/config/arm.
+ * config/arm/t-arm-elf (LIBGCC, INSTALL_LIBGCC)
+ (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/arm/t-bpabi, config/arm/t-linux: Remove.
+ * config/arm/t-linux-eabi (TARGET_LIBGCC2_CFLAGS)
+ (LIB2FUNCS_STATIC_EXTRA): Remove.
+ * config/arm/t-netbsd: Remove.
+ * config/arm/t-strongarm-elf (LIBGCC, INSTALL_LIBGCC)
+ (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/arm/t-symbian (LIB2FUNCS_STATIC_EXTRA): Remove.
+ * config/arm/t-wince-pe (LIBGCC, INSTALL_LIBGCC)
+ (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/avr/t-avr (LIB2FUNCS_EXCLUDE, TARGET_LIBGCC2_CFLAGS)
+ (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/bfin/t-bfin-elf (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/bfin/t-bfin-linux: Likewise.
+ * config/bfin/t-bfin-uclinux: Likewise.
+ * config/c6x/eqd.c, config/c6x/eqf.c, config/c6x/ged.c,
+ config/c6x/gef.c, config/c6x/gtd.c, config/c6x/gtf.c,
+ config/c6x/led.c, config/c6x/lef.c, config/c6x/ltd.c,
+ config/c6x/ltf.c: Move to ../libgcc/config/c6x.
+ * config/c6x/t-c6x-elf (LIB2FUNCS_EXCLUDE, LIB2FUNCS_EXTRA): Remove.
+ * config/c6x/t-c6x-uclinux (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/cris/arit.c: Move to ../libgcc/config/cris.
+ * config/cris/cris_abi_symbol.c: Remove.
+ * config/cris/cris.h: Remove obsolete comment.
+ * config/cris/mulsi3.asm: Move to ../libgcc/config/cris/mulsi3.S.
+ * config/cris/t-cris (LIB2FUNCS_EXTRA, CRIS_LIB1CSRC)
+ ($(LIB2FUNCS_EXTRA)): Remove.
+ * config/cris/t-elfmulti (LIB2FUNCS_STATIC_EXTRA, INSTALL_LIBGCC)
+ (LIBGCC): Remove.
+ * config/cris/t-linux (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/fr30/t-fr30: Remove.
+ * config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c,
+ config/frv/modi.c, config/frv/uitod.c, config/frv/uitof.c,
+ config/frv/ulltod.c, config/frv/ulltof.c, config/frv/umodi.c: Move
+ to ../libgcc/config/frv.
+ * config/frv/t-frv (LIB2FUNCS_EXTRA, TARGET_LIBGCC2_CFLAGS)
+ (cmovh.c, cmovw.c, cmovd.c, modi.c, umodi.c, uitof.c, uitod.c)
+ (ulltof.c, LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/frv/t-linux (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/h8300/clzhi2.c, config/h8300/ctzhi2.c,
+ config/h8300/fixunssfsi.c, config/h8300/parityhi2.c,
+ config/h8300/popcounthi2.c: Move to ../libgcc/config/h8300.
+ * config/h8300/t-h8300 (LIB2FUNCS_EXTRA, TARGET_LIBGCC2_CFLAGS)
+ (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/i386/gthr-win32.c: Move to ../libgcc/config/i386.
+ * config/i386/t-cygming (LIBGCC2_INCLUDES): Remove.
+ * config/i386/t-cygwin: Remove.
+ * config/i386/t-darwin (LIB2_SIDITI_CONV_FUNCS, LIB2FUNCS_EXTRA)
+ (LIB2FUNCS_EXCLUDE): Remove.
+ * config/i386/t-darwin64 (LIB2_SIDITI_CONV_FUNCS, LIB2FUNCS_EXTRA)
+ (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/i386/t-gthr-win32: Move to ../libgcc/config/i386.
+ * config/i386/t-linux64 (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/i386/t-mingw-w32: Likewise.
+ * config/i386/t-mingw-w64: Likewise.
+ * config/i386/t-openbsd: Likewise.
+ * config/i386/t-nto: Remove.
+ * config/ia64/quadlib.c: Move to ../libgcc/config/ia64.
+ * config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, LIB2FUNCS_EXTRA)
+ (quadlib.c): Remove.
+ * config/ia64/t-ia64: Remove comment.
+ * config/iq2000/lib2extra-funcs.c: Move to
+ ../libgcc/config/iq2000/lib2funcs.c.
+ * config/iq2000/t-iq2000: Remove.
+ * config/m32c/m32c-lib2.c: Move to ../libgcc/config/m32c/lib2funcs.c.
+ * config/m32c/m32c-lib2-trapv.c: Move to ../libgcc/config/m32c/trapv.c.
+ * config/m32r/t-linux (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/m32c/t-m32c (LIB2FUNCS_EXTRA): Remove.
+ * config/m32r/t-m32r (TARGET_LIBGCC2_CFLAGS, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/m68k/fpgnulib.c: Move to ../libgcc/config/m68k.
+ * config/m68k/t-floatlib: Remove.
+ * config/m68k/t-mlibs (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/mcore/t-mcore (TARGET_LIBGCC2_CFLAGS): Remove.
+ Fix typo.
+ (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/mep/mep-lib2.c: Move to ../libgcc/config/mep/lib2funcs.c.
+ * config/mep/mep-tramp.c: Move to ../libgcc/config/mep/tramp.c.
+ * config/mep/t-mep (LIB2FUNCS_EXTRA): Remove.
+ * config/mips/t-elf (TARGET_LIBGCC2_CFLAGS, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/mips/t-isa3264: Likewise.
+ * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Remove.
+ * config/mips/t-r3900 (TARGET_LIBGCC2_CFLAGS, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/mips/t-sde (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/mips/t-sr71k (TARGET_LIBGCC2_CFLAGS, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/mips/t-vr (TARGET_LIBGCC2_CFLAGS)
+ (LIB2FUNCS_STATIC_EXTRA): Remove.
+ * config/mips/vr4120-div.S: Move to ../libgcc/config/mips.
+ * config/mmix/t-mmix (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/mn10300/t-mn10300 (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/pa/fptr.c, config/pa/linux-atomic.c: Move to
+ ../libgcc/config/pa.
+ * config/pa/lib2funcs.asm: Move to ../libgcc/config/pa/lib2funcs.S.
+ * config/pa/quadlib.c: Move to ../libgcc/config/pa.
+ * config/pa/t-dce-thr (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/pa/t-linux, config/pa/t-linux64: Remove.
+ * config/pa/t-pa-hpux, config/pa/t-pa-hpux10,
+ config/pa/t-pa-hpux11, config/pa/t-pa64: Remove.
+ * config/pdp11/t-pdp11 (TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXTRA):
+ Remove.
+ * config/picochip/libgccExtras: Move to ../libgcc/config/picochip.
+ * config/picochip/t-picochip (LIB2FUNCS_EXTRA, RANLIB_FOR_TARGET)
+ (TARGET_LIBGCC2_CFLAGS, LIBGCC2_DEBUG_CFLAGS): Remove.
+ * config/rs6000/crtresfpr.asm: Move to
+ ../libgcc/config/rs6000/crtresfpr.S.
+ * config/rs6000/crtresgpr.asm: Move to
+ ../libgcc/config/rs6000/crtresgpr.S.
+ * config/rs6000/crtresxfpr.asm: Move to
+ ../libgcc/config/rs6000/crtresxfpr.S.
+ * config/rs6000/crtresxgpr.asm: Move to
+ ../libgcc/config/rs6000/crtresxgpr.S.
+ * config/rs6000/crtsavfpr.asm: Move to
+ ../libgcc/config/rs6000/crtsavfpr.S.
+ * config/rs6000/crtsavgpr.asm: Move to
+ ../libgcc/config/rs6000/crtsavgpr.S.
+ * config/rs6000/darwin-asm.h: Move to ../libgcc/config/rs6000.
+ * config/rs6000/darwin-fpsave.asm: Move to
+ ../libgcc/config/rs6000/darwin-fpsave.S.
+ * config/rs6000/darwin-gpsave.asm: Move to
+ ../libgcc/config/rs6000/darwin-gpsave.S.
+ * config/rs6000/darwin-tramp.asm: Move to
+ ../libgcc/config/rs6000/darwin-tramp.S.
+ * config/rs6000/darwin-vecsave.asm: Move to
+ ../libgcc/config/rs6000/darwin-vecsave.S.
+ * config/rs6000/darwin-world.asm: Move to
+ ../libgcc/config/rs6000/darwin-world.S.
+ * config/rs6000/e500crtres32gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtres32gpr.S.
+ * config/rs6000/e500crtres64gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtres64gpr.S.
+ * config/rs6000/e500crtres64gprctr.asm: Move to
+ ../libgcc/config/rs6000/e500crtres64gprctr.S.
+ * config/rs6000/e500crtrest32gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtrest32gpr.S.
+ * config/rs6000/e500crtrest64gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtrest64gpr.S.
+ * config/rs6000/e500crtresx32gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtresx32gpr.S.
+ * config/rs6000/e500crtresx64gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtresx64gpr.S.
+ * config/rs6000/e500crtsav32gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsav32gpr.S.
+ * config/rs6000/e500crtsav64gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsav64gpr.S.
+ * config/rs6000/e500crtsav64gprctr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsav64gprctr.S.
+ * config/rs6000/e500crtsavg32gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsavg32gpr.S.
+ * config/rs6000/e500crtsavg64gpr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsavg64gpr.S.
+ * config/rs6000/e500crtsavg64gprctr.asm: Move to
+ ../libgcc/config/rs6000/e500crtsavg64gprctr.S.
+ * config/rs6000/eabi.asm: Move to ../libgcc/config/rs6000/eabi.S.
+ * config/rs6000/t-aix43 (LIBGCC, INSTALL_LIBGCC, LIB2FUNCS_EXTRA)
+ (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/rs6000/t-aix52: Likewise.
+ * config/rs6000/t-darwin: Remove.
+ * config/rs6000/t-darwin64 (LIB2_SIDITI_CONV_FUNCS)
+ (LIB2FUNCS_EXTRA): Remove.
+ * config/rs6000/t-fprules (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/rs6000/t-linux64 (TARGET_LIBGCC2_CFLAGS): Remove.
+ * config/rs6000/t-lynx (LIB2FUNCS_EXTRA, tramp.S, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/rs6000/t-netbsd (LIB2FUNCS_EXTRA)
+ (LIB2FUNCS_STATIC_EXTRA, tramp.S, crtsavfpr.S, crtresfpr.S)
+ (crtsavgpr.S, crtresgpr.S, crtresxfpr.S, crtresxgpr.S, LIBGCC)
+ (INSTALL_LIBGCC, $(T)crtsavfpr$(objext), $(T)crtresfpr$(objext))
+ ($(T)crtsavgpr$(objext), $(T)crtresgpr$(objext))
+ ($(T)crtresxfpr$(objext), $(T)crtresxgpr$(objext)): Remove.
+ * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA)
+ (LIB2FUNCS_STATIC_EXTRA, eabi.S, tramp.S): Remove.
+ * config/rs6000/t-spe (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/rs6000/t-vxworks: Remove comment.
+ * config/rs6000/tramp.asm: Move to ../libgcc/config/rs6000/tramp.S.
+ * config/rx/t-rx (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/sh/linux-atomic.asm: Move to
+ ../libgcc/config/sh/linux-atomic.S.
+ * config/sh/t-linux (LIB2FUNCS_EXTRA): Remove.
+ * config/sh/t-netbsd: Remove.
+ * config/sh/t-sh (TARGET_LIBGCC2_CFLAGS, LIBGCC, INSTALL_LIBGCC):
+ Remove.
+ * config/sparc/t-elf (LIBGCC, INSTALL_LIBGCC): Remove.
+ * config/sparc/t-leon: Likewise.
+ * config/sparc/t-leon3: Likewise.
+ * config/sparc/t-linux64: Likewise.
+ * config/sparc/t-netbsd64: Fix typo.
+ Remove comment.
+ * config/spu/divmodti4.c, config/spu/divv2df3.c,
+ config/spu/float_disf.c, config/spu/float_unsdidf.c,
+ config/spu/float_unsdisf.c, config/spu/float_unssidf.c,
+ config/spu/mfc_multi_tag_release.c,
+ config/spu/mfc_multi_tag_reserve.c, config/spu/mfc_tag_release.c,
+ config/spu/mfc_tag_reserve.c, config/spu/mfc_tag_table.c,
+ config/spu/multi3.c: Move to ../libgcc/config/spu.
+ * config/spu/t-spu-elf (TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXCLUDE)
+ (LIB2FUNCS_STATIC_EXTRA, LIB2_SIDITI_CONV_FUNCS, LIBGCC)
+ (INSTALL_LIBGCC): Remove.
+ * config/stormy16/stormy16-lib2.c: Move to
+ ../libgcc/config/stormy16/lib2.c.
+ * config/stormy16/stormy16-lib2-ashlsi3.c: Move to
+ ../libgcc/config/stormy16/ashlsi3.c.
+ * config/stormy16/stormy16-lib2-ashrsi3.c: Move to
+ ../libgcc/config/stormy16/ashrsi3.c.
+ * config/stormy16/stormy16-lib2-clzhi2.c: Move to
+ ../libgcc/config/stormy16/clzhi2.c.
+ * config/stormy16/stormy16-lib2-cmpsi2.c: Move to
+ ../libgcc/config/stormy16/cmpsi2.c.
+ * config/stormy16/stormy16-lib2-ctzhi2.c: Move to
+ ../libgcc/config/stormy16/ctzhi2.c.
+ * config/stormy16/stormy16-lib2-divsi3.c: Move to
+ ../libgcc/config/stormy16/divsi3.c.
+ * config/stormy16/stormy16-lib2-ffshi2.c: Move to
+ ../libgcc/config/stormy16/ffshi2.c.
+ * config/stormy16/stormy16-lib2-lshrsi3.c: Move to
+ ../libgcc/config/stormy16/lshrsi3.c.
+ * config/stormy16/stormy16-lib2-modsi3.c: Move to
+ ../libgcc/config/stormy16/modsi3.c.
+ * config/stormy16/stormy16-lib2-parityhi2.c: Move to
+ ../libgcc/config/stormy16/parityhi2.c.
+ * config/stormy16/stormy16-lib2-popcounthi2.c: Move to
+ ../libgcc/config/stormy16/popcounthi2.c.
+ * config/stormy16/stormy16-lib2-ucmpsi2.c: Move to
+ ../libgcc/config/stormy16/ucmpsi2.c.
+ * config/stormy16/stormy16-lib2-udivmodsi4.c: Move to
+ ../libgcc/config/stormy16/udivmodsi4.c.
+ * config/stormy16/stormy16-lib2-udivsi3.c: Move to
+ ../libgcc/config/stormy16/udivsi3.c.
+ * config/stormy16/stormy16-lib2-umodsi3.c: Move to
+ ../libgcc/config/stormy16/umodsi3.c.
+ * config/stormy16/t-stormy16: Move to ../libgcc/config/t-stormy16.
+ * config/v850/t-v850 (INSTALL_LIBGCC): Remove.
+ * config/xtensa/lib2funcs.S: Move to ../libgcc/config/xtensa.
+ * config/xtensa/t-elf: Remove.
+ * config/xtensa/t-xtensa (LIB2FUNCS_EXTRA): Remove.
+ * config.gcc (*-*-freebsd*): Remove t-freebsd, t-freebsd-thread
+ from tmake_file.
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
+ *-*-gnu*, *-*-kopensolaris*-gnu): Remove t-linux from tmake_file.
+ (*-*-netbsd*): Remove t-libgcc-pic from tmake_file.
+ (*-*-openbsd*): Likewise.
+ Remove t-openbsd-thread for posix threads.
+ (alpha*-*-linux*): Remove alpha/t-alpha, alpha/t-ieee from tmake_file.
+ (alpha*-*-freebsd*): Likewise.
+ (alpha*-*-netbsd*): Likewise.
+ (alpha*-*-openbsd*): Likewise.
+ (alpha64-dec-*vms*): Likewise.
+ (alpha*-dec-*vms*): Likewise.
+ (arm*-*-netbsdelf*): Remove arm/t-netbsd from tmake_file.
+ (arm*-*-linux*): Remove t-linux from tmake_file.
+ Remove arm/t-bpabi from tmake_file for arm*-*-linux-*eabi.
+ (arm*-*-uclinux*): Remove arm/t-bpabi from tmake_file for
+ arm*-*-uclinux*eabi.
+ (arm*-*-eabi*, arm*-*-symbianelf* ): Remove arm/t-bpabi from
+ tmake_file for arm*-*-eabi*.
+ (fr30-*-elf): Remove tmake_file.
+ (hppa*64*-*-linux*): Remove tmake_file.
+ (hppa*-*-linux*): Likewise.
+ (hppa[12]*-*-hpux10*): Remove pa/t-pa-hpux10, pa/t-pa-hpux from
+ tmake_file.
+ (hppa*64*-*-hpux11*): Remove pa/t-pa64, pa/t-pa-hpux from tmake_file.
+ (hppa[12]*-*-hpux11*): Remove pa/t-pa-hpux11, pa/t-pa-hpux from
+ tmake_file.
+ (i[34567]86-*-elf*): Remove tmake_file.
+ (x86_64-*-elf*): Likewise.
+ (i[34567]86-*-nto-qnx*): Likewise.
+ (i[34567]86-*-cygwin*): Remove i386/t-cygwin from tmake_file.
+ (i[34567]86-*-mingw*, x86_64-*-mingw*): Remove i386/t-gthr-win32
+ from tmake_file if using win32 threads.
+ (iq2000*-*-elf*): Remove tmake-file.
+ (microblaze*-linux*): Likewise.
+ (sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*)
+ (sh[2346lbe]*-*-linux*, sh-*-netbsdelf*, shl*-*-netbsdelf*)
+ (sh5-*-netbsd*, sh5l*-*-netbsd*, sh64-*-netbsd*)
+ (sh64l*-*-netbsd*): Remove sh/t-netbsd from tmake_file for
+ sh5*-*-netbsd*, sh64*-netbsd*, *-*-netbsd.
+ (xtensa*-*-elf*): Remove tmake_file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.in (LIB1ASMSRC): Don't export.
+ (libgcc.mvars): Don't emit LIB1ASMFUNCS, LIB1ASMSRC.
+ * config/arm/arm.c: Update lib1funcs.asm filename.
+ * config/arm/linux-eabi.h: Likewise.
+ * config/arm/bpabi-v6m.S, config/arm/bpabi.S,
+ config/arm/ieee754-df.S, config/arm/ieee754-sf.S: Move to
+ ../libgcc/config/arm.
+ * config/arm/lib1funcs.asm: Move to ../libgcc/config/arm/lib1funcs.S.
+ * config/arm/t-arm (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/arm/t-arm-elf (LIB1ASMFUNCS): Remove.
+ * config/arm/t-bpabi: Likewise.
+ * config/arm/t-linux (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/arm/t-linux-eabi (LIB1ASMFUNCS): Remove.
+ * config/arm/t-strongarm-elf: Likewise.
+ * config/arm/t-symbian: Likewise.
+ * config/arm/t-vxworks: Likewise.
+ * config/arm/t-wince-pe: Likewise.
+ * config/avr/libgcc.S: Move to ../libgcc/config/avr.
+ * config/avr/t-avr (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/bfin/lib1funcs.asm: Move to ../libgcc/config/bfin/lib1funcs.S.
+ * config/bfin/t-bfin: Remove.
+ * config/bfin/t-bfin-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/bfin/t-bfin-linux: Likewise.
+ * config/bfin/t-bfin-uclinux: Likewise.
+ * config/c6x/lib1funcs.asm: Move to ../libgcc/config/c6x/lib1funcs.S.
+ * config/c6x/t-c6x-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/fr30/lib1funcs.asm: Move to ../libgcc/config/fr30/lib1funcs.S.
+ * config/fr30/t-fr30 (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/frv/lib1funcs.asm: Move to ../libgcc/config/frv/lib1funcs.S.
+ * config/frv/t-frv (CROSS_LIBGCC1, LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/h8300/fixunssfsi.c: Update lib1funcs.asm filename.
+ * config/h8300/lib1funcs.asm: Move to
+ ../libgcc/config/h8300/lib1funcs.S.
+ * config/h8300/t-h8300 (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/i386/cygwin.asm: Move to ../libgcc/config/i386/cygwin.S.
+ * config/i386/t-cygming (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/i386/t-interix: Likewise.
+ * config/ia64/lib1funcs.asm: Move to ../libgcc/config/ia64/lib1funcs.S.
+ * config/ia64/t-hpux (LIB1ASMFUNCS, LIBGCC1_TEST): Remove.
+ * config/ia64/t-ia64 (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/iq2000/t-iq2000 (LIBGCC1, CROSS_LIBGCC1): Remove.
+ * config/m32c/m32c.c: Update m32c-lib1.S filename.
+ * config/m32c/m32c-lib1.S: Move to ../libgcc/config/m32c/lib1funcs.S.
+ * config/m32c/t-m32c (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/m32r/t-linux (CROSS_LIBGCC1, LIBGCC1, LIBGCC1_TEST): Remove.
+ * config/m68k/lb1sf68.asm: Move to ../libgcc/config/m68k/lb1sf68.S.
+ * config/m68k/t-floatlib (LIB1ASMSRC, LIB1ASMFUNCS): New file.
+ * config/mcore/lib1.asm: Move to ../libgcc/config/mcore/lib1funcs.S.
+ * config/mcore/t-mcore (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/mep/mep-lib1.asm: Move to ../libgcc/config/mep/lib1funcs.S.
+ * config/mep/t-mep (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/mips/mips16.S: Move to ../libgcc/config/mips.
+ * config/mips/t-libgcc-mips16: Remove.
+ * config/mips/t-sr71k (LIBGCC1, CROSS_LIBGCC1): Remove.
+ * config/pa/milli64.S: Move to ../libgcc/config/pa.
+ * config/pa/t-linux (LIB1ASMFUNCS, LIB1ASMSRC): Remove.
+ * config/pa/t-linux64: Likewise.
+ * config/picochip/libgccExtras/fake_libgcc.asm: Move to
+ ../libgcc/config/picochip/lib1funcs.S.
+ * config/picochip/t-picochip (LIB1ASMFUNCS, LIB1ASMSRC): Remove.
+ * config/sh/lib1funcs.asm: Move to ../libgcc/config/sh/lib1funcs.S.
+ * config/sh/lib1funcs.h: Move to ../libgcc/config/sh.
+ * config/sh/sh.h: Update lib1funcs.asm filename.
+ * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Remove.
+ * config/sh/t-netbsd: Likewise.
+ * config/sh/t-sh (LIB1ASMSRC, LIB1ASMFUNCS, LIB1ASMFUNCS_CACHE):
+ Remove.
+ * config/sh/t-sh64 (LIB1ASMFUNCS): Remove.
+ * config/sparc/lb1spc.asm: Move to ../libgcc/config/sparc/lb1spc.S.
+ * config/sparc/lb1spl.asm: Remove.
+ * config/sparc/t-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config/sparc/t-leon: Likewise.
+ * config/spu/t-spu-elf (LIBGCC1, CROSS_LIBGCC1): Remove.
+ * config/v850/lib1funcs.asm: Move to ../libgcc/config/v850/lib1funcs.S.
+ * config/v850/t-v850 (LIB1ASMSRC, LIB1ASMFUNCS): Remove
+ * config/vax/lib1funcs.asm: Move to ../libgcc/config/vax/lib1funcs.S.
+ * config/vax/t-linux: Remove.
+ * config/xtensa/ieee754-df.S, config/xtensa/ieee754-sf.S: Move to
+ ../libgcc/config/xtensa.
+ * config/xtensa/lib1funcs.asm: Move to
+ ../libgcc/config/xtensa/lib1funcs.S.
+ * config/xtensa/t-xtensa (LIB1ASMSRC, LIB1ASMFUNCS): Remove.
+ * config.gcc (bfin*-rtems*): Remove bfin/t-bfin from tmake_file.
+ (bfin*-*): Likewise.
+ (mips64*-*-linux*, mipsisa64*-*-linux*): Remove
+ mips/t-libgcc-mips16 from tmake_file.
+ (mips*-*-linux*): Likewise.
+ (mips*-sde-elf*): Likewise.
+ (mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*)
+ (mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*)
+ (mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Likewise.
+ (mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*): Likewise.
+ (mips-*-elf*, mipsel-*-elf*): Likewise.
+ (mips64-*-elf*, mips64el-*-elf*): Likewise.
+ (mips64orion-*-elf*, mips64orionel-*-elf*): Likewise.
+ (mips*-*-rtems*): Likewise.
+ (mipstx39-*-elf*, mipstx39el-*-elf*): Likewise.
+ (vax-*-linux*): Remove vax/t-linux from tmake_file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.gcc (extra_parts): Remove.
+ (*-*-freebsd*): Remove extra_parts.
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
+ *-*-gnu*, *-*-kopensolaris*-gnu): Likewise.
+ (*-*-netbsd*): Remove t-libc-ok, t-netbsd from tmake_file.
+ Remove extra_parts for *-*-netbsd*1.[7-9]*, *-*-netbsd[2-9]*,
+ *-*-netbsdelf[2-9]*.
+ (*-*-openbsd*): Remove t-libc-ok from tmake_file.
+ (alpha*-*-linux*): Remove extra_parts.
+ (alpha*-*-freebsd*): Likewise.
+ (bfin*-linux-uclibc*): Likewise.
+ (fr30-*-elf): Likewise.
+ (moxie-*-elf): Likewise.
+ (moxie-*-uclinux*): Likewise.
+ (h8300-*-rtems*): Remove h8300/t-elf from tmake_file.
+ (h8300-*-elf*): Likewise.
+ (hppa*64*-*-hpux11*): Remove extra_parts.
+ (i[34567]86-*-elf*): Remove i386/t-i386elf, i386/t-crtstuff from
+ tmake_file.
+ (x86_64-*-elf*): Likewise.
+ (i[34567]86-*-freebsd*): Remove tmake_file.
+ (x86_64-*-freebsd*): Likewise.
+ (x86_64-*-netbsd*): Likewise.
+ (i[34567]86-*-openbsd2.*, i[34567]86-*openbsd3.[0123]): Remove
+ t-libc-ok from tmake_file.
+ (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu,
+ i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*,
+ i[34567]86-*-kopensolaris*-gnu): Remove i386/t-crtstuff from
+ tmake_file.
+ Remove extra_parts.
+ (x86_64-*-linux*, x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu):
+ Remove i386/t-crtstuff from tmake_file.
+ (i[34567]86-*-lynxos*): Likewise.
+ Remove extra_parts.
+ (ia64*-*-elf*): Remove extra_parts.
+ (ia64*-*-freebsd*): Likewise.
+ (ia64*-*-linux*): Likewise.
+ (ia64-hp-*vms*): Remove ia64/t-vms from tmake_file.
+ (m32r-*-elf*): Remove extra_parts.
+ (m32rle-*-elf*): Likewise.
+ (m32r-*-rtems*): Likewise.
+ (m68k-*-elf*, fido-*-elf*): Likewise.
+ (m68k*-*-openbsd*): Remove t-libc-ok from tmake_file.
+ (m68k-*-rtems*): Remove extra_parts.
+ (mep-*-*): Likewise.
+ (microblaze*-linux*): Likewise.
+ (mips64*-*-linux*, mipsisa64*-*-linux*): Likewise.
+ (mips*-*-linux*): Likewise.
+ (powerpc-*-lynxos*): Likewise.
+ (s390x-ibm-tpf*): Likewise.
+ (score-*-elf): Likewise.
+ Remove tmake_file.
+ (sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*, sh[2346lbe]*-*-linux*,
+ sh-*-netbsdelf*, shl*-*-netbsdelf*, sh5-*-netbsd*, sh5l*-*-netbsd*,
+ sh64-*-netbsd*, sh64l*-*-netbsd*): Remove sh/t-elf from tmake_file.
+ Remove sh/t-superh from tmake_file for sh*-superh-elf.
+ Remove sh/t-linux64 from tmake_file for sh64*-*-linux*.
+ (sh-*-rtems*): Remove sh/t-elf from tmake_file.
+ (sh-wrs-vxworks): Likewise.
+ (sparc-*-linux*): Remove extra_parts.
+ (sparc64-*-linux*): Likewise.
+ (sparc64-*-freebsd*, ultrasparc-*-freebsd*): Likewise.
+ (xstormy16-*-elf): Likewise.
+ (xtensa*-*-linux*): Remove xtensa/t-linux from tmake_file.
+ (am33_2.0-*-linux*): Remove extra_parts.
+ * configure.ac (extra_parts): Don't substitute.
+ * configure: Regenerate.
+ * crtstuff.c: Move to ../libgcc.
+ * Makefile.in (CRTSTUFF_CFLAGS): Remove.
+ (EXTRA_PARTS): Remove.
+ (CRTSTUFF_T_CFLAGS): Remove.
+ (MOSTLYCLEANFILES): Remove $(EXTRA_PARTS).
+ (GCC_EXTRA_PARTS): Remove.
+ (libgcc.mvars): Remove GCC_EXTRA_PARTS, CRTSTUFF_CFLAGS,
+ CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S.
+ Emit GCC_CFLAGS, INHIBIT_LIBC_CFLAGS.
+ ($(T)crtbegin.o, $(T)crtend.o, $(T)crtbeginS.o, $(T)crtendS.o)
+ ($(T)crtbeginT.o): Remove.
+ * config/alpha/t-vms (EXTRA_PARTS): Remove.
+ ($(T)vms-dwarf2.o, $(T)vms-dwarf2eh.o): Remove.
+ * config/alpha/vms-dwarf2.asm: Move to
+ ../libgcc/config/alpha/vms-dwarf2.S.
+ * config/alpha/vms-dwarf2eh.asm: Move to
+ ../libgcc/config/alpha/vms-dwarf2eh.S.
+ * config/arm/crti.asm: Move to ../libgcc/config/arm/crti.S.
+ * config/arm/crtn.asm: Move to ../libgcc/config/arm/crtn.S.
+ * config/arm/t-arm-elf (EXTRA_MULTILIB_PARTS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/arm/t-linux: Remove comment.
+ * config/arm/t-linux-eabi (EXTRA_MULTILIB_PARTS): Remove.
+ * config/arm/t-strongarm-elf (EXTRA_MULTILIB_PARTS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/arm/t-symbian (EXTRA_MULTILIB_PARTS): Remove.
+ * config/bfin/crti.s: Move to ../libgcc/config/bfin/crti.S.
+ * config/bfin/crtn.s: Move to ../libgcc/config/bfin/crtn.S.
+ * config/bfin/crtlibid.s: Move to ../libgcc/config/bfin/crtlibid.S.
+ * config/bfin/t-bfin (EXTRA_PARTS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/bfin/t-bfin-elf (CRTSTUFF_T_CFLAGS): Remove.
+ ($(T)crti.o, $(T)crtn.o, $(T)crtlibid.o): Remove
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/bfin/t-bfin-linux (CRTSTUFF_T_CFLAGS,
+ EXTRA_MULTILIB_PARTS): Remove.
+ * config/bfin/t-bfin-uclinux (CRTSTUFF_T_CFLAGS): Remove.
+ ($(T)crtlibid.o): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/c6x/crti.s: Move to ../libgcc/config/c6x/crti.S.
+ * config/c6x/crtn.s: Move to ../libgcc/config/c6x/crtn.S.
+ * config/c6x/t-c6x-elf ($(T)crti.o, $(T)crtn.o): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/c6x/t-c6x-uclinux (CRTSTUFF_T_CFLAGS,
+ CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/cris/t-elfmulti (CRTSTUFF_T_CFLAGS): Remove.
+ * config/cris/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/fr30/crti.asm: Move to ../libgcc/config/fr30/crti.S.
+ * config/fr30/crtn.asm: Move to ../libgcc/config/fr30/crtn.S.
+ * config/fr30/t-fr30 ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/frv/frvbegin.c, config/frv/frvend.c: Move to
+ ../libgcc/config/frv.
+ * config/frv/t-frv (EXTRA_MULTILIB_PARTS): Remove.
+ (FRVSTUFF_CFLAGS, $(T)frvbegin$(objext), $(T)frvend$(objext)): Remove.
+ * config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove.
+ (CRTSTUFF_T_CFLAGS): Remove.
+ * config/h8300/crti.asm: Move to ../libgcc/config/h8300/crti.S.
+ * config/h8300/crtn.asm: Move to ../libgcc/config/h8300/crtn.S.
+ * config/h8300/t-elf: Remove.
+ * config/i386/cygming-crtbegin.c, config/i386/cygming-crtend.c:
+ Move to ../libgcc/config/i386.
+ * config/i386/t-crtstuff: Remove.
+ * config/i386/t-i386elf: Remove.
+ * config/i386/t-linux64 (EXTRA_MULTILIB_PARTS): Remove.
+ * config/i386/t-nto (CRTSTUFF_T_CFLAGS, EXTRA_PARTS): Remove.
+ * config/ia64/crtbegin.asm: Move to ../libgcc/config/ia64/crtbegin.S.
+ * config/ia64/crtend.asm: Move to ../libgcc/config/ia64/crtend.S.
+ * config/ia64/crti.asm: Move to ../libgcc/config/ia64/crti.S.
+ * config/ia64/crtn.asm: Move to ../libgcc/config/ia64/crtn.S.
+ * config/ia64/t-vms: Remove.
+ * config/ia64/vms-crtinit.asm: Move to
+ ../libgcc/config/ia64/vms-crtinit.S.
+ * config/m32c/t-m32c (EXTRA_MULTILIB_PARTS): Remove.
+ * config/m32r/initfini.c: Move to ../libgcc/config/m32r.
+ * config/m32r/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/m32r/t-m32r (CRTSTUFF_T_CFLAGS): Remove.
+ ($(T)crtinit.o, $(T)crtfini.o): Remove.
+ (m32rx, m32r2): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/m68k/crti.s: Move to ../libgcc/config/m68k/crti.S.
+ * config/m68k/crtn.s: Move to ../libgcc/config/m68k/crtn.S.
+ * config/m68k/t-crtstuff: Remove.
+ * config/m68k/t-linux (EXTRA_MULTILIB_PARTS): Remove.
+ * config/m68k/t-m68kelf: Remove.
+ * config/m68k/t-uclinux (EXTRA_MULTILIB_PARTS): Remove.
+ * config/mcore/crti.asm: Move to ../libgcc/config/mcore/crti.S.
+ * config/mcore/crtn.asm: Move to ../libgcc/config/mcore/crtn.S.
+ * config/mcore/t-mcore ($(T)crti.o, $(T)crtn.o): Remove.
+ (EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Remove.
+ * config/mep/t-mep (CRTSTUFF_CFLAGS): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/microblaze/crti.s: Move to ../libgcc/config/microblaze/crti.S.
+ * config/microblaze/crtn.s: Move to ../libgcc/config/microblaze/crtn.S.
+ * config/microblaze/t-microblaze (EXTRA_MULTILIB_PARTS,
+ EXTRA_PARTS): Remove.
+ ($(T)crti$(objext), $(T)crtn$(objext)): Remove.
+ * config/mips/crti.asm: Move to ../libgcc/config/mips/crti.S.
+ * config/mips/crtn.asm: Move to ../libgcc/config/mips/crtn.S.
+ * config/mips/t-elf (CRTSTUFF_T_CFLAGS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/mips/t-isa3264: Likewise.
+ * config/mips/t-linux64 (EXTRA_MULTILIB_PARTS): Remove.
+ * config/mips/t-r3900 (EXTRA_MULTILIB_PARTS): Remove.
+ (CRTSTUFF_T_CFLAGS): Remove.
+ * config/mips/t-sde (CRTSTUFF_T_CFLAGS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/mips/t-sr71k (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS):
+ Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/mips/t-st (EXTRA_MULTILIB_PARTS): Remove.
+ * config/mips/t-vr (CRTSTUFF_T_CFLAGS): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/mmix/crti.asm: Move to ../libgcc/config/crti.S.
+ * config/mmix/crtn.asm: Move to ../libgcc/config/crtn.S.
+ * config/mmix/t-mmix (CRTSTUFF_T_CFLAGS): Remove.
+ * config/moxie/crti.asm, config/moxie/crtn.asm: Remove.
+ * config/pa/stublib.c: Move to libgcc/config/pa.
+ * config/pa/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/pa/t-linux64 (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/pa/t-pa-hpux11 (LIBGCCSTUB_OBJS, stublib.c): Remove.
+ (pthread_default_stacksize_np-stub.o, pthread_mutex_lock-stub.o)
+ (pthread_mutex_unlock-stub.o, pthread_once-stub.o)
+ ($(T)libgcc_stub.a): Remove.
+ * config/pa/t-pa64 (LIBGCCSTUB_OBJS, stublib.c): Remove.
+ (rfi-stub.o, dfi-stub.o, cxaf-stub.o, jvrc-stub.o)
+ (pthread_default_stacksize_np-stub.o, pthread_mutex_lock-stub.o)
+ (pthread_mutex_unlock-stub.o, pthread_once-stub.o)
+ ($(T)libgcc_stub.a): Remove.
+ * config/rs6000/eabi-cn.asm: Move to
+ ../../../libgcc/config/rs6000/eabi-cn.S.
+ * config/rs6000/eabi-ci.asm: Move to
+ ../../../libgcc/config/rs6000/eabi-ci.S.
+ * config/rs6000/sol-ci.asm: Move to
+ ../../../libgcc/config/rs6000/sol-ci.S.
+ * config/rs6000/sol-cn.asm: Move to
+ ../../../libgcc/config/rs6000/sol-cn.S.
+ * config/rs6000/t-lynx (EXTRA_MULTILIB_PARTS): Remove.
+ (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/rs6000/t-netbsd (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S):
+ Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/rs6000/t-ppccomm (EXTRA_MULTILIB_PARTS): Remove.
+ (ecrti.S, ecrtn.S, ncrti.S, ncrtn.S): Remove.
+ ($(T)ecrti$(objext), $(T)ecrtn$(objext), $(T)ncrti$(objext),
+ ($(T)ncrtn$(objext)): Remove.
+ (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/rs6000/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
+ * config/rx/t-rx (EXTRA_MULTILIB_PARTS): Remove.
+ * config/score/crti.asm: Move to ../libgcc/config/score/crti.S.
+ * config/score/crtn.asm: Move to ../libgcc/config/score/crtn.S.
+ * config/score/t-score-elf: Remove.
+ * config/sh/crt1.asm: Move to ../libgcc/config/sh/crt1.S.
+ * config/sh/crti.asm: Move to ../libgcc/config/sh/crti.S.
+ * config/sh/crtn.asm: Move to ../libgcc/config/sh/crtn.S.
+ * config/sh/lib1funcs-4-300.asm: Move to
+ ../../../libgcc/config/sh/lib1funcs-4-300.S.
+ * config/sh/lib1funcs-Os-4-200.asm: Move to
+ ../libgcc/config/sh/lib1funcs-Os-4-200.S.
+ * config/sh/t-elf: Remove.
+ * config/sh/t-linux (EXTRA_MULTILIB_PARTS): Remove.
+ * config/sh/t-linux64: Remove.
+ * config/sh/t-netbsd (EXTRA_MULTILIB_PARTS): Remove.
+ * config/sh/t-sh ($(T)crt1.o, $(T)crti.o, $(T)crtn.o): Remove.
+ (IC_EXTRA_PARTS, OPT_EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Remove.
+ ($(T)ic_invalidate_array_4-100.o)
+ ($(T)libic_invalidate_array_4-100.a)
+ ($(T)ic_invalidate_array_4-200.o)
+ ($(T)libic_invalidate_array_4-200.a, $(T)ic_invalidate_array_4a.o)
+ ($(T)libic_invalidate_array_4a.a, $(T)sdivsi3_i4i-Os-4-200.o)
+ ($(T)udivsi3_i4i-Os-4-200.o, $(T)unwind-dw2-Os-4-200.o)
+ ($(T)libgcc-Os-4-200.a, $(T)div_table-4-300.o)
+ ($(T)libgcc-4-300.a): Remove.
+ * config/sh/t-superh: Remove.
+ * config/sh/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
+ * config/sparc/t-linux64 (CRTSTUFF_T_CFLAGS): Remove.
+ * config/spu/cache.S: Move to ../libgcc/config/spu.
+ * config/spu/cachemgr.c: Move to ../libgcc/config/spu.
+ * config/spu/t-spu-elf (CRTSTUFF_T_CFLAGS): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ ($(T)cachemgr.o, $(T)cachemgr_nonatomic.o, $(T)libgcc_%.a): Remove.
+ ($(T)cache8k.o, $(T)cache16k.o, $(T)cache32k.o, $(T)cache32k.o)
+ ($(T)cache64k.o, $(T)cache128k.o): Remove.
+ * config/t-freebsd (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/t-libc-ok: Remove.
+ * config/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/t-lynx (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/t-netbsd: Remove.
+ * config/t-svr4 (CRTSTUFF_T_CFLAGS_S): Remove.
+ * config/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
+ * config/vms/t-vms (VMS_EXTRA_PARTS): Remove.
+ ($(T)vcrt0.o, $(T)pcrt0.o): Remove.
+ * config/vms/vms-ucrt0.c: Move to ../libgcc/config/vms.
+ * config/xtensa/crti.asm: Move to ../libgcc/config/xtensa/crti.S.
+ * config/xtensa/crtn.asm: Move to ../libgcc/config/xtensa/crtn.S.
+ * config/xtensa/t-elf (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
+ (EXTRA_MULTILIB_PARTS): Remove.
+ * config/xtensa/t-linux: Remove.
+ * config/xtensa/t-xtensa ($(T)crti.o, $(T)crtn.o): Remove.
+
+2011-11-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (bdesc_args) [IX86_BUILTIN_CVTTPD2DQ256]: Use
+ CODE_FOR_fix_truncv4dfv4si2, not CODE_FOR_fix_truncv4sfv4si2.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR translation/45116
+ * Makefile.in (slibdir): Remove, don't export.
+ (SHLIB_NM_FLAGS): Remove.
+ (libgcc.mvars): Don't emit SHLIB_LINK, SHLIB_INSTALL,
+ SHLIB_DLLDIR, SHLIB_EXT, SHLIB_MKMAP, SHLIB_MKMAP_OPTS,
+ SHLIB_MAPFILES, SHLIB_NM_FLAGS.
+ (DRIVER_DEFINES): Test SHLIB instead of SHLIB_LINK.
+ (gcc.o): Pass SHLIB instead of SHLIB_LINK.
+ (gccspec.o): Likewise.
+ (installdirs): Don't create $(DESTDIR)$(slibdir).
+ * configure.ac (slibdir): Remove.
+ * configure: Regenerate.
+ * libgcc-libsystem.ver: Move to ../libgcc/config.
+ * mkmap-flat.awk, mkmap-symver.awk: Move to ../libgcc.
+ * config/libgcc-glibc.ver: Move to ../libgcc/config.
+ * config/t-libunwind (SHLIB_LC): Remove.
+ * config/t-linux (SHLIB_MAPFILES): Remove.
+ * config/t-slibgcc-dummy: Rename to config/t-slibgcc.
+ * config/t-slibgcc-elf-ver: Remove.
+ * config/t-slibgcc-libgcc, config/t-slibgcc-nolc-override: Move to
+ ../libgcc/config.
+ * config/alpha/libgcc-alpha-ldbl.ver, config/alpha/t-linux: Move
+ to ../libgcc/config/alpha.
+ * config/alpha/t-vms (shlib_version, SHLIB_EXT, SHLIB_OBJS,
+ SHLIB_NAME, SHLIB_MULTILIB, SHLIB_INSTALL, SHLIB_SYMVEC,
+ SHLIB_SYMVECX2, SHLIB_LINK): Remove.
+ * config/arm/libgcc-bpabi.ver: Move to ../libgcc/config/arm.
+ * config/arm/t-bpabi (SHLIB_MAPFILES): Remove.
+ * config/arm/t-netbsd (SHLIB_EXT, SHLIB_NAME, SHLIB_SONAME,
+ SHLIB_OBJS, SHLIB_LINK, SHLIB_INSTALL): Remove.
+ * config/arm/t-symbian (SHLIB_LC): Remove.
+ * config/bfin/libgcc-bfin.ver: Move to
+ ../libgcc/config/bfin/libgcc-glibc.ver.
+ * config/bfin/t-bfin-linux (SHLIB_MAPFILES): Remove.
+ * config/c6x/libgcc-c6xeabi.ver: Move to
+ ../libgcc/config/c6x/libgcc-eabi.ver.
+ * config/c6x/t-c6x-elf (SHLIB_MAPFILES): Remove.
+ * config/cris/libgcc.ver: Move to
+ ../libgcc/config/cris/libgcc-glibc.ver.
+ * config/cris/t-linux (SHLIB_MAPFILES): Remove.
+ * config/frv/libgcc-frv.ver: Move to ../libgcc/config/frv.
+ * config/frv/t-linux (SHLIB_MAPFILES): Remove.
+ * config/i386/darwin-libgcc.10.4.ver: Move to
+ ../libgcc/config/i386/libgcc-darwin.10.4.ver.
+ * config/i386/darwin-libgcc.10.5.ver: Move to
+ ../libgcc/config/i386/libgcc-darwin.10.5.ver.
+ * config/i386/libgcc-glibc.ver: Move to ../libgcc/config/i386.
+ * config/i386/t-cygming (SHLIB_EXT, SHLIB_IMPLIB, SHLIB_SOVERSION,
+ SHLIB_SONAME, SHLIB_MAP, SHLIB_OBJS, SHLIB_DIR, SHLIB_SLIBDIR_QUAL)
+ SHLIB_PTHREAD_CFLAG, SHLIB_PTHREAD_LDFLAG, SHLIB_LINK,
+ SHLIB_INSTALL, SHLIB_MKMAP, SHLIB_MKMAP_OPTS, SHLIB_MAPFILES): Remove.
+ * config/i386/t-cygwin (SHLIB_LC, SHLIB_EH_EXTENSION,
+ SHLIB_IMPLIB, SHLIB_SONAME, SHLIB_MKMAP_OPTS): Remove.
+ * config/i386/t-dlldir, config/i386/t-dlldir-x: Move to
+ ../libgcc/config/i386.
+ * config/i386/t-dw2-eh, config/i386/t-sjlj-eh: Move to
+ ../libgcc/config/i386.
+ * config/i386/t-linux: Move to ../libgcc/config/i386.
+ * config/i386/t-mingw-pthread: Move to ../libgcc/config/i386.
+ * config/i386/t-mingw-w32 (SHLIB_LC): Remove.
+ * config/i386/t-mingw-w64: Likewise.
+ * config/i386/t-mingw32: Remove.
+ * config/ia64/libgcc-glibc.ver, config/ia64/libgcc-ia64.ver: Move
+ to ../libgcc/config/ia64.
+ * config/ia64/t-glibc: Remove.
+ * config/ia64/t-hpux (SHLIB_EXT, SHLIB_LINK, SHLIB_INSTALL): Remove.
+ * config/ia64/t-ia64 (SHLIB_MAPFILES): Remove.
+ * config/ia64/t-vms (shlib_version, SHLIB_EXT, SHLIB_OBJS,
+ SHLIB_NAME, SHLIB_MULTILIB, SHLIB_INSTALL, SHLIB_LINK): Remove.
+ * config/ia64/vms_symvec_libgcc_s.opt: Remove.
+ * config/m32r/libgcc-glibc.ver: Move to ../libgcc/config/m32r.
+ * config/m32r/t-linux (SHLIB_MAPFILES): Remove.
+ * config/m68k/t-slibgcc-elf-ver: Move to ../libgcc/config/m68k.
+ * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Remove.
+ * config/pa/t-hpux-shlib: Move to ../libgcc/config/pa/t-slibgcc-hpux.
+ * config/pa/t-slibgcc-dwarf-ver, config/pa/t-slibgcc-sjsj-ver:
+ Move to ../libgcc/config/pa.
+ * config/rs6000/darwin-libgcc.10.4.ver: Move to
+ ../libgcc/config/rs6000/libgcc-darwin.10.4.ver.
+ * config/rs6000/darwin-libgcc.10.5.ver: Move to
+ ../libgcc/config/rs6000/libgcc-darwin.10.5.ver.
+ * config/rs6000/t-aix43 (SHLIB_EXT, SHLIB_LINK, SHLIB_INSTALL,
+ SHLIB_LIBS, SHLIB_MKMAP, SHLIB_NM_FLAGS, AR_FLAGS_FOR_TARGET): Remove.
+ * config/rs6000/t-aix52: Likewise.
+ * config/sh/libgcc-excl.ver, config/sh/libgcc-glibc.ver: Move to
+ ../libgcc/config/sh.
+ * config/sparc/libgcc-sparc-glibc.ver: Move to
+ ../libgcc/config/sparc/libgcc-glibc.ver.
+ * config/sparc/t-linux: Move to ../libgcc/config/sparc.
+ * config/xtensa/t-linux (SHLIB_MAPFILES): Remove.
+ * config/xtensa/libgcc-xtensa.ver: Move to
+ ../libgcc/config/xtensa/libgcc-glibc.ver.
+ * config.gcc (*-*-freebsd*): Replace t-slibgcc-elf-ver with
+ t-slibgcc in tmake_file.
+ Remove t-slibgcc-nolc-override for *-*-freebsd[34],
+ *-*-freebsd[34].* with pthreads.
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu,
+ *-*-knetbsd*-gnu, *-*-gnu*, *-*-kopensolaris*-gnu): Replace
+ t-slibgcc-elf-ver with t-slibgcc in tmake_file.
+ (*-*-netbsd*): Likewise.
+ (*-*-solaris2*): Replace t-slibgcc-dummy with t-slibgcc in tmake_file.
+ (*-*-*vms*): Add t-slibgcc to tmake_file.
+ (alpha*-*-linux*): Remove alpha/t-linux from tmake_file.
+ (alpha*-dec-osf5.1*): Replace t-slibgcc-dummy with t-slibgcc in
+ tmake_file.
+ (arm*-*-linux*): Remove t-slibgcc-libgcc from tmake_file for
+ arm*-*-linux-*eabi.
+ (bfin*-linux-uclibc*): Replace t-slibgcc-dummy with t-slibgcc in
+ tmake_file.
+ (crisv32-*-linux*, cris-*-linux*): Likewise.
+ (hppa*-*-linux*): Remove t-slibgcc-libgcc, pa/t-slibgcc-sjlj-ver,
+ pa/t-slibgcc-dwarf-ver from tmake_file.
+ (hppa[12]*-*-hpux10*): Replace pa/t-hpux-shlib with t-slibgcc in
+ tmake_file.
+ Remove pa/t-slibgcc-sjlj-ver, pa/t-slibgcc-dwarf-ver from tmake_file.
+ (hppa*64*-*-hpux11*): Likewise.
+ (hppa[12]*-*-hpux11*): Likewise.
+ (i[34567]86-*-darwin*): Replace t-slibgcc-dummy in t-slibgcc in
+ tmake_file.
+ (x86_64-*-darwin*): Likewise.
+ (i[34567]86-*-cygwin*): Remove tmake_eh_file, tmake_dlldir_file.
+ Add t-slibgcc to tmake_file.
+ (i[34567]86-*-mingw*, x86_64-*-mingw*): Likewise.
+ Remove i386/t-mingw32 from tmake_file unless x86_64-w64-*,
+ i[34567]86-w64-*.
+ Remove i386/t-mingw-pthread from tmake_file.
+ (ia64*-*-linux*): Remove ia64/t-glibc from tmake_file.
+ (ia64*-*-hpux*): Add t-slibgcc to tmake_file.
+ (ia64-hp-*vms*): Likewise.
+ (m32r-*-linux*): Replace t-slibgcc-elf-ver with t-slibgcc in
+ tmake_file.
+ (m32rle-*-linux*): Likewise.
+ (m68k-*-linux*): Remove m68k/t-slibgcc-elf-ver from tmake_file.
+ (microblaze*-linux*): Remove t-slibgcc-elf-ver,
+ t-slibgcc-nolc-override from tmake_file.
+ (mips-sgi-irix6.5*): Replace t-slibgcc-dummy with t-slibgcc in
+ tmake_file.
+ (powerpc-*-darwin*): Likewise.
+ (powerpc64-*-darwin*): Likewise.
+ (powerpc-*-freebsd*): Remove t-slibgcc-libgcc from tmake_file.
+ (powerpc-*-linux*, powerpc64-*-linux*): Likewise.
+ (rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*): Add
+ t-slibgcc to tmake_file.
+ (rs6000-ibm-aix5.1.*, powerpc-ibm-aix5.1.*): Likewise.
+ (rs6000-ibm-aix5.2.*, powerpc-ibm-aix5.2.*): Likewise.
+ (rs6000-ibm-aix5.3.*, powerpc-ibm-aix5.3.*): Likewise.
+ (rs6000-ibm-aix[6789].*, powerpc-ibm-aix[6789].*): Likewise.
+ (sparc-*-linux*): Remove sparc/t-linux from tmake_file.
+ (sparc64-*-linux*): Likewise.
+ (tic6x-*-uclinux): Replace t-slibgcc-elf-ver with t-slibgcc in
+ tmake_file.
+ (i[34567]86-*-linux*, x86_64-*-linux*, i[34567]86-*-kfreebsd*-gnu,
+ x86_64-*-kfreebsd*-gnu, i[34567]86-*-gnu*): Remove i386/t-linux
+ from tmake_file.
+
+2011-11-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50902
+ * tree-vect-stmts.c (vectorizable_load): Properly convert
+ an invariant initializer element.
+
+2010-11-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50890
+ * gimple.h (gimple_fold_call): Remove.
+ * gimple-fold.c (fold_stmt_1): Move all call related code to ...
+ (gimple_fold_call): ... here. Make static. Update the
+ cannot-inline flag on direct calls.
+ * ipa-inline.c (early_inliner): Copy the cannot-inline flag
+ from the statements to the edges.
+
+2011-11-01 Ian Lance Taylor <iant@google.com>
+
+ * godump.c (struct macro_hash_value): Define.
+ (macro_hash_hashval): New static function.
+ (macro_hash_eq, macro_hash_del): New static functions.
+ (go_define): Use macro_hash_value to store values in macro_hash.
+ Replace an old value on a redefinition. Don't print anything to
+ go_dump_file.
+ (go_undef): Delete the entry from the hash table.
+ (go_output_typedef): For an enum, use macro_hash_value, and don't
+ print anything to go_dump_file.
+ (go_print_macro): New static function.
+ (go_finish): Traverse macro_hash with go_print_macro.
+ (dump_go_spec_init): Update macro_hash creation for macro_hash_value.
+
+2011-11-02 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000.c (rs6000_code_end): Declare ATTRIBUTE_UNUSED.
+
+2011-11-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44277
+ * doc/invoke.texi: Document -Wzero-as-null-pointer-constant.
+
+2011-11-01 Andrew Stubbs <ams@codesourcery.com>
+
+ * config/arm/bpabi.h (BE8_LINK_SPEC): Recognize generic-armv7 tuning.
+
+2011-11-01 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (splitters for int-float conversion): Use
+ SUBREG_REG on SUBREGs in splitter constraints.
+
2011-11-01 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386-protos.h (ix86_expand_adjust_ufix_to_sfix_si): New
prototype.
* config/i386/i386.c (ix86_expand_adjust_ufix_to_sfix_si): New
function.
- * config/i386/sse.md (fixuns_trunc<mode><sseintvecmodelower>2): Use
- it.
+ * config/i386/sse.md (fixuns_trunc<mode><sseintvecmodelower>2): Use it.
(ssepackfltmode): New mode attr.
(vec_pack_ufix_trunc_<mode>): New expander.
-2011-10-30 Uros Bizjak <ubizjak@gmail.com>
+2011-11-01 Uros Bizjak <ubizjak@gmail.com>
+ PR target/50940
* config/i386/i386.md (floatsi<mode>2_vector_sse_with_temp splitter):
- Compare <ssevecmode>mode with V4SFmode, not V4SImode.
+ Compare <ssevecmode>mode to V4SFmode, not V4SImode.
2011-11-01 Peter Bergner <bergner@vnet.ibm.com>
@@ -46,7 +1914,7 @@
* config/avr/avr.h (BRANCH_COST): Define to avr_branch_cost.
* config/avr/avr.c (avr_rtx_costs_1): Adjust [U]DIV/[U]MOD costs.
* config/avr/avr.md (*addqi3.lt0, *addhi3.lt0, *addsi3.lt0): New insns.
- (*addhi3_zero_extend1): Remov % in constraint of operand 1.
+ (*addhi3_zero_extend1): Remove % in constraint of operand 1.
(*addhi3.sign_extend1, *subhi3.sign_extend2): New insns.
2011-11-01 Tom de Vries <tom@codesourcery.com>
@@ -62,6 +1930,9 @@
2011-11-01 David S. Miller <davem@davemloft.net>
+ * config/sparc/sparc.c (vector_init_faligndata): New function.
+ (sparc_expand_vector_init): Use it for V4HImode on VIS1.
+
* config/sparc/sparc.c (sparc_expand_vcond): New function.
* config/sparc/sparc-protos.h (sparc_expand_vcond): Declare it.
* config/sparc/sparc.md (vcond<mode><mode>): New VIS3 expander.
@@ -4198,7 +6069,7 @@
* hwint.h (HOST_WIDE_INT_PRINT_HEX_PURE): Add.
* lto-streamer.c (lto_get_section_name): Remove crc32_string.
- Handle numerical random seed.
+ Handle numerical random seed.
* lto-streamer.h (lto_file_decl_data): Change id to
unsigned HOST_WIDE_INT.
* toplev.c (random_seed): Add.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 7fff5588466..95d26156ac4 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20111101
+20111107
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 625ccbc7959..9ec2df1485b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -164,6 +164,8 @@ C_STRICT_WARN = @c_strict_warn@
# "extern" tags in header files.
NOCOMMON_FLAG = @nocommon_flag@
+NOEXCEPTION_FLAGS = @noexception_flags@
+
# This is set by --disable-maintainer-mode (default) to "#"
# FIXME: 'MAINT' will always be set to an empty string, no matter if
# --disable-maintainer-mode is used or not. This is because the
@@ -374,6 +376,7 @@ USER_H = $(srcdir)/ginclude/float.h \
$(srcdir)/ginclude/varargs.h \
$(srcdir)/ginclude/stdfix.h \
$(srcdir)/ginclude/stdnoreturn.h \
+ $(srcdir)/ginclude/stdalign.h \
$(EXTRA_HEADERS)
USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
@@ -490,8 +493,6 @@ md_file=$(srcdir)/config/@md_file@
tm_file_list=@tm_file_list@
tm_include_list=@tm_include_list@
tm_defines=@tm_defines@
-libgcc_tm_file_list=@libgcc_tm_file_list@
-libgcc_tm_include_list=@libgcc_tm_include_list@
tm_p_file_list=@tm_p_file_list@
tm_p_include_list=@tm_p_include_list@
build_xm_file_list=@build_xm_file_list@
@@ -534,9 +535,7 @@ lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt
lang_specs_files=@lang_specs_files@
lang_tree_files=@lang_tree_files@
target_cpu_default=@target_cpu_default@
-GCC_THREAD_FILE=@thread_file@
OBJC_BOEHM_GC=@objc_boehm_gc@
-GTHREAD_FLAGS=@gthread_flags@
extra_modes_file=@extra_modes_file@
extra_opt_files=@extra_opt_files@
host_hook_obj=@out_host_hook_obj@
@@ -612,8 +611,6 @@ prefix_to_exec_prefix := \
dollar = @dollar@
# Used in install-cross.
gcc_tooldir = @gcc_tooldir@
-# Used to install the shared libgcc.
-slibdir = @slibdir@
# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
build_tooldir = $(exec_prefix)/$(target_noncanonical)
# Directory in which the compiler finds target-independent g++ includes.
@@ -673,32 +670,6 @@ ifeq ($(inhibit_libc),true)
INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
endif
-# Options to use when compiling libgcc2.a.
-#
-LIBGCC2_DEBUG_CFLAGS = -g
-LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(INCLUDES_FOR_TARGET) $(GCC_CFLAGS) \
- $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) \
- $(GTHREAD_FLAGS) -DIN_LIBGCC2 \
- -fbuilding-libgcc -fno-stack-protector \
- $(INHIBIT_LIBC_CFLAGS)
-
-# Additional options to use when compiling libgcc2.a.
-# Some targets override this to -isystem include
-LIBGCC2_INCLUDES =
-
-# Additional target-dependent options for compiling libgcc2.a.
-TARGET_LIBGCC2_CFLAGS =
-
-# Options to use when compiling crtbegin/end.
-CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES_FOR_TARGET) $(MULTILIB_CFLAGS) \
- -g0 -finhibit-size-directive -fno-inline -fno-exceptions \
- -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
- -fno-stack-protector \
- $(INHIBIT_LIBC_CFLAGS)
-
-# nm flags to list global symbols in libgcc object files.
-SHLIB_NM_FLAGS = -pg
-
# List of extra executables that should be compiled for this target machine
# that are used for compiling from source code to object code.
# The rules for compiling them should be in the t-* file for the machine.
@@ -707,10 +678,6 @@ EXTRA_PASSES =@extra_passes@
# Like EXTRA_PASSES, but these are used when linking.
EXTRA_PROGRAMS = @extra_programs@
-# List of extra object files that should be compiled for this target machine.
-# The rules for compiling them should be in the t-* file for the machine.
-EXTRA_PARTS = @extra_parts@
-
# List of extra object files that should be compiled and linked with
# compiler proper (cc1, cc1obj, cc1plus).
EXTRA_OBJS = @extra_objs@
@@ -733,17 +700,6 @@ USE_GCC_STDINT = @use_gcc_stdint@
# set to empty.
COLLECT2 = @collect2@
-# List of extra C and assembler files to add to static and shared libgcc2.
-# Assembler files should have names ending in `.asm'.
-LIB2FUNCS_EXTRA =
-
-# List of extra C and assembler files to add to static libgcc2.
-# Assembler files should have names ending in `.asm'.
-LIB2FUNCS_STATIC_EXTRA =
-
-# List of functions not to build from libgcc2.c.
-LIB2FUNCS_EXCLUDE =
-
# Program to convert libraries.
LIBCONVERT =
@@ -806,17 +762,6 @@ RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
else echo runtest; fi`
RUNTESTFLAGS =
-# Extra flags to use when compiling crt{begin,end}.o.
-CRTSTUFF_T_CFLAGS =
-
-# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
-T =
-
-# Should T contain a `=', libgcc/Makefile will make T_TARGET, setting
-# $(T_TARGET) to the name of the actual target filename.
-T_TARGET =
-T_TARGET : $(T_TARGET)
-
# This should name the specs file that we're going to install. Target
# Makefiles may override it and name another file to be generated from
# the built-in specs and installed as the default spec, as long as
@@ -844,8 +789,7 @@ CONFIG_H = config.h $(host_xm_file_list)
TCONFIG_H = tconfig.h $(xm_file_list)
TM_P_H = tm_p.h $(tm_p_file_list)
GTM_H = tm.h $(tm_file_list) insn-constants.h
-TM_H = $(GTM_H) libgcc_tm.h $(libgcc_tm_file_list) insn-flags.h \
- $(OPTIONS_H)
+TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)
# Variables for version information.
BASEVER := $(srcdir)/BASE-VER # 4.x.y
@@ -1035,7 +979,7 @@ ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
# The C++ version.
ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
- $(COVERAGE_FLAGS) $(WARN_CXXFLAGS) @DEFS@
+ $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
# puts -I options in CPPFLAGS, our include files in the srcdir will always
@@ -1106,9 +1050,6 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
$(CPPINC) $(GMPINC) $(DECNUMINC) \
$(PPLINC) $(CLOOGINC)
-INCLUDES_FOR_TARGET = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
- -I$(srcdir)/../include $(DECNUMINC) -I$(srcdir)/../libgcc
-
.c.o:
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
@@ -1131,15 +1072,12 @@ export DESTDIR
export GCC_FOR_TARGET
export INCLUDES
export INSTALL_DATA
-export LIB1ASMSRC
-export LIBGCC2_CFLAGS
export LIPO_FOR_TARGET
export MACHMODE_H
export NM_FOR_TARGET
export STRIP_FOR_TARGET
export RANLIB_FOR_TARGET
export libsubdir
-export slibdir
FLAGS_TO_PASS = \
"ADA_CFLAGS=$(ADA_CFLAGS)" \
@@ -1547,20 +1485,13 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
- $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
+ $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
gcc-ranlib$(exeext) \
gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \
libcommon-target.a libcommon.a libgcc.mk
-# Defined in libgcc2.c, included only in the static library.
-LIB2FUNCS_ST = _eprintf __gcc_bcmp
-
-# These might cause a divide overflow trap and so are compiled with
-# unwinder info.
-LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
-
#
# Language makefile fragments.
@@ -1669,7 +1600,6 @@ config.h: cs-config.h ; @true
bconfig.h: cs-bconfig.h ; @true
tconfig.h: cs-tconfig.h ; @true
tm.h: cs-tm.h ; @true
-libgcc_tm.h: cs-libgcc_tm.h ; @true
tm_p.h: cs-tm_p.h ; @true
cs-config.h: Makefile
@@ -1692,11 +1622,6 @@ cs-tm.h: Makefile
HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh tm.h
-cs-libgcc_tm.h: Makefile
- TARGET_CPU_DEFAULT="" \
- HEADERS="$(libgcc_tm_include_list)" DEFINES="" \
- $(SHELL) $(srcdir)/mkconfig.sh libgcc_tm.h
-
cs-tm_p.h: Makefile
TARGET_CPU_DEFAULT="" \
HEADERS="$(tm_p_include_list)" DEFINES="" \
@@ -1881,52 +1806,13 @@ cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
#
# Build libgcc.a.
-LIB2ADD = $(LIB2FUNCS_EXTRA)
-LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
-
-# All source files for libgcc are either generated in the libgcc build
-# directory which will be substituted for $$(libgcc_objdir), in the
-# source directory (in which case they will start with $(srcdir)), or
-# generated into the build directory (in which case they will be
-# relative paths).
-srcdirify = $(patsubst $$(libgcc_objdir)/%,%, \
- $(filter $$(libgcc_objdir)%,$(1))) \
- $(patsubst $(srcdir)%,$$(gcc_srcdir)%,$(filter $(srcdir)%,$(1))) \
- $(patsubst %,$$(gcc_objdir)/%, \
- $(filter-out $(srcdir)% $$(libgcc_objdir)%,$(1)))
-
-# The distinction between these two variables is no longer relevant,
-# so we combine them. Sort removes duplicates.
-GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTILIB_PARTS) $(EXTRA_PARTS))
-
libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
- $(MACHMODE_H) $(LIB2ADD) $(LIB2ADD_ST) gcov-iov.h
+ $(MACHMODE_H) gcov-iov.h
-libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
- xgcc$(exeext)
+libgcc.mvars: config.status Makefile specs xgcc$(exeext)
: > tmp-libgcc.mvars
- echo LIB1ASMFUNCS = '$(LIB1ASMFUNCS)' >> tmp-libgcc.mvars
- echo LIB1ASMSRC = '$(LIB1ASMSRC)' >> tmp-libgcc.mvars
- echo LIB2FUNCS_ST = '$(LIB2FUNCS_ST)' >> tmp-libgcc.mvars
- echo LIB2FUNCS_EXCLUDE = '$(LIB2FUNCS_EXCLUDE)' >> tmp-libgcc.mvars
- echo LIB2ADD = '$(call srcdirify,$(LIB2ADD))' >> tmp-libgcc.mvars
- echo LIB2ADD_ST = '$(call srcdirify,$(LIB2ADD_ST))' >> tmp-libgcc.mvars
- echo LIB2_SIDITI_CONV_FUNCS = '$(LIB2_SIDITI_CONV_FUNCS)' >> tmp-libgcc.mvars
- echo LIB2_DIVMOD_FUNCS = '$(LIB2_DIVMOD_FUNCS)' >> tmp-libgcc.mvars
- echo GCC_EXTRA_PARTS = '$(GCC_EXTRA_PARTS)' >> tmp-libgcc.mvars
- echo SHLIB_LINK = '$(subst $(GCC_FOR_TARGET),$$(GCC_FOR_TARGET),$(SHLIB_LINK))' >> tmp-libgcc.mvars
- echo SHLIB_INSTALL = '$(SHLIB_INSTALL)' >> tmp-libgcc.mvars
- echo SHLIB_DLLDIR = '$(SHLIB_DLLDIR)' >> tmp-libgcc.mvars
- echo SHLIB_EXT = '$(SHLIB_EXT)' >> tmp-libgcc.mvars
- echo SHLIB_MKMAP = '$(call srcdirify,$(SHLIB_MKMAP))' >> tmp-libgcc.mvars
- echo SHLIB_MKMAP_OPTS = '$(SHLIB_MKMAP_OPTS)' >> tmp-libgcc.mvars
- echo SHLIB_MAPFILES = '$(call srcdirify,$(SHLIB_MAPFILES))' >> tmp-libgcc.mvars
- echo SHLIB_NM_FLAGS = '$(SHLIB_NM_FLAGS)' >> tmp-libgcc.mvars
- echo LIBGCC2_CFLAGS = '$(LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
- echo TARGET_LIBGCC2_CFLAGS = '$(TARGET_LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
- echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
- echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
- echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
+ echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
+ echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
mv tmp-libgcc.mvars libgcc.mvars
@@ -1954,41 +1840,6 @@ s-mlib: $(srcdir)/genmultilib Makefile
fi
$(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
$(STAMP) s-mlib
-
-# Compile two additional files that are linked with every program
-# linked using GCC on systems using COFF or ELF, for the sake of C++
-# constructors.
-$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
- -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
- -o $(T)crtbegin$(objext)
-
-$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
- -c $(srcdir)/crtstuff.c -DCRT_END \
- -o $(T)crtend$(objext)
-
-# These are versions of crtbegin and crtend for shared libraries.
-$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
- -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
- -o $(T)crtbeginS$(objext)
-
-$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
- -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
- -o $(T)crtendS$(objext)
-
-# This is a version of crtbegin for -static links.
-$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
- -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
- -o $(T)crtbeginT$(objext)
#
# Compiling object files from source files.
@@ -2231,20 +2082,20 @@ DRIVER_DEFINES = \
-DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
@TARGET_SYSTEM_ROOT_DEFINE@ \
$(VALGRIND_DRIVER_DEFINES) \
- `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
+ `test "X$${SHLIB}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
-DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\""
gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \
configargs.h $(OBSTACK_H) $(OPTS_H) $(DIAGNOSTIC_H) $(VEC_H) $(PARAMS_H)
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$(DRIVER_DEFINES) \
-c $(srcdir)/gcc.c $(OUTPUT_OPTION))
gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
$(OPTS_H)
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$(DRIVER_DEFINES) \
-c $(srcdir)/gccspec.c $(OUTPUT_OPTION))
@@ -4139,7 +3990,7 @@ PREPROCESSOR_DEFINES = \
CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s)
cppbuiltin.o: cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- cppbuiltin.h Makefile
+ $(TREE_H) cppbuiltin.h Makefile
CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES)
cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
@@ -4576,7 +4427,7 @@ clean: mostlyclean lang.clean
-rm -f libgcc.a libgcc_eh.a libgcov.a
-rm -f libgcc_s*
-rm -f libunwind*
- -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h libgcc_tm.h
+ -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
-rm -f options.c options.h optionlist
-rm -f cs-*
-rm -f doc/*.dvi
@@ -4662,7 +4513,6 @@ installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(mkinstalldirs) $(DESTDIR)$(includedir)
$(mkinstalldirs) $(DESTDIR)$(infodir)
- $(mkinstalldirs) $(DESTDIR)$(slibdir)
$(mkinstalldirs) $(DESTDIR)$(man1dir)
$(mkinstalldirs) $(DESTDIR)$(man7dir)
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 350f8e9c47f..51b2719a387 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,403 @@
+2011-11-07 Olivier Hainque <hainque@adacore.com>
+
+ * sigtramp-ppcvxw.c: Add general comments.
+ (CFI_COMMON_REGS): Remove rule for r1, as in other unwinders. Add
+ rules for r2 to r13, plus CTR and XER.
+ (CFA_REG): New, register number used to hold the local CFA.
+ (CFI_DEF_CFA, SIGTRAMP_BODY): Use it.
+ Make that 15, not 14, with documentation.
+ (TCR): Undef before definition, preventing conflict with reg number in
+ VxWorks headers.
+
+2011-11-07 Robert Dewar <dewar@adacore.com>
+
+ * exp_util.ads, exp_alfa.adb, a-cohama.adb, a-cohama.ads, sem_ch4.adb,
+ aspects.ads, exp_ch8.adb, exp_ch8.ads, atree.ads: Minor reformatting.
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2011-11-07 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb: A tagged type is a legal actual for an aliased
+ formal.
+
+2011-11-07 Pascal Obry <obry@adacore.com>
+
+ * g-socket.adb, g-socket.ads: Minor reformatting.
+
+2011-11-07 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb (Resolve_Actuals): Minor error message improvement.
+
+2011-11-07 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Add discussion of default mode handling of
+ source representation with no -gnatW option given, in particular
+ noting that NEL (next line) is not recognized in this context.
+
+2011-11-07 Yannick Moy <moy@adacore.com>
+
+ * sem_util.adb (Note_Possible_Modification): In Alfa mode,
+ generate a reference for a modification even when the modification
+ does not come from source.
+
+2011-11-07 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch5.adb (Expand_Iterator_Loop): For the "of" iterator form,
+ use the indexing attributes rather than the Element function,
+ to obtain variable references.
+ * sem_ch4.adb (Try_Container_Indexing): Code cleanup. Use
+ Find_Aspect rather than iterating over representation
+ items. Improve error message.
+ * a-cohama.adb, a-cohama.ads Update to latest RM, with two versions
+ of Reference functions.
+
+2011-11-07 Yannick Moy <moy@adacore.com>
+
+ * sem_util.adb (Unique_Entity): For a parameter on a subprogram
+ body that has a corresponding parameter on the subprogram
+ declaration, define the unique entity as being the declaration
+ one.
+
+2011-11-07 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Return_Type): In Ada 2012 mode, if the
+ return type of a function is the class-wide type of an incomplete
+ type T, T can be a Taft-amendment type and does not have to be
+ completed in the current private part.
+
+2011-11-07 Ed Schonberg <schonberg@adacore.com>
+
+ * aspects.ads (Inherited_Aspect): Map that indicates type aspects
+ that are inherited by default, and apply to the class-wide type
+ as well.
+ * aspects.adb (Find_Aspect): If the entity is class-wide and the
+ aspect is inherited, use the aspect of the specific type.
+
+2011-11-07 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_alfa.adb: Remove with and use clause for
+ Exp_Ch8. Add with and use clause for Exp_Util.
+ Remove local constant Disable_Processing_Of_Renamings.
+ (Expand_Alfa_N_Object_Renaming_Declaration): The expansion of
+ object renamings has been reenabled.
+ (Expand_Possible_Renaming):
+ The expansion of identifier and expanded names has been
+ reenabled. Perform the substitutions only for entities that
+ denote an object.
+ * exp_ch8.ads, exp_ch8.adb (Evaluate_Name): Moved to Exp_Util.
+ * exp_util.adb (Evaluate_Name): Moved from Exp_Ch8.
+ (Remove_Side_Effects): Alphabetize local variables. Add a guard
+ to avoid the infinite expansion of an expression in Alfa mode. Add
+ processing for function calls in Alfa mode.
+ * exp_util.ads (Evaliate_Name): Moved from Exp_Ch8.
+
+2011-11-07 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb (Freeze_Entity): If the entity is an access to
+ subprogram whose designated type is itself a subprogram type,
+ its own return type must be decorated with size information.
+
+2011-11-04 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sprint.adb (Sprint_Node_Actual, case Qualified_Expression):
+ Avoid junk semicolon after argument of machine code Asm operand.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch11.adb (Generate_Push_Pop): Inhibit push/pop nodes in
+ CodePeer mode or if restriction No_Exception_Handlers is present.
+ * exp_ch6.adb (Expand_N_Subprogram_Body): (Inhibit push/pop
+ nodes in CodePeer mode or if restriction No_Exception_Handlers
+ is present.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * s-tassta.adb, atree.ads, errout.adb, sinput.adb: Minor reformatting.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Subprogram_Specification): The
+ specification is legal if it is a function that returns an
+ abstract type, if it comes from an attribute renaming of a stream
+ attribute of an abstract type.
+
+2011-11-04 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_util.adb (Is_Possibly_Unaligned_Object): In case of indexed
+ components, check whether recursively check whether the prefix
+ denotes an unaligned object.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Debug): The argument of
+ the pragma is legal if it is an expanded name that denotes a
+ procedure that be can called without parameters.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat_ugn.texi (Performance Considerations) <Vectorization
+ of loops>: New sub-section. <Other Optimization Switches>:
+ Minor tweak.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Minor reformatting.
+
+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * a-convec.adb, a-coinve.adb, a-cobove.adb (Merge): Raise PE
+ when Target and Source denote same non-empty object
+ * a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb (Merge): Ditto
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb: Minor reformatting.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch5.adb (Expand_Assign_Record): Do not generate a
+ discriminant assignment within an initialization proc if the
+ record is an unchecked union, as it can only come from the
+ initialization of an unchecked union component.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Minor reformatting.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * par-labl.adb (Rewrite_As_Loop): Generate info msg rather than
+ warning message.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor code reorganization (remove junk obsolete
+ var Save_Space).
+
+2011-11-04 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_alfa.adb: Add local constant
+ Disable_Processing_Of_Renamings;
+ (Expand_Alfa_N_Object_Renaming_Declaration): Disable
+ the name evaluation of object renamings for now.
+ (Expand_Potential_Renaming): Do not perform the substitution
+ for now.
+ * exp_util.adb (Remove_Side_Effects): Remove processing for
+ functions with side effects in Alfa mode.
+
+2011-11-04 Gary Dismukes <dismukes@adacore.com>
+
+ * bindgen.adb (Gen_Elab_Calls): In the case
+ of the AAMP target, set elaboration entities to 1 rather than
+ incrementing.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Install_Limited_With_Unit): To establish the
+ proper entities on the ancestors of a child unit that appear
+ in a limited_with clause, follow the unit links because the
+ units are not analyzed and scope information is incomplete.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Selected_Component): Refine code
+ setting the Atomic_Sync_Required flag to detect one more case.
+ * exp_util.adb (Activate_Atomic_Synchronization): Refine code
+ setting the Atomic_Sync_Required flag to exclude more cases,
+ depending on the parent of the node to be examined.
+
+2011-11-04 Bob Duff <duff@adacore.com>
+
+ * g-excact.adb: Minor: use named notation.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb: Improve error messages for illegal iterators.
+
+2011-11-04 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_alfa.adb: Add with and use clauses for Exp_Ch8 and
+ Sem_Util.
+ (Expand_Alfa): Alphabetize cases on first choice. Add
+ processing for object renaming declarations, identifiers and
+ expanded names.
+ (Expand_Alfa_N_In): Remove useless return.
+ (Expand_Alfa_N_Object_Renaming_Declaration): New routine.
+ (Expand_Potential_Renaming): New routine.
+ * exp_ch8.adb (Evaluate_Name): Moved to the top level.
+ (Expand_N_Object_Declaration): Alphabetize local variables. Move
+ Evaluate_Name out to the top level.
+ * exp_ch8.ads (Evaluate_Name): Moved from body to package spec.
+ * exp_util.adb (Remove_Side_Effects): Add processing for
+ functions with side effects in Alfa mode.
+
+2011-11-04 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * gnat_rm.texi: Add entries for
+ restrictions No_Relative_Delay, No_Requeue_Statements and
+ No_Stream_Optimizations.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb: Set type of entity in prefixed call, for
+ completeness in a generic context.
+
+2011-11-04 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb: Minor refactoring (renaming of a parameter).
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * atree.ads: Minor reformatting.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * checks.adb (Atomic_Synchronization_Disabled): Check -gnatd.d
+ and -gnatd.e here
+ * exp_ch2.adb (Expand_Entity_Reference): Use
+ Activate_Atomic_Synchronization
+ * exp_ch4.adb (Expand_N_Explicit_Dereference): Use
+ Activate_Atomic_Synchronization (Expand_N_Indexed_Compoonent):
+ Activate_Atomic_Synchronization (Expand_N_Selected_Component):
+ Use Activate_Atomic_Synchronization
+ * exp_util.ads, exp_util.adb (Activate_Atomic_Synchronization): New
+ procedure.
+ * sinfo.ads, sinfo.adb (Atomic_Sync_Required): Can now apply to
+ N_Selected_Component node
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb, atree.ads, prj-env.adb, prj-env.ads: Minor reformatting.
+
+2011-11-04 Yannick Moy <moy@adacore.com>
+
+ * atree.adb, atree.ads (Set_Original_Node): New set procedure.
+ * sem_ch13.adb (Analyze_Aspect_Specifications/Pre_Post_Aspects):
+ In ASIS mode, no splitting of aspects between conjuncts.
+ (Analyze_Aspect_Specifications/Aspect_Test_Case): Make pragma
+ expressions refer to the original aspect expressions through
+ the Original_Node link. This is used in semantic analysis for
+ ASIS mode, so that the original expression also gets analyzed.
+ * sem_prag.adb (Preanalyze_TC_Args,
+ Check_Precondition_Postcondition,
+ Analyze_Pragma/Pragma_Test_Case): In ASIS mode, for a pragma
+ generated from a source aspect, also analyze the original aspect
+ expression.
+ (Check_Expr_Is_Static_Expression): New procedure
+ similar to existing procedure Check_Arg_Is_Static_Expression,
+ except called on expression inside pragma.
+
+2011-11-04 Tristan Gingold <gingold@adacore.com>
+
+ * prj-env.adb, prj-env.ads (Find_Name_In_Path): New function, from
+ Find_Project.Try_Path_Name.
+ (Find_Project): Use Find_Name_In_Path to implement Try_Path_Name.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * s-atocou.ads (Atomic_Counter): Remove redundant pragma Volatile.
+
+2011-11-04 Pascal Obry <obry@adacore.com>
+
+ * projects.texi: Add short description for qualifiers aggregate
+ and aggregate library.
+
+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * Makefile.rtl, impunit.adb: Added a-cogeso.ad[sb]
+ * a-cgaaso.adb: Replaced implementation with instantiation
+ of Generic_Sort.
+ * a-cogeso.ad[sb] This is the new Ada 2012 unit
+ Ada.Containers.Generic_Sort
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch2.adb (Expand_Entity_Reference): Do not set
+ Atomic_Sync_Required for the case of a prefix of an attribute.
+ * exp_ch4.adb (Expand_N_Explicit_Dereference): May require
+ atomic synchronization
+ (Expand_N_Indexed_Component): Ditto.
+ (Expand_B_Selected_Component): Ditto.
+ * sem_prag.adb (Process_Suppress_Unsuppress):
+ Disable/Enable_Atomic_Synchronization can now occur for array
+ types with pragma Atomic_Components.
+ * sinfo.ads, sinfo.adb (Atomic_Sync_Required): Can now occur on
+ N_Explicit_Dereference nodes and on N_Indexed_Component nodes.
+
+2011-11-04 Gary Dismukes <dismukes@adacore.com>
+
+ * gnat_ugn.texi: Editorial corrections for gnattest section.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: Minor reformatting.
+ * gnat_rm.texi: Update documentation for pragma Warnings (Off,
+ "***") usage.
+ * exp_ch2.adb (Expand_Entity_Reference): Only set
+ Atomic_Sync_Required on entities that are variables. Doesn't
+ make any sense on anything else.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch2.adb (Expand_Entity_Reference): Extend handling of
+ atomic sync to type case.
+ * sem_prag.adb (Process_Suppress_Unsuppress): Atomic Sync can
+ apply to types.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_warn.adb (Warn_On_Useless_Assignment): More accurate test
+ for call vs assign.
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: Detect more cases of Long_Float inconsistencies at
+ compile time.
+
+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * Makefile.rtl, impunit.adb: Added a-sfecin.ads,
+ * a-sfhcin.ads, a-sflcin.ads, a-sbecin.ad[sb], a-sbhcin.ad[sb],
+ a-sblcin.ad[sb], a-suecin.ad[sb], a-suhcin.ad[sb], a-sulcin.ad[sb]
+ * a-sfecin.ads, a-sfhcin.ads, a-sflcin.ads, a-sbecin.ad[sb],
+ a-sbhcin.ad[sb], a-sblcin.ad[sb], a-suecin.ad[sb], a-suhcin.ad[sb],
+ a-sulcin.ad[sb]: New files.
+
+2011-11-04 Geert Bosch <bosch@adacore.com>
+
+ * i-forbla-unimplemented.ads, s-gecola.adb, s-gecola.ads,
+ s-gerebl.adb, s-gerebl.ads, i-forbla.adb, i-forbla.ads,
+ i-forlap.ads, i-forbla-darwin.adb, s-gecobl.adb, s-gecobl.ads,
+ s-gerela.adb, s-gerela.ads: Remove partial interface to BLAS/LAPACK.
+ * gcc-interface/Makefile.in: Remove libgnala and related objects.
+
+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * a-cdlili.ad[sb], a-cidlli.ad[sb], a-coorse.ad[sb], a-ciorse.ad[sb],
+ a-coorma.ad[sb], a-ciorma.ad[sb], a-coormu.ad[sb], a-ciormu.ad[sb],
+ a-cohama.ad[sb], a-cihama.ad[sb], a-cohase.ad[sb], a-cihase.ad[sb],
+ a-convec.ad[sb], a-coinve.ad[sb] (Assign, Copy): New operations
+ added to package.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: Do not assert
+ that the type of the parameters isn't dummy in type_annotate_only mode.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch12.adb: Minor reformatting
+
+2011-11-04 Gary Dismukes <dismukes@adacore.com>
+
+ * bindgen.adb (Gen_Elab_Calls): In the case of the AAMP target,
+ initialize elaboration entities to zero when specs are processed.
+
2011-10-28 Iain Sandoe <iains@gcc.gnu.org>
Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 4e03c9e178e..50e8a96a3d3 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -122,6 +122,7 @@ GNATRTL_NONTASKING_OBJS= \
a-ciormu$(objext) \
a-ciorse$(objext) \
a-clrefi$(objext) \
+ a-cogeso$(objext) \
a-cohama$(objext) \
a-cohase$(objext) \
a-cohata$(objext) \
@@ -214,9 +215,15 @@ GNATRTL_NONTASKING_OBJS= \
a-rbtgbo$(objext) \
a-rbtgbk$(objext) \
a-rbtgso$(objext) \
+ a-sbecin$(objext) \
+ a-sbhcin$(objext) \
+ a-sblcin$(objext) \
a-scteio$(objext) \
a-secain$(objext) \
a-sequio$(objext) \
+ a-sfecin$(objext) \
+ a-sfhcin$(objext) \
+ a-sflcin$(objext) \
a-sfteio$(objext) \
a-sfwtio$(objext) \
a-sfztio$(objext) \
@@ -261,10 +268,13 @@ GNATRTL_NONTASKING_OBJS= \
a-stzsea$(objext) \
a-stzsup$(objext) \
a-stzunb$(objext) \
+ a-suecin$(objext) \
a-suenco$(objext) \
a-suenst$(objext) \
a-suewst$(objext) \
a-suezst$(objext) \
+ a-suhcin$(objext) \
+ a-sulcin$(objext) \
a-suteio$(objext) \
a-swbwha$(objext) \
a-swfwha$(objext) \
diff --git a/gcc/ada/a-cbdlli.adb b/gcc/ada/a-cbdlli.adb
index 1b10d42b4a3..e1f7725d5cd 100644
--- a/gcc/ada/a-cbdlli.adb
+++ b/gcc/ada/a-cbdlli.adb
@@ -713,10 +713,24 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb
index 497a1112d43..8b513222ef8 100644
--- a/gcc/ada/a-cdlili.adb
+++ b/gcc/ada/a-cdlili.adb
@@ -146,6 +146,27 @@ package body Ada.Containers.Doubly_Linked_Lists is
Insert (Container, No_Element, New_Item, Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out List; Source : List) is
+ Node : Node_Access;
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ Node := Source.First;
+ while Node /= null loop
+ Target.Append (Node.Element);
+ Node := Node.Next;
+ end loop;
+ end Assign;
+
-----------
-- Clear --
-----------
@@ -206,6 +227,17 @@ package body Ada.Containers.Doubly_Linked_Lists is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : List) return List is
+ begin
+ return Target : List do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
@@ -483,10 +515,24 @@ package body Ada.Containers.Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cdlili.ads b/gcc/ada/a-cdlili.ads
index d38b0d08ba3..2de03e520aa 100644
--- a/gcc/ada/a-cdlili.ads
+++ b/gcc/ada/a-cdlili.ads
@@ -90,6 +90,10 @@ package Ada.Containers.Doubly_Linked_Lists is
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out List; Source : List);
+
+ function Copy (Source : List) return List;
+
procedure Move
(Target : in out List;
Source : in out List);
diff --git a/gcc/ada/a-cgaaso.adb b/gcc/ada/a-cgaaso.adb
index abb8631d55c..12763f12a67 100644
--- a/gcc/ada/a-cgaaso.adb
+++ b/gcc/ada/a-cgaaso.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -27,103 +27,21 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
--- This algorithm was adapted from GNAT.Heap_Sort (see g-heasor.ad[sb])
+-- This unit was originally a GNAT-specific addition to Ada 2005. A unit
+-- providing the same feature, Ada.Containers.Generic_Sort, was defined for
+-- Ada 2012. We retain Generic_Anonymous_Array_Sort for compatibility, but
+-- implement it in terms of the official unit, Generic_Sort.
-with System;
+with Ada.Containers.Generic_Sort;
procedure Ada.Containers.Generic_Anonymous_Array_Sort
(First, Last : Index_Type'Base)
is
- type T is range System.Min_Int .. System.Max_Int;
-
- function To_Index (J : T) return Index_Type;
- pragma Inline (To_Index);
-
- function Lt (J, K : T) return Boolean;
- pragma Inline (Lt);
-
- procedure Xchg (J, K : T);
- pragma Inline (Xchg);
-
- procedure Sift (S : T);
-
- --------------
- -- To_Index --
- --------------
-
- function To_Index (J : T) return Index_Type is
- K : constant T'Base := Index_Type'Pos (First) + J - T'(1);
- begin
- return Index_Type'Val (K);
- end To_Index;
-
- --------
- -- Lt --
- --------
-
- function Lt (J, K : T) return Boolean is
- begin
- return Less (To_Index (J), To_Index (K));
- end Lt;
-
- ----------
- -- Xchg --
- ----------
-
- procedure Xchg (J, K : T) is
- begin
- Swap (To_Index (J), To_Index (K));
- end Xchg;
-
- Max : T := Index_Type'Pos (Last) - Index_Type'Pos (First) + T'(1);
-
- ----------
- -- Sift --
- ----------
-
- procedure Sift (S : T) is
- C : T := S;
- Son : T;
- Father : T;
-
- begin
- loop
- Son := C + C;
-
- if Son < Max then
- if Lt (Son, Son + 1) then
- Son := Son + 1;
- end if;
- elsif Son > Max then
- exit;
- end if;
-
- Xchg (Son, C);
- C := Son;
- end loop;
-
- while C /= S loop
- Father := C / 2;
-
- if Lt (Father, C) then
- Xchg (Father, C);
- C := Father;
- else
- exit;
- end if;
- end loop;
- end Sift;
-
--- Start of processing for Generic_Anonymous_Array_Sort
+ procedure Sort is new Ada.Containers.Generic_Sort
+ (Index_Type => Index_Type,
+ Before => Less,
+ Swap => Swap);
begin
- for J in reverse 1 .. Max / 2 loop
- Sift (J);
- end loop;
-
- while Max > 1 loop
- Xchg (1, Max);
- Max := Max - 1;
- Sift (1);
- end loop;
+ Sort (First, Last);
end Ada.Containers.Generic_Anonymous_Array_Sort;
diff --git a/gcc/ada/a-cidlli.adb b/gcc/ada/a-cidlli.adb
index 849cb53c64a..dbdc6de47d4 100644
--- a/gcc/ada/a-cidlli.adb
+++ b/gcc/ada/a-cidlli.adb
@@ -171,6 +171,27 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Insert (Container, No_Element, New_Item, Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out List; Source : List) is
+ Node : Node_Access;
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ Node := Source.First;
+ while Node /= null loop
+ Target.Append (Node.Element.all);
+ Node := Node.Next;
+ end loop;
+ end Assign;
+
-----------
-- Clear --
-----------
@@ -230,6 +251,17 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : List) return List is
+ begin
+ return Target : List do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
@@ -531,10 +563,24 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cidlli.ads b/gcc/ada/a-cidlli.ads
index 8a23fc75442..c40ad30b155 100644
--- a/gcc/ada/a-cidlli.ads
+++ b/gcc/ada/a-cidlli.ads
@@ -90,6 +90,10 @@ package Ada.Containers.Indefinite_Doubly_Linked_Lists is
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out List; Source : List);
+
+ function Copy (Source : List) return List;
+
procedure Move
(Target : in out List;
Source : in out List);
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb
index d4f2c1d92dc..b90c5426481 100644
--- a/gcc/ada/a-cihama.adb
+++ b/gcc/ada/a-cihama.adb
@@ -35,6 +35,8 @@ pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Keys);
with Ada.Unchecked_Deallocation;
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Hashed_Maps is
procedure Free_Key is
@@ -132,6 +134,41 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
HT_Ops.Adjust (Container.HT);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is new HT_Ops.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key.all, New_Item => Node.Element.all);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ if Target.Capacity < Source.Length then
+ Target.Reserve_Capacity (Source.Length);
+ end if;
+
+ Insert_Items (Target.HT);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -159,6 +196,34 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Map;
+ Capacity : Count_Type := 0) return Map
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Map do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-cihama.ads b/gcc/ada/a-cihama.ads
index 1b16d8f4589..7c67c315583 100644
--- a/gcc/ada/a-cihama.ads
+++ b/gcc/ada/a-cihama.ads
@@ -134,6 +134,10 @@ package Ada.Containers.Indefinite_Hashed_Maps is
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb
index e52f38bba9f..e29a204570e 100644
--- a/gcc/ada/a-cihase.adb
+++ b/gcc/ada/a-cihase.adb
@@ -173,6 +173,16 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Free_Element (X);
end Assign;
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -200,6 +210,34 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Set;
+ Capacity : Count_Type := 0) return Set
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Set do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-cihase.ads b/gcc/ada/a-cihase.ads
index 860034469ea..33994cdeffa 100644
--- a/gcc/ada/a-cihase.ads
+++ b/gcc/ada/a-cihase.ads
@@ -153,6 +153,10 @@ package Ada.Containers.Indefinite_Hashed_Sets is
Position : Cursor)
return Constant_Reference_Type;
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
diff --git a/gcc/ada/a-ciorma.adb b/gcc/ada/a-ciorma.adb
index 3de57c76aa4..cd95b9fd5ab 100644
--- a/gcc/ada/a-ciorma.adb
+++ b/gcc/ada/a-ciorma.adb
@@ -35,6 +35,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Operations);
with Ada.Containers.Red_Black_Trees.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Maps is
pragma Suppress (All_Checks);
@@ -287,6 +289,37 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is
+ new Tree_Operations.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key.all, New_Item => Node.Element.all);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Insert_Items (Target.Tree);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -340,6 +373,17 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Map) return Map is
+ begin
+ return Target : Map do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-ciorma.ads b/gcc/ada/a-ciorma.ads
index b31dc0d2e25..1c19b81161f 100644
--- a/gcc/ada/a-ciorma.ads
+++ b/gcc/ada/a-ciorma.ads
@@ -96,6 +96,10 @@ package Ada.Containers.Indefinite_Ordered_Maps is
Process : not null access procedure (Key : Key_Type;
Element : in out Element_Type));
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
procedure Insert
diff --git a/gcc/ada/a-ciormu.adb b/gcc/ada/a-ciormu.adb
index 8c7055b2fef..e11d5045135 100644
--- a/gcc/ada/a-ciormu.adb
+++ b/gcc/ada/a-ciormu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Multisets is
-----------------------------
@@ -298,6 +300,20 @@ package body Ada.Containers.Indefinite_Ordered_Multisets is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -344,6 +360,17 @@ package body Ada.Containers.Indefinite_Ordered_Multisets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-ciormu.ads b/gcc/ada/a-ciormu.ads
index 80e21662b29..c1d81d5b753 100644
--- a/gcc/ada/a-ciormu.ads
+++ b/gcc/ada/a-ciormu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
@@ -118,6 +118,10 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
-- change the value of the element while Process is executing (to "tamper
-- with elements") will raise Program_Error.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- If Target denotes the same object as Source, the operation does
-- nothing. If either Target or Source is busy (cursor tampering is
diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb
index 4257f0974e6..56c33cfe670 100644
--- a/gcc/ada/a-ciorse.adb
+++ b/gcc/ada/a-ciorse.adb
@@ -38,6 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
with Ada.Unchecked_Deallocation;
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Sets is
type Iterator is new
@@ -321,6 +323,20 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -363,6 +379,17 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads
index f397f1d464e..c0ead018bb2 100644
--- a/gcc/ada/a-ciorse.ads
+++ b/gcc/ada/a-ciorse.ads
@@ -111,6 +111,10 @@ package Ada.Containers.Indefinite_Ordered_Sets is
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
procedure Insert
diff --git a/gcc/ada/a-cobove.adb b/gcc/ada/a-cobove.adb
index 16d465d5f0e..e78e3ce12d3 100644
--- a/gcc/ada/a-cobove.adb
+++ b/gcc/ada/a-cobove.adb
@@ -788,16 +788,26 @@ package body Ada.Containers.Bounded_Vectors is
I, J : Count_Type;
begin
- if Target.Is_Empty then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Is_Empty then
+ if Target.Is_Empty then
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/a-cogeso.adb b/gcc/ada/a-cogeso.adb
new file mode 100644
index 00000000000..fc2198cb4b1
--- /dev/null
+++ b/gcc/ada/a-cogeso.adb
@@ -0,0 +1,127 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.CONTAINERS.GENERIC_SORT --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+-- This algorithm was adapted from GNAT.Heap_Sort (see g-heasor.ad[sb])
+
+with System;
+
+procedure Ada.Containers.Generic_Sort (First, Last : Index_Type'Base) is
+ type T is range System.Min_Int .. System.Max_Int;
+
+ function To_Index (J : T) return Index_Type;
+ pragma Inline (To_Index);
+
+ function Lt (J, K : T) return Boolean;
+ pragma Inline (Lt);
+
+ procedure Xchg (J, K : T);
+ pragma Inline (Xchg);
+
+ procedure Sift (S : T);
+
+ --------------
+ -- To_Index --
+ --------------
+
+ function To_Index (J : T) return Index_Type is
+ K : constant T'Base := Index_Type'Pos (First) + J - T'(1);
+ begin
+ return Index_Type'Val (K);
+ end To_Index;
+
+ --------
+ -- Lt --
+ --------
+
+ function Lt (J, K : T) return Boolean is
+ begin
+ return Before (To_Index (J), To_Index (K));
+ end Lt;
+
+ ----------
+ -- Xchg --
+ ----------
+
+ procedure Xchg (J, K : T) is
+ begin
+ Swap (To_Index (J), To_Index (K));
+ end Xchg;
+
+ Max : T := Index_Type'Pos (Last) - Index_Type'Pos (First) + T'(1);
+
+ ----------
+ -- Sift --
+ ----------
+
+ procedure Sift (S : T) is
+ C : T := S;
+ Son : T;
+ Father : T;
+
+ begin
+ loop
+ Son := C + C;
+
+ if Son < Max then
+ if Lt (Son, Son + 1) then
+ Son := Son + 1;
+ end if;
+ elsif Son > Max then
+ exit;
+ end if;
+
+ Xchg (Son, C);
+ C := Son;
+ end loop;
+
+ while C /= S loop
+ Father := C / 2;
+
+ if Lt (Father, C) then
+ Xchg (Father, C);
+ C := Father;
+ else
+ exit;
+ end if;
+ end loop;
+ end Sift;
+
+-- Start of processing for Generic_Sort
+
+begin
+ for J in reverse 1 .. Max / 2 loop
+ Sift (J);
+ end loop;
+
+ while Max > 1 loop
+ Xchg (1, Max);
+ Max := Max - 1;
+ Sift (1);
+ end loop;
+end Ada.Containers.Generic_Sort;
diff --git a/gcc/ada/a-cogeso.ads b/gcc/ada/a-cogeso.ads
new file mode 100644
index 00000000000..ebf805ab79f
--- /dev/null
+++ b/gcc/ada/a-cogeso.ads
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.CONTAINERS.GENERIC_SORT --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+-- Allows an anonymous array (or array-like container) to be sorted. Generic
+-- formal Before returns the result of comparing the elements designated by
+-- the indexes, and generic formal Swap exchanges the designated elements.
+
+generic
+ type Index_Type is (<>);
+ with function Before (Left, Right : Index_Type) return Boolean;
+ with procedure Swap (Left, Right : Index_Type);
+
+procedure Ada.Containers.Generic_Sort (First, Last : Index_Type'Base);
+pragma Pure (Ada.Containers.Generic_Sort);
diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb
index c06ba9e35e4..351030d3a7b 100644
--- a/gcc/ada/a-cohama.adb
+++ b/gcc/ada/a-cohama.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -35,6 +35,8 @@ pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Operations);
with Ada.Containers.Hash_Tables.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Hashed_Maps is
type Iterator is new
@@ -131,6 +133,41 @@ package body Ada.Containers.Hashed_Maps is
HT_Ops.Adjust (Container.HT);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is new HT_Ops.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key, New_Item => Node.Element);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ if Target.Capacity < Source.Length then
+ Target.Reserve_Capacity (Source.Length);
+ end if;
+
+ Insert_Items (Target.HT);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -158,6 +195,34 @@ package body Ada.Containers.Hashed_Maps is
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Map;
+ Capacity : Count_Type := 0) return Map
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Map do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
@@ -780,14 +845,36 @@ package body Ada.Containers.Hashed_Maps is
-- Reference --
---------------
- function Constant_Reference (Container : Map; Key : Key_Type)
- return Constant_Reference_Type is
+ function Constant_Reference
+ (Container : aliased Map;
+ Position : Cursor) return Constant_Reference_Type
+ is
+ pragma Unreferenced (Container);
+ begin
+ return (Element => Element (Position)'Unrestricted_Access);
+ end Constant_Reference;
+
+ function Reference
+ (Container : aliased in out Map;
+ Position : Cursor) return Reference_Type
+ is
+ pragma Unreferenced (Container);
+ begin
+ return (Element => Element (Position)'Unrestricted_Access);
+ end Reference;
+
+ function Constant_Reference
+ (Container : aliased Map;
+ Key : Key_Type) return Constant_Reference_Type
+ is
begin
return (Element => Container.Element (Key)'Unrestricted_Access);
end Constant_Reference;
- function Reference (Container : Map; Key : Key_Type)
- return Reference_Type is
+ function Reference
+ (Container : aliased in out Map;
+ Key : Key_Type) return Reference_Type
+ is
begin
return (Element => Container.Element (Key)'Unrestricted_Access);
end Reference;
diff --git a/gcc/ada/a-cohama.ads b/gcc/ada/a-cohama.ads
index 0d614bd4f8f..5f01994e8ad 100644
--- a/gcc/ada/a-cohama.ads
+++ b/gcc/ada/a-cohama.ads
@@ -148,6 +148,10 @@ package Ada.Containers.Hashed_Maps is
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
@@ -307,19 +311,28 @@ package Ada.Containers.Hashed_Maps is
for Reference_Type'Read use Read;
function Constant_Reference
- (Container : Map; Key : Key_Type) -- SHOULD BE ALIASED
- return Constant_Reference_Type;
+ (Container : aliased Map;
+ Position : Cursor) return Constant_Reference_Type;
+
+ function Reference
+ (Container : aliased in out Map;
+ Position : Cursor) return Reference_Type;
+
+ function Constant_Reference
+ (Container : aliased Map;
+ Key : Key_Type) return Constant_Reference_Type;
- function Reference (Container : Map; Key : Key_Type)
- return Reference_Type;
+ function Reference
+ (Container : aliased in out Map;
+ Key : Key_Type) return Reference_Type;
procedure Iterate
(Container : Map;
Process : not null access procedure (Position : Cursor));
-- Calls Process for each node in the map
- function Iterate (Container : Map)
- return Map_Iterator_Interfaces.Forward_Iterator'class;
+ function Iterate
+ (Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'class;
private
pragma Inline ("=");
diff --git a/gcc/ada/a-cohase.adb b/gcc/ada/a-cohase.adb
index 643dde5d964..e0b2345234b 100644
--- a/gcc/ada/a-cohase.adb
+++ b/gcc/ada/a-cohase.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
@@ -159,6 +159,16 @@ package body Ada.Containers.Hashed_Sets is
Node.Element := Item;
end Assign;
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -186,6 +196,34 @@ package body Ada.Containers.Hashed_Sets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Set;
+ Capacity : Count_Type := 0) return Set
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Set do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-cohase.ads b/gcc/ada/a-cohase.ads
index a262dded097..0bb370bfe83 100644
--- a/gcc/ada/a-cohase.ads
+++ b/gcc/ada/a-cohase.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -133,6 +133,10 @@ package Ada.Containers.Hashed_Sets is
-- Calls Process with the element (having only a constant view) of the node
-- designed by the cursor.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb
index 3172bd2c7b5..e35f2f781de 100644
--- a/gcc/ada/a-coinve.adb
+++ b/gcc/ada/a-coinve.adb
@@ -616,6 +616,20 @@ package body Ada.Containers.Indefinite_Vectors is
Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Vector; Source : Vector) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Append (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -698,6 +712,34 @@ package body Ada.Containers.Indefinite_Vectors is
return Find_Index (Container, Item) /= No_Index;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Vector;
+ Capacity : Count_Type := 0) return Vector
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Vector do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
@@ -1226,16 +1268,26 @@ package body Ada.Containers.Indefinite_Vectors is
I, J : Index_Type'Base;
begin
- if Target.Last < Index_Type'First then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Last < Index_Type'First then -- Source is empty
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Last < Index_Type'First then
+ if Target.Last < Index_Type'First then -- Target is empty
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/a-coinve.ads b/gcc/ada/a-coinve.ads
index a13003819b0..06568278997 100644
--- a/gcc/ada/a-coinve.ads
+++ b/gcc/ada/a-coinve.ads
@@ -204,6 +204,10 @@ package Ada.Containers.Indefinite_Vectors is
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out Vector; Source : Vector);
+
+ function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector;
+
procedure Move (Target : in out Vector; Source : in out Vector);
procedure Insert
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb
index a57f7fbd9a8..79071810182 100644
--- a/gcc/ada/a-convec.adb
+++ b/gcc/ada/a-convec.adb
@@ -432,6 +432,20 @@ package body Ada.Containers.Vectors is
Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Vector; Source : Vector) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Append (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
@@ -471,6 +485,34 @@ package body Ada.Containers.Vectors is
return Find_Index (Container, Item) /= No_Index;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Vector;
+ Capacity : Count_Type := 0) return Vector
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Vector do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
@@ -867,16 +909,26 @@ package body Ada.Containers.Vectors is
J : Index_Type'Base;
begin
- if Target.Last < Index_Type'First then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Last < Index_Type'First then -- Source is empty
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Last < Index_Type'First then
+ if Target.Last < Index_Type'First then -- Target is empty
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/a-convec.ads b/gcc/ada/a-convec.ads
index c90cf01bde9..9eb82c791fe 100644
--- a/gcc/ada/a-convec.ads
+++ b/gcc/ada/a-convec.ads
@@ -202,7 +202,12 @@ package Ada.Containers.Vectors is
function Reference (Container : Vector; Position : Index_Type)
return Reference_Type;
+ procedure Assign (Target : in out Vector; Source : Vector);
+
+ function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector;
+
procedure Move (Target : in out Vector; Source : in out Vector);
+
procedure Insert
(Container : in out Vector;
Before : Extended_Index;
diff --git a/gcc/ada/a-coorma.adb b/gcc/ada/a-coorma.adb
index c1ae68297b3..e8099c3c297 100644
--- a/gcc/ada/a-coorma.adb
+++ b/gcc/ada/a-coorma.adb
@@ -35,6 +35,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Operations);
with Ada.Containers.Red_Black_Trees.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Maps is
type Iterator is new
@@ -248,6 +250,37 @@ package body Ada.Containers.Ordered_Maps is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is
+ new Tree_Operations.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key, New_Item => Node.Element);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Insert_Items (Target.Tree);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -304,6 +337,17 @@ package body Ada.Containers.Ordered_Maps is
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Map) return Map is
+ begin
+ return Target : Map do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-coorma.ads b/gcc/ada/a-coorma.ads
index 6fd45b78253..53942b71fa2 100644
--- a/gcc/ada/a-coorma.ads
+++ b/gcc/ada/a-coorma.ads
@@ -96,6 +96,10 @@ package Ada.Containers.Ordered_Maps is
Process : not null access
procedure (Key : Key_Type; Element : in out Element_Type));
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
procedure Insert
diff --git a/gcc/ada/a-coormu.adb b/gcc/ada/a-coormu.adb
index b59f6f554ef..2ed14819243 100644
--- a/gcc/ada/a-coormu.adb
+++ b/gcc/ada/a-coormu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Multisets is
-----------------------------
@@ -266,6 +268,20 @@ package body Ada.Containers.Ordered_Multisets is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -312,6 +328,17 @@ package body Ada.Containers.Ordered_Multisets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-coormu.ads b/gcc/ada/a-coormu.ads
index bcc6eb5e9b8..6f9e3d0b2d8 100644
--- a/gcc/ada/a-coormu.ads
+++ b/gcc/ada/a-coormu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
@@ -117,6 +117,10 @@ package Ada.Containers.Ordered_Multisets is
-- change the value of the element while Process is executing (to "tamper
-- with elements") will raise Program_Error.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- If Target denotes the same object as Source, the operation does
-- nothing. If either Target or Source is busy (cursor tampering is
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb
index 915eed62117..4c6476864b8 100644
--- a/gcc/ada/a-coorse.adb
+++ b/gcc/ada/a-coorse.adb
@@ -38,6 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Sets is
type Iterator is new
@@ -281,6 +283,20 @@ package body Ada.Containers.Ordered_Sets is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -325,6 +341,17 @@ package body Ada.Containers.Ordered_Sets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads
index 8349ef85fb4..45e6ab90a73 100644
--- a/gcc/ada/a-coorse.ads
+++ b/gcc/ada/a-coorse.ads
@@ -113,6 +113,10 @@ package Ada.Containers.Ordered_Sets is
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
procedure Insert
diff --git a/gcc/ada/i-forbla-darwin.adb b/gcc/ada/a-sbecin.adb
index 825a8840414..78000176844 100644
--- a/gcc/ada/i-forbla-darwin.adb
+++ b/gcc/ada/a-sbecin.adb
@@ -1,12 +1,12 @@
------------------------------------------------------------------------------
-- --
--- GNAT RUN-TIME COMPONENTS --
+-- GNAT LIBRARY COMPONENTS --
-- --
--- I N T E R F A C E S . F O R T R A N . B L A S --
+-- ADA.STRINGS.BOUNDED.EQUAL_CASE_INSENSITIVE --
-- --
--- B o d y --
+-- B o d y --
-- --
--- Copyright (C) 2006-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2011, 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,15 +24,17 @@
-- 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 unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
--- Version for Mac OS X
+with Ada.Strings.Equal_Case_Insensitive;
-package body Interfaces.Fortran.BLAS is
- pragma Linker_Options ("-lgnala");
- pragma Linker_Options ("-lm");
- pragma Linker_Options ("-Wl,-framework,vecLib");
-end Interfaces.Fortran.BLAS;
+function Ada.Strings.Bounded.Equal_Case_Insensitive
+ (Left, Right : Bounded.Bounded_String)
+ return Boolean
+is
+begin
+ return Ada.Strings.Equal_Case_Insensitive
+ (Left => Bounded.To_String (Left),
+ Right => Bounded.To_String (Right));
+end Ada.Strings.Bounded.Equal_Case_Insensitive;
diff --git a/gcc/ada/i-forbla.adb b/gcc/ada/a-sbecin.ads
index 4445c5124cb..115c7220606 100644
--- a/gcc/ada/i-forbla.adb
+++ b/gcc/ada/a-sbecin.ads
@@ -1,12 +1,16 @@
------------------------------------------------------------------------------
-- --
--- GNAT RUN-TIME COMPONENTS --
+-- GNAT LIBRARY COMPONENTS --
-- --
--- I N T E R F A C E S . F O R T R A N . B L A S --
+-- ADA.STRINGS.BOUNDED.EQUAL_CASE_INSENSITIVE --
-- --
--- B o d y --
+-- S p e c --
-- --
--- Copyright (C) 2006-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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,19 +28,15 @@
-- 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 unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
--- This Interfaces.Fortran.Blas package body contains the required linker
--- pragmas for automatically linking with the LAPACK linear algebra support
--- library, and the systems math library. Alternative bodies can be supplied
--- if different sets of libraries are needed.
+generic
+ with package Bounded is
+ new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
+
+function Ada.Strings.Bounded.Equal_Case_Insensitive
+ (Left, Right : Bounded.Bounded_String)
+ return Boolean;
-package body Interfaces.Fortran.BLAS is
- pragma Linker_Options ("-lgnala");
- pragma Linker_Options ("-llapack");
- pragma Linker_Options ("-lblas");
- pragma Linker_Options ("-lm");
-end Interfaces.Fortran.BLAS;
+pragma Preelaborate (Ada.Strings.Bounded.Equal_Case_Insensitive);
diff --git a/gcc/ada/a-sbhcin.adb b/gcc/ada/a-sbhcin.adb
new file mode 100644
index 00000000000..8c69290e0d0
--- /dev/null
+++ b/gcc/ada/a-sbhcin.adb
@@ -0,0 +1,38 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.BOUNDED.HASH_CASE_INSENSITIVE --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Hash_Case_Insensitive;
+
+function Ada.Strings.Bounded.Hash_Case_Insensitive
+ (Key : Bounded.Bounded_String)
+ return Containers.Hash_Type
+is
+begin
+ return Ada.Strings.Hash_Case_Insensitive (Bounded.To_String (Key));
+end Ada.Strings.Bounded.Hash_Case_Insensitive;
diff --git a/gcc/ada/i-forbla-unimplemented.ads b/gcc/ada/a-sbhcin.ads
index deea344bbf2..c291f53db9a 100644
--- a/gcc/ada/i-forbla-unimplemented.ads
+++ b/gcc/ada/a-sbhcin.ads
@@ -1,12 +1,16 @@
------------------------------------------------------------------------------
-- --
--- GNAT RUN-TIME COMPONENTS --
+-- GNAT LIBRARY COMPONENTS --
-- --
--- I N T E R F A C E S . F O R T R A N . B L A S --
+-- ADA.STRINGS.BOUNDED.HASH_CASE_INSENSITIVE --
-- --
-- S p e c --
-- --
--- Copyright (C) 2006-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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,22 +28,17 @@
-- 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 unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
--- This package provides a thin binding to the standard Fortran BLAS library.
--- Documentation and a reference BLAS implementation is available from
--- ftp://ftp.netlib.org. The main purpose of this package is to facilitate
--- implementation of the Ada 2005 Ada.Numerics.Generic_Real_Arrays and
--- Ada.Numerics.Generic_Complex_Arrays packages. Bindings to other BLAS
--- routines may be added over time.
-
--- This unit is not implemented in this GNAT configuration
+with Ada.Containers;
-package Interfaces.Fortran.BLAS is
+generic
+ with package Bounded is
+ new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
- pragma Unimplemented_Unit;
+function Ada.Strings.Bounded.Hash_Case_Insensitive
+ (Key : Bounded.Bounded_String)
+ return Containers.Hash_Type;
-end Interfaces.Fortran.BLAS;
+pragma Preelaborate (Ada.Strings.Bounded.Hash_Case_Insensitive);
diff --git a/gcc/ada/a-sblcin.adb b/gcc/ada/a-sblcin.adb
new file mode 100644
index 00000000000..e2ce4d3f384
--- /dev/null
+++ b/gcc/ada/a-sblcin.adb
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.BOUNDED.LESS_CASE_INSENSITIVE --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Less_Case_Insensitive;
+
+function Ada.Strings.Bounded.Less_Case_Insensitive
+ (Left, Right : Bounded.Bounded_String)
+ return Boolean
+is
+begin
+ return Ada.Strings.Less_Case_Insensitive
+ (Left => Bounded.To_String (Left),
+ Right => Bounded.To_String (Right));
+end Ada.Strings.Bounded.Less_Case_Insensitive;
diff --git a/gcc/ada/a-sblcin.ads b/gcc/ada/a-sblcin.ads
new file mode 100644
index 00000000000..d7284110aef
--- /dev/null
+++ b/gcc/ada/a-sblcin.ads
@@ -0,0 +1,42 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.BOUNDED.LESS_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+generic
+ with package Bounded is
+ new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
+
+function Ada.Strings.Bounded.Less_Case_Insensitive
+ (Left, Right : Bounded.Bounded_String)
+ return Boolean;
+
+pragma Preelaborate (Ada.Strings.Bounded.Less_Case_Insensitive);
diff --git a/gcc/ada/a-sfecin.ads b/gcc/ada/a-sfecin.ads
new file mode 100644
index 00000000000..592b69166c9
--- /dev/null
+++ b/gcc/ada/a-sfecin.ads
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.FIXED.EQUAL_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Equal_Case_Insensitive;
+
+function Ada.Strings.Fixed.Equal_Case_Insensitive
+ (Left, Right : String)
+ return Boolean renames Ada.Strings.Equal_Case_Insensitive;
+
+pragma Pure (Ada.Strings.Fixed.Equal_Case_Insensitive);
diff --git a/gcc/ada/a-sfhcin.ads b/gcc/ada/a-sfhcin.ads
new file mode 100644
index 00000000000..86f60f68944
--- /dev/null
+++ b/gcc/ada/a-sfhcin.ads
@@ -0,0 +1,41 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.FIXED.HASH_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Containers;
+with Ada.Strings.Hash_Case_Insensitive;
+
+function Ada.Strings.Fixed.Hash_Case_Insensitive
+ (Key : String)
+ return Containers.Hash_Type renames Ada.Strings.Hash_Case_Insensitive;
+
+pragma Pure (Ada.Strings.Fixed.Hash_Case_Insensitive);
diff --git a/gcc/ada/a-sflcin.ads b/gcc/ada/a-sflcin.ads
new file mode 100644
index 00000000000..8af21fe9e55
--- /dev/null
+++ b/gcc/ada/a-sflcin.ads
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.FIXED.LESS_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Less_Case_Insensitive;
+
+function Ada.Strings.Fixed.Less_Case_Insensitive
+ (Left, Right : String)
+ return Boolean renames Ada.Strings.Less_Case_Insensitive;
+
+pragma Pure (Ada.Strings.Fixed.Less_Case_Insensitive);
diff --git a/gcc/ada/a-suecin.adb b/gcc/ada/a-suecin.adb
new file mode 100644
index 00000000000..73ebae57156
--- /dev/null
+++ b/gcc/ada/a-suecin.adb
@@ -0,0 +1,47 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.EQUAL_CASE_INSENSITIVE --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Unbounded.Aux;
+with Ada.Strings.Equal_Case_Insensitive;
+
+function Ada.Strings.Unbounded.Equal_Case_Insensitive
+ (Left, Right : Unbounded.Unbounded_String)
+ return Boolean
+is
+ SL, SR : Aux.Big_String_Access;
+ LL, LR : Natural;
+
+begin
+ Aux.Get_String (Left, SL, LL);
+ Aux.Get_String (Right, SR, LR);
+
+ return Ada.Strings.Equal_Case_Insensitive
+ (Left => SL (1 .. LL),
+ Right => SR (1 .. LR));
+end Ada.Strings.Unbounded.Equal_Case_Insensitive;
diff --git a/gcc/ada/a-suecin.ads b/gcc/ada/a-suecin.ads
new file mode 100644
index 00000000000..08960241c8e
--- /dev/null
+++ b/gcc/ada/a-suecin.ads
@@ -0,0 +1,38 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.EQUAL_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+function Ada.Strings.Unbounded.Equal_Case_Insensitive
+ (Left, Right : Unbounded.Unbounded_String)
+ return Boolean;
+
+pragma Preelaborate (Ada.Strings.Unbounded.Equal_Case_Insensitive);
diff --git a/gcc/ada/a-suhcin.adb b/gcc/ada/a-suhcin.adb
new file mode 100644
index 00000000000..0417c15db24
--- /dev/null
+++ b/gcc/ada/a-suhcin.adb
@@ -0,0 +1,43 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.HASH_CASE_INSENSITIVE --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Unbounded.Aux;
+with Ada.Strings.Hash_Case_Insensitive;
+
+function Ada.Strings.Unbounded.Hash_Case_Insensitive
+ (Key : Unbounded.Unbounded_String)
+ return Containers.Hash_Type
+is
+ S : Aux.Big_String_Access;
+ L : Natural;
+
+begin
+ Aux.Get_String (Key, S, L);
+ return Ada.Strings.Hash_Case_Insensitive (S (1 .. L));
+end Ada.Strings.Unbounded.Hash_Case_Insensitive;
diff --git a/gcc/ada/a-suhcin.ads b/gcc/ada/a-suhcin.ads
new file mode 100644
index 00000000000..180d4a4391a
--- /dev/null
+++ b/gcc/ada/a-suhcin.ads
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.HASH_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Containers;
+
+function Ada.Strings.Unbounded.Hash_Case_Insensitive
+ (Key : Unbounded.Unbounded_String)
+ return Containers.Hash_Type;
+
+pragma Preelaborate (Ada.Strings.Unbounded.Hash_Case_Insensitive);
diff --git a/gcc/ada/a-sulcin.adb b/gcc/ada/a-sulcin.adb
new file mode 100644
index 00000000000..9f1f3c4aca9
--- /dev/null
+++ b/gcc/ada/a-sulcin.adb
@@ -0,0 +1,47 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.LESS_CASE_INSENSITIVE --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2011, 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+with Ada.Strings.Unbounded.Aux;
+with Ada.Strings.Less_Case_Insensitive;
+
+function Ada.Strings.Unbounded.Less_Case_Insensitive
+ (Left, Right : Unbounded.Unbounded_String)
+ return Boolean
+is
+ SL, SR : Aux.Big_String_Access;
+ LL, LR : Natural;
+
+begin
+ Aux.Get_String (Left, SL, LL);
+ Aux.Get_String (Right, SR, LR);
+
+ return Ada.Strings.Less_Case_Insensitive
+ (Left => SL (1 .. LL),
+ Right => SR (1 .. LR));
+end Ada.Strings.Unbounded.Less_Case_Insensitive;
diff --git a/gcc/ada/a-sulcin.ads b/gcc/ada/a-sulcin.ads
new file mode 100644
index 00000000000..fafb546ca77
--- /dev/null
+++ b/gcc/ada/a-sulcin.ads
@@ -0,0 +1,38 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT LIBRARY COMPONENTS --
+-- --
+-- ADA.STRINGS.UNBOUNDED.LESS_CASE_INSENSITIVE --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- 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/>. --
+-- --
+-- This unit was originally developed by Matthew J Heaney. --
+------------------------------------------------------------------------------
+
+function Ada.Strings.Unbounded.Less_Case_Insensitive
+ (Left, Right : Unbounded.Unbounded_String)
+ return Boolean;
+
+pragma Preelaborate (Ada.Strings.Unbounded.Less_Case_Insensitive);
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 48a1c89e700..9b707734b76 100755
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -127,7 +127,19 @@ package body Aspects is
Ritem : Node_Id;
begin
- Ritem := First_Rep_Item (Ent);
+
+ -- If the aspect is an inherited one and the entity is a class-wide
+ -- type, use the aspect of the specific type.
+
+ if Is_Type (Ent)
+ and then Is_Class_Wide_Type (Ent)
+ and then Inherited_Aspect (A)
+ then
+ Ritem := First_Rep_Item (Etype (Ent));
+ else
+ Ritem := First_Rep_Item (Ent);
+ end if;
+
while Present (Ritem) loop
if Nkind (Ritem) = N_Aspect_Specification
and then Get_Aspect_Id (Chars (Identifier (Ritem))) = A
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index dfca9b12af1..582a71e7a55 100755
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -176,6 +176,18 @@ package Aspects is
(Aspect_Test_Case => False,
others => True);
+ -- The following array indicates type aspects that are inherited and apply
+ -- to the class-wide type as well.
+
+ Inherited_Aspect : constant array (Aspect_Id) of Boolean :=
+ (Aspect_Constant_Indexing => True,
+ Aspect_Default_Iterator => True,
+ Aspect_Implicit_Dereference => True,
+ Aspect_Iterator_Element => True,
+ Aspect_Remote_Types => True,
+ Aspect_Variable_Indexing => True,
+ others => False);
+
-- The following subtype defines aspects corresponding to library unit
-- pragmas, these can only validly appear as aspects for library units,
-- and result in a corresponding pragma being inserted immediately after
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index 17c6814fb90..793da138861 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -1797,6 +1797,15 @@ package body Atree is
Nodes.Table (N).Has_Aspects := Val;
end Set_Has_Aspects;
+ -----------------------
+ -- Set_Original_Node --
+ -----------------------
+
+ procedure Set_Original_Node (N : Node_Id; Val : Node_Id) is
+ begin
+ Orig_Nodes.Table (N) := Val;
+ end Set_Original_Node;
+
---------------------
-- Set_Paren_Count --
---------------------
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index 4e20b0b0f00..305e914f97c 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -151,14 +151,14 @@ package Atree is
-- it is useful to be able to do untyped traversals, and an internal
-- package in Atree allows for direct untyped accesses in such cases.
- -- Flag4 Sixteen Boolean flags (use depends on Nkind and
+ -- Flag4 Fifteen Boolean flags (use depends on Nkind and
-- Flag5 Ekind, as described for FieldN). Again the access
-- Flag6 is usually via subprograms in Sinfo and Einfo which
-- Flag7 provide high-level synonyms for these flags, and
-- Flag8 contain debugging code that checks that the values
-- Flag9 in Nkind and Ekind are appropriate for the access.
-- Flag10
- -- Flag11 Note that Flag1-2 are missing from this list. For
+ -- Flag11 Note that Flag1-3 are missing from this list. For
-- Flag12 historical reasons, these flag names are unused.
-- Flag13
-- Flag14
@@ -761,6 +761,14 @@ package Atree is
procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True);
pragma Inline (Set_Has_Aspects);
+ procedure Set_Original_Node (N : Node_Id; Val : Node_Id);
+ pragma Inline (Set_Original_Node);
+ -- Note that this routine is used only in very peculiar cases. In normal
+ -- cases, the Original_Node link is set by calls to Rewrite. We currently
+ -- use it in ASIS mode to manually set the link from pragma expressions
+ -- to their aspect original source expressions, so that the original source
+ -- expressions accessed by ASIS are also semantically analyzed.
+
------------------------------
-- Entity Update Procedures --
------------------------------
@@ -887,9 +895,13 @@ package Atree is
-----------------------------------
-- This subpackage provides the functions for accessing and procedures for
- -- setting fields that are normally referenced by their logical synonyms
- -- defined in packages Sinfo and Einfo. The implementations of these
- -- packages use the package Atree.Unchecked_Access.
+ -- setting fields that are normally referenced by wrapper subprograms (e.g.
+ -- logical synonyms defined in packages Sinfo and Einfo, or specialized
+ -- routines such as Rewrite (for Original_Node), or the node creation
+ -- routines (for Set_Nkind). The implementations of these wrapper
+ -- subprograms use the package Atree.Unchecked_Access as do various
+ -- special case accesses where no wrapper applies. Documentation is always
+ -- required for such a special case access explaining why it is needed.
package Unchecked_Access is
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index d75fe06c51b..a4b7d394deb 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -1050,9 +1050,8 @@ package body Bindgen is
or else U.Unit_Kind /= 's')
then
- -- The only case in which we have to do something is if this
- -- is a body, with a separate spec, where the separate spec
- -- has an elaboration entity defined. In that case, this is
+ -- In the case of a body with a separate spec, where the
+ -- separate spec has an elaboration entity defined, this is
-- where we increment the elaboration entity.
if U.Utype = Is_Body
@@ -1061,9 +1060,39 @@ package body Bindgen is
then
Set_String (" E");
Set_Unit_Number (Unum_Spec);
- Set_String (" := E");
+
+ -- The AAMP target has no notion of shared libraries, and
+ -- there's no possibility of reelaboration, so we treat the
+ -- the elaboration var as a flag instead of a counter and
+ -- simply set it.
+
+ if AAMP_On_Target then
+ Set_String (" := 1;");
+
+ -- Otherwise (normal case), increment elaboration counter
+
+ else
+ Set_String (" := E");
+ Set_Unit_Number (Unum_Spec);
+ Set_String (" + 1;");
+ end if;
+
+ Write_Statement_Buffer;
+
+ -- In the special case where the target is AAMP and the unit is
+ -- a spec with a body, the elaboration entity is initialized
+ -- here. This is done because it's the only way to accomplish
+ -- initialization of such entities, as there is no mechanism
+ -- provided for initializing global variables at load time on
+ -- AAMP.
+
+ elsif AAMP_On_Target
+ and then U.Utype = Is_Spec
+ and then Units.Table (Unum_Spec).Set_Elab_Entity
+ then
+ Set_String (" E");
Set_Unit_Number (Unum_Spec);
- Set_String (" + 1;");
+ Set_String (" := 0;");
Write_Statement_Buffer;
end if;
@@ -1087,6 +1116,23 @@ package body Bindgen is
-- variables, only calls to 'Elab* subprograms.
else
+ -- In the special case where the target is AAMP and the unit is
+ -- a spec with a body, the elaboration entity is initialized
+ -- here. This is done because it's the only way to accomplish
+ -- initialization of such entities, as there is no mechanism
+ -- provided for initializing global variables at load time on
+ -- AAMP.
+
+ if AAMP_On_Target
+ and then U.Utype = Is_Spec
+ and then Units.Table (Unum_Spec).Set_Elab_Entity
+ then
+ Set_String (" E");
+ Set_Unit_Number (Unum_Spec);
+ Set_String (" := 0;");
+ Write_Statement_Buffer;
+ end if;
+
Check_Elab_Flag :=
not CodePeer_Mode
and then (Force_Checking_Of_Elaboration_Flags
@@ -1151,9 +1197,23 @@ package body Bindgen is
then
Set_String (" E");
Set_Unit_Number (Unum_Spec);
- Set_String (" := E");
- Set_Unit_Number (Unum_Spec);
- Set_String (" + 1;");
+
+ -- The AAMP target has no notion of shared libraries, and
+ -- there's no possibility of reelaboration, so we treat the
+ -- the elaboration var as a flag instead of a counter and
+ -- simply set it.
+
+ if AAMP_On_Target then
+ Set_String (" := 1;");
+
+ -- Otherwise (normal case), increment elaboration counter
+
+ else
+ Set_String (" := E");
+ Set_Unit_Number (Unum_Spec);
+ Set_String (" + 1;");
+ end if;
+
Write_Statement_Buffer;
end if;
end if;
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index f3234865dbd..67febfe1919 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -2565,8 +2565,25 @@ package body Checks is
function Atomic_Synchronization_Disabled (E : Entity_Id) return Boolean is
begin
- if Present (E) and then Checks_May_Be_Suppressed (E) then
+ -- If debug flag d.e is set, always return False, i.e. all atomic sync
+ -- looks enabled, since it is never disabled.
+
+ if Debug_Flag_Dot_E then
+ return False;
+
+ -- If debug flag d.d is set then always return True, i.e. all atomic
+ -- sync looks disabled, since it always tests True.
+
+ elsif Debug_Flag_Dot_D then
+ return True;
+
+ -- If entity present, then check result for that entity
+
+ elsif Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Atomic_Synchronization);
+
+ -- Otherwise result depends on current scope setting
+
else
return Scope_Suppress (Atomic_Synchronization);
end if;
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 88482898a92..5993132cf81 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -439,7 +439,6 @@ package body Errout is
Error_Msg_Internal
("?in inlined body #",
Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
-
else
Error_Msg_Internal
("error in inlined body #",
@@ -453,7 +452,6 @@ package body Errout is
Error_Msg_Internal
("?in instantiation #",
Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
-
else
Error_Msg_Internal
("instantiation error #",
diff --git a/gcc/ada/exp_alfa.adb b/gcc/ada/exp_alfa.adb
index 988d16fba1f..ab0e40fae5b 100644
--- a/gcc/ada/exp_alfa.adb
+++ b/gcc/ada/exp_alfa.adb
@@ -29,10 +29,12 @@ with Exp_Attr; use Exp_Attr;
with Exp_Ch4; use Exp_Ch4;
with Exp_Ch6; use Exp_Ch6;
with Exp_Dbug; use Exp_Dbug;
+with Exp_Util; use Exp_Util;
with Nlists; use Nlists;
with Rtsfind; use Rtsfind;
with Sem_Aux; use Sem_Aux;
with Sem_Res; use Sem_Res;
+with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
@@ -56,12 +58,19 @@ package body Exp_Alfa is
procedure Expand_Alfa_N_In (N : Node_Id);
-- Expand set membership into individual ones
+ procedure Expand_Alfa_N_Object_Renaming_Declaration (N : Node_Id);
+ -- Perform name evaluation for a renamed object
+
procedure Expand_Alfa_N_Simple_Return_Statement (N : Node_Id);
-- Insert conversion on function return if necessary
procedure Expand_Alfa_Simple_Function_Return (N : Node_Id);
-- Expand simple return from function
+ procedure Expand_Potential_Renaming (N : Node_Id);
+ -- N denotes a N_Identifier or N_Expanded_Name. If N references a renaming,
+ -- replace N with the renamed object.
+
-----------------
-- Expand_Alfa --
-----------------
@@ -69,22 +78,22 @@ package body Exp_Alfa is
procedure Expand_Alfa (N : Node_Id) is
begin
case Nkind (N) is
+ when N_Attribute_Reference =>
+ Expand_Alfa_N_Attribute_Reference (N);
- when N_Package_Body |
+ when N_Block_Statement |
+ N_Package_Body |
N_Package_Declaration |
- N_Subprogram_Body |
- N_Block_Statement =>
+ N_Subprogram_Body =>
Qualify_Entity_Names (N);
- when N_Simple_Return_Statement =>
- Expand_Alfa_N_Simple_Return_Statement (N);
-
when N_Function_Call |
N_Procedure_Call_Statement =>
Expand_Alfa_Call (N);
- when N_Attribute_Reference =>
- Expand_Alfa_N_Attribute_Reference (N);
+ when N_Expanded_Name |
+ N_Identifier =>
+ Expand_Potential_Renaming (N);
when N_In =>
Expand_Alfa_N_In (N);
@@ -92,6 +101,12 @@ package body Exp_Alfa is
when N_Not_In =>
Expand_N_Not_In (N);
+ when N_Object_Renaming_Declaration =>
+ Expand_Alfa_N_Object_Renaming_Declaration (N);
+
+ when N_Simple_Return_Statement =>
+ Expand_Alfa_N_Simple_Return_Statement (N);
+
when others =>
null;
end case;
@@ -157,7 +172,6 @@ package body Exp_Alfa is
Set_Entity (Name (Call_Node), Parent_Subp);
end if;
-
end Expand_Alfa_Call;
---------------------------------------
@@ -186,10 +200,20 @@ package body Exp_Alfa is
begin
if Present (Alternatives (N)) then
Expand_Set_Membership (N);
- return;
end if;
end Expand_Alfa_N_In;
+ -----------------------------------------------
+ -- Expand_Alfa_N_Object_Renaming_Declaration --
+ -----------------------------------------------
+
+ procedure Expand_Alfa_N_Object_Renaming_Declaration (N : Node_Id) is
+ begin
+ -- Unconditionally remove all side effects from the name
+
+ Evaluate_Name (Name (N));
+ end Expand_Alfa_N_Object_Renaming_Declaration;
+
-------------------------------------------
-- Expand_Alfa_N_Simple_Return_Statement --
-------------------------------------------
@@ -218,7 +242,6 @@ package body Exp_Alfa is
E_Entry |
E_Entry_Family |
E_Return_Statement =>
- -- Expand_Non_Function_Return (N);
null;
when others =>
@@ -265,4 +288,22 @@ package body Exp_Alfa is
end if;
end Expand_Alfa_Simple_Function_Return;
+ -------------------------------
+ -- Expand_Potential_Renaming --
+ -------------------------------
+
+ procedure Expand_Potential_Renaming (N : Node_Id) is
+ E : constant Entity_Id := Entity (N);
+ T : constant Entity_Id := Etype (N);
+
+ begin
+ -- Replace a reference to a renaming with the actual renamed object
+
+ if Ekind (E) in Object_Kind and then Present (Renamed_Object (E)) then
+ Rewrite (N, New_Copy_Tree (Renamed_Object (E)));
+ Reset_Analyzed_Flags (N);
+ Analyze_And_Resolve (N, T);
+ end if;
+ end Expand_Potential_Renaming;
+
end Exp_Alfa;
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index db8f6a30d5d..57e94d29840 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -4046,13 +4046,13 @@ package body Exp_Attr is
X : constant Node_Id := Prefix (N);
Y : constant Node_Id := First (Expressions (N));
- -- The argumens
+ -- The arguments
X_Addr, Y_Addr : Node_Id;
- -- the expressions for their addresses
+ -- Rhe expressions for their addresses
X_Size, Y_Size : Node_Id;
- -- the expressions for their sizes
+ -- Rhe expressions for their sizes
begin
-- The attribute is expanded as:
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index dca021f9237..b2bf98cd1db 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -334,7 +334,7 @@ package body Exp_Ch11 is
-- raise statements into gotos, e.g. all N_Raise_xxx_Error nodes are
-- left unchanged and passed to the back end.
- -- Instead, the front end generates two nodes
+ -- Instead, the front end generates three nodes
-- N_Push_Constraint_Error_Label
-- N_Push_Program_Error_Label
@@ -356,6 +356,10 @@ package body Exp_Ch11 is
-- field in the Push node will be empty signifying that for this region
-- of code, no optimization is possible.
+ -- These Push/Pop nodes are inhibited if No_Exception_Handlers is set
+ -- since they are useless in this case, and in CodePeer mode, where
+ -- they serve no purpose and can intefere with the analysis.
+
-- The back end must maintain three stacks, one for each exception case,
-- the Push node pushes an entry onto the corresponding stack, and Pop
-- node pops off the entry. Then instead of calling Rcheck_nn, if the
@@ -503,6 +507,12 @@ package body Exp_Ch11 is
procedure Generate_Push_Pop (H : Node_Id) is
begin
+ if Restriction_Active (No_Exception_Handlers)
+ or else CodePeer_Mode
+ then
+ return;
+ end if;
+
if Exc_Locally_Handled then
return;
else
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index a71ce69602e..80f381b82a1 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -401,46 +401,39 @@ package body Exp_Ch2 is
-- Set Atomic_Sync_Required if necessary for atomic variable
- if Is_Atomic (E) then
+ if Nkind_In (N, N_Identifier, N_Expanded_Name)
+ and then Ekind (E) = E_Variable
+ and then (Is_Atomic (E) or else Is_Atomic (Etype (E)))
+ then
declare
Set : Boolean;
- MLoc : Node_Id;
begin
- -- Always set if debug flag d.e is set
+ -- If variable is atomic, but type is not, setting depends on
+ -- disable/enable state for the variable.
- if Debug_Flag_Dot_E then
- Set := True;
+ if Is_Atomic (E) and then not Is_Atomic (Etype (E)) then
+ Set := not Atomic_Synchronization_Disabled (E);
- -- Never set if debug flag d.d is set
+ -- If variable is not atomic, but its type is atomic, setting
+ -- depends on disable/enable state for the type.
- elsif Debug_Flag_Dot_D then
- Set := False;
+ elsif not Is_Atomic (E) and then Is_Atomic (Etype (E)) then
+ Set := not Atomic_Synchronization_Disabled (Etype (E));
- -- Otherwise setting comes from Atomic_Synchronization state
+ -- Else both variable and type are atomic (see outer if), and we
+ -- disable if either variable or its type have sync disabled.
else
- Set := not Atomic_Synchronization_Disabled (E);
+ Set := (not Atomic_Synchronization_Disabled (E))
+ and then
+ (not Atomic_Synchronization_Disabled (Etype (E)));
end if;
-- Set flag if required
if Set then
-
- -- Generate info message if requested
-
- if Warn_On_Atomic_Synchronization then
- if Nkind (N) = N_Identifier then
- MLoc := N;
- else
- MLoc := Selector_Name (N);
- end if;
-
- Error_Msg_N
- ("?info: atomic synchronization set for &", MLoc);
- end if;
-
- Set_Atomic_Sync_Required (N);
+ Activate_Atomic_Synchronization (N);
end if;
end;
end if;
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 87e02d0e1ee..d2f0668873e 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -591,8 +591,7 @@ package body Exp_Ch4 is
-- 1) Get access to the allocated object
Rewrite (N,
- Make_Explicit_Dereference (Loc,
- Relocate_Node (N)));
+ Make_Explicit_Dereference (Loc, Relocate_Node (N)));
Set_Etype (N, Etyp);
Set_Analyzed (N);
@@ -2615,12 +2614,7 @@ package body Exp_Ch4 is
-- Result of the concatenation (of type Ityp)
Actions : constant List_Id := New_List;
- -- Collect actions to be inserted if Save_Space is False
-
- Save_Space : Boolean;
- pragma Warnings (Off, Save_Space);
- -- Set to True if we are saving generated code space by calling routines
- -- in packages System.Concat_n.
+ -- Collect actions to be inserted
Known_Non_Null_Operand_Seen : Boolean;
-- Set True during generation of the assignments of operands into
@@ -4472,6 +4466,15 @@ package body Exp_Ch4 is
-- Insert explicit dereference call for the checked storage pool case
Insert_Dereference_Action (Prefix (N));
+
+ -- If the type is an Atomic type for which Atomic_Sync is enabled, then
+ -- we set the atomic sync flag.
+
+ if Is_Atomic (Etype (N))
+ and then not Atomic_Synchronization_Disabled (Etype (N))
+ then
+ Activate_Atomic_Synchronization (N);
+ end if;
end Expand_N_Explicit_Dereference;
--------------------------------------
@@ -5245,6 +5248,7 @@ package body Exp_Ch4 is
Typ : constant Entity_Id := Etype (N);
P : constant Node_Id := Prefix (N);
T : constant Entity_Id := Etype (P);
+ Atp : Entity_Id;
begin
-- A special optimization, if we have an indexed component that is
@@ -5290,6 +5294,9 @@ package body Exp_Ch4 is
if Is_Access_Type (T) then
Insert_Explicit_Dereference (P);
Analyze_And_Resolve (P, Designated_Type (T));
+ Atp := Designated_Type (T);
+ else
+ Atp := T;
end if;
-- Generate index and validity checks
@@ -5300,6 +5307,17 @@ package body Exp_Ch4 is
Apply_Subscript_Validity_Checks (N);
end if;
+ -- If selecting from an array with atomic components, and atomic sync
+ -- is not suppressed for this array type, set atomic sync flag.
+
+ if (Has_Atomic_Components (Atp)
+ and then not Atomic_Synchronization_Disabled (Atp))
+ or else (Is_Atomic (Typ)
+ and then not Atomic_Synchronization_Disabled (Typ))
+ then
+ Activate_Atomic_Synchronization (N);
+ end if;
+
-- All done for the non-packed case
if not Is_Packed (Etype (Prefix (N))) then
@@ -7869,9 +7887,6 @@ package body Exp_Ch4 is
-- Expand_N_Selected_Component --
---------------------------------
- -- If the selector is a discriminant of a concurrent object, rewrite the
- -- prefix to denote the corresponding record type.
-
procedure Expand_N_Selected_Component (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Par : constant Node_Id := Parent (N);
@@ -8175,6 +8190,46 @@ package body Exp_Ch4 is
Rewrite (N, New_N);
Analyze (N);
end if;
+
+ -- Set Atomic_Sync_Required if necessary for atomic component
+
+ if Nkind (N) = N_Selected_Component then
+ declare
+ E : constant Entity_Id := Entity (Selector_Name (N));
+ Set : Boolean;
+
+ begin
+ -- If component is atomic, but type is not, setting depends on
+ -- disable/enable state for the component.
+
+ if Is_Atomic (E) and then not Is_Atomic (Etype (E)) then
+ Set := not Atomic_Synchronization_Disabled (E);
+
+ -- If component is not atomic, but its type is atomic, setting
+ -- depends on disable/enable state for the type.
+
+ elsif not Is_Atomic (E) and then Is_Atomic (Etype (E)) then
+ Set := not Atomic_Synchronization_Disabled (Etype (E));
+
+ -- If both component and type are atomic, we disable if either
+ -- component or its type have sync disabled.
+
+ elsif Is_Atomic (E) and then Is_Atomic (Etype (E)) then
+ Set := (not Atomic_Synchronization_Disabled (E))
+ and then
+ (not Atomic_Synchronization_Disabled (Etype (E)));
+
+ else
+ Set := False;
+ end if;
+
+ -- Set flag if required
+
+ if Set then
+ Activate_Atomic_Synchronization (N);
+ end if;
+ end;
+ end if;
end Expand_N_Selected_Component;
--------------------
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 971d0ad65d2..fd75b158449 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1461,7 +1461,22 @@ package body Exp_Ch5 is
end if;
if Is_Unchecked_Union (Base_Type (R_Typ)) then
- Insert_Action (N, Make_Field_Assign (CF, True));
+
+ -- Within an initialization procedure this is the
+ -- assignment to an unchecked union component, in which
+ -- case there is no discriminant to initialize.
+
+ if Inside_Init_Proc then
+ null;
+
+ else
+ -- The assignment is part of a conversion from a
+ -- derived unchecked union type with an inferable
+ -- discriminant, to a parent type.
+
+ Insert_Action (N, Make_Field_Assign (CF, True));
+ end if;
+
else
Insert_Action (N, Make_Field_Assign (CF));
end if;
@@ -3105,32 +3120,32 @@ package body Exp_Ch5 is
end loop;
-- Generate:
- -- Id : Element_Type renames Pack.Element (Cursor);
+ -- Id : Element_Type renames Container (Cursor);
+ -- This assumes that the container type has an indexing
+ -- operation with Cursor. The check that this operation
+ -- exists is performed in Check_Container_Indexing.
Decl :=
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Id,
- Subtype_Mark =>
+ Subtype_Mark =>
New_Reference_To (Element_Type, Loc),
- Name =>
+ Name =>
Make_Indexed_Component (Loc,
- Prefix => Make_Selected_Component (Loc,
- Prefix => New_Reference_To (Pack, Loc),
- Selector_Name =>
- Make_Identifier (Loc, Chars => Name_Element)),
+ Prefix => Relocate_Node (Container_Arg),
Expressions =>
New_List (New_Occurrence_Of (Cursor, Loc))));
-- If the container holds controlled objects, wrap the loop
-- statements and element renaming declaration with a block.
- -- This ensures that the result of Element (Iterator) is
+ -- This ensures that the result of Element (Cusor) is
-- cleaned up after each iteration of the loop.
if Needs_Finalization (Element_Type) then
-- Generate:
-- declare
- -- Id : Element_Type := Pack.Element (Iterator);
+ -- Id : Element_Type := Pack.Element (curosr);
-- begin
-- <original loop statements>
-- end;
@@ -3264,9 +3279,11 @@ package body Exp_Ch5 is
-- The Iterator is not modified in the source, but of course will
-- be updated in the generated code. Indicate that it is actually
- -- set to prevent spurious warnings.
+ -- set to prevent spurious warnings. Ditto for the Cursor, which
+ -- is modified indirectly in generated code.
Set_Never_Set_In_Source (Iterator, False);
+ Set_Never_Set_In_Source (Cursor, False);
-- If the range of iteration is given by a function call that
-- returns a container, the finalization actions have been saved
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 993fa40c3fa..6049c452cb8 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -2652,10 +2652,13 @@ package body Exp_Ch6 is
end if;
end if;
- -- For Ada 2012, if a parameter is aliased, the actual must be an
- -- aliased object.
+ -- For Ada 2012, if a parameter is aliased, the actual must be a
+ -- tagged type or an aliased view of an object.
- if Is_Aliased (Formal) and then not Is_Aliased_View (Actual) then
+ if Is_Aliased (Formal)
+ and then not Is_Aliased_View (Actual)
+ and then not Is_Tagged_Type (Etype (Formal))
+ then
Error_Msg_NE
("actual for aliased formal& must be aliased object",
Actual, Formal);
@@ -5679,10 +5682,14 @@ package body Exp_Ch6 is
end if;
-- If local-exception-to-goto optimization active, insert dummy push
- -- statements at start, and dummy pop statements at end.
+ -- statements at start, and dummy pop statements at end, but inhibit
+ -- this if we have No_Exception_Handlers, since they are useless and
+ -- intefere with analysis, e.g. by codepeer.
if (Debug_Flag_Dot_G
or else Restriction_Active (No_Exception_Propagation))
+ and then not Restriction_Active (No_Exception_Handlers)
+ and then not CodePeer_Mode
and then Is_Non_Empty_List (L)
then
declare
diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb
index af33868b799..a0e9d4cf1be 100644
--- a/gcc/ada/exp_ch8.adb
+++ b/gcc/ada/exp_ch8.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -50,7 +50,6 @@ package body Exp_Ch8 is
procedure Expand_N_Exception_Renaming_Declaration (N : Node_Id) is
Decl : constant Node_Id := Debug_Renaming_Declaration (N);
-
begin
if Present (Decl) then
Insert_Action (N, Decl);
@@ -91,114 +90,17 @@ package body Exp_Ch8 is
procedure Expand_N_Object_Renaming_Declaration (N : Node_Id) is
Nam : constant Node_Id := Name (N);
- T : Entity_Id;
Decl : Node_Id;
-
- procedure Evaluate_Name (Fname : Node_Id);
- -- A recursive procedure used to freeze a name in the sense described
- -- above, i.e. any variable references or function calls are removed.
- -- Of course the outer level variable reference must not be removed.
- -- For example in A(J,F(K)), A is left as is, but J and F(K) are
- -- evaluated and removed.
+ T : Entity_Id;
function Evaluation_Required (Nam : Node_Id) return Boolean;
- -- Determines whether it is necessary to do static name evaluation
- -- for renaming of Nam. It is considered necessary if evaluating the
- -- name involves indexing a packed array, or extracting a component
- -- of a record to which a component clause applies. Note that we are
- -- only interested in these operations if they occur as part of the
- -- name itself, subscripts are just values that are computed as part
- -- of the evaluation, so their form is unimportant.
-
- -------------------
- -- Evaluate_Name --
- -------------------
-
- procedure Evaluate_Name (Fname : Node_Id) is
- K : constant Node_Kind := Nkind (Fname);
- E : Node_Id;
-
- begin
- -- For an explicit dereference, we simply force the evaluation
- -- of the name expression. The dereference provides a value that
- -- is the address for the renamed object, and it is precisely
- -- this value that we want to preserve.
-
- if K = N_Explicit_Dereference then
- Force_Evaluation (Prefix (Fname));
-
- -- For a selected component, we simply evaluate the prefix
-
- elsif K = N_Selected_Component then
- Evaluate_Name (Prefix (Fname));
-
- -- For an indexed component, or an attribute reference, we evaluate
- -- the prefix, which is itself a name, recursively, and then force
- -- the evaluation of all the subscripts (or attribute expressions).
-
- elsif Nkind_In (K, N_Indexed_Component, N_Attribute_Reference) then
- Evaluate_Name (Prefix (Fname));
-
- E := First (Expressions (Fname));
- while Present (E) loop
- Force_Evaluation (E);
-
- if Original_Node (E) /= E then
- Set_Do_Range_Check (E, Do_Range_Check (Original_Node (E)));
- end if;
-
- Next (E);
- end loop;
-
- -- For a slice, we evaluate the prefix, as for the indexed component
- -- case and then, if there is a range present, either directly or
- -- as the constraint of a discrete subtype indication, we evaluate
- -- the two bounds of this range.
-
- elsif K = N_Slice then
- Evaluate_Name (Prefix (Fname));
-
- declare
- DR : constant Node_Id := Discrete_Range (Fname);
- Constr : Node_Id;
- Rexpr : Node_Id;
-
- begin
- if Nkind (DR) = N_Range then
- Force_Evaluation (Low_Bound (DR));
- Force_Evaluation (High_Bound (DR));
-
- elsif Nkind (DR) = N_Subtype_Indication then
- Constr := Constraint (DR);
-
- if Nkind (Constr) = N_Range_Constraint then
- Rexpr := Range_Expression (Constr);
-
- Force_Evaluation (Low_Bound (Rexpr));
- Force_Evaluation (High_Bound (Rexpr));
- end if;
- end if;
- end;
-
- -- For a type conversion, the expression of the conversion must be
- -- the name of an object, and we simply need to evaluate this name.
-
- elsif K = N_Type_Conversion then
- Evaluate_Name (Expression (Fname));
-
- -- For a function call, we evaluate the call
-
- elsif K = N_Function_Call then
- Force_Evaluation (Fname);
-
- -- The remaining cases are direct name, operator symbol and
- -- character literal. In all these cases, we do nothing, since
- -- we want to reevaluate each time the renamed object is used.
-
- else
- return;
- end if;
- end Evaluate_Name;
+ -- Determines whether it is necessary to do static name evaluation for
+ -- renaming of Nam. It is considered necessary if evaluating the name
+ -- involves indexing a packed array, or extracting a component of a
+ -- record to which a component clause applies. Note that we are only
+ -- interested in these operations if they occur as part of the name
+ -- itself, subscripts are just values that are computed as part of the
+ -- evaluation, so their form is unimportant.
-------------------------
-- Evaluation_Required --
diff --git a/gcc/ada/exp_ch8.ads b/gcc/ada/exp_ch8.ads
index 7df54f3069a..1dc066c0f4b 100644
--- a/gcc/ada/exp_ch8.ads
+++ b/gcc/ada/exp_ch8.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index dd58b017d24..e675da82889 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -160,6 +160,76 @@ package body Exp_Util is
-- or body. Flag Nested_Constructs should be set when any nested packages
-- declared in L must be processed.
+ -------------------------------------
+ -- Activate_Atomic_Synchronization --
+ -------------------------------------
+
+ procedure Activate_Atomic_Synchronization (N : Node_Id) is
+ Msg_Node : Node_Id;
+
+ begin
+ case Nkind (Parent (N)) is
+
+ -- Check for cases of appearing in the prefix of a construct where
+ -- we don't need atomic synchronization for this kind of usage.
+
+ when
+ -- Nothing to do if we are the prefix of an attribute, since we
+ -- do not want an atomic sync operation for things like 'Size.
+
+ N_Attribute_Reference |
+
+ -- The N_Reference node is like an attribute
+
+ N_Reference |
+
+ -- Nothing to do for a reference to a component (or components)
+ -- of a composite object. Only reads and updates of the object
+ -- as a whole require atomic synchronization (RM C.6 (15)).
+
+ N_Indexed_Component |
+ N_Selected_Component |
+ N_Slice =>
+
+ -- For all the above cases, nothing to do if we are the prefix
+
+ if Prefix (Parent (N)) = N then
+ return;
+ end if;
+
+ when others => null;
+ end case;
+
+ -- Go ahead and set the flag
+
+ Set_Atomic_Sync_Required (N);
+
+ -- Generate info message if requested
+
+ if Warn_On_Atomic_Synchronization then
+ case Nkind (N) is
+ when N_Identifier =>
+ Msg_Node := N;
+
+ when N_Selected_Component | N_Expanded_Name =>
+ Msg_Node := Selector_Name (N);
+
+ when N_Explicit_Dereference | N_Indexed_Component =>
+ Msg_Node := Empty;
+
+ when others =>
+ pragma Assert (False);
+ return;
+ end case;
+
+ if Present (Msg_Node) then
+ Error_Msg_N ("?info: atomic synchronization set for &", Msg_Node);
+ else
+ Error_Msg_N ("?info: atomic synchronization set", N);
+ end if;
+ end if;
+ end Activate_Atomic_Synchronization;
+
----------------------
-- Adjust_Condition --
----------------------
@@ -1689,6 +1759,100 @@ package body Exp_Util is
and then not Restriction_Active (No_Local_Allocators);
end Entry_Names_OK;
+ -------------------
+ -- Evaluate_Name --
+ -------------------
+
+ procedure Evaluate_Name (Nam : Node_Id) is
+ K : constant Node_Kind := Nkind (Nam);
+
+ begin
+ -- For an explicit dereference, we simply force the evaluation of the
+ -- name expression. The dereference provides a value that is the address
+ -- for the renamed object, and it is precisely this value that we want
+ -- to preserve.
+
+ if K = N_Explicit_Dereference then
+ Force_Evaluation (Prefix (Nam));
+
+ -- For a selected component, we simply evaluate the prefix
+
+ elsif K = N_Selected_Component then
+ Evaluate_Name (Prefix (Nam));
+
+ -- For an indexed component, or an attribute reference, we evaluate the
+ -- prefix, which is itself a name, recursively, and then force the
+ -- evaluation of all the subscripts (or attribute expressions).
+
+ elsif Nkind_In (K, N_Indexed_Component, N_Attribute_Reference) then
+ Evaluate_Name (Prefix (Nam));
+
+ declare
+ E : Node_Id;
+
+ begin
+ E := First (Expressions (Nam));
+ while Present (E) loop
+ Force_Evaluation (E);
+
+ if Original_Node (E) /= E then
+ Set_Do_Range_Check (E, Do_Range_Check (Original_Node (E)));
+ end if;
+
+ Next (E);
+ end loop;
+ end;
+
+ -- For a slice, we evaluate the prefix, as for the indexed component
+ -- case and then, if there is a range present, either directly or as the
+ -- constraint of a discrete subtype indication, we evaluate the two
+ -- bounds of this range.
+
+ elsif K = N_Slice then
+ Evaluate_Name (Prefix (Nam));
+
+ declare
+ DR : constant Node_Id := Discrete_Range (Nam);
+ Constr : Node_Id;
+ Rexpr : Node_Id;
+
+ begin
+ if Nkind (DR) = N_Range then
+ Force_Evaluation (Low_Bound (DR));
+ Force_Evaluation (High_Bound (DR));
+
+ elsif Nkind (DR) = N_Subtype_Indication then
+ Constr := Constraint (DR);
+
+ if Nkind (Constr) = N_Range_Constraint then
+ Rexpr := Range_Expression (Constr);
+
+ Force_Evaluation (Low_Bound (Rexpr));
+ Force_Evaluation (High_Bound (Rexpr));
+ end if;
+ end if;
+ end;
+
+ -- For a type conversion, the expression of the conversion must be the
+ -- name of an object, and we simply need to evaluate this name.
+
+ elsif K = N_Type_Conversion then
+ Evaluate_Name (Expression (Nam));
+
+ -- For a function call, we evaluate the call
+
+ elsif K = N_Function_Call then
+ Force_Evaluation (Nam);
+
+ -- The remaining cases are direct name, operator symbol and character
+ -- literal. In all these cases, we do nothing, since we want to
+ -- reevaluate each time the renamed object is used.
+
+ else
+ return;
+ end if;
+ end Evaluate_Name;
+
---------------------
-- Evolve_And_Then --
---------------------
@@ -4203,9 +4367,14 @@ package body Exp_Util is
return True;
end if;
- -- Case of component reference
+ -- Case of indexed component reference: test whether prefix is unaligned
- if Nkind (N) = N_Selected_Component then
+ if Nkind (N) = N_Indexed_Component then
+ return Is_Possibly_Unaligned_Object (Prefix (N));
+
+ -- Case of selected component reference
+
+ elsif Nkind (N) = N_Selected_Component then
declare
P : constant Node_Id := Prefix (N);
C : constant Entity_Id := Entity (Selector_Name (N));
@@ -5846,11 +6015,11 @@ package body Exp_Util is
Exp_Type : constant Entity_Id := Etype (Exp);
Svg_Suppress : constant Suppress_Array := Scope_Suppress;
Def_Id : Entity_Id;
+ E : Node_Id;
+ New_Exp : Node_Id;
+ Ptr_Typ_Decl : Node_Id;
Ref_Type : Entity_Id;
Res : Node_Id;
- Ptr_Typ_Decl : Node_Id;
- New_Exp : Node_Id;
- E : Node_Id;
function Side_Effect_Free (N : Node_Id) return Boolean;
-- Determines if the tree N represents an expression that is known not
@@ -6085,7 +6254,7 @@ package body Exp_Util is
-- A binary operator is side effect free if and both operands are
-- side effect free. For this purpose binary operators include
- -- membership tests and short circuit forms
+ -- membership tests and short circuit forms.
when N_Binary_Op | N_Membership_Test | N_Short_Circuit =>
return Side_Effect_Free (Left_Opnd (N))
@@ -6453,6 +6622,15 @@ package body Exp_Util is
-- Otherwise we generate a reference to the value
else
+ -- An expression which is in Alfa mode is considered side effect free
+ -- if the resulting value is captured by a variable or a constant.
+
+ if Alfa_Mode
+ and then Nkind (Parent (Exp)) = N_Object_Declaration
+ then
+ return;
+ end if;
+
-- Special processing for function calls that return a limited type.
-- We need to build a declaration that will enable build-in-place
-- expansion of the call. This is not done if the context is already
@@ -6461,10 +6639,10 @@ package body Exp_Util is
-- This is relevant only in Ada 2005 mode. In Ada 95 programs we have
-- to accommodate functions returning limited objects by reference.
- if Nkind (Exp) = N_Function_Call
+ if Ada_Version >= Ada_2005
+ and then Nkind (Exp) = N_Function_Call
and then Is_Immutably_Limited_Type (Etype (Exp))
and then Nkind (Parent (Exp)) /= N_Object_Declaration
- and then Ada_Version >= Ada_2005
then
declare
Obj : constant Entity_Id := Make_Temporary (Loc, 'F', Exp);
@@ -6484,32 +6662,57 @@ package body Exp_Util is
end;
end if;
- Ref_Type := Make_Temporary (Loc, 'A');
+ Def_Id := Make_Temporary (Loc, 'R', Exp);
+ Set_Etype (Def_Id, Exp_Type);
- Ptr_Typ_Decl :=
- Make_Full_Type_Declaration (Loc,
- Defining_Identifier => Ref_Type,
- Type_Definition =>
- Make_Access_To_Object_Definition (Loc,
- All_Present => True,
- Subtype_Indication =>
- New_Reference_To (Exp_Type, Loc)));
+ -- The regular expansion of functions with side effects involves the
+ -- generation of an access type to capture the return value found on
+ -- the secondary stack. Since Alfa (and why) cannot process access
+ -- types, use a different approach which ignores the secondary stack
+ -- and "copies" the returned object.
- E := Exp;
- Insert_Action (Exp, Ptr_Typ_Decl);
+ if Alfa_Mode then
+ Res := New_Reference_To (Def_Id, Loc);
+ Ref_Type := Exp_Type;
- Def_Id := Make_Temporary (Loc, 'R', Exp);
- Set_Etype (Def_Id, Exp_Type);
+ -- Regular expansion utilizing an access type and 'reference
- Res :=
- Make_Explicit_Dereference (Loc,
- Prefix => New_Reference_To (Def_Id, Loc));
+ else
+ Res :=
+ Make_Explicit_Dereference (Loc,
+ Prefix => New_Reference_To (Def_Id, Loc));
+
+ -- Generate:
+ -- type Ann is access all <Exp_Type>;
+ Ref_Type := Make_Temporary (Loc, 'A');
+
+ Ptr_Typ_Decl :=
+ Make_Full_Type_Declaration (Loc,
+ Defining_Identifier => Ref_Type,
+ Type_Definition =>
+ Make_Access_To_Object_Definition (Loc,
+ All_Present => True,
+ Subtype_Indication =>
+ New_Reference_To (Exp_Type, Loc)));
+
+ Insert_Action (Exp, Ptr_Typ_Decl);
+ end if;
+
+ E := Exp;
if Nkind (E) = N_Explicit_Dereference then
New_Exp := Relocate_Node (Prefix (E));
else
E := Relocate_Node (E);
- New_Exp := Make_Reference (Loc, E);
+
+ -- Do not generate a 'reference in Alfa mode since the access type
+ -- is not created in the first place.
+
+ if Alfa_Mode then
+ New_Exp := E;
+ else
+ New_Exp := Make_Reference (Loc, E);
+ end if;
end if;
if Is_Delayed_Aggregate (E) then
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index 1f0ee42fc5d..c0e0082185d 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -149,6 +149,14 @@ package Exp_Util is
-- Other Subprograms --
-----------------------
+ procedure Activate_Atomic_Synchronization (N : Node_Id);
+ -- N is a node for which atomic synchronization may be required (it is
+ -- either an identifier, expanded name, or selected/indexed component or
+ -- an explicit dereference). The caller has checked the basic conditions
+ -- (atomic variable appearing and Atomic_Sync not disabled). This function
+ -- checks if atomic synchronization is required and if so sets the flag
+ -- and if appropriate generates a warning (in -gnatw.n mode).
+
procedure Adjust_Condition (N : Node_Id);
-- The node N is an expression whose root-type is Boolean, and which
-- represents a boolean value used as a condition (i.e. a True/False
@@ -343,6 +351,11 @@ package Exp_Util is
-- which represent entry [family member] names. These strings are created
-- by the compiler and used by GDB.
+ procedure Evaluate_Name (Nam : Node_Id);
+ -- Remove the all side effects from a name which appears as part of an
+ -- object renaming declaration. More comments are needed here that explain
+ -- how this differs from Force_Evaluation and Remove_Side_Effects ???
+
procedure Evolve_And_Then (Cond : in out Node_Id; Cond1 : Node_Id);
-- Rewrites Cond with the expression: Cond and then Cond1. If Cond is
-- Empty, then simply returns Cond1 (this allows the use of Empty to
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 8c42fed255b..b1a33d58da1 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -4063,6 +4063,16 @@ package body Freeze is
Layout_Type (E);
end if;
+ -- If this is an access to subprogram whose designated type is itself
+ -- a subprogram type, the return type of this anonymous subprogram
+ -- type must be decorated as well.
+
+ if Ekind (E) = E_Anonymous_Access_Subprogram_Type
+ and then Ekind (Designated_Type (E)) = E_Subprogram_Type
+ then
+ Layout_Type (Etype (Designated_Type (E)));
+ end if;
+
-- If the type has a Defaut_Value/Default_Component_Value aspect,
-- this is where we analye the expression (after the type is frozen,
-- since in the case of Default_Value, we are analyzing with the
diff --git a/gcc/ada/g-excact.adb b/gcc/ada/g-excact.adb
index 1ba4cf8d64e..ed454cefcde 100644
--- a/gcc/ada/g-excact.adb
+++ b/gcc/ada/g-excact.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -97,7 +97,7 @@ package body GNAT.Exception_Actions is
function Name_To_Id (Name : String) return Exception_Id is
begin
- return To_Id (Internal_Exception (Name, False));
+ return To_Id (Internal_Exception (Name, Create_If_Not_Exist => False));
end Name_To_Id;
---------------------------------
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index bf1fe9fdde0..d48065a23f5 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -36,8 +36,8 @@ with Ada.Unchecked_Conversion;
with Interfaces.C.Strings;
-with GNAT.Sockets.Thin_Common; use GNAT.Sockets.Thin_Common;
-with GNAT.Sockets.Thin; use GNAT.Sockets.Thin;
+with GNAT.Sockets.Thin_Common; use GNAT.Sockets.Thin_Common;
+with GNAT.Sockets.Thin; use GNAT.Sockets.Thin;
with GNAT.Sockets.Linker_Options;
pragma Warnings (Off, GNAT.Sockets.Linker_Options);
@@ -246,11 +246,11 @@ package body GNAT.Sockets is
-- Type and Stream_Socket_Stream_Type.
procedure Wait_On_Socket
- (Socket : Socket_Type;
- For_Read : Boolean;
- Timeout : Selector_Duration;
- Selector : access Selector_Type := null;
- Status : out Selector_Status);
+ (Socket : Socket_Type;
+ For_Read : Boolean;
+ Timeout : Selector_Duration;
+ Selector : access Selector_Type := null;
+ Status : out Selector_Status);
-- Common code for variants of socket operations supporting a timeout:
-- block in Check_Selector on Socket for at most the indicated timeout.
-- If For_Read is True, Socket is added to the read set for this call, else
@@ -490,8 +490,8 @@ package body GNAT.Sockets is
-- that Fd is within range (otherwise behaviour is undefined).
elsif Fd < 0 or else Fd >= SOSC.FD_SETSIZE then
- raise Constraint_Error with "invalid value for socket set: "
- & Image (Fd);
+ raise Constraint_Error
+ with "invalid value for socket set: " & Image (Fd);
end if;
end Check_For_Fd_Set;
@@ -731,11 +731,11 @@ package body GNAT.Sockets is
-- Wait for socket to become available for writing
Wait_On_Socket
- (Socket => Socket,
- For_Read => False,
- Timeout => Timeout,
- Selector => Selector,
- Status => Status);
+ (Socket => Socket,
+ For_Read => False,
+ Timeout => Timeout,
+ Selector => Selector,
+ Status => Status);
-- Reset the socket to blocking I/O
@@ -1580,11 +1580,11 @@ package body GNAT.Sockets is
--------------------
procedure Wait_On_Socket
- (Socket : Socket_Type;
- For_Read : Boolean;
- Timeout : Selector_Duration;
- Selector : access Selector_Type := null;
- Status : out Selector_Status)
+ (Socket : Socket_Type;
+ For_Read : Boolean;
+ Timeout : Selector_Duration;
+ Selector : access Selector_Type := null;
+ Status : out Selector_Status)
is
type Local_Selector_Access is access Selector_Type;
for Local_Selector_Access'Storage_Size use Selector_Type'Size;
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 01983282ac7..462556265a6 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -432,8 +432,8 @@ package GNAT.Sockets is
Immediate : constant Duration := 0.0;
- Forever : constant Duration :=
- Duration'Min (Duration'Last, 1.0 * SOSC.MAX_tv_sec);
+ Forever : constant Duration :=
+ Duration'Min (Duration'Last, 1.0 * SOSC.MAX_tv_sec);
-- Largest possible Duration that is also a valid value for struct timeval
subtype Timeval_Duration is Duration range Immediate .. Forever;
@@ -1146,7 +1146,6 @@ private
R_Sig_Socket : Socket_Type := No_Socket;
W_Sig_Socket : Socket_Type := No_Socket;
-- Signalling sockets used to abort a select operation
-
end case;
end record;
@@ -1234,10 +1233,10 @@ private
end record;
type Service_Entry_Type (Aliases_Length : Natural) is record
- Official : Name_Type;
- Aliases : Name_Array (1 .. Aliases_Length);
- Port : Port_Type;
- Protocol : Name_Type;
+ Official : Name_Type;
+ Aliases : Name_Array (1 .. Aliases_Length);
+ Port : Port_Type;
+ Protocol : Name_Type;
end record;
type Request_Flag_Type is mod 2 ** 8;
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 43d42f658b5..221d326c6aa 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1773,11 +1773,12 @@ ada/exp_alfa.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
ada/exp_alfa.ads ada/exp_alfa.adb ada/exp_attr.ads ada/exp_ch4.ads \
- ada/exp_ch6.ads ada/exp_dbug.ads ada/gnat.ads ada/g-htable.ads \
- ada/hostparm.ads ada/interfac.ads ada/namet.ads ada/namet.adb \
- ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
- ada/rtsfind.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_res.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/exp_ch6.ads ada/exp_dbug.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem_aux.ads \
+ ada/sem_aux.adb ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
@@ -1953,32 +1954,35 @@ ada/exp_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/exp_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads \
- ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
- ada/elists.adb ada/err_vars.ads ada/errout.ads ada/errout.adb \
- ada/erroutc.ads ada/erroutc.adb ada/exp_ch2.ads ada/exp_ch2.adb \
- ada/exp_code.ads ada/exp_smem.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_vfpt.ads ada/expander.ads ada/fname.ads ada/gnat.ads \
- ada/g-htable.ads ada/gnatvsn.ads ada/hlo.ads ada/hostparm.ads \
- ada/inline.ads ada/interfac.ads ada/lib.ads ada/lib-load.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/rident.ads \
- ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
- ada/sem_aux.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
- ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads \
- ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
- ada/sem_ch9.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/stylesw.ads ada/system.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/atree.adb 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/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/errout.adb ada/erroutc.ads ada/erroutc.adb ada/eval_fat.ads \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch2.adb ada/exp_ch4.ads \
+ ada/exp_code.ads ada/exp_pakd.ads ada/exp_smem.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_vfpt.ads ada/expander.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/gnatvsn.ads ada/hlo.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/lib.ads ada/lib-load.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/sem.ads ada/sem.adb \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch10.ads ada/sem_ch11.ads \
+ ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads \
+ ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \
+ ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_eval.ads ada/sem_prag.ads \
+ ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sem_warn.adb \
+ 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/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -4066,42 +4070,42 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/validsw.ads ada/warnsw.ads ada/widechar.ads
ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
- ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
- ada/atree.ads ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \
- ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
- ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
- ada/errout.adb ada/erroutc.ads ada/erroutc.adb ada/eval_fat.ads \
- ada/exp_ch11.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_code.ads \
- ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
- ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/gnatvsn.ads \
- ada/hlo.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-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/namet.adb ada/namet-sp.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \
- ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_ch10.ads \
- ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
- ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch4.adb ada/sem_ch5.ads \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads \
- ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
- ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_prag.ads \
- ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/errout.adb \
+ ada/erroutc.ads ada/erroutc.adb ada/eval_fat.ads ada/exp_ch11.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_code.ads ada/exp_disp.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesorg.ads ada/g-htable.ads ada/gnatvsn.ads ada/hlo.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-util.ads ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/par_sco.ads \
+ ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_case.ads \
+ ada/sem_case.adb ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads \
+ ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads \
+ ada/sem_ch4.ads ada/sem_ch4.adb ada/sem_ch5.ads ada/sem_ch6.ads \
+ ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_disp.ads \
+ ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_intr.ads ada/sem_prag.ads ada/sem_res.ads \
+ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 990a6987736..d9215dfb092 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2116,7 +2116,6 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
SO_OPTS = -shared-libgcc
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-darwin.ads \
- i-forbla.adb<i-forbla-darwin.adb \
s-inmaop.adb<s-inmaop-posix.adb \
s-osinte.adb<s-osinte-darwin.adb \
s-osinte.ads<s-osinte-darwin.ads \
@@ -2238,10 +2237,8 @@ LIBGNAT_OBJS = adadecode.o adaint.o argv.o cio.o cstreams.o ctrl_c.o \
include $(fsrcdir)/ada/Makefile.rtl
-GNATRTL_LINEARALGEBRA_OBJS = i-forbla.o i-forlap.o
-
GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
- $(GNATRTL_LINEARALGEBRA_OBJS) memtrack.o
+ memtrack.o
# Default run time files
@@ -2538,9 +2535,6 @@ gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
$(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
$(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
$(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
- $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
- $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
ifeq ($(GMEM_LIB),gmemlib)
$(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
$(RTSDIR)/memtrack.o
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 49434430ecd..d7ca5dbbe6e 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -4185,7 +4185,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* The failure of this assertion will very likely come from an
order of elaboration issue for the type of the parameter. */
gcc_assert (kind == E_Subprogram_Type
- || !TYPE_IS_DUMMY_P (gnu_param_type));
+ || !TYPE_IS_DUMMY_P (gnu_param_type)
+ || type_annotate_only);
if (gnu_param)
{
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 513bca20642..2d342c347bc 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -5318,7 +5318,7 @@ This pragma signals that the entities whose names are listed are
deliberately not referenced in the current source unit. This
suppresses warnings about the
entities being unreferenced, and in addition a warning will be
-generated if one of these entities is in fact referenced in the
+generated if one of these entities is in fact subsequently referenced in the
same unit as the pragma (or in the corresponding body, or one
of its subunits).
@@ -5575,7 +5575,7 @@ as possibly modified by compiler switches. Then each pragma Warning
modifies this set of warnings as specified. This form of the pragma may
also be used as a configuration pragma.
-The fourth form, with an On|Off parameter and a string, is used to
+The fourth form, with an @code{On|Off} parameter and a string, is used to
control individual messages, based on their text. The string argument
is a pattern that is used to match against the text of individual
warning messages (not including the initial "warning: " tag).
@@ -5587,7 +5587,7 @@ message @code{warning: 960 bits of "a" unused}. No other regular
expression notations are permitted. All characters other than asterisk in
these three specific cases are treated as literal characters in the match.
-There are two ways to use this pragma. The OFF form can be used as a
+There are two ways to use the pragma in this form. The OFF form can be used as a
configuration pragma. The effect is to suppress all warnings (if any)
that match the pattern string throughout the compilation.
@@ -5604,6 +5604,13 @@ pragma Warnings (On, Pattern);
In this usage, the pattern string must match in the Off and On pragmas,
and at least one matching warning must be suppressed.
+Note: to write a string that will match any warning, use the string
+@code{"***"}. It will not work to use a single asterisk or two asterisks
+since this looks like an operator name. This form with three asterisks
+is similar in effect to specifying @code{pragma Warnings (Off)} except that a
+matching @code{pragma Warnings (On, "***")} will be required. This can be
+helpful in avoiding forgetting to turn warnings back on.
+
Note: the debug flag -gnatd.i (@code{/NOWARNINGS_PRAGMAS} in VMS) can be
used to cause the compiler to entirely ignore all WARNINGS pragmas. This can
be useful in checking whether obsolete pragmas in existing programs are hiding
@@ -9117,6 +9124,17 @@ only declared at the library level.
This restriction ensures at compile time that there are no allocator
expressions that attempt to allocate protected objects.
+@item No_Relative_Delay
+@findex No_Relative_Delay
+This restriction ensures at compile time that there are no delay relative
+statements and prevents expressions such as @code{delay 1.23;} from appearing
+in source code.
+
+@item No_Requeue_Statements
+@findex No_Requeue_Statements
+This restriction ensures at compile time that no requeue statements are
+permitted and prevents keyword @code{requeue} from being used in source code.
+
@item No_Secondary_Stack
@findex No_Secondary_Stack
This restriction ensures at compile time that the generated code does not
@@ -9138,6 +9156,14 @@ use the standard default storage pool. Any access type declared must
have an explicit Storage_Pool attribute defined specifying a
user-defined storage pool.
+@item No_Stream_Optimizations
+@findex No_Stream_Optimizations
+This restriction affects the performance of stream operations on types
+@code{String}, @code{Wide_String} and @code{Wide_Wide_String}. By default, the
+compiler uses block reads and writes when manipulating @code{String} objects
+due to their supperior performance. When this restriction is in effect, the
+compiler performs all IO operations on a per-character basis.
+
@item No_Streams
@findex No_Streams
This restriction ensures at compile/bind time that there are no
@@ -10196,7 +10222,7 @@ floating-point standard.
Note that on machines that are not fully compliant with the IEEE
floating-point standard, such as Alpha, the @option{-mieee} compiler flag
-must be used for achieving IEEE confirming behavior (although at the cost
+must be used for achieving IEEE conforming behavior (although at the cost
of a significant performance penalty), so infinite and NaN values are
properly generated.
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index abf8093a8ed..253cfff172b 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -337,6 +337,7 @@ Performance Considerations
* Optimization Levels::
* Debugging Optimized Code::
* Inlining of Subprograms::
+* Vectorization of loops::
* Other Optimization Switches::
* Optimization and Strict Aliasing::
@ifset vms
@@ -475,11 +476,11 @@ Creating Unit Tests Using gnattest
* Switches for gnattest::
* Project Attributes for gnattest::
* Simple Example::
-* Setting Up and Tearing Down Testing Environment::
+* Setting Up and Tearing Down the Testing Environment::
* Regenerating Tests::
* Default Test Behavior::
* Testing Primitive Operations of Tagged Types::
-* Test Inheritance::
+* Testing Inheritance::
* Tagged Types Substitutability Testing::
* Testing with Contracts::
* Additional Tests::
@@ -5658,8 +5659,8 @@ This switch activates warnings to be generated for entities that
are declared but not referenced, and for units that are @code{with}'ed
and not
referenced. In the case of packages, a warning is also generated if
-no entities in the package are referenced. This means that if the package
-is referenced but the only references are in @code{use}
+no entities in the package are referenced. This means that if a with'ed
+package is referenced but the only references are in @code{use}
clauses or @code{renames}
declarations, a warning is still generated. A warning is also generated
for a generic package that is @code{with}'ed but never instantiated.
@@ -7154,7 +7155,10 @@ used, it must be used consistently throughout the program. However,
since brackets encoding is always recognized, it may be conveniently
used in standard libraries, allowing these libraries to be used with
any of the available coding schemes.
-scheme.
+
+Note that brackets encoding only applies to program text. Within comments,
+brackets are considered to be normal graphic characters, and bracket sequences
+are never recognized as wide characters.
If no @option{-gnatW?} parameter is present, then the default
representation is normally Brackets encoding only. However, if the
@@ -7168,6 +7172,27 @@ for Wide_Text_IO files if not specifically overridden by a WCEM form
parameter.
@end table
+
+When no @option{-gnatW?} is specified, then characters (other than wide
+characters represented using brackets notation) are treated as 8-bit
+Latin-1 codes. The codes recognized are the Latin-1 graphic characters,
+and ASCII format effectors (CR, LF, HT, VT). Other lower half control
+characters in the range 16#00#..16#1F# are not accepted in program text
+or in comments. Upper half control characters (16#80#..16#9F#) are rejected
+in program text, but allowed and ignored in comments. Note in particular
+that the Next Line (NEL) character whose encoding is 16#85# is not recognized
+as an end of line in this default mode. If your source program contains
+instances of the NEL character used as a line terminator,
+you must use UTF-8 encoding for the whole
+source program. In default mode, all lines must be ended by a standard
+end of line sequence (CR, CR/LF, or LF).
+
+Note that the convention of simply accepting all upper half characters in
+comments means that programs that use standard ASCII for program text, but
+UTF-8 encoding for comments are accepted in default mode, providing that the
+comments are ended by an appropriate (CR, or CR/LF, or LF) line terminator.
+This is a common mode for many programs with foreign language comments.
+
@node File Naming Control
@subsection File Naming Control
@@ -10150,6 +10175,7 @@ some guidelines on debugging optimized code.
* Optimization Levels::
* Debugging Optimized Code::
* Inlining of Subprograms::
+* Vectorization of loops::
* Other Optimization Switches::
* Optimization and Strict Aliasing::
@@ -10595,6 +10621,103 @@ that you should not automatically assume that @option{-O3} is better than
@option{-O2}, and indeed you should use @option{-O3} only if tests show that
it actually improves performance.
+@node Vectorization of loops
+@subsection Vectorization of loops
+@cindex Optimization Switches
+
+You can take advantage of the auto-vectorizer present in the @command{gcc}
+back end to vectorize loops with GNAT. The corresponding command line switch
+is @option{-ftree-vectorize} but, as it is enabled by default at @option{-O3}
+and other aggressive optimizations helpful for vectorization also are enabled
+by default at this level, using @option{-O3} directly is recommended.
+
+You also need to make sure that the target architecture features a supported
+SIMD instruction set. For example, for the x86 architecture, you should at
+least specify @option{-msse2} to get significant vectorization (but you don't
+need to specify it for x86-64 as it is part of the base 64-bit architecture).
+Similarly, for the PowerPC architecture, you should specify @option{-maltivec}.
+
+The preferred loop form for vectorization is the @code{for} iteration scheme.
+Loops with a @code{while} iteration scheme can also be vectorized if they are
+very simple, but the vectorizer will quickly give up otherwise. With either
+iteration scheme, the flow of control must be straight, in particular no
+@code{exit} statement may appear in the loop body. The loop may however
+contain a single nested loop, if it can be vectorized when considered alone:
+
+@smallexample @c ada
+@cartouche
+ A : array (1..4, 1..4) of Long_Float;
+ S : array (1..4) of Long_Float;
+
+ procedure Sum is
+ begin
+ for I in A'Range(1) loop
+ for J in A'Range(2) loop
+ S (I) := S (I) + A (I, J);
+ end loop;
+ end loop;
+ end Sum;
+@end cartouche
+@end smallexample
+
+The vectorizable operations depend on the targeted SIMD instruction set, but
+the adding and some of the multiplying operators are generally supported, as
+well as the logical operators for modular types. Note that, in the former
+case, enabling overflow checks, for example with @option{-gnato}, totally
+disables vectorization. The other checks are not supposed to have the same
+definitive effect, although compiling with @option{-gnatp} might well reveal
+cases where some checks do thwart vectorization.
+
+Type conversions may also prevent vectorization if they involve semantics that
+are not directly supported by the code generator or the SIMD instruction set.
+A typical example is direct conversion from floating-point to integer types.
+The solution in this case is to use the following idiom:
+
+@smallexample @c ada
+ Integer (S'Truncation (F))
+@end smallexample
+
+@noindent
+if @code{S} is the subtype of floating-point object @code{F}.
+
+In most cases, the vectorizable loops are loops that iterate over arrays.
+All kinds of array types are supported, i.e. constrained array types with
+static bounds:
+
+@smallexample @c ada
+ type Array_Type is array (1 .. 4) of Long_Float;
+@end smallexample
+
+@noindent
+constrained array types with dynamic bounds:
+
+@smallexample @c ada
+ type Array_Type is array (1 .. Q.N) of Long_Float;
+
+ type Array_Type is array (Q.K .. 4) of Long_Float;
+
+ type Array_Type is array (Q.K .. Q.N) of Long_Float;
+@end smallexample
+
+@noindent
+or unconstrained array types:
+
+@smallexample @c ada
+ type Array_Type is array (Positive range <>) of Long_Float;
+@end smallexample
+
+@noindent
+The quality of the generated code decreases when the dynamic aspect of the
+array type increases, the worst code being generated for unconstrained array
+types. This is so because, the less information the compiler has about the
+bounds of the array, the more fallback code it needs to generate in order to
+fix things up at run time.
+
+You can obtain information about the vectorization performed by the compiler
+by specifying @option{-ftree-vectorizer-verbose=N}. For more details of
+this switch, see @ref{Debugging Options,,Options for Debugging Your Program
+or GCC, gcc, Using the GNU Compiler Collection (GCC)}.
+
@node Other Optimization Switches
@subsection Other Optimization Switches
@cindex Optimization Switches
@@ -10602,10 +10725,9 @@ it actually improves performance.
Since @code{GNAT} uses the @command{gcc} back end, all the specialized
@command{gcc} optimization switches are potentially usable. These switches
have not been extensively tested with GNAT but can generally be expected
-to work. Examples of switches in this category are
-@option{-funroll-loops} and
-the various target-specific @option{-m} options (in particular, it has been
-observed that @option{-march=pentium4} can significantly improve performance
+to work. Examples of switches in this category are @option{-funroll-loops}
+and the various target-specific @option{-m} options (in particular, it has
+been observed that @option{-march=xxx} can significantly improve performance
on appropriate machines). For full details of these switches, see
@ref{Submodel Options,, Hardware Models and Configurations, gcc, Using
the GNU Compiler Collection (GCC)}.
@@ -17491,7 +17613,7 @@ option @option{^--no-exception^/NO_EXCEPTION^} (see below).
@section Running @command{gnatstub}
@noindent
-@command{gnatstub} has the command-line interface of the form
+@command{gnatstub} has a command-line interface of the form:
@smallexample
@c $ gnatstub @ovar{switches} @var{filename} @ovar{directory}
@@ -17673,34 +17795,34 @@ Verbose mode: generate version information.
@findex gnattest
@noindent
-@command{gnattest} is an ASIS-based utility that creates unit tests stubs
+@command{gnattest} is an ASIS-based utility that creates unit-test stubs
as well as a test driver infrastructure (harness). @command{gnattest} creates
a stub for each visible subprogram in the packages under consideration when
they do not exist already.
-In order to process source files from the project, @command{gnattest} has to
-semantically analyze these Ada sources. Therefore, test stubs can only be
-generated for legal Ada units. If a unit is dependent on some other units,
-those units should be among source files of the project or of other projects
+In order to process source files from a project, @command{gnattest} has to
+semantically analyze the sources. Therefore, test stubs can only be
+generated for legal Ada units. If a unit is dependent on other units,
+those units should be among the source files of the project or of other projects
imported by this one.
-Generated stubs and harness are based on the AUnit testing framework. AUnit is
-an Ada adaptation of the xxxUnit testing frameworks similar to JUnit for Java or
-CppUnit for C++. While it is advised that gnattest users read AUnit manual, deep
-knowledge of AUnit is not necessary for using gnattest. For correct operation of
-@command{gnattest} AUnit should be installed and aunit.gpr must be on the
-project path. This happens automatically when Aunit is installed at its default
-location.
+Generated stubs and harnesses are based on the AUnit testing framework. AUnit is
+an Ada adaptation of the xxxUnit testing frameworks, similar to JUnit for Java
+or CppUnit for C++. While it is advised that gnattest users read the AUnit
+manual, deep knowledge of AUnit is not necessary for using gnattest. For correct
+operation of @command{gnattest}, AUnit should be installed and aunit.gpr must be
+on the project path. This happens automatically when Aunit is installed at its
+default location.
@menu
* Running gnattest::
* Switches for gnattest::
* Project Attributes for gnattest::
* Simple Example::
-* Setting Up and Tearing Down Testing Environment::
+* Setting Up and Tearing Down the Testing Environment::
* Regenerating Tests::
* Default Test Behavior::
* Testing Primitive Operations of Tagged Types::
-* Test Inheritance::
+* Testing Inheritance::
* Tagged Types Substitutability Testing::
* Testing with Contracts::
* Additional Tests::
@@ -17711,7 +17833,7 @@ location.
@section Running @command{gnattest}
@noindent
-@command{gnattest} has the command-line interface of the form
+@command{gnattest} has a command-line interface of the form
@smallexample
@c $ gnattest @var{-Pprojname} @ovar{switches} @ovar{filename} @ovar{directory}
@@ -17724,30 +17846,29 @@ where
@table @var
@item -Pprojname
-specifies the project that allow locating the source files. When no [filenames]
-are provided on the command line, all project sources are used as input. This
-switch is mandatory.
+specifies the project defining the location of source files. When no
+file names are provided on the command line, all sources in the project
+are used as input. This switch is required.
@item --harness-dir=dirname
-specifies directory to put harness packages and project file for the test
-driver. The harness dir should be either specified by that switch or by
-corresponding attribute in the argument project file.
+specifies the directory that will hold the harness packages and project file
+for the test driver. The harness directory should be specified either by that
+switch or by the corresponding attribute in the project file.
@item filename
-is the name of the source file that contains a library unit package declaration
-for which a test package must be created. The file name may contain the path
-information.
+is the name of the source file containing the library unit package declaration
+for which a test package will be created. The file name may given with a path.
@item @samp{@var{gcc_switches}} is a list of switches for
-@command{gcc}. They will be passed on to all compiler invocations made by
-@command{gnatstub} to generate the ASIS trees. Here you can provide
+@command{gcc}. These switches will be passed on to all compiler invocations
+made by @command{gnatstub} to generate a set of ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
-Ada 2005 mode etc.
+Ada 2005 mode, etc.
@item switches
-is an optional sequence of switches as described in the next section
+is an optional sequence of switches as described in the next section.
@end table
@@ -17755,11 +17876,11 @@ is an optional sequence of switches as described in the next section
@itemize @bullet
@item automatic harness
-the harnessing code which is located in the harness-dir as specified on the
-comand line or in the project file. All this code is generated completely
-automatically and can be destroyed and regenerated at will. It is not
-recommended to modify manually this code since it might be overridden
-easily. The entry point in this harnessing code is the project file called
+the harness code, which is located either in the harness-dir as specified on
+the command line or in the project file. All of this code is generated
+completely automatically and can be destroyed and regenerated at will. It is not
+recommended to modify this code manually, since it could easily be overridden
+by mistake. The entry point in the harness code is the project file named
@command{test_driver.gpr}. Tests can be compiled and run using a command
such as:
@@ -17772,12 +17893,12 @@ test_runner
a test stub for each visible subprogram is created in a separate file, if it
doesn't exist already. By default, those separate test files are located in a
"tests" directory that is created in the directory containing the source file
-itself. if it is not appropriate to create the tests in subdirs of the source,
-option @option{--separate-root} can be used. So let say for instance that
-a source file my_unit.ads in directory src contains a visible subprogram Proc.
-Then, the corresponding unit test will be found in file
-src/tests/my_unit-tests-proc_<code>.adb. <code> is an signature encoding used to
-differentiate test names in case of overloading.
+itself. If it is not appropriate to create the tests in subdirectories of the
+source, option @option{--separate-root} can be used. For example, if a source
+file my_unit.ads in directory src contains a visible subprogram Proc, then
+the corresponding unit test will be found in file
+src/tests/my_unit-tests-proc_<code>.adb. <code> is a signature encoding used to
+differentiate test names in cases of overloading.
@end itemize
@node Switches for gnattest
@@ -17789,7 +17910,7 @@ differentiate test names in case of overloading.
@item --harness-only
@cindex @option{--harness-only} (@command{gnattest})
When this option is given, @command{gnattest} creates a harness for all
-sources treating them as test packages.
+sources, treating them as test packages.
@item --additional-tests=@var{projname}
@cindex @option{--additional-tests} (@command{gnattest})
@@ -17798,15 +17919,15 @@ manual tests to be added to the test suite.
@item -r
@cindex @option{-r} (@command{gnattest})
-Consider recursively all sources from all projects.
+Recursively consider all sources from all projects.
@item -q
@cindex @option{-q} (@command{gnattest})
-Supresses non-critical output messages.
+Suppresses noncritical output messages.
@item -v
@cindex @option{-v} (@command{gnattest})
-Verbose mode: generate version information.
+Verbose mode: generates version information.
@item --liskov
@cindex @option{--liskov} (@command{gnattest})
@@ -17820,14 +17941,14 @@ Specifies the default behavior of generated stubs. @var{val} can be either
@item --separate-root=@var{dirname}
@cindex @option{--separate-root} (@command{gnattest})
-Directory hierarchy of tested sources is recreated in the @var{dirname} directory,
-test packages are placed in corresponding dirs.
+The directory hierarchy of tested sources is recreated in the @var{dirname}
+directory, and test packages are placed in corresponding directories.
@item --subdir=@var{dirname}
@cindex @option{--subdir} (@command{gnattest})
-Test packages are placed in subdirectories. That's the default output mode since
-it does not require any additional input from the user. Subdirs called "tests"
-will be created by default.
+Test packages are placed in subdirectories. This is the default output mode
+since it does not require any additional input from the user. Subdirectories
+named "tests" will be created by default.
@end table
@@ -17838,36 +17959,36 @@ will be created by default.
@noindent
-Most of the command line options can be also given to the tool by adding
+Most of the command-line options can also be passed to the tool by adding
special attributes to the project file. Those attributes should be put in
-package gnattest. Here is the list of the attributes.
+package gnattest. Here is the list of attributes:
@itemize @bullet
@item Separate_Stub_Root
is used to select the same output mode as with the --separate-root option.
-This attribute cannot be used togather with Stub_Subdir.
+This attribute cannot be used together with Stub_Subdir.
@item Stub_Subdir
-is used to select the same output mode as with the --sudbir option.
-This attribute cannot be used togather with Separate_Stub_Root.
+is used to select the same output mode as with the --subdir option.
+This attribute cannot be used together with Separate_Stub_Root.
@item Harness_Dir
-is used to specify the directory to place harness packages and project
+is used to specify the directory in which to place harness packages and project
file for the test driver, otherwise specified by --harness-dir.
@item Additional_Tests
-is used to specify the project file otherwise given by
+is used to specify the project file, otherwise given by
--additional-tests switch.
@item Stubs_Default
is used to specify the default behaviour of test stubs, otherwise
-specified by --stub-default option. The value for this attribute
-shoul be either "pass" or "fail"
+specified by --stub-default option. The value of this attribute
+should be either "pass" or "fail".
@end itemize
-All those attributes can be overridden from command line if needed.
+Each of those attributes can be overridden from the command line if needed.
Other @command{gnattest} switches can also be passed via the project
file as an attribute list called GNATtest_Switches.
@@ -17877,19 +17998,19 @@ file as an attribute list called GNATtest_Switches.
@noindent
Let's take a very simple example using the first @command{gnattest} example
-located at
+located in:
@smallexample
<install_prefix>/share/examples/gnattest/simple
@end smallexample
-This project contains a simple package containing one subprogram. By running gnattest
+This project contains a simple package containing one subprogram. By running gnattest:
@smallexample
$ gnattest --harness-dir=driver -Psimple.gpr
@end smallexample
-a test driver is created in dir "driver". It can be compiled and run:
+a test driver is created in directory "driver". It can be compiled and run:
@smallexample
$ cd driver
@@ -17898,8 +18019,8 @@ $ test_runner
@end smallexample
One failed test with diagnosis "test not implemented" is reported.
-Since no special output option was specified the test package Simple.Tests
-is located in
+Since no special output option was specified, the test package Simple.Tests
+is located in:
@smallexample
<install_prefix>/share/examples/gnattest/simple/src/tests
@@ -17907,25 +18028,25 @@ is located in
For each package containing visible subprograms, a child test package is
generated. It contains one test routine per tested subprogram. Each
-declaration of test subprogram has a comment specifying to which tested
-subprogram it corresponds. All the test routines have separated bodies.
-The test routine locates at simple-tests-test_inc_5eaee3.adb has a single
-statement - procedure Assert. It has two arguments: the boolean expression
-which we want to check and the diagnosis message to display if the condition
-is false.
+declaration of a test subprogram has a comment specifying which tested
+subprogram it corresponds to. All of the test routines have separate bodies.
+The test routine located at simple-tests-test_inc_5eaee3.adb contains a single
+statement: a call to procedure Assert. It has two arguments: the Boolean
+expression we want to check and the diagnosis message to display if
+the condition is false.
That is where actual testing code should be written after a proper setup.
-An actual check can be performed by replacing the assert statement with
+An actual check can be performed by replacing the Assert call with:
@smallexample @c ada
Assert (Inc (1) = 2, "wrong incrementation");
@end smallexample
-After recompiling and running the test driver one successfully passed test
+After recompiling and running the test driver, one successfully passed test
is reported.
-@node Setting Up and Tearing Down Testing Environment
-@section Setting Up and Tearing Down Testing Environment
+@node Setting Up and Tearing Down the Testing Environment
+@section Setting Up and Tearing Down the Testing Environment
@noindent
@@ -17934,7 +18055,7 @@ Env_Mgmt that has two procedures: User_Set_Up and User_Tear_Down.
User_Set_Up is called before each test routine of the package and
User_Tear_Down is called after each test routine. Those two procedures can
be used to perform necessary initialization and finalization,
-memory allocation etc.
+memory allocation, etc.
@node Regenerating Tests
@section Regenerating Tests
@@ -17943,12 +18064,12 @@ memory allocation etc.
Bodies of test routines and env_mgmt packages are never overridden after they
have been created once. As long as the name of the subprogram, full expanded Ada
-names and order of its parameters are the same, the old test routine will
-fit in it's place and no test stub will be generated for this subprogram.
+names, and the order of its parameters is the same, the old test routine will
+fit in its place and no test stub will be generated for the subprogram.
This can be demonstrated with the previous example. By uncommenting declaration
and body of function Dec in simple.ads and simple.adb, running
-@command{gnattest} on the project and then running the test driver:
+@command{gnattest} on the project, and then running the test driver:
@smallexample
gnattest --harness-dir=driver -Psimple.gpr
@@ -17957,10 +18078,10 @@ gprbuild -Ptest_driver
test_runner
@end smallexample
-the old test is not replaced with a stub neither lost but a new test stub is
+the old test is not replaced with a stub, nor is it lost, but a new test stub is
created for function Dec.
-The only way for regenerating tests stubs is t oremove the previously created
+The only way of regenerating tests stubs is to remove the previously created
tests.
@node Default Test Behavior
@@ -17968,18 +18089,18 @@ tests.
@noindent
-Generated test driver can treat all unimplemented tests in two ways:
-either count them all as failed (this is usefull to see which tests are still
-left to implement) or as passed (to sort out unimplemented ones from those
-actually failing for a reason).
+The generated test driver can treat unimplemented tests in two ways:
+either count them all as failed (this is useful to see which tests are still
+left to implement) or as passed (to sort out unimplemented ones from those
+actually failing).
-Test driver accepts a switch to specify this behavior: --stub-default=val,
+The test driver accepts a switch to specify this behavior: --stub-default=val,
where val is either "pass" or "fail" (exactly as for @command{gnattest}).
The default behavior of the test driver is set with the same switch
-passed to gnattest when generating the test driver.
+as passed to gnattest when generating the test driver.
-Passing it to the driver generated on the first example
+Passing it to the driver generated on the first example:
@smallexample
test_runner --stub-default=pass
@@ -17992,15 +18113,15 @@ makes both tests pass, even the unimplemented one.
@noindent
-Creating test stubs for primitive operations of tagged types have a number
+Creation of test stubs for primitive operations of tagged types entails a number
of features. Test routines for all primitives of a given tagged type are
-placed in a separate child package named after the tagged type (so if you
-have tagged type T in package P all tests for primitives of T will be in
-P.T_Tests).
+placed in a separate child package named according to the tagged type. For
+example, if you have tagged type T in package P, all tests for primitives
+of T will be in P.T_Tests.
-By running gnattest on the second example (actual tests for this example
-are already written so no need to worry if the tool reports that 0 new stubs
-were generated).
+Consider running gnattest on the second example (note: actual tests for this
+example already exist, so there's no need to worry if the tool reports that
+no new stubs were generated):
@smallexample
cd <install_prefix>/share/examples/gnattest/tagged_rec
@@ -18008,42 +18129,42 @@ gnattest --harness-dir=driver -Ptagged_rec.gpr
@end smallexample
Taking a closer look at the test type declared in the test package
-Speed1.Controller_Tests is necessary. It is declared in
+Speed1.Controller_Tests is necessary. It is declared in:
@smallexample
<install_prefix>/share/examples/gnattest/tagged_rec/src/tests
@end smallexample
Test types are direct or indirect descendants of
-AUnit.Test_Fixtures.Test_Fixture type. For non-primitive tested subprograms
-there is no need for the user to care about them. However when generating
-test packages for primitive operations, there are some things the user
-should know.
+AUnit.Test_Fixtures.Test_Fixture type. In the case of nonprimitive tested
+subprograms, the user doesn't need to be concerned with them. However,
+when generating test packages for primitive operations, there are some things
+the user needs to know.
-Type Test_Controller has component that allows to assign it all kinds of
+Type Test_Controller has components that allow assignment of various
derivations of type Controller. And if you look at the specification of
-package Speed2.Auto_Controller, you can see, that Test_Auto_Controller
-actually derives from Test_Controller rather that AUnit type Test_Fixture.
-Thus test types repeat the hierarchy of tested types.
+package Speed2.Auto_Controller, you will see that Test_Auto_Controller
+actually derives from Test_Controller rather than AUnit type Test_Fixture.
+Thus, test types mirror the hierarchy of tested types.
The User_Set_Up procedure of Env_Mgmt package corresponding to a test package
-of primitive operations of type T assigns Fixture with a reference to an
-object of that exact type T. Notice however, that if the tagged type has
-discriminants, the User_Set_Up only has a commented template of setting
-up the fixture since filling the discriminant with actual value is up
+of primitive operations of type T assigns to Fixture a reference to an
+object of that exact type T. Notice, however, that if the tagged type has
+discriminants, the User_Set_Up only has a commented template for setting
+up the fixture, since filling the discriminant with actual value is up
to the user.
-The knowledge of the structure if test types allows to have additional testing
+The knowledge of the structure of test types allows additional testing
without additional effort. Those possibilities are described below.
-@node Test Inheritance
-@section Test Inheritance
+@node Testing Inheritance
+@section Testing Inheritance
@noindent
-Since test type hierarchy mimics the hierarchy of tested types, the
-inheritance of tests take place. An example of such inheritance can be
-shown by running the test driver generated for second example. As previously
+Since the test type hierarchy mimics the hierarchy of tested types, the
+inheritance of tests takes place. An example of such inheritance can be
+seen by running the test driver generated for the second example. As previously
mentioned, actual tests are already written for this example.
@smallexample
@@ -18052,8 +18173,8 @@ gprbuild -Ptest_driver
test_runner
@end smallexample
-There are 6 passed tests while there are only 5 testable subprograms. Test
-routine for function Speed has been inherited and ran against objects of the
+There are 6 passed tests while there are only 5 testable subprograms. The test
+routine for function Speed has been inherited and run against objects of the
derived type.
@node Tagged Types Substitutability Testing
@@ -18061,29 +18182,28 @@ derived type.
@noindent
-Tagged Types Substitutability Testing is a way of verifying by testing
-the Liskov substitution principle (LSP). LSP is a principle stating that if
+Tagged Types Substitutability Testing is a way of verifying the Liskov
+substitution principle (LSP) by testing. LSP is a principle stating that if
S is a subtype of T (in Ada, S is a derived type of tagged type T),
-then objects of type T may be replaced with objects of type S (i.e., objects
-of type S may be substituted for objects of type T), without altering any of
-the desirable properties of the program. When the properties of the program are
-expressed in the form of subprogram pre & postconditions, LSP is formulated
-as relations between the pre & post of primitive operations and the pre & post
-of theirs derived operations. The pre of a derived operation should not be
-stronger that the original pre, and the post of the derived operation should not
-be weaker than the original post. Those relations insure that verifying if a
-dyspatching call is safe can be done just with the pre & post of the root
-operation.
-
-Verifying LSP by testing consists in running all the unit tests associated with
+then objects of type T may be replaced with objects of type S (that is,
+objects of type S may be substituted for objects of type T), without
+altering any of the desirable properties of the program. When the properties
+of the program are expressed in the form of subprogram preconditions and
+postconditions (let's call them pre and post), LSP is formulated as relations
+between the pre and post of primitive operations and the pre and post of their
+derived operations. The pre of a derived operation should not be stronger than
+the original pre, and the post of the derived operation should not be weaker
+than the original post. Those relations ensure that verifying if a dispatching
+call is safe can be done just by using the pre and post of the root operation.
+
+Verifying LSP by testing consists of running all the unit tests associated with
the primitives of a given tagged type with objects of its derived types.
-In the example used by the previous section there clearly have a violation of LSP.
-The overriding primitive Adjust_Speed in package Speed2 removes the
+In the example used in the previous section, there was clearly a violation of
+LSP. The overriding primitive Adjust_Speed in package Speed2 removes the
functionality of the overridden primitive and thus doesn't respect LSP.
-Gnattest has a special option to run
-overridden parent tests against objects of the type which have overriding
-primitives.
+Gnattest has a special option to run overridden parent tests against objects
+of the type which have overriding primitives:
@smallexample
gnattest --harness-dir=driver --liskov -Ptagged_rec.gpr
@@ -18093,21 +18213,21 @@ test_runner
@end smallexample
While all the tests pass by themselves, the parent test for Adjust_Speed fails
-against object of derived type.
+against objects of the derived type.
@node Testing with Contracts
@section Testing with Contracts
@noindent
-@command{gnattest} supports pragmas Precondition, Postcondition and Test_Case.
-Test routines are generated one per each Test_Case associated with a tested
+@command{gnattest} supports pragmas Precondition, Postcondition, and Test_Case.
+Test routines are generated, one per each Test_Case associated with a tested
subprogram. Those test routines have special wrappers for tested functions
-that have composition of pre- and postcondition of the subprogram an
-"requires" and "ensures" of the Test_Case (depending on the mode pre- and post
-either count for Nominal mode or do not for Robustness mode).
+that have composition of pre- and postcondition of the subprogram with
+"requires" and "ensures" of the Test_Case (depending on the mode, pre and post
+either count for Nominal mode or do not count for Robustness mode).
-The third example demonstrates how it works:
+The third example demonstrates how this works:
@smallexample
cd <install_prefix>/share/examples/gnattest/contracts
@@ -18116,13 +18236,13 @@ gnattest --harness-dir=driver -Pcontracts.gpr
Putting actual checks within the range of the contract does not cause any
error reports. For example, for the test routine which corresponds to
-test case 1
+test case 1:
@smallexample @c ada
Assert (Sqrt (9.0) = 3.0, "wrong sqrt");
@end smallexample
-and for the test routine corresponding to test case 2
+and for the test routine corresponding to test case 2:
@smallexample @c ada
Assert (Sqrt (-5.0) = -1.0, "wrong error indication");
@@ -18136,9 +18256,9 @@ gprbuild -Ptest_driver
test_runner
@end smallexample
-However, by by changing 9.0 to 25.0 and 3.0 to 5.0 for example you can get
-a precondition violation for test case one. Also by putting any otherwise
-correct but positive pair of numbers to the second test routine you can also
+However, by changing 9.0 to 25.0 and 3.0 to 5.0, for example, you can get
+a precondition violation for test case one. Also, by using any otherwise
+correct but positive pair of numbers in the second test routine, you can also
get a precondition violation. Postconditions are checked and reported
the same way.
@@ -18146,21 +18266,23 @@ the same way.
@section Additional Tests
@noindent
-@command{gnattest} can add user written tests to the main suite of the test
-driver. @command{gnattest} traverses given packages and searches for test
+@command{gnattest} can add user-written tests to the main suite of the test
+driver. @command{gnattest} traverses the given packages and searches for test
routines. All procedures with a single in out parameter of a type which is
-a derivation of AUnit.Test_Fixtures.Test_Fixture declared in package
-specifications are added to the suites and then are executed by test driver.
-(Set_Up and Tear_Down are filtered out).
+derived from AUnit.Test_Fixtures.Test_Fixture and that are declared in package
+specifications are added to the suites and are then executed by the test driver.
+(Set_Up and Tear_Down are filtered out.)
-An example illustrates two ways of crating test harness for user written tests.
-Directory additional contains a AUnit based test driver written by hand.
+An example illustrates two ways of creating test harnesses for user-written
+tests. Directory additional_tests contains an AUnit-based test driver written
+by hand.
@smallexample
<install_prefix>/share/examples/gnattest/additional_tests/
@end smallexample
-To create a test driver for already written tests use --harness-only option:
+To create a test driver for already-written tests, use the --harness-only
+option:
@smallexample
gnattest -Padditional/harness/harness.gpr --harness-dir=harness_only \
@@ -18169,7 +18291,7 @@ gnatmake -Pharness_only/test_driver.gpr
harness_only/test_runner
@end smallexample
-Additional tests can also be executed together withgenerated tests:
+Additional tests can also be executed together with generated tests:
@smallexample
gnattest -Psimple.gpr --additional-tests=additional/harness/harness.gpr \
@@ -18187,8 +18309,8 @@ The tool currently does not support following features:
@itemize @bullet
@item generic tests for generic packages and package instantiations
-@item tests for protected operations and entries
-@item acpects Pre-, Postcondition and Test_Case
+@item tests for protected subprograms and entries
+@item aspects Precondition, Postcondition, and Test_Case
@end itemize
@c *********************************
diff --git a/gcc/ada/i-forbla.ads b/gcc/ada/i-forbla.ads
deleted file mode 100644
index 3910349a652..00000000000
--- a/gcc/ada/i-forbla.ads
+++ /dev/null
@@ -1,261 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- I N T E R F A C E S . F O R T R A N . B L A S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2006-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 thin binding to the standard Fortran BLAS library.
--- Documentation and a reference BLAS implementation is available from
--- ftp://ftp.netlib.org. The main purpose of this package is to facilitate
--- implementation of the Ada 2005 Ada.Numerics.Generic_Real_Arrays and
--- Ada.Numerics.Generic_Complex_Arrays packages. Bindings to other BLAS
--- routines may be added over time.
-
--- As actual linker arguments to link with the BLAS implementation differs
--- according to platform and chosen BLAS implementation, the linker arguments
--- are given in the body of this package. The body may need to be modified in
--- order to link with different BLAS implementations tuned to the specific
--- target.
-
-package Interfaces.Fortran.BLAS is
- pragma Pure;
- pragma Elaborate_Body;
-
- No_Trans : aliased constant Character := 'N';
- Trans : aliased constant Character := 'T';
- Conj_Trans : aliased constant Character := 'C';
-
- -- Vector types
-
- type Real_Vector is array (Integer range <>) of Real;
-
- type Complex_Vector is array (Integer range <>) of Complex;
-
- type Double_Precision_Vector is array (Integer range <>)
- of Double_Precision;
-
- type Double_Complex_Vector is array (Integer range <>) of Double_Complex;
-
- -- Matrix types
-
- type Real_Matrix is array (Integer range <>, Integer range <>)
- of Real;
-
- type Double_Precision_Matrix is array (Integer range <>, Integer range <>)
- of Double_Precision;
-
- type Complex_Matrix is array (Integer range <>, Integer range <>)
- of Complex;
-
- type Double_Complex_Matrix is array (Integer range <>, Integer range <>)
- of Double_Complex;
-
- -- BLAS Level 1
-
- function sdot
- (N : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1;
- Y : Real_Vector;
- Inc_Y : Integer := 1) return Real;
-
- function ddot
- (N : Positive;
- X : Double_Precision_Vector;
- Inc_X : Integer := 1;
- Y : Double_Precision_Vector;
- Inc_Y : Integer := 1) return Double_Precision;
-
- function cdotu
- (N : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1;
- Y : Complex_Vector;
- Inc_Y : Integer := 1) return Complex;
-
- function zdotu
- (N : Positive;
- X : Double_Complex_Vector;
- Inc_X : Integer := 1;
- Y : Double_Complex_Vector;
- Inc_Y : Integer := 1) return Double_Complex;
-
- function snrm2
- (N : Natural;
- X : Real_Vector;
- Inc_X : Integer := 1) return Real;
-
- function dnrm2
- (N : Natural;
- X : Double_Precision_Vector;
- Inc_X : Integer := 1) return Double_Precision;
-
- function scnrm2
- (N : Natural;
- X : Complex_Vector;
- Inc_X : Integer := 1) return Real;
-
- function dznrm2
- (N : Natural;
- X : Double_Complex_Vector;
- Inc_X : Integer := 1) return Double_Precision;
-
- -- BLAS Level 2
-
- procedure sgemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Real := 0.0;
- Y : in out Real_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- procedure dgemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Double_Precision := 1.0;
- A : Double_Precision_Matrix;
- Ld_A : Positive;
- X : Double_Precision_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Double_Precision := 0.0;
- Y : in out Double_Precision_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- procedure cgemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Complex := (1.0, 1.0);
- A : Complex_Matrix;
- Ld_A : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Complex := (0.0, 0.0);
- Y : in out Complex_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- procedure zgemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Double_Complex := (1.0, 1.0);
- A : Double_Complex_Matrix;
- Ld_A : Positive;
- X : Double_Complex_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Double_Complex := (0.0, 0.0);
- Y : in out Double_Complex_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- -- BLAS Level 3
-
- procedure sgemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Integer;
- B : Real_Matrix;
- Ld_B : Integer;
- Beta : Real := 0.0;
- C : in out Real_Matrix;
- Ld_C : Integer);
-
- procedure dgemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Double_Precision := 1.0;
- A : Double_Precision_Matrix;
- Ld_A : Integer;
- B : Double_Precision_Matrix;
- Ld_B : Integer;
- Beta : Double_Precision := 0.0;
- C : in out Double_Precision_Matrix;
- Ld_C : Integer);
-
- procedure cgemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Complex := (1.0, 1.0);
- A : Complex_Matrix;
- Ld_A : Integer;
- B : Complex_Matrix;
- Ld_B : Integer;
- Beta : Complex := (0.0, 0.0);
- C : in out Complex_Matrix;
- Ld_C : Integer);
-
- procedure zgemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Double_Complex := (1.0, 1.0);
- A : Double_Complex_Matrix;
- Ld_A : Integer;
- B : Double_Complex_Matrix;
- Ld_B : Integer;
- Beta : Double_Complex := (0.0, 0.0);
- C : in out Double_Complex_Matrix;
- Ld_C : Integer);
-
-private
- pragma Import (Fortran, cdotu, "cdotu_");
- pragma Import (Fortran, cgemm, "cgemm_");
- pragma Import (Fortran, cgemv, "cgemv_");
- pragma Import (Fortran, ddot, "ddot_");
- pragma Import (Fortran, dgemm, "dgemm_");
- pragma Import (Fortran, dgemv, "dgemv_");
- pragma Import (Fortran, dnrm2, "dnrm2_");
- pragma Import (Fortran, dznrm2, "dznrm2_");
- pragma Import (Fortran, scnrm2, "scnrm2_");
- pragma Import (Fortran, sdot, "sdot_");
- pragma Import (Fortran, sgemm, "sgemm_");
- pragma Import (Fortran, sgemv, "sgemv_");
- pragma Import (Fortran, snrm2, "snrm2_");
- pragma Import (Fortran, zdotu, "zdotu_");
- pragma Import (Fortran, zgemm, "zgemm_");
- pragma Import (Fortran, zgemv, "zgemv_");
-end Interfaces.Fortran.BLAS;
diff --git a/gcc/ada/i-forlap.ads b/gcc/ada/i-forlap.ads
deleted file mode 100644
index ebb08abe654..00000000000
--- a/gcc/ada/i-forlap.ads
+++ /dev/null
@@ -1,414 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- I N T E R F A C E S . F O R T R A N . L A P A C K --
--- --
--- S p e c --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
--- Package comment required if non-RM package ???
-
-with Interfaces.Fortran.BLAS;
-package Interfaces.Fortran.LAPACK is
- pragma Pure;
-
- type Integer_Vector is array (Integer range <>) of Integer;
-
- Upper : aliased constant Character := 'U';
- Lower : aliased constant Character := 'L';
-
- subtype Real_Vector is BLAS.Real_Vector;
- subtype Real_Matrix is BLAS.Real_Matrix;
- subtype Double_Precision_Vector is BLAS.Double_Precision_Vector;
- subtype Double_Precision_Matrix is BLAS.Double_Precision_Matrix;
- subtype Complex_Vector is BLAS.Complex_Vector;
- subtype Complex_Matrix is BLAS.Complex_Matrix;
- subtype Double_Complex_Vector is BLAS.Double_Complex_Vector;
- subtype Double_Complex_Matrix is BLAS.Double_Complex_Matrix;
-
- -- LAPACK Computational Routines
-
- -- gerfs Refines the solution of a system of linear equations with
- -- a general matrix and estimates its error
- -- getrf Computes LU factorization of a general m-by-n matrix
- -- getri Computes inverse of an LU-factored general matrix
- -- square matrix, with multiple right-hand sides
- -- getrs Solves a system of linear equations with an LU-factored
- -- square matrix, with multiple right-hand sides
- -- hetrd Reduces a complex Hermitian matrix to tridiagonal form
- -- heevr Computes selected eigenvalues and, optionally, eigenvectors of
- -- a Hermitian matrix using the Relatively Robust Representations
- -- orgtr Generates the real orthogonal matrix Q determined by sytrd
- -- steqr Computes all eigenvalues and eigenvectors of a symmetric or
- -- Hermitian matrix reduced to tridiagonal form (QR algorithm)
- -- sterf Computes all eigenvalues of a real symmetric
- -- tridiagonal matrix using QR algorithm
- -- sytrd Reduces a real symmetric matrix to tridiagonal form
-
- procedure sgetrf
- (M : Natural;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- procedure dgetrf
- (M : Natural;
- N : Natural;
- A : in out Double_Precision_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- procedure cgetrf
- (M : Natural;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- procedure zgetrf
- (M : Natural;
- N : Natural;
- A : in out Double_Complex_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- procedure sgetri
- (N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure dgetri
- (N : Natural;
- A : in out Double_Precision_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Double_Precision_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure cgetri
- (N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Complex_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure zgetri
- (N : Natural;
- A : in out Double_Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Double_Complex_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure sgetrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Real_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- procedure dgetrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Double_Precision_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Double_Precision_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- procedure cgetrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Complex_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- procedure zgetrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Double_Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Double_Complex_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- procedure cheevr
- (Job_Z : access constant Character;
- Rng : access constant Character;
- Uplo : access constant Character;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- Vl, Vu : Real := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Real := 0.0;
- M : out Integer;
- W : out Real_Vector;
- Z : out Complex_Matrix;
- Ld_Z : Positive;
- I_Supp_Z : out Integer_Vector;
- Work : out Complex_Vector;
- L_Work : Integer;
- R_Work : out Real_Vector;
- LR_Work : Integer;
- I_Work : out Integer_Vector;
- LI_Work : Integer;
- Info : access Integer);
-
- procedure zheevr
- (Job_Z : access constant Character;
- Rng : access constant Character;
- Uplo : access constant Character;
- N : Natural;
- A : in out Double_Complex_Matrix;
- Ld_A : Positive;
- Vl, Vu : Double_Precision := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Double_Precision := 0.0;
- M : out Integer;
- W : out Double_Precision_Vector;
- Z : out Double_Complex_Matrix;
- Ld_Z : Positive;
- I_Supp_Z : out Integer_Vector;
- Work : out Double_Complex_Vector;
- L_Work : Integer;
- R_Work : out Double_Precision_Vector;
- LR_Work : Integer;
- I_Work : out Integer_Vector;
- LI_Work : Integer;
- Info : access Integer);
-
- procedure chetrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- D : out Real_Vector;
- E : out Real_Vector;
- Tau : out Complex_Vector;
- Work : out Complex_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure zhetrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Double_Complex_Matrix;
- Ld_A : Positive;
- D : out Double_Precision_Vector;
- E : out Double_Precision_Vector;
- Tau : out Double_Complex_Vector;
- Work : out Double_Complex_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure ssytrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- D : out Real_Vector;
- E : out Real_Vector;
- Tau : out Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure dsytrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Double_Precision_Matrix;
- Ld_A : Positive;
- D : out Double_Precision_Vector;
- E : out Double_Precision_Vector;
- Tau : out Double_Precision_Vector;
- Work : out Double_Precision_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure ssterf
- (N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Info : access Integer);
-
- procedure dsterf
- (N : Natural;
- D : in out Double_Precision_Vector;
- E : in out Double_Precision_Vector;
- Info : access Integer);
-
- procedure sorgtr
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- Tau : Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure dorgtr
- (Uplo : access constant Character;
- N : Natural;
- A : in out Double_Precision_Matrix;
- Ld_A : Positive;
- Tau : Double_Precision_Vector;
- Work : out Double_Precision_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure sstebz
- (Rng : access constant Character;
- Order : access constant Character;
- N : Natural;
- Vl, Vu : Real := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Real := 0.0;
- D : Real_Vector;
- E : Real_Vector;
- M : out Natural;
- N_Split : out Natural;
- W : out Real_Vector;
- I_Block : out Integer_Vector;
- I_Split : out Integer_Vector;
- Work : out Real_Vector;
- I_Work : out Integer_Vector;
- Info : access Integer);
-
- procedure dstebz
- (Rng : access constant Character;
- Order : access constant Character;
- N : Natural;
- Vl, Vu : Double_Precision := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Double_Precision := 0.0;
- D : Double_Precision_Vector;
- E : Double_Precision_Vector;
- M : out Natural;
- N_Split : out Natural;
- W : out Double_Precision_Vector;
- I_Block : out Integer_Vector;
- I_Split : out Integer_Vector;
- Work : out Double_Precision_Vector;
- I_Work : out Integer_Vector;
- Info : access Integer);
-
- procedure ssteqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Real_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer);
-
- procedure dsteqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Double_Precision_Vector;
- E : in out Double_Precision_Vector;
- Z : in out Double_Precision_Matrix;
- Ld_Z : Positive;
- Work : out Double_Precision_Vector;
- Info : access Integer);
-
- procedure csteqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Complex_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer);
-
- procedure zsteqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Double_Precision_Vector;
- E : in out Double_Precision_Vector;
- Z : in out Double_Complex_Matrix;
- Ld_Z : Positive;
- Work : out Double_Precision_Vector;
- Info : access Integer);
-
-private
- pragma Import (Fortran, csteqr, "csteqr_");
- pragma Import (Fortran, cgetrf, "cgetrf_");
- pragma Import (Fortran, cgetri, "cgetri_");
- pragma Import (Fortran, cgetrs, "cgetrs_");
- pragma Import (Fortran, cheevr, "cheevr_");
- pragma Import (Fortran, chetrd, "chetrd_");
- pragma Import (Fortran, dgetrf, "dgetrf_");
- pragma Import (Fortran, dgetri, "dgetri_");
- pragma Import (Fortran, dgetrs, "dgetrs_");
- pragma Import (Fortran, dsytrd, "dsytrd_");
- pragma Import (Fortran, dstebz, "dstebz_");
- pragma Import (Fortran, dsterf, "dsterf_");
- pragma Import (Fortran, dorgtr, "dorgtr_");
- pragma Import (Fortran, dsteqr, "dsteqr_");
- pragma Import (Fortran, sgetrf, "sgetrf_");
- pragma Import (Fortran, sgetri, "sgetri_");
- pragma Import (Fortran, sgetrs, "sgetrs_");
- pragma Import (Fortran, sorgtr, "sorgtr_");
- pragma Import (Fortran, sstebz, "sstebz_");
- pragma Import (Fortran, ssterf, "ssterf_");
- pragma Import (Fortran, ssteqr, "ssteqr_");
- pragma Import (Fortran, ssytrd, "ssytrd_");
- pragma Import (Fortran, zgetrf, "zgetrf_");
- pragma Import (Fortran, zgetri, "zgetri_");
- pragma Import (Fortran, zgetrs, "zgetrs_");
- pragma Import (Fortran, zheevr, "zheevr_");
- pragma Import (Fortran, zhetrd, "zhetrd_");
- pragma Import (Fortran, zsteqr, "zsteqr_");
-end Interfaces.Fortran.LAPACK;
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index dfe176bf38d..63ab9256953 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -487,9 +487,6 @@ package body Impunit is
("a-ciormu", F), -- Ada.Containers.Indefinite_Ordered_Multisets
("a-coormu", F), -- Ada.Containers.Ordered_Multisets
("a-crdlli", F), -- Ada.Containers.Restricted_Doubly_Linked_Lists
- ("a-secain", F), -- Ada.Strings.Equal_Case_Insensitive
- ("a-shcain", F), -- Ada.Strings.Hash_Case_Insensitive
- ("a-slcain", F), -- Ada.Strings.Less_Case_Insensitive
("a-szuzti", F), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
("a-zchuni", F), -- Ada.Wide_Wide_Characters.Unicode
("a-ztcstr", F), -- Ada.Wide_Wide_Text_IO.C_Streams
@@ -497,6 +494,19 @@ package body Impunit is
-- Note: strictly the following should be Ada 2012 units, but it seems
-- harmless (and useful) to make then available in Ada 2005 mode.
+ ("a-cogeso", T), -- Ada.Containers.Generic_Sort
+ ("a-secain", T), -- Ada.Strings.Equal_Case_Insensitive
+ ("a-shcain", T), -- Ada.Strings.Hash_Case_Insensitive
+ ("a-slcain", T), -- Ada.Strings.Less_Case_Insensitive
+ ("a-sfecin", T), -- Ada.Strings.Fixed.Equal_Case_Insensitive
+ ("a-sfhcin", T), -- Ada.Strings.Fixed.Hash_Case_Insensitive
+ ("a-sflcin", T), -- Ada.Strings.Fixed.Less_Case_Insensitive
+ ("a-sbecin", T), -- Ada.Strings.Bounded.Equal_Case_Insensitive
+ ("a-sbhcin", T), -- Ada.Strings.Bounded.Hash_Case_Insensitive
+ ("a-sblcin", T), -- Ada.Strings.Bounded.Less_Case_Insensitive
+ ("a-suecin", T), -- Ada.Strings.Unbounded.Equal_Case_Insensitive
+ ("a-suhcin", T), -- Ada.Strings.Unbounded.Hash_Case_Insensitive
+ ("a-sulcin", T), -- Ada.Strings.Unbounded.Less_Case_Insensitive
("a-suezst", T), -- Ada.Strings.UTF_Encoding.Wide_Wide_Strings
---------------------------
diff --git a/gcc/ada/par-labl.adb b/gcc/ada/par-labl.adb
index 8520292ecd2..9bafb07b7d1 100644
--- a/gcc/ada/par-labl.adb
+++ b/gcc/ada/par-labl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -340,6 +340,7 @@ procedure Labl is
New_Node (N_Loop_Statement, Sloc (Loop_Header));
Stat : Node_Id;
Next_Stat : Node_Id;
+
begin
Stat := Next (Loop_Header);
while Stat /= Loop_End loop
@@ -355,7 +356,7 @@ procedure Labl is
Remove (Loop_Header);
Rewrite (Loop_End, Loop_Stmt);
Error_Msg_N
- ("code between label and backwards goto rewritten as loop?",
+ ("info: code between label and backwards goto rewritten as loop?",
Loop_End);
end Rewrite_As_Loop;
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index 9f29313a0b6..898ba8dfa35 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -2058,91 +2058,93 @@ package body Prj.Env is
Projects_Paths.Reset (Self.Cache);
end Set_Path;
- ------------------
- -- Find_Project --
- ------------------
+ -----------------------
+ -- Find_Name_In_Path --
+ -----------------------
- procedure Find_Project
- (Self : in out Project_Search_Path;
- Project_File_Name : String;
- Directory : String;
- Path : out Namet.Path_Name_Type)
+ function Find_Name_In_Path
+ (Self : Project_Search_Path;
+ Path : String) return String_Access
is
- File : constant String := Project_File_Name;
- -- Have to do a copy, in case the parameter is Name_Buffer, which we
- -- modify below
+ First : Natural;
+ Last : Natural;
- function Try_Path_Name (Path : String) return String_Access;
- pragma Inline (Try_Path_Name);
- -- Try the specified Path
+ begin
+ if Current_Verbosity = High then
+ Debug_Output ("Trying " & Path);
+ end if;
- -------------------
- -- Try_Path_Name --
- -------------------
+ if Is_Absolute_Path (Path) then
+ if Check_Filename (Path) then
+ return new String'(Path);
+ else
+ return null;
+ end if;
- function Try_Path_Name (Path : String) return String_Access is
- First : Natural;
- Last : Natural;
- Result : String_Access := null;
+ else
+ -- Because we don't want to resolve symbolic links, we cannot use
+ -- Locate_Regular_File. So, we try each possible path successively.
- begin
- if Current_Verbosity = High then
- Debug_Output ("Trying " & Path);
- end if;
+ First := Self.Path'First;
+ while First <= Self.Path'Last loop
+ while First <= Self.Path'Last
+ and then Self.Path (First) = Path_Separator
+ loop
+ First := First + 1;
+ end loop;
- if Is_Absolute_Path (Path) then
- if Is_Regular_File (Path) then
- Result := new String'(Path);
- end if;
+ exit when First > Self.Path'Last;
- else
- -- Because we don't want to resolve symbolic links, we cannot use
- -- Locate_Regular_File. So, we try each possible path
- -- successively.
-
- First := Self.Path'First;
- while First <= Self.Path'Last loop
- while First <= Self.Path'Last
- and then Self.Path (First) = Path_Separator
- loop
- First := First + 1;
- end loop;
-
- exit when First > Self.Path'Last;
-
- Last := First;
- while Last < Self.Path'Last
- and then Self.Path (Last + 1) /= Path_Separator
- loop
- Last := Last + 1;
- end loop;
-
- Name_Len := 0;
-
- if not Is_Absolute_Path (Self.Path (First .. Last)) then
- Add_Str_To_Name_Buffer (Get_Current_Dir); -- ??? System call
- Add_Char_To_Name_Buffer (Directory_Separator);
- end if;
+ Last := First;
+ while Last < Self.Path'Last
+ and then Self.Path (Last + 1) /= Path_Separator
+ loop
+ Last := Last + 1;
+ end loop;
- Add_Str_To_Name_Buffer (Self.Path (First .. Last));
+ Name_Len := 0;
+
+ if not Is_Absolute_Path (Self.Path (First .. Last)) then
+ Add_Str_To_Name_Buffer (Get_Current_Dir); -- ??? System call
Add_Char_To_Name_Buffer (Directory_Separator);
- Add_Str_To_Name_Buffer (Path);
+ end if;
- if Current_Verbosity = High then
- Debug_Output ("Testing file " & Name_Buffer (1 .. Name_Len));
- end if;
+ Add_Str_To_Name_Buffer (Self.Path (First .. Last));
+ Add_Char_To_Name_Buffer (Directory_Separator);
+ Add_Str_To_Name_Buffer (Path);
- if Is_Regular_File (Name_Buffer (1 .. Name_Len)) then
- Result := new String'(Name_Buffer (1 .. Name_Len));
- exit;
- end if;
+ if Current_Verbosity = High then
+ Debug_Output ("Testing file " & Name_Buffer (1 .. Name_Len));
+ end if;
- First := Last + 1;
- end loop;
- end if;
+ if Check_Filename (Name_Buffer (1 .. Name_Len)) then
+ return new String'(Name_Buffer (1 .. Name_Len));
+ end if;
+
+ First := Last + 1;
+ end loop;
+ end if;
+
+ return null;
+ end Find_Name_In_Path;
- return Result;
- end Try_Path_Name;
+ ------------------
+ -- Find_Project --
+ ------------------
+
+ procedure Find_Project
+ (Self : in out Project_Search_Path;
+ Project_File_Name : String;
+ Directory : String;
+ Path : out Namet.Path_Name_Type)
+ is
+ File : constant String := Project_File_Name;
+ -- Have to do a copy, in case the parameter is Name_Buffer, which we
+ -- modify below
+
+ function Try_Path_Name is new Find_Name_In_Path
+ (Check_Filename => Is_Regular_File);
+ -- Find a file in the project search path.
-- Local Declarations
@@ -2194,27 +2196,29 @@ package body Prj.Env is
if not Has_Dot then
Result := Try_Path_Name
- (Directory & Directory_Separator &
+ (Self,
+ Directory & Directory_Separator &
File & Project_File_Extension);
end if;
-- Then we try <directory>/<file_name>
if Result = null then
- Result := Try_Path_Name (Directory & Directory_Separator & File);
+ Result := Try_Path_Name
+ (Self, Directory & Directory_Separator & File);
end if;
end if;
-- Then we try <file_name>.<extension>
if Result = null and then not Has_Dot then
- Result := Try_Path_Name (File & Project_File_Extension);
+ Result := Try_Path_Name (Self, File & Project_File_Extension);
end if;
-- Then we try <file_name>
if Result = null then
- Result := Try_Path_Name (File);
+ Result := Try_Path_Name (Self, File);
end if;
-- If we cannot find the project file, we return an empty string
diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads
index fd14a4a3c3d..79de6464a0a 100644
--- a/gcc/ada/prj-env.ads
+++ b/gcc/ada/prj-env.ads
@@ -210,6 +210,17 @@ package Prj.Env is
-- Override the value of the project path. This also removes the implicit
-- default search directories.
+ generic
+ with function Check_Filename (Name : String) return Boolean;
+ function Find_Name_In_Path
+ (Self : Project_Search_Path;
+ Path : String) return String_Access;
+ -- Find a name in the project search path of Self. Check_Filename is
+ -- the predicate to valid the search. If Path is an absolute filename,
+ -- simply calls the predicate with Path. Otherwise, calls the predicate
+ -- for each component of the path. Stops as soon as the predicate
+ -- returns True and returns the name, or returns null in case of failure.
+
procedure Find_Project
(Self : in out Project_Search_Path;
Project_File_Name : String;
diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi
index 356104f07c0..6970733bdaf 100644
--- a/gcc/ada/projects.texi
+++ b/gcc/ada/projects.texi
@@ -2915,8 +2915,10 @@ The current list of qualifiers is:
qualified abstract project.
@item @b{standard}: a standard project is a non library project with sources.
This is the default (implicit) qualifier.
-@item @b{aggregate}: for future extension
-@item @b{aggregate library}: for future extension
+@item @b{aggregate}: a project whose sources are aggregated from other
+project files.
+@item @b{aggregate library}: a library whose sources are aggregated
+from other project or library project files.
@item @b{library}: a library project must declare both attributes
@code{Library_Name} and @code{Library_Dir}.
@item @b{configuration}: a configuration project cannot be in a project tree.
diff --git a/gcc/ada/s-atocou.ads b/gcc/ada/s-atocou.ads
index a78c4fd26cd..cad18d29896 100644
--- a/gcc/ada/s-atocou.ads
+++ b/gcc/ada/s-atocou.ads
@@ -72,7 +72,6 @@ private
type Atomic_Counter is limited record
Value : aliased Unsigned_32 := 1;
pragma Atomic (Value);
- pragma Volatile (Value);
end record;
end System.Atomic_Counters;
diff --git a/gcc/ada/s-gecobl.adb b/gcc/ada/s-gecobl.adb
deleted file mode 100644
index d20b53f31b4..00000000000
--- a/gcc/ada/s-gecobl.adb
+++ /dev/null
@@ -1,350 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ C O M P L E X _ B L A S --
--- --
--- B o d y --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
-with Ada.Unchecked_Conversion; use Ada;
-with Interfaces; use Interfaces;
-with Interfaces.Fortran; use Interfaces.Fortran;
-with Interfaces.Fortran.BLAS; use Interfaces.Fortran.BLAS;
-with System.Generic_Array_Operations; use System.Generic_Array_Operations;
-
-package body System.Generic_Complex_BLAS is
-
- Is_Single : constant Boolean :=
- Real'Machine_Mantissa = Fortran.Real'Machine_Mantissa
- and then Fortran.Real (Real'First) = Fortran.Real'First
- and then Fortran.Real (Real'Last) = Fortran.Real'Last;
-
- Is_Double : constant Boolean :=
- Real'Machine_Mantissa = Double_Precision'Machine_Mantissa
- and then
- Double_Precision (Real'First) = Double_Precision'First
- and then
- Double_Precision (Real'Last) = Double_Precision'Last;
-
- subtype Complex is Complex_Types.Complex;
-
- -- Local subprograms
-
- function To_Double_Precision (X : Real) return Double_Precision;
- pragma Inline (To_Double_Precision);
-
- function To_Double_Complex (X : Complex) return Double_Complex;
- pragma Inline (To_Double_Complex);
-
- function To_Complex (X : Double_Complex) return Complex;
- function To_Complex (X : Fortran.Complex) return Complex;
- pragma Inline (To_Complex);
-
- function To_Fortran (X : Complex) return Fortran.Complex;
- pragma Inline (To_Fortran);
-
- -- Instantiations
-
- function To_Double_Complex is new
- Vector_Elementwise_Operation
- (X_Scalar => Complex_Types.Complex,
- Result_Scalar => Fortran.Double_Complex,
- X_Vector => Complex_Vector,
- Result_Vector => BLAS.Double_Complex_Vector,
- Operation => To_Double_Complex);
-
- function To_Complex is new
- Vector_Elementwise_Operation
- (X_Scalar => Fortran.Double_Complex,
- Result_Scalar => Complex,
- X_Vector => BLAS.Double_Complex_Vector,
- Result_Vector => Complex_Vector,
- Operation => To_Complex);
-
- function To_Double_Complex is new
- Matrix_Elementwise_Operation
- (X_Scalar => Complex,
- Result_Scalar => Double_Complex,
- X_Matrix => Complex_Matrix,
- Result_Matrix => BLAS.Double_Complex_Matrix,
- Operation => To_Double_Complex);
-
- function To_Complex is new
- Matrix_Elementwise_Operation
- (X_Scalar => Double_Complex,
- Result_Scalar => Complex,
- X_Matrix => BLAS.Double_Complex_Matrix,
- Result_Matrix => Complex_Matrix,
- Operation => To_Complex);
-
- function To_Double_Precision (X : Real) return Double_Precision is
- begin
- return Double_Precision (X);
- end To_Double_Precision;
-
- function To_Double_Complex (X : Complex) return Double_Complex is
- begin
- return (To_Double_Precision (X.Re), To_Double_Precision (X.Im));
- end To_Double_Complex;
-
- function To_Complex (X : Double_Complex) return Complex is
- begin
- return (Real (X.Re), Real (X.Im));
- end To_Complex;
-
- function To_Complex (X : Fortran.Complex) return Complex is
- begin
- return (Real (X.Re), Real (X.Im));
- end To_Complex;
-
- function To_Fortran (X : Complex) return Fortran.Complex is
- begin
- return (Fortran.Real (X.Re), Fortran.Real (X.Im));
- end To_Fortran;
-
- ---------
- -- dot --
- ---------
-
- function dot
- (N : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1;
- Y : Complex_Vector;
- Inc_Y : Integer := 1) return Complex
- is
- begin
- if Is_Single then
- declare
- type X_Ptr is access all BLAS.Complex_Vector (X'Range);
- type Y_Ptr is access all BLAS.Complex_Vector (Y'Range);
- function Conv_X is new Unchecked_Conversion (Address, X_Ptr);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- return To_Complex (BLAS.cdotu (N, Conv_X (X'Address).all, Inc_X,
- Conv_Y (Y'Address).all, Inc_Y));
- end;
-
- elsif Is_Double then
- declare
- type X_Ptr is access all BLAS.Double_Complex_Vector (X'Range);
- type Y_Ptr is access all BLAS.Double_Complex_Vector (Y'Range);
- function Conv_X is new Unchecked_Conversion (Address, X_Ptr);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- return To_Complex (BLAS.zdotu (N, Conv_X (X'Address).all, Inc_X,
- Conv_Y (Y'Address).all, Inc_Y));
- end;
-
- else
- return To_Complex (BLAS.zdotu (N, To_Double_Complex (X), Inc_X,
- To_Double_Complex (Y), Inc_Y));
- end if;
- end dot;
-
- ----------
- -- gemm --
- ----------
-
- procedure gemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Complex := (1.0, 0.0);
- A : Complex_Matrix;
- Ld_A : Integer;
- B : Complex_Matrix;
- Ld_B : Integer;
- Beta : Complex := (0.0, 0.0);
- C : in out Complex_Matrix;
- Ld_C : Integer)
- is
- begin
- if Is_Single then
- declare
- subtype A_Type is BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- subtype B_Type is BLAS.Complex_Matrix (B'Range (1), B'Range (2));
- type C_Ptr is
- access all BLAS.Complex_Matrix (C'Range (1), C'Range (2));
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_B is
- new Unchecked_Conversion (Complex_Matrix, B_Type);
- function Conv_C is
- new Unchecked_Conversion (Address, C_Ptr);
- begin
- BLAS.cgemm (Trans_A, Trans_B, M, N, K, To_Fortran (Alpha),
- Conv_A (A), Ld_A, Conv_B (B), Ld_B, To_Fortran (Beta),
- Conv_C (C'Address).all, Ld_C);
- end;
-
- elsif Is_Double then
- declare
- subtype A_Type is
- BLAS.Double_Complex_Matrix (A'Range (1), A'Range (2));
- subtype B_Type is
- BLAS.Double_Complex_Matrix (B'Range (1), B'Range (2));
- type C_Ptr is access all
- BLAS.Double_Complex_Matrix (C'Range (1), C'Range (2));
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_B is
- new Unchecked_Conversion (Complex_Matrix, B_Type);
- function Conv_C is new Unchecked_Conversion (Address, C_Ptr);
- begin
- BLAS.zgemm (Trans_A, Trans_B, M, N, K, To_Double_Complex (Alpha),
- Conv_A (A), Ld_A, Conv_B (B), Ld_B,
- To_Double_Complex (Beta),
- Conv_C (C'Address).all, Ld_C);
- end;
-
- else
- declare
- DP_C : BLAS.Double_Complex_Matrix (C'Range (1), C'Range (2));
- begin
- if Beta.Re /= 0.0 or else Beta.Im /= 0.0 then
- DP_C := To_Double_Complex (C);
- end if;
-
- BLAS.zgemm (Trans_A, Trans_B, M, N, K, To_Double_Complex (Alpha),
- To_Double_Complex (A), Ld_A,
- To_Double_Complex (B), Ld_B, To_Double_Complex (Beta),
- DP_C, Ld_C);
-
- C := To_Complex (DP_C);
- end;
- end if;
- end gemm;
-
- ----------
- -- gemv --
- ----------
-
- procedure gemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Complex := (1.0, 0.0);
- A : Complex_Matrix;
- Ld_A : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1;
- Beta : Complex := (0.0, 0.0);
- Y : in out Complex_Vector;
- Inc_Y : Integer := 1)
- is
- begin
- if Is_Single then
- declare
- subtype A_Type is BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- subtype X_Type is BLAS.Complex_Vector (X'Range);
- type Y_Ptr is access all BLAS.Complex_Vector (Y'Range);
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_X is
- new Unchecked_Conversion (Complex_Vector, X_Type);
- function Conv_Y is
- new Unchecked_Conversion (Address, Y_Ptr);
- begin
- BLAS.cgemv (Trans, M, N, To_Fortran (Alpha),
- Conv_A (A), Ld_A, Conv_X (X), Inc_X, To_Fortran (Beta),
- Conv_Y (Y'Address).all, Inc_Y);
- end;
-
- elsif Is_Double then
- declare
- subtype A_Type is
- BLAS.Double_Complex_Matrix (A'Range (1), A'Range (2));
- subtype X_Type is
- BLAS.Double_Complex_Vector (X'Range);
- type Y_Ptr is access all BLAS.Double_Complex_Vector (Y'Range);
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_X is
- new Unchecked_Conversion (Complex_Vector, X_Type);
- function Conv_Y is
- new Unchecked_Conversion (Address, Y_Ptr);
- begin
- BLAS.zgemv (Trans, M, N, To_Double_Complex (Alpha),
- Conv_A (A), Ld_A, Conv_X (X), Inc_X,
- To_Double_Complex (Beta),
- Conv_Y (Y'Address).all, Inc_Y);
- end;
-
- else
- declare
- DP_Y : BLAS.Double_Complex_Vector (Y'Range);
- begin
- if Beta.Re /= 0.0 or else Beta.Im /= 0.0 then
- DP_Y := To_Double_Complex (Y);
- end if;
-
- BLAS.zgemv (Trans, M, N, To_Double_Complex (Alpha),
- To_Double_Complex (A), Ld_A,
- To_Double_Complex (X), Inc_X, To_Double_Complex (Beta),
- DP_Y, Inc_Y);
-
- Y := To_Complex (DP_Y);
- end;
- end if;
- end gemv;
-
- ----------
- -- nrm2 --
- ----------
-
- function nrm2
- (N : Natural;
- X : Complex_Vector;
- Inc_X : Integer := 1) return Real
- is
- begin
- if Is_Single then
- declare
- subtype X_Type is BLAS.Complex_Vector (X'Range);
- function Conv_X is
- new Unchecked_Conversion (Complex_Vector, X_Type);
- begin
- return Real (BLAS.scnrm2 (N, Conv_X (X), Inc_X));
- end;
-
- elsif Is_Double then
- declare
- subtype X_Type is BLAS.Double_Complex_Vector (X'Range);
- function Conv_X is
- new Unchecked_Conversion (Complex_Vector, X_Type);
- begin
- return Real (BLAS.dznrm2 (N, Conv_X (X), Inc_X));
- end;
-
- else
- return Real (BLAS.dznrm2 (N, To_Double_Complex (X), Inc_X));
- end if;
- end nrm2;
-
-end System.Generic_Complex_BLAS;
diff --git a/gcc/ada/s-gecobl.ads b/gcc/ada/s-gecobl.ads
deleted file mode 100644
index 85bd3b50bf0..00000000000
--- a/gcc/ada/s-gecobl.ads
+++ /dev/null
@@ -1,102 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ C O M P L E X _ B L A S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
--- Package comment required ???
-
-with Ada.Numerics.Generic_Complex_Types;
-
-generic
- type Real is digits <>;
- with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- type Complex_Vector is array (Integer range <>) of Complex;
- type Complex_Matrix is array (Integer range <>, Integer range <>)
- of Complex;
-package System.Generic_Complex_BLAS is
- pragma Pure;
-
- -- Although BLAS support is only available for IEEE single and double
- -- compatible floating-point types, this unit will accept any type
- -- and apply conversions as necessary, with possible loss of
- -- precision and range.
-
- No_Trans : aliased constant Character := 'N';
- Trans : aliased constant Character := 'T';
- Conj_Trans : aliased constant Character := 'C';
-
- -- BLAS Level 1 Subprograms and Types
-
- function dot
- (N : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1;
- Y : Complex_Vector;
- Inc_Y : Integer := 1) return Complex;
-
- function nrm2
- (N : Natural;
- X : Complex_Vector;
- Inc_X : Integer := 1) return Real;
-
- procedure gemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Complex := (1.0, 0.0);
- A : Complex_Matrix;
- Ld_A : Positive;
- X : Complex_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Complex := (0.0, 0.0);
- Y : in out Complex_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- -- BLAS Level 3
-
- -- gemm s, d, c, z Matrix-matrix product of general matrices
-
- procedure gemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Complex := (1.0, 0.0);
- A : Complex_Matrix;
- Ld_A : Integer;
- B : Complex_Matrix;
- Ld_B : Integer;
- Beta : Complex := (0.0, 0.0);
- C : in out Complex_Matrix;
- Ld_C : Integer);
-
-end System.Generic_Complex_BLAS;
diff --git a/gcc/ada/s-gecola.adb b/gcc/ada/s-gecola.adb
deleted file mode 100644
index ad69fee9bc5..00000000000
--- a/gcc/ada/s-gecola.adb
+++ /dev/null
@@ -1,493 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ C O M P L E X _ L A P A C K --
--- --
--- B o d y --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
-with Ada.Unchecked_Conversion; use Ada;
-with Interfaces; use Interfaces;
-with Interfaces.Fortran; use Interfaces.Fortran;
-with Interfaces.Fortran.BLAS; use Interfaces.Fortran.BLAS;
-with Interfaces.Fortran.LAPACK; use Interfaces.Fortran.LAPACK;
-with System.Generic_Array_Operations; use System.Generic_Array_Operations;
-
-package body System.Generic_Complex_LAPACK is
-
- Is_Single : constant Boolean :=
- Real'Machine_Mantissa = Fortran.Real'Machine_Mantissa
- and then Fortran.Real (Real'First) = Fortran.Real'First
- and then Fortran.Real (Real'Last) = Fortran.Real'Last;
-
- Is_Double : constant Boolean :=
- Real'Machine_Mantissa = Double_Precision'Machine_Mantissa
- and then
- Double_Precision (Real'First) = Double_Precision'First
- and then
- Double_Precision (Real'Last) = Double_Precision'Last;
-
- subtype Complex is Complex_Types.Complex;
-
- -- Local subprograms
-
- function To_Double_Precision (X : Real) return Double_Precision;
- pragma Inline (To_Double_Precision);
-
- function To_Real (X : Double_Precision) return Real;
- pragma Inline (To_Real);
-
- function To_Double_Complex (X : Complex) return Double_Complex;
- pragma Inline (To_Double_Complex);
-
- function To_Complex (X : Double_Complex) return Complex;
- pragma Inline (To_Complex);
-
- -- Instantiations
-
- function To_Double_Precision is new
- Vector_Elementwise_Operation
- (X_Scalar => Real,
- Result_Scalar => Double_Precision,
- X_Vector => Real_Vector,
- Result_Vector => Double_Precision_Vector,
- Operation => To_Double_Precision);
-
- function To_Real is new
- Vector_Elementwise_Operation
- (X_Scalar => Double_Precision,
- Result_Scalar => Real,
- X_Vector => Double_Precision_Vector,
- Result_Vector => Real_Vector,
- Operation => To_Real);
-
- function To_Double_Complex is new
- Matrix_Elementwise_Operation
- (X_Scalar => Complex,
- Result_Scalar => Double_Complex,
- X_Matrix => Complex_Matrix,
- Result_Matrix => Double_Complex_Matrix,
- Operation => To_Double_Complex);
-
- function To_Complex is new
- Matrix_Elementwise_Operation
- (X_Scalar => Double_Complex,
- Result_Scalar => Complex,
- X_Matrix => Double_Complex_Matrix,
- Result_Matrix => Complex_Matrix,
- Operation => To_Complex);
-
- function To_Double_Precision (X : Real) return Double_Precision is
- begin
- return Double_Precision (X);
- end To_Double_Precision;
-
- function To_Real (X : Double_Precision) return Real is
- begin
- return Real (X);
- end To_Real;
-
- function To_Double_Complex (X : Complex) return Double_Complex is
- begin
- return (To_Double_Precision (X.Re), To_Double_Precision (X.Im));
- end To_Double_Complex;
-
- function To_Complex (X : Double_Complex) return Complex is
- begin
- return (Real (X.Re), Real (X.Im));
- end To_Complex;
-
- -----------
- -- getrf --
- -----------
-
- procedure getrf
- (M : Natural;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer)
- is
- begin
- if Is_Single then
- declare
- type A_Ptr is
- access all BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- begin
- cgetrf (M, N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv), Info);
- end;
-
- elsif Is_Double then
- declare
- type A_Ptr is
- access all Double_Complex_Matrix (A'Range (1), A'Range (2));
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- begin
- zgetrf (M, N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv), Info);
- end;
-
- else
- declare
- DP_A : Double_Complex_Matrix (A'Range (1), A'Range (2));
- begin
- DP_A := To_Double_Complex (A);
- zgetrf (M, N, DP_A, Ld_A, LAPACK.Integer_Vector (I_Piv), Info);
- A := To_Complex (DP_A);
- end;
- end if;
- end getrf;
-
- -----------
- -- getri --
- -----------
-
- procedure getri
- (N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Complex_Vector;
- L_Work : Integer;
- Info : access Integer)
- is
- begin
- if Is_Single then
- declare
- type A_Ptr is
- access all BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- type Work_Ptr is
- access all BLAS.Complex_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- cgetri (N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- elsif Is_Double then
- declare
- type A_Ptr is
- access all Double_Complex_Matrix (A'Range (1), A'Range (2));
- type Work_Ptr is
- access all Double_Complex_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- zgetri (N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Complex_Matrix (A'Range (1), A'Range (2));
- DP_Work : Double_Complex_Vector (Work'Range);
- begin
- DP_A := To_Double_Complex (A);
- zgetri (N, DP_A, Ld_A, LAPACK.Integer_Vector (I_Piv),
- DP_Work, L_Work, Info);
- A := To_Complex (DP_A);
- Work (1) := To_Complex (DP_Work (1));
- end;
- end if;
- end getri;
-
- -----------
- -- getrs --
- -----------
-
- procedure getrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Complex_Matrix;
- Ld_B : Positive;
- Info : access Integer)
- is
- begin
- if Is_Single then
- declare
- subtype A_Type is BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- type B_Ptr is
- access all BLAS.Complex_Matrix (B'Range (1), B'Range (2));
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Address, B_Ptr);
- begin
- cgetrs (Trans, N, N_Rhs,
- Conv_A (A), Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_B (B'Address).all, Ld_B,
- Info);
- end;
-
- elsif Is_Double then
- declare
- subtype A_Type is
- Double_Complex_Matrix (A'Range (1), A'Range (2));
- type B_Ptr is
- access all Double_Complex_Matrix (B'Range (1), B'Range (2));
- function Conv_A is
- new Unchecked_Conversion (Complex_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Address, B_Ptr);
- begin
- zgetrs (Trans, N, N_Rhs,
- Conv_A (A), Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_B (B'Address).all, Ld_B,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Complex_Matrix (A'Range (1), A'Range (2));
- DP_B : Double_Complex_Matrix (B'Range (1), B'Range (2));
- begin
- DP_A := To_Double_Complex (A);
- DP_B := To_Double_Complex (B);
- zgetrs (Trans, N, N_Rhs,
- DP_A, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- DP_B, Ld_B,
- Info);
- B := To_Complex (DP_B);
- end;
- end if;
- end getrs;
-
- procedure heevr
- (Job_Z : access constant Character;
- Rng : access constant Character;
- Uplo : access constant Character;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- Vl, Vu : Real := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Real := 0.0;
- M : out Integer;
- W : out Real_Vector;
- Z : out Complex_Matrix;
- Ld_Z : Positive;
- I_Supp_Z : out Integer_Vector;
- Work : out Complex_Vector;
- L_Work : Integer;
- R_Work : out Real_Vector;
- LR_Work : Integer;
- I_Work : out Integer_Vector;
- LI_Work : Integer;
- Info : access Integer)
- is
- begin
- if Is_Single then
- declare
- type A_Ptr is
- access all BLAS.Complex_Matrix (A'Range (1), A'Range (2));
- type W_Ptr is
- access all BLAS.Real_Vector (W'Range);
- type Z_Ptr is
- access all BLAS.Complex_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is access all BLAS.Complex_Vector (Work'Range);
- type R_Work_Ptr is access all BLAS.Real_Vector (R_Work'Range);
-
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_W is new Unchecked_Conversion (Address, W_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- function Conv_R_Work is
- new Unchecked_Conversion (Address, R_Work_Ptr);
- begin
- cheevr (Job_Z, Rng, Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Fortran.Real (Vl), Fortran.Real (Vu),
- Il, Iu, Fortran.Real (Abs_Tol), M,
- Conv_W (W'Address).all,
- Conv_Z (Z'Address).all, Ld_Z,
- LAPACK.Integer_Vector (I_Supp_Z),
- Conv_Work (Work'Address).all, L_Work,
- Conv_R_Work (R_Work'Address).all, LR_Work,
- LAPACK.Integer_Vector (I_Work), LI_Work, Info);
- end;
-
- elsif Is_Double then
- declare
- type A_Ptr is
- access all BLAS.Double_Complex_Matrix (A'Range (1), A'Range (2));
- type W_Ptr is
- access all BLAS.Double_Precision_Vector (W'Range);
- type Z_Ptr is
- access all BLAS.Double_Complex_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is
- access all BLAS.Double_Complex_Vector (Work'Range);
- type R_Work_Ptr is
- access all BLAS.Double_Precision_Vector (R_Work'Range);
-
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_W is new Unchecked_Conversion (Address, W_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- function Conv_R_Work is
- new Unchecked_Conversion (Address, R_Work_Ptr);
- begin
- zheevr (Job_Z, Rng, Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Double_Precision (Vl), Double_Precision (Vu),
- Il, Iu, Double_Precision (Abs_Tol), M,
- Conv_W (W'Address).all,
- Conv_Z (Z'Address).all, Ld_Z,
- LAPACK.Integer_Vector (I_Supp_Z),
- Conv_Work (Work'Address).all, L_Work,
- Conv_R_Work (R_Work'Address).all, LR_Work,
- LAPACK.Integer_Vector (I_Work), LI_Work, Info);
- end;
-
- else
- declare
- DP_A : Double_Complex_Matrix (A'Range (1), A'Range (2));
- DP_W : Double_Precision_Vector (W'Range);
- DP_Z : Double_Complex_Matrix (Z'Range (1), Z'Range (2));
- DP_Work : Double_Complex_Vector (Work'Range);
- DP_R_Work : Double_Precision_Vector (R_Work'Range);
-
- begin
- DP_A := To_Double_Complex (A);
-
- zheevr (Job_Z, Rng, Uplo, N,
- DP_A, Ld_A,
- Double_Precision (Vl), Double_Precision (Vu),
- Il, Iu, Double_Precision (Abs_Tol), M,
- DP_W, DP_Z, Ld_Z,
- LAPACK.Integer_Vector (I_Supp_Z),
- DP_Work, L_Work,
- DP_R_Work, LR_Work,
- LAPACK.Integer_Vector (I_Work), LI_Work, Info);
-
- A := To_Complex (DP_A);
- W := To_Real (DP_W);
- Z := To_Complex (DP_Z);
-
- Work (1) := To_Complex (DP_Work (1));
- R_Work (1) := To_Real (DP_R_Work (1));
- end;
- end if;
- end heevr;
-
- -----------
- -- steqr --
- -----------
-
- procedure steqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Complex_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer)
- is
- begin
- if Is_Single then
- declare
- type D_Ptr is access all BLAS.Real_Vector (D'Range);
- type E_Ptr is access all BLAS.Real_Vector (E'Range);
- type Z_Ptr is
- access all BLAS.Complex_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is
- access all BLAS.Real_Vector (Work'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- csteqr (Comp_Z, N,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Z (Z'Address).all,
- Ld_Z,
- Conv_Work (Work'Address).all,
- Info);
- end;
-
- elsif Is_Double then
- declare
- type D_Ptr is access all Double_Precision_Vector (D'Range);
- type E_Ptr is access all Double_Precision_Vector (E'Range);
- type Z_Ptr is
- access all Double_Complex_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is
- access all Double_Precision_Vector (Work'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- zsteqr (Comp_Z, N,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Z (Z'Address).all,
- Ld_Z,
- Conv_Work (Work'Address).all,
- Info);
- end;
-
- else
- declare
- DP_D : Double_Precision_Vector (D'Range);
- DP_E : Double_Precision_Vector (E'Range);
- DP_Z : Double_Complex_Matrix (Z'Range (1), Z'Range (2));
- DP_Work : Double_Precision_Vector (Work'Range);
- begin
- DP_D := To_Double_Precision (D);
- DP_E := To_Double_Precision (E);
-
- if Comp_Z.all = 'V' then
- DP_Z := To_Double_Complex (Z);
- end if;
-
- zsteqr (Comp_Z, N, DP_D, DP_E, DP_Z, Ld_Z, DP_Work, Info);
-
- D := To_Real (DP_D);
- E := To_Real (DP_E);
-
- if Comp_Z.all /= 'N' then
- Z := To_Complex (DP_Z);
- end if;
- end;
- end if;
- end steqr;
-
-end System.Generic_Complex_LAPACK;
diff --git a/gcc/ada/s-gecola.ads b/gcc/ada/s-gecola.ads
deleted file mode 100644
index eb8741ac046..00000000000
--- a/gcc/ada/s-gecola.ads
+++ /dev/null
@@ -1,131 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ C O M P L E X _ L A P A C K --
--- --
--- S p e c --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
--- Package comment required ???
-
-with Ada.Numerics.Generic_Complex_Types;
-generic
- type Real is digits <>;
- type Real_Vector is array (Integer range <>) of Real;
-
- with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- type Complex_Vector is array (Integer range <>) of Complex;
- type Complex_Matrix is array (Integer range <>, Integer range <>)
- of Complex;
-package System.Generic_Complex_LAPACK is
- pragma Pure;
-
- type Integer_Vector is array (Integer range <>) of Integer;
-
- Upper : aliased constant Character := 'U';
- Lower : aliased constant Character := 'L';
-
- -- LAPACK Computational Routines
-
- -- getrf computes LU factorization of a general m-by-n matrix
-
- procedure getrf
- (M : Natural;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- -- getri computes inverse of an LU-factored square matrix,
- -- with multiple right-hand sides
-
- procedure getri
- (N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Complex_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- -- getrs solves a system of linear equations with an LU-factored
- -- square matrix, with multiple right-hand sides
-
- procedure getrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Complex_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Complex_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- -- heevr computes selected eigenvalues and, optionally,
- -- eigenvectors of a Hermitian matrix using the Relatively
- -- Robust Representations
-
- procedure heevr
- (Job_Z : access constant Character;
- Rng : access constant Character;
- Uplo : access constant Character;
- N : Natural;
- A : in out Complex_Matrix;
- Ld_A : Positive;
- Vl, Vu : Real := 0.0;
- Il, Iu : Integer := 1;
- Abs_Tol : Real := 0.0;
- M : out Integer;
- W : out Real_Vector;
- Z : out Complex_Matrix;
- Ld_Z : Positive;
- I_Supp_Z : out Integer_Vector;
- Work : out Complex_Vector;
- L_Work : Integer;
- R_Work : out Real_Vector;
- LR_Work : Integer;
- I_Work : out Integer_Vector;
- LI_Work : Integer;
- Info : access Integer);
-
- -- steqr computes all eigenvalues and eigenvectors of a symmetric or
- -- Hermitian matrix reduced to tridiagonal form (QR algorithm)
-
- procedure steqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Complex_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer);
-
-end System.Generic_Complex_LAPACK;
diff --git a/gcc/ada/s-gerebl.adb b/gcc/ada/s-gerebl.adb
deleted file mode 100644
index fc2f5d7d604..00000000000
--- a/gcc/ada/s-gerebl.adb
+++ /dev/null
@@ -1,311 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ R E A L _ B L A S --
--- --
--- B o d y --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
-with Ada.Unchecked_Conversion; use Ada;
-with Interfaces; use Interfaces;
-with Interfaces.Fortran; use Interfaces.Fortran;
-with Interfaces.Fortran.BLAS; use Interfaces.Fortran.BLAS;
-with System.Generic_Array_Operations; use System.Generic_Array_Operations;
-
-package body System.Generic_Real_BLAS is
-
- Is_Single : constant Boolean :=
- Real'Machine_Mantissa = Fortran.Real'Machine_Mantissa
- and then Fortran.Real (Real'First) = Fortran.Real'First
- and then Fortran.Real (Real'Last) = Fortran.Real'Last;
-
- Is_Double : constant Boolean :=
- Real'Machine_Mantissa = Double_Precision'Machine_Mantissa
- and then
- Double_Precision (Real'First) = Double_Precision'First
- and then
- Double_Precision (Real'Last) = Double_Precision'Last;
-
- -- Local subprograms
-
- function To_Double_Precision (X : Real) return Double_Precision;
- pragma Inline_Always (To_Double_Precision);
-
- function To_Real (X : Double_Precision) return Real;
- pragma Inline_Always (To_Real);
-
- -- Instantiations
-
- function To_Double_Precision is new
- Vector_Elementwise_Operation
- (X_Scalar => Real,
- Result_Scalar => Double_Precision,
- X_Vector => Real_Vector,
- Result_Vector => Double_Precision_Vector,
- Operation => To_Double_Precision);
-
- function To_Real is new
- Vector_Elementwise_Operation
- (X_Scalar => Double_Precision,
- Result_Scalar => Real,
- X_Vector => Double_Precision_Vector,
- Result_Vector => Real_Vector,
- Operation => To_Real);
-
- function To_Double_Precision is new
- Matrix_Elementwise_Operation
- (X_Scalar => Real,
- Result_Scalar => Double_Precision,
- X_Matrix => Real_Matrix,
- Result_Matrix => Double_Precision_Matrix,
- Operation => To_Double_Precision);
-
- function To_Real is new
- Matrix_Elementwise_Operation
- (X_Scalar => Double_Precision,
- Result_Scalar => Real,
- X_Matrix => Double_Precision_Matrix,
- Result_Matrix => Real_Matrix,
- Operation => To_Real);
-
- function To_Double_Precision (X : Real) return Double_Precision is
- begin
- return Double_Precision (X);
- end To_Double_Precision;
-
- function To_Real (X : Double_Precision) return Real is
- begin
- return Real (X);
- end To_Real;
-
- ---------
- -- dot --
- ---------
-
- function dot
- (N : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1;
- Y : Real_Vector;
- Inc_Y : Integer := 1) return Real
- is
- begin
- if Is_Single then
- declare
- type X_Ptr is access all BLAS.Real_Vector (X'Range);
- type Y_Ptr is access all BLAS.Real_Vector (Y'Range);
- function Conv_X is new Unchecked_Conversion (Address, X_Ptr);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- return Real (sdot (N, Conv_X (X'Address).all, Inc_X,
- Conv_Y (Y'Address).all, Inc_Y));
- end;
-
- elsif Is_Double then
- declare
- type X_Ptr is access all BLAS.Double_Precision_Vector (X'Range);
- type Y_Ptr is access all BLAS.Double_Precision_Vector (Y'Range);
- function Conv_X is new Unchecked_Conversion (Address, X_Ptr);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- return Real (ddot (N, Conv_X (X'Address).all, Inc_X,
- Conv_Y (Y'Address).all, Inc_Y));
- end;
-
- else
- return Real (ddot (N, To_Double_Precision (X), Inc_X,
- To_Double_Precision (Y), Inc_Y));
- end if;
- end dot;
-
- ----------
- -- gemm --
- ----------
-
- procedure gemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Integer;
- B : Real_Matrix;
- Ld_B : Integer;
- Beta : Real := 0.0;
- C : in out Real_Matrix;
- Ld_C : Integer)
- is
- begin
- if Is_Single then
- declare
- subtype A_Type is BLAS.Real_Matrix (A'Range (1), A'Range (2));
- subtype B_Type is BLAS.Real_Matrix (B'Range (1), B'Range (2));
- type C_Ptr is
- access all BLAS.Real_Matrix (C'Range (1), C'Range (2));
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Real_Matrix, B_Type);
- function Conv_C is new Unchecked_Conversion (Address, C_Ptr);
- begin
- sgemm (Trans_A, Trans_B, M, N, K, Fortran.Real (Alpha),
- Conv_A (A), Ld_A, Conv_B (B), Ld_B, Fortran.Real (Beta),
- Conv_C (C'Address).all, Ld_C);
- end;
-
- elsif Is_Double then
- declare
- subtype A_Type is
- Double_Precision_Matrix (A'Range (1), A'Range (2));
- subtype B_Type is
- Double_Precision_Matrix (B'Range (1), B'Range (2));
- type C_Ptr is
- access all Double_Precision_Matrix (C'Range (1), C'Range (2));
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Real_Matrix, B_Type);
- function Conv_C is new Unchecked_Conversion (Address, C_Ptr);
- begin
- dgemm (Trans_A, Trans_B, M, N, K, Double_Precision (Alpha),
- Conv_A (A), Ld_A, Conv_B (B), Ld_B, Double_Precision (Beta),
- Conv_C (C'Address).all, Ld_C);
- end;
-
- else
- declare
- DP_C : Double_Precision_Matrix (C'Range (1), C'Range (2));
- begin
- if Beta /= 0.0 then
- DP_C := To_Double_Precision (C);
- end if;
-
- dgemm (Trans_A, Trans_B, M, N, K, Double_Precision (Alpha),
- To_Double_Precision (A), Ld_A,
- To_Double_Precision (B), Ld_B, Double_Precision (Beta),
- DP_C, Ld_C);
-
- C := To_Real (DP_C);
- end;
- end if;
- end gemm;
-
- ----------
- -- gemv --
- ----------
-
- procedure gemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1;
- Beta : Real := 0.0;
- Y : in out Real_Vector;
- Inc_Y : Integer := 1)
- is
- begin
- if Is_Single then
- declare
- subtype A_Type is BLAS.Real_Matrix (A'Range (1), A'Range (2));
- subtype X_Type is BLAS.Real_Vector (X'Range);
- type Y_Ptr is access all BLAS.Real_Vector (Y'Range);
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_X is new Unchecked_Conversion (Real_Vector, X_Type);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- sgemv (Trans, M, N, Fortran.Real (Alpha),
- Conv_A (A), Ld_A, Conv_X (X), Inc_X, Fortran.Real (Beta),
- Conv_Y (Y'Address).all, Inc_Y);
- end;
-
- elsif Is_Double then
- declare
- subtype A_Type is
- Double_Precision_Matrix (A'Range (1), A'Range (2));
- subtype X_Type is Double_Precision_Vector (X'Range);
- type Y_Ptr is access all Double_Precision_Vector (Y'Range);
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_X is new Unchecked_Conversion (Real_Vector, X_Type);
- function Conv_Y is new Unchecked_Conversion (Address, Y_Ptr);
- begin
- dgemv (Trans, M, N, Double_Precision (Alpha),
- Conv_A (A), Ld_A, Conv_X (X), Inc_X,
- Double_Precision (Beta),
- Conv_Y (Y'Address).all, Inc_Y);
- end;
-
- else
- declare
- DP_Y : Double_Precision_Vector (Y'Range);
- begin
- if Beta /= 0.0 then
- DP_Y := To_Double_Precision (Y);
- end if;
-
- dgemv (Trans, M, N, Double_Precision (Alpha),
- To_Double_Precision (A), Ld_A,
- To_Double_Precision (X), Inc_X, Double_Precision (Beta),
- DP_Y, Inc_Y);
-
- Y := To_Real (DP_Y);
- end;
- end if;
- end gemv;
-
- ----------
- -- nrm2 --
- ----------
-
- function nrm2
- (N : Natural;
- X : Real_Vector;
- Inc_X : Integer := 1) return Real
- is
- begin
- if Is_Single then
- declare
- subtype X_Type is BLAS.Real_Vector (X'Range);
- function Conv_X is new Unchecked_Conversion (Real_Vector, X_Type);
- begin
- return Real (snrm2 (N, Conv_X (X), Inc_X));
- end;
-
- elsif Is_Double then
- declare
- subtype X_Type is Double_Precision_Vector (X'Range);
- function Conv_X is new Unchecked_Conversion (Real_Vector, X_Type);
- begin
- return Real (dnrm2 (N, Conv_X (X), Inc_X));
- end;
-
- else
- return Real (dnrm2 (N, To_Double_Precision (X), Inc_X));
- end if;
- end nrm2;
-
-end System.Generic_Real_BLAS;
diff --git a/gcc/ada/s-gerebl.ads b/gcc/ada/s-gerebl.ads
deleted file mode 100644
index dacbf7bdb13..00000000000
--- a/gcc/ada/s-gerebl.ads
+++ /dev/null
@@ -1,96 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- SYSTEM.GENERIC_REAL_BLAS --
--- --
--- 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. --
--- --
-------------------------------------------------------------------------------
-
--- Package comment required ???
-
-generic
- type Real is digits <>;
- type Real_Vector is array (Integer range <>) of Real;
- type Real_Matrix is array (Integer range <>, Integer range <>) of Real;
-package System.Generic_Real_BLAS is
- pragma Pure;
-
- -- Although BLAS support is only available for IEEE single and double
- -- compatible floating-point types, this unit will accept any type
- -- and apply conversions as necessary, with possible loss of
- -- precision and range.
-
- No_Trans : aliased constant Character := 'N';
- Trans : aliased constant Character := 'T';
- Conj_Trans : aliased constant Character := 'C';
-
- -- BLAS Level 1 Subprograms and Types
-
- function dot
- (N : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1;
- Y : Real_Vector;
- Inc_Y : Integer := 1) return Real;
-
- function nrm2
- (N : Natural;
- X : Real_Vector;
- Inc_X : Integer := 1) return Real;
-
- procedure gemv
- (Trans : access constant Character;
- M : Natural := 0;
- N : Natural := 0;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Positive;
- X : Real_Vector;
- Inc_X : Integer := 1; -- must be non-zero
- Beta : Real := 0.0;
- Y : in out Real_Vector;
- Inc_Y : Integer := 1); -- must be non-zero
-
- -- BLAS Level 3
-
- -- gemm s, d, c, z Matrix-matrix product of general matrices
-
- procedure gemm
- (Trans_A : access constant Character;
- Trans_B : access constant Character;
- M : Positive;
- N : Positive;
- K : Positive;
- Alpha : Real := 1.0;
- A : Real_Matrix;
- Ld_A : Integer;
- B : Real_Matrix;
- Ld_B : Integer;
- Beta : Real := 0.0;
- C : in out Real_Matrix;
- Ld_C : Integer);
-
-end System.Generic_Real_BLAS;
diff --git a/gcc/ada/s-gerela.adb b/gcc/ada/s-gerela.adb
deleted file mode 100644
index 57d3640ad4d..00000000000
--- a/gcc/ada/s-gerela.adb
+++ /dev/null
@@ -1,564 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- SYSTEM.GENERIC_REAL_LAPACK --
--- --
--- 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. --
--- --
-------------------------------------------------------------------------------
-
-with Ada.Unchecked_Conversion; use Ada;
-with Interfaces; use Interfaces;
-with Interfaces.Fortran; use Interfaces.Fortran;
-with Interfaces.Fortran.BLAS; use Interfaces.Fortran.BLAS;
-with Interfaces.Fortran.LAPACK; use Interfaces.Fortran.LAPACK;
-with System.Generic_Array_Operations; use System.Generic_Array_Operations;
-
-package body System.Generic_Real_LAPACK is
-
- Is_Real : constant Boolean :=
- Real'Machine_Mantissa = Fortran.Real'Machine_Mantissa
- and then Fortran.Real (Real'First) = Fortran.Real'First
- and then Fortran.Real (Real'Last) = Fortran.Real'Last;
-
- Is_Double_Precision : constant Boolean :=
- Real'Machine_Mantissa =
- Double_Precision'Machine_Mantissa
- and then
- Double_Precision (Real'First) =
- Double_Precision'First
- and then
- Double_Precision (Real'Last) =
- Double_Precision'Last;
-
- -- Local subprograms
-
- function To_Double_Precision (X : Real) return Double_Precision;
- pragma Inline_Always (To_Double_Precision);
-
- function To_Real (X : Double_Precision) return Real;
- pragma Inline_Always (To_Real);
-
- -- Instantiations
-
- function To_Double_Precision is new
- Vector_Elementwise_Operation
- (X_Scalar => Real,
- Result_Scalar => Double_Precision,
- X_Vector => Real_Vector,
- Result_Vector => Double_Precision_Vector,
- Operation => To_Double_Precision);
-
- function To_Real is new
- Vector_Elementwise_Operation
- (X_Scalar => Double_Precision,
- Result_Scalar => Real,
- X_Vector => Double_Precision_Vector,
- Result_Vector => Real_Vector,
- Operation => To_Real);
-
- function To_Double_Precision is new
- Matrix_Elementwise_Operation
- (X_Scalar => Real,
- Result_Scalar => Double_Precision,
- X_Matrix => Real_Matrix,
- Result_Matrix => Double_Precision_Matrix,
- Operation => To_Double_Precision);
-
- function To_Real is new
- Matrix_Elementwise_Operation
- (X_Scalar => Double_Precision,
- Result_Scalar => Real,
- X_Matrix => Double_Precision_Matrix,
- Result_Matrix => Real_Matrix,
- Operation => To_Real);
-
- function To_Double_Precision (X : Real) return Double_Precision is
- begin
- return Double_Precision (X);
- end To_Double_Precision;
-
- function To_Real (X : Double_Precision) return Real is
- begin
- return Real (X);
- end To_Real;
-
- -----------
- -- getrf --
- -----------
-
- procedure getrf
- (M : Natural;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type A_Ptr is
- access all BLAS.Real_Matrix (A'Range (1), A'Range (2));
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- begin
- sgetrf (M, N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv), Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type A_Ptr is
- access all Double_Precision_Matrix (A'Range (1), A'Range (2));
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- begin
- dgetrf (M, N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv), Info);
- end;
-
- else
- declare
- DP_A : Double_Precision_Matrix (A'Range (1), A'Range (2));
- begin
- DP_A := To_Double_Precision (A);
- dgetrf (M, N, DP_A, Ld_A, LAPACK.Integer_Vector (I_Piv), Info);
- A := To_Real (DP_A);
- end;
- end if;
- end getrf;
-
- -----------
- -- getri --
- -----------
-
- procedure getri
- (N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Real_Vector;
- L_Work : Integer;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type A_Ptr is
- access all BLAS.Real_Matrix (A'Range (1), A'Range (2));
- type Work_Ptr is
- access all BLAS.Real_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- sgetri (N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type A_Ptr is
- access all Double_Precision_Matrix (A'Range (1), A'Range (2));
- type Work_Ptr is
- access all Double_Precision_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- dgetri (N, Conv_A (A'Address).all, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Precision_Matrix (A'Range (1), A'Range (2));
- DP_Work : Double_Precision_Vector (Work'Range);
- begin
- DP_A := To_Double_Precision (A);
- dgetri (N, DP_A, Ld_A, LAPACK.Integer_Vector (I_Piv),
- DP_Work, L_Work, Info);
- A := To_Real (DP_A);
- Work (1) := To_Real (DP_Work (1));
- end;
- end if;
- end getri;
-
- -----------
- -- getrs --
- -----------
-
- procedure getrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Real_Matrix;
- Ld_B : Positive;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- subtype A_Type is BLAS.Real_Matrix (A'Range (1), A'Range (2));
- type B_Ptr is
- access all BLAS.Real_Matrix (B'Range (1), B'Range (2));
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Address, B_Ptr);
- begin
- sgetrs (Trans, N, N_Rhs,
- Conv_A (A), Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_B (B'Address).all, Ld_B,
- Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- subtype A_Type is
- Double_Precision_Matrix (A'Range (1), A'Range (2));
- type B_Ptr is
- access all Double_Precision_Matrix (B'Range (1), B'Range (2));
- function Conv_A is new Unchecked_Conversion (Real_Matrix, A_Type);
- function Conv_B is new Unchecked_Conversion (Address, B_Ptr);
- begin
- dgetrs (Trans, N, N_Rhs,
- Conv_A (A), Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- Conv_B (B'Address).all, Ld_B,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Precision_Matrix (A'Range (1), A'Range (2));
- DP_B : Double_Precision_Matrix (B'Range (1), B'Range (2));
- begin
- DP_A := To_Double_Precision (A);
- DP_B := To_Double_Precision (B);
- dgetrs (Trans, N, N_Rhs,
- DP_A, Ld_A,
- LAPACK.Integer_Vector (I_Piv),
- DP_B, Ld_B,
- Info);
- B := To_Real (DP_B);
- end;
- end if;
- end getrs;
-
- -----------
- -- orgtr --
- -----------
-
- procedure orgtr
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- Tau : Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type A_Ptr is
- access all BLAS.Real_Matrix (A'Range (1), A'Range (2));
- subtype Tau_Type is BLAS.Real_Vector (Tau'Range);
- type Work_Ptr is
- access all BLAS.Real_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Tau is
- new Unchecked_Conversion (Real_Vector, Tau_Type);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- sorgtr (Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Conv_Tau (Tau),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type A_Ptr is
- access all Double_Precision_Matrix (A'Range (1), A'Range (2));
- subtype Tau_Type is Double_Precision_Vector (Tau'Range);
- type Work_Ptr is
- access all Double_Precision_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_Tau is
- new Unchecked_Conversion (Real_Vector, Tau_Type);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- dorgtr (Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Conv_Tau (Tau),
- Conv_Work (Work'Address).all, L_Work,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Precision_Matrix (A'Range (1), A'Range (2));
- DP_Work : Double_Precision_Vector (Work'Range);
- DP_Tau : Double_Precision_Vector (Tau'Range);
- begin
- DP_A := To_Double_Precision (A);
- DP_Tau := To_Double_Precision (Tau);
- dorgtr (Uplo, N, DP_A, Ld_A, DP_Tau, DP_Work, L_Work, Info);
- A := To_Real (DP_A);
- Work (1) := To_Real (DP_Work (1));
- end;
- end if;
- end orgtr;
-
- -----------
- -- steqr --
- -----------
-
- procedure steqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Real_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type D_Ptr is access all BLAS.Real_Vector (D'Range);
- type E_Ptr is access all BLAS.Real_Vector (E'Range);
- type Z_Ptr is
- access all BLAS.Real_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is
- access all BLAS.Real_Vector (Work'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- ssteqr (Comp_Z, N,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Z (Z'Address).all,
- Ld_Z,
- Conv_Work (Work'Address).all,
- Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type D_Ptr is access all Double_Precision_Vector (D'Range);
- type E_Ptr is access all Double_Precision_Vector (E'Range);
- type Z_Ptr is
- access all Double_Precision_Matrix (Z'Range (1), Z'Range (2));
- type Work_Ptr is
- access all Double_Precision_Vector (Work'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Z is new Unchecked_Conversion (Address, Z_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- dsteqr (Comp_Z, N,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Z (Z'Address).all,
- Ld_Z,
- Conv_Work (Work'Address).all,
- Info);
- end;
-
- else
- declare
- DP_D : Double_Precision_Vector (D'Range);
- DP_E : Double_Precision_Vector (E'Range);
- DP_Z : Double_Precision_Matrix (Z'Range (1), Z'Range (2));
- DP_Work : Double_Precision_Vector (Work'Range);
- begin
- DP_D := To_Double_Precision (D);
- DP_E := To_Double_Precision (E);
-
- if Comp_Z.all = 'V' then
- DP_Z := To_Double_Precision (Z);
- end if;
-
- dsteqr (Comp_Z, N, DP_D, DP_E, DP_Z, Ld_Z, DP_Work, Info);
-
- D := To_Real (DP_D);
- E := To_Real (DP_E);
- Z := To_Real (DP_Z);
- end;
- end if;
- end steqr;
-
- -----------
- -- sterf --
- -----------
-
- procedure sterf
- (N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type D_Ptr is access all BLAS.Real_Vector (D'Range);
- type E_Ptr is access all BLAS.Real_Vector (E'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- begin
- ssterf (N, Conv_D (D'Address).all, Conv_E (E'Address).all, Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type D_Ptr is access all Double_Precision_Vector (D'Range);
- type E_Ptr is access all Double_Precision_Vector (E'Range);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- begin
- dsterf (N, Conv_D (D'Address).all, Conv_E (E'Address).all, Info);
- end;
-
- else
- declare
- DP_D : Double_Precision_Vector (D'Range);
- DP_E : Double_Precision_Vector (E'Range);
-
- begin
- DP_D := To_Double_Precision (D);
- DP_E := To_Double_Precision (E);
-
- dsterf (N, DP_D, DP_E, Info);
-
- D := To_Real (DP_D);
- E := To_Real (DP_E);
- end;
- end if;
- end sterf;
-
- -----------
- -- sytrd --
- -----------
-
- procedure sytrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- D : out Real_Vector;
- E : out Real_Vector;
- Tau : out Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer)
- is
- begin
- if Is_Real then
- declare
- type A_Ptr is
- access all BLAS.Real_Matrix (A'Range (1), A'Range (2));
- type D_Ptr is access all BLAS.Real_Vector (D'Range);
- type E_Ptr is access all BLAS.Real_Vector (E'Range);
- type Tau_Ptr is access all BLAS.Real_Vector (Tau'Range);
- type Work_Ptr is
- access all BLAS.Real_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Tau is new Unchecked_Conversion (Address, Tau_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- ssytrd (Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Tau (Tau'Address).all,
- Conv_Work (Work'Address).all,
- L_Work,
- Info);
- end;
-
- elsif Is_Double_Precision then
- declare
- type A_Ptr is
- access all Double_Precision_Matrix (A'Range (1), A'Range (2));
- type D_Ptr is access all Double_Precision_Vector (D'Range);
- type E_Ptr is access all Double_Precision_Vector (E'Range);
- type Tau_Ptr is access all Double_Precision_Vector (Tau'Range);
- type Work_Ptr is
- access all Double_Precision_Vector (Work'Range);
- function Conv_A is new Unchecked_Conversion (Address, A_Ptr);
- function Conv_D is new Unchecked_Conversion (Address, D_Ptr);
- function Conv_E is new Unchecked_Conversion (Address, E_Ptr);
- function Conv_Tau is new Unchecked_Conversion (Address, Tau_Ptr);
- function Conv_Work is new Unchecked_Conversion (Address, Work_Ptr);
- begin
- dsytrd (Uplo, N,
- Conv_A (A'Address).all, Ld_A,
- Conv_D (D'Address).all,
- Conv_E (E'Address).all,
- Conv_Tau (Tau'Address).all,
- Conv_Work (Work'Address).all,
- L_Work,
- Info);
- end;
-
- else
- declare
- DP_A : Double_Precision_Matrix (A'Range (1), A'Range (2));
- DP_D : Double_Precision_Vector (D'Range);
- DP_E : Double_Precision_Vector (E'Range);
- DP_Tau : Double_Precision_Vector (Tau'Range);
- DP_Work : Double_Precision_Vector (Work'Range);
- begin
- DP_A := To_Double_Precision (A);
-
- dsytrd (Uplo, N, DP_A, Ld_A, DP_D, DP_E, DP_Tau,
- DP_Work, L_Work, Info);
-
- if L_Work /= -1 then
- A := To_Real (DP_A);
- D := To_Real (DP_D);
- E := To_Real (DP_E);
- Tau := To_Real (DP_Tau);
- end if;
-
- Work (1) := To_Real (DP_Work (1));
- end;
- end if;
- end sytrd;
-
-end System.Generic_Real_LAPACK;
diff --git a/gcc/ada/s-gerela.ads b/gcc/ada/s-gerela.ads
deleted file mode 100644
index c09ce81d027..00000000000
--- a/gcc/ada/s-gerela.ads
+++ /dev/null
@@ -1,128 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . G E N E R I C _ R E A L _ L A P A C K --
--- --
--- S p e c --
--- --
--- Copyright (C) 2006-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. --
--- --
-------------------------------------------------------------------------------
-
--- Package comment required ???
-
-generic
- type Real is digits <>;
- type Real_Vector is array (Integer range <>) of Real;
- type Real_Matrix is array (Integer range <>, Integer range <>) of Real;
-package System.Generic_Real_LAPACK is
- pragma Pure;
-
- type Integer_Vector is array (Integer range <>) of Integer;
-
- Upper : aliased constant Character := 'U';
- Lower : aliased constant Character := 'L';
-
- -- LAPACK Computational Routines
-
- -- gerfs Refines the solution of a system of linear equations with
- -- a general matrix and estimates its error
- -- getrf Computes LU factorization of a general m-by-n matrix
- -- getri Computes inverse of an LU-factored general matrix
- -- square matrix, with multiple right-hand sides
- -- getrs Solves a system of linear equations with an LU-factored
- -- square matrix, with multiple right-hand sides
- -- orgtr Generates the Float orthogonal matrix Q determined by sytrd
- -- steqr Computes all eigenvalues and eigenvectors of a symmetric or
- -- Hermitian matrix reduced to tridiagonal form (QR algorithm)
- -- sterf Computes all eigenvalues of a Float symmetric
- -- tridiagonal matrix using QR algorithm
- -- sytrd Reduces a Float symmetric matrix to tridiagonal form
-
- procedure getrf
- (M : Natural;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : out Integer_Vector;
- Info : access Integer);
-
- procedure getri
- (N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- Work : in out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure getrs
- (Trans : access constant Character;
- N : Natural;
- N_Rhs : Natural;
- A : Real_Matrix;
- Ld_A : Positive;
- I_Piv : Integer_Vector;
- B : in out Real_Matrix;
- Ld_B : Positive;
- Info : access Integer);
-
- procedure orgtr
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- Tau : Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
- procedure sterf
- (N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Info : access Integer);
-
- procedure steqr
- (Comp_Z : access constant Character;
- N : Natural;
- D : in out Real_Vector;
- E : in out Real_Vector;
- Z : in out Real_Matrix;
- Ld_Z : Positive;
- Work : out Real_Vector;
- Info : access Integer);
-
- procedure sytrd
- (Uplo : access constant Character;
- N : Natural;
- A : in out Real_Matrix;
- Ld_A : Positive;
- D : out Real_Vector;
- E : out Real_Vector;
- Tau : out Real_Vector;
- Work : out Real_Vector;
- L_Work : Integer;
- Info : access Integer);
-
-end System.Generic_Real_LAPACK;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 27c847df6e9..410cc8c0f06 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -1156,7 +1156,7 @@ package body System.Tasking.Stages is
Stack_Guard (Self_ID, True);
-- Initialize low-level TCB components, that cannot be initialized by
- -- the creator. Enter_Task sets Self_ID.LL.Thread
+ -- the creator. Enter_Task sets Self_ID.LL.Thread.
Enter_Task (Self_ID);
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 98a57e2556e..34346e39925 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -5013,12 +5013,16 @@ package body Sem_Ch10 is
-- Set entity of parent identifiers if the unit is a child
-- unit. This ensures that the tree is properly formed from
- -- semantic point of view (e.g. for ASIS queries).
+ -- semantic point of view (e.g. for ASIS queries). The unit
+ -- entities are not fully analyzed, so we need to follow unit
+ -- links in the tree.
Set_Entity (Nam, Ent);
Nam := Prefix (Nam);
- Ent := Scope (Ent);
+ Ent :=
+ Defining_Entity
+ (Unit (Parent_Spec (Unit_Declaration_Node (Ent))));
-- Set entity of last ancestor
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index e62629e2a22..e51b8029803 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -7549,16 +7549,14 @@ package body Sem_Ch12 is
Scop := Scope (Scop);
end loop;
- if Scop = Par_I then
-
- -- Previous instance encloses current instance
+ -- Previous instance encloses current instance
+ if Scop = Par_I then
null;
- elsif Is_Generic_Instance (Scop) then
-
- -- Current instance is within an unrelated instance
+ -- Current instance is within an unrelated instance
+ elsif Is_Generic_Instance (Scop) then
null;
else
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index d30ba09635d..acfb989dc3c 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1231,8 +1231,13 @@ package body Sem_Ch13 is
-- We do not do this for Pre'Class, since we have to put
-- these conditions together in a complex OR expression
- if Pname = Name_Postcondition
- or else not Class_Present (Aspect)
+ -- We do not do this in ASIS mode, as ASIS relies on the
+ -- original node representing the complete expression, when
+ -- retrieving it through the source aspect table.
+
+ if not ASIS_Mode
+ and then (Pname = Name_Postcondition
+ or else not Class_Present (Aspect))
then
while Nkind (Expr) = N_And_Then loop
Insert_After (Aspect,
@@ -1385,6 +1390,7 @@ package body Sem_Ch13 is
Args : List_Id;
Comp_Expr : Node_Id;
Comp_Assn : Node_Id;
+ New_Expr : Node_Id;
begin
Args := New_List;
@@ -1401,11 +1407,18 @@ package body Sem_Ch13 is
goto Continue;
end if;
+ -- Make pragma expressions refer to the original aspect
+ -- expressions through the Original_Node link. This is used
+ -- in semantic analysis for ASIS mode, so that the original
+ -- expression also gets analyzed.
+
Comp_Expr := First (Expressions (Expr));
while Present (Comp_Expr) loop
+ New_Expr := Relocate_Node (Comp_Expr);
+ Set_Original_Node (New_Expr, Comp_Expr);
Append
(Make_Pragma_Argument_Association (Sloc (Comp_Expr),
- Expression => Relocate_Node (Comp_Expr)),
+ Expression => New_Expr),
Args);
Next (Comp_Expr);
end loop;
@@ -1421,10 +1434,12 @@ package body Sem_Ch13 is
goto Continue;
end if;
+ New_Expr := Relocate_Node (Expression (Comp_Assn));
+ Set_Original_Node (New_Expr, Expression (Comp_Assn));
Append (Make_Pragma_Argument_Association (
Sloc => Sloc (Comp_Assn),
Chars => Chars (First (Choices (Comp_Assn))),
- Expression => Relocate_Node (Expression (Comp_Assn))),
+ Expression => New_Expr),
Args);
Next (Comp_Assn);
end loop;
@@ -8732,8 +8747,8 @@ package body Sem_Ch13 is
Source : constant Entity_Id := T.Source;
Target : constant Entity_Id := T.Target;
- Source_Siz : Uint;
- Target_Siz : Uint;
+ Source_Siz : Uint;
+ Target_Siz : Uint;
begin
-- This validation check, which warns if we have unequal sizes for
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index efc76f11398..4b438e13f1c 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -6427,38 +6427,20 @@ package body Sem_Ch4 is
Func : Entity_Id;
Func_Name : Node_Id;
Indexing : Node_Id;
- Is_Var : Boolean;
- Ritem : Node_Id;
begin
-- Check whether type has a specified indexing aspect
Func_Name := Empty;
- Is_Var := False;
- Ritem := First_Rep_Item (Etype (Prefix));
- while Present (Ritem) loop
- if Nkind (Ritem) = N_Aspect_Specification then
-
- -- Prefer Variable_Indexing, but will settle for Constant
-
- if Get_Aspect_Id (Chars (Identifier (Ritem))) =
- Aspect_Constant_Indexing
- then
- Func_Name := Expression (Ritem);
-
- elsif Get_Aspect_Id (Chars (Identifier (Ritem))) =
- Aspect_Variable_Indexing
- then
- Func_Name := Expression (Ritem);
- Is_Var := True;
- exit;
- end if;
- end if;
+ if Is_Variable (Prefix) then
+ Func_Name := Find_Aspect (Etype (Prefix), Aspect_Variable_Indexing);
+ end if;
- Next_Rep_Item (Ritem);
- end loop;
+ if No (Func_Name) then
+ Func_Name := Find_Aspect (Etype (Prefix), Aspect_Constant_Indexing);
+ end if;
-- If aspect does not exist the expression is illegal. Error is
-- diagnosed in caller.
@@ -6478,12 +6460,6 @@ package body Sem_Ch4 is
end if;
end if;
- if Is_Var
- and then not Is_Variable (Prefix)
- then
- Error_Msg_N ("Variable indexing cannot be applied to a constant", N);
- end if;
-
if not Is_Overloaded (Func_Name) then
Func := Entity (Func_Name);
Indexing := Make_Function_Call (Loc,
@@ -6526,11 +6502,11 @@ package body Sem_Ch4 is
Analyze_One_Call (N, It.Nam, False, Success);
if Success then
Set_Etype (Name (N), It.Typ);
+ Set_Entity (Name (N), It.Nam);
-- Add implicit dereference interpretation
Disc := First_Discriminant (Etype (It.Nam));
-
while Present (Disc) loop
if Has_Implicit_Dereference (Disc) then
Add_One_Interp
@@ -6540,12 +6516,21 @@ package body Sem_Ch4 is
Next_Discriminant (Disc);
end loop;
+
+ exit;
end if;
Get_Next_Interp (I, It);
end loop;
end;
end if;
+ if Etype (N) = Any_Type then
+ Error_Msg_NE ("container cannot be indexed with&", N, Etype (Expr));
+ Rewrite (N, New_Occurrence_Of (Any_Id, Loc));
+ else
+ Analyze (N);
+ end if;
+
return True;
end Try_Container_Indexing;
@@ -6863,7 +6848,8 @@ package body Sem_Ch4 is
First_Actual := First (Parameter_Associations (Call_Node));
-- For cross-reference purposes, treat the new node as being in
- -- the source if the original one is.
+ -- the source if the original one is. Set entity and type, even
+ -- though they may be overwritten during resolution if overloaded.
Set_Comes_From_Source (Subprog, Comes_From_Source (N));
Set_Comes_From_Source (Call_Node, Comes_From_Source (N));
@@ -6872,6 +6858,7 @@ package body Sem_Ch4 is
and then not Inside_A_Generic
then
Set_Entity (Selector_Name (N), Entity (Subprog));
+ Set_Etype (Selector_Name (N), Etype (Entity (Subprog)));
end if;
-- If need be, rewrite first actual as an explicit dereference
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 1b0f919d3ff..0e6c5cf98bd 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -2429,8 +2429,17 @@ package body Sem_Ch5 is
-- The type of the loop variable is the Iterator_Element aspect of
-- the container type.
- Set_Etype (Def_Id,
- Entity (Find_Aspect (Typ, Aspect_Iterator_Element)));
+ declare
+ Element : constant Entity_Id :=
+ Find_Aspect (Typ, Aspect_Iterator_Element);
+ begin
+ if No (Element) then
+ Error_Msg_NE ("cannot iterate over&", N, Typ);
+ return;
+ else
+ Set_Etype (Def_Id, Entity (Element));
+ end if;
+ end;
else
-- For an iteration of the form IN, the name must denote an
@@ -2440,12 +2449,17 @@ package body Sem_Ch5 is
if Is_Entity_Name (Original_Node (Name (N)))
and then not Is_Iterator (Typ)
then
- Error_Msg_N
- ("name must be an iterator, not a container", Name (N));
+ if No (Find_Aspect (Typ, Aspect_Iterator_Element)) then
+ Error_Msg_NE
+ ("cannot iterate over&", Name (N), Typ);
+ else
+ Error_Msg_N
+ ("name must be an iterator, not a container", Name (N));
+ end if;
Error_Msg_NE
- ("\to iterate directly over a container, write `of &`",
- Name (N), Original_Node (Name (N)));
+ ("\to iterate directly over the elements of a container, " &
+ "write `of &`", Name (N), Original_Node (Name (N)));
end if;
-- The result type of Iterate function is the classwide type of
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 3dbf782b60b..a9f84d34faa 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1641,10 +1641,13 @@ package body Sem_Ch6 is
-- The type must be completed in the current package. This
-- is checked at the end of the package declaraton, when
- -- Taft amemdment types are identified.
+ -- Taft-amendment types are identified. If the return type
+ -- is class-wide, there is no required check, the type can
+ -- be a bona fide TAT.
if Ekind (Scope (Current_Scope)) = E_Package
and then In_Private_Part (Scope (Current_Scope))
+ and then not Is_Class_Wide_Type (Typ)
then
Append_Elmt (Designator, Private_Dependents (Typ));
end if;
@@ -3415,14 +3418,17 @@ package body Sem_Ch6 is
-- Ada 2005 (AI-251): If the return type is abstract, verify that
-- the subprogram is abstract also. This does not apply to renaming
- -- declarations, where abstractness is inherited.
+ -- declarations, where abstractness is inherited, and to subprogram
+ -- bodies generated for stream operations, which become renamings as
+ -- bodies.
-- In case of primitives associated with abstract interface types
-- the check is applied later (see Analyze_Subprogram_Declaration).
- if not Nkind_In (Parent (N), N_Subprogram_Renaming_Declaration,
- N_Abstract_Subprogram_Declaration,
- N_Formal_Abstract_Subprogram_Declaration)
+ if not Nkind_In (Original_Node (Parent (N)),
+ N_Subprogram_Renaming_Declaration,
+ N_Abstract_Subprogram_Declaration,
+ N_Formal_Abstract_Subprogram_Declaration)
then
if Is_Abstract_Type (Etype (Designator))
and then not Is_Interface (Etype (Designator))
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 9de2f1f0320..397c73380a2 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -181,7 +181,7 @@ package body Sem_Prag is
-- original one, following the renaming chain) is returned. Otherwise the
-- entity is returned unchanged. Should be in Einfo???
- procedure Preanalyze_TC_Args (Arg_Req, Arg_Ens : Node_Id);
+ procedure Preanalyze_TC_Args (N, Arg_Req, Arg_Ens : Node_Id);
-- Preanalyze the boolean expressions in the Requires and Ensures arguments
-- of a Test_Case pragma if present (possibly Empty). We treat these as
-- spec expressions (i.e. similar to a default expression).
@@ -260,8 +260,17 @@ package body Sem_Prag is
-- Preanalyze the boolean expression, we treat this as a spec expression
-- (i.e. similar to a default expression).
- Preanalyze_Spec_Expression
- (Get_Pragma_Arg (Arg1), Standard_Boolean);
+ Preanalyze_Spec_Expression (Get_Pragma_Arg (Arg1), Standard_Boolean);
+
+ -- In ASIS mode, for a pragma generated from a source aspect, also
+ -- analyze the original aspect expression.
+
+ if ASIS_Mode
+ and then Present (Corresponding_Aspect (N))
+ then
+ Preanalyze_Spec_Expression
+ (Expression (Corresponding_Aspect (N)), Standard_Boolean);
+ end if;
-- For a class-wide condition, a reference to a controlling formal must
-- be interpreted as having the class-wide type (or an access to such)
@@ -518,6 +527,15 @@ package body Sem_Prag is
-- This procedure checks for possible duplications if this is the export
-- case, and if found, issues an appropriate error message.
+ procedure Check_Expr_Is_Static_Expression
+ (Expr : Node_Id;
+ Typ : Entity_Id := Empty);
+ -- Check the specified expression Expr to make sure that it is a static
+ -- expression of the given type (i.e. it will be analyzed and resolved
+ -- using this type, which can be any valid argument to Resolve, e.g.
+ -- Any_Integer is OK). If not, given error and raise Pragma_Exit. If
+ -- Typ is left Empty, then any static expression is allowed.
+
procedure Check_First_Subtype (Arg : Node_Id);
-- Checks that Arg, whose expression is an entity name, references a
-- first subtype.
@@ -1199,53 +1217,8 @@ package body Sem_Prag is
(Arg : Node_Id;
Typ : Entity_Id := Empty)
is
- Argx : constant Node_Id := Get_Pragma_Arg (Arg);
-
begin
- if Present (Typ) then
- Analyze_And_Resolve (Argx, Typ);
- else
- Analyze_And_Resolve (Argx);
- end if;
-
- if Is_OK_Static_Expression (Argx) then
- return;
-
- elsif Etype (Argx) = Any_Type then
- raise Pragma_Exit;
-
- -- An interesting special case, if we have a string literal and we
- -- are in Ada 83 mode, then we allow it even though it will not be
- -- flagged as static. This allows the use of Ada 95 pragmas like
- -- Import in Ada 83 mode. They will of course be flagged with
- -- warnings as usual, but will not cause errors.
-
- elsif Ada_Version = Ada_83
- and then Nkind (Argx) = N_String_Literal
- then
- return;
-
- -- Static expression that raises Constraint_Error. This has already
- -- been flagged, so just exit from pragma processing.
-
- elsif Is_Static_Expression (Argx) then
- raise Pragma_Exit;
-
- -- Finally, we have a real error
-
- else
- Error_Msg_Name_1 := Pname;
-
- declare
- Msg : String :=
- "argument for pragma% must be a static expression!";
- begin
- Fix_Error (Msg);
- Flag_Non_Static_Expr (Msg, Argx);
- end;
-
- raise Pragma_Exit;
- end if;
+ Check_Expr_Is_Static_Expression (Get_Pragma_Arg (Arg), Typ);
end Check_Arg_Is_Static_Expression;
------------------------------------------
@@ -1478,6 +1451,61 @@ package body Sem_Prag is
end if;
end Check_Duplicated_Export_Name;
+ -------------------------------------
+ -- Check_Expr_Is_Static_Expression --
+ -------------------------------------
+
+ procedure Check_Expr_Is_Static_Expression
+ (Expr : Node_Id;
+ Typ : Entity_Id := Empty)
+ is
+ begin
+ if Present (Typ) then
+ Analyze_And_Resolve (Expr, Typ);
+ else
+ Analyze_And_Resolve (Expr);
+ end if;
+
+ if Is_OK_Static_Expression (Expr) then
+ return;
+
+ elsif Etype (Expr) = Any_Type then
+ raise Pragma_Exit;
+
+ -- An interesting special case, if we have a string literal and we
+ -- are in Ada 83 mode, then we allow it even though it will not be
+ -- flagged as static. This allows the use of Ada 95 pragmas like
+ -- Import in Ada 83 mode. They will of course be flagged with
+ -- warnings as usual, but will not cause errors.
+
+ elsif Ada_Version = Ada_83
+ and then Nkind (Expr) = N_String_Literal
+ then
+ return;
+
+ -- Static expression that raises Constraint_Error. This has already
+ -- been flagged, so just exit from pragma processing.
+
+ elsif Is_Static_Expression (Expr) then
+ raise Pragma_Exit;
+
+ -- Finally, we have a real error
+
+ else
+ Error_Msg_Name_1 := Pname;
+
+ declare
+ Msg : String :=
+ "argument for pragma% must be a static expression!";
+ begin
+ Fix_Error (Msg);
+ Flag_Non_Static_Expr (Msg, Expr);
+ end;
+
+ raise Pragma_Exit;
+ end if;
+ end Check_Expr_Is_Static_Expression;
+
-------------------------
-- Check_First_Subtype --
-------------------------
@@ -1980,6 +2008,16 @@ package body Sem_Prag is
Preanalyze_Spec_Expression
(Get_Pragma_Arg (Arg1), Standard_Boolean);
+
+ -- In ASIS mode, for a pragma generated from a source aspect,
+ -- also analyze the original aspect expression.
+
+ if ASIS_Mode
+ and then Present (Corresponding_Aspect (N))
+ then
+ Preanalyze_Spec_Expression
+ (Expression (Corresponding_Aspect (N)), Standard_Boolean);
+ end if;
end if;
In_Body := True;
@@ -5462,10 +5500,10 @@ package body Sem_Prag is
-- a non-atomic variable.
if C = Atomic_Synchronization
- and then not Is_Atomic (E)
+ and then not (Is_Atomic (E) or else Has_Atomic_Components (E))
then
Error_Msg_N
- ("pragma & requires atomic variable",
+ ("pragma & requires atomic type or variable",
Pragma_Identifier (Original_Node (N)));
end if;
@@ -7864,10 +7902,13 @@ package body Sem_Prag is
N_Indexed_Component,
N_Function_Call,
N_Identifier,
+ N_Expanded_Name,
N_Selected_Component)
then
-- If this pragma Debug comes from source, its argument was
-- parsed as a name form (which is syntactically identical).
+ -- In a generic context a parameterless call will be left as
+ -- an expanded name (if global) or selected_component if local.
-- Change it to a procedure call statement now.
Change_Name_To_Procedure_Call_Statement (Call);
@@ -10952,7 +10993,8 @@ package body Sem_Prag is
-- pragma Long_Float (D_Float | G_Float);
- when Pragma_Long_Float =>
+ when Pragma_Long_Float => Long_Float : declare
+ begin
GNAT_Pragma;
Check_Valid_Configuration_Pragma;
Check_Arg_Count (1);
@@ -10967,22 +11009,42 @@ package body Sem_Prag is
if Chars (Get_Pragma_Arg (Arg1)) = Name_D_Float then
if Opt.Float_Format_Long = 'G' then
- Error_Pragma ("G_Float previously specified");
- end if;
+ Error_Pragma_Arg
+ ("G_Float previously specified", Arg1);
+
+ elsif Current_Sem_Unit /= Main_Unit
+ and then Opt.Float_Format_Long /= 'D'
+ then
+ Error_Pragma_Arg
+ ("main unit not compiled with pragma Long_Float (D_Float)",
+ "\pragma% must be used consistently for whole partition",
+ Arg1);
- Opt.Float_Format_Long := 'D';
+ else
+ Opt.Float_Format_Long := 'D';
+ end if;
-- G_Float case (this is the default, does not need overriding)
else
if Opt.Float_Format_Long = 'D' then
Error_Pragma ("D_Float previously specified");
- end if;
- Opt.Float_Format_Long := 'G';
+ elsif Current_Sem_Unit /= Main_Unit
+ and then Opt.Float_Format_Long /= 'G'
+ then
+ Error_Pragma_Arg
+ ("main unit not compiled with pragma Long_Float (G_Float)",
+ "\pragma% must be used consistently for whole partition",
+ Arg1);
+
+ else
+ Opt.Float_Format_Long := 'G';
+ end if;
end if;
Set_Standard_Fpt_Formats;
+ end Long_Float;
-----------------------
-- Machine_Attribute --
@@ -13657,6 +13719,17 @@ package body Sem_Prag is
Check_Optional_Identifier (Arg1, Name_Name);
Check_Arg_Is_Static_Expression (Arg1, Standard_String);
+
+ -- In ASIS mode, for a pragma generated from a source aspect, also
+ -- analyze the original aspect expression.
+
+ if ASIS_Mode
+ and then Present (Corresponding_Aspect (N))
+ then
+ Check_Expr_Is_Static_Expression
+ (Original_Node (Get_Pragma_Arg (Arg1)), Standard_String);
+ end if;
+
Check_Optional_Identifier (Arg2, Name_Mode);
Check_Arg_Is_One_Of (Arg2, Name_Nominal, Name_Robustness);
@@ -14374,7 +14447,7 @@ package body Sem_Prag is
-- actual is a conversion. Retrieve the real entity name.
if (In_Instance_Body
- or else In_Inlined_Body)
+ or else In_Inlined_Body)
and then Nkind (E_Id) = N_Unchecked_Type_Conversion
then
E_Id := Expression (E_Id);
@@ -14545,7 +14618,8 @@ package body Sem_Prag is
-- Preanalyze the boolean expressions, we treat these as spec
-- expressions (i.e. similar to a default expression).
- Preanalyze_TC_Args (Get_Requires_From_Test_Case_Pragma (N),
+ Preanalyze_TC_Args (N,
+ Get_Requires_From_Test_Case_Pragma (N),
Get_Ensures_From_Test_Case_Pragma (N));
-- Remove the subprogram from the scope stack now that the pre-analysis
@@ -15065,7 +15139,7 @@ package body Sem_Prag is
-- Preanalyze_TC_Args --
------------------------
- procedure Preanalyze_TC_Args (Arg_Req, Arg_Ens : Node_Id) is
+ procedure Preanalyze_TC_Args (N, Arg_Req, Arg_Ens : Node_Id) is
begin
-- Preanalyze the boolean expressions, we treat these as spec
-- expressions (i.e. similar to a default expression).
@@ -15073,11 +15147,31 @@ package body Sem_Prag is
if Present (Arg_Req) then
Preanalyze_Spec_Expression
(Get_Pragma_Arg (Arg_Req), Standard_Boolean);
+
+ -- In ASIS mode, for a pragma generated from a source aspect, also
+ -- analyze the original aspect expression.
+
+ if ASIS_Mode
+ and then Present (Corresponding_Aspect (N))
+ then
+ Preanalyze_Spec_Expression
+ (Original_Node (Get_Pragma_Arg (Arg_Req)), Standard_Boolean);
+ end if;
end if;
if Present (Arg_Ens) then
Preanalyze_Spec_Expression
(Get_Pragma_Arg (Arg_Ens), Standard_Boolean);
+
+ -- In ASIS mode, for a pragma generated from a source aspect, also
+ -- analyze the original aspect expression.
+
+ if ASIS_Mode
+ and then Present (Corresponding_Aspect (N))
+ then
+ Preanalyze_Spec_Expression
+ (Original_Node (Get_Pragma_Arg (Arg_Ens)), Standard_Boolean);
+ end if;
end if;
end Preanalyze_TC_Args;
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index d94a6bfa328..ad59f952252 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -3926,16 +3926,16 @@ package body Sem_Res is
if Is_Atomic_Object (A)
and then not Is_Atomic (Etype (F))
then
- Error_Msg_N
- ("cannot pass atomic argument to non-atomic formal",
- N);
+ Error_Msg_NE
+ ("cannot pass atomic argument to non-atomic formal&",
+ A, F);
elsif Is_Volatile_Object (A)
and then not Is_Volatile (Etype (F))
then
- Error_Msg_N
- ("cannot pass volatile argument to non-volatile formal",
- N);
+ Error_Msg_NE
+ ("cannot pass volatile argument to non-volatile formal&",
+ A, F);
end if;
end if;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 9dfecd3d956..1764da9db02 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -10837,7 +10837,9 @@ package body Sem_Util is
-- source. This excludes, for example, calls to a dispatching
-- assignment operation when the left-hand side is tagged.
- if Modification_Comes_From_Source then
+ if Modification_Comes_From_Source
+ or else Alfa_Mode
+ then
Generate_Reference (Ent, Exp, 'm');
-- If the target of the assignment is the bound variable
@@ -12835,6 +12837,11 @@ package body Sem_Util is
U := Corresponding_Spec (P);
end if;
+ when Formal_Kind =>
+ if Present (Spec_Entity (E)) then
+ U := Spec_Entity (E);
+ end if;
+
when others =>
null;
end case;
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 9f0b259311c..99b71c00fbf 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3993,39 +3993,59 @@ package body Sem_Warn is
-- Case of assigned value never referenced
if No (N) then
+ declare
+ LA : constant Node_Id := Last_Assignment (Ent);
- -- Don't give this for OUT and IN OUT formals, since
- -- clearly caller may reference the assigned value. Also
- -- never give such warnings for internal variables.
+ begin
+ -- Don't give this for OUT and IN OUT formals, since
+ -- clearly caller may reference the assigned value. Also
+ -- never give such warnings for internal variables.
- if Ekind (Ent) = E_Variable
- and then not Is_Internal_Name (Chars (Ent))
- then
- if Referenced_As_Out_Parameter (Ent) then
- Error_Msg_NE
- ("?& modified by call, but value never referenced",
- Last_Assignment (Ent), Ent);
- else
- Error_Msg_NE -- CODEFIX
- ("?useless assignment to&, value never referenced!",
- Last_Assignment (Ent), Ent);
+ if Ekind (Ent) = E_Variable
+ and then not Is_Internal_Name (Chars (Ent))
+ then
+ -- Give appropriate message, distinguishing between
+ -- assignment statements and out parameters.
+
+ if Nkind_In (Parent (LA), N_Procedure_Call_Statement,
+ N_Parameter_Association)
+ then
+ Error_Msg_NE
+ ("?& modified by call, but value never "
+ & "referenced", LA, Ent);
+
+ else
+ Error_Msg_NE -- CODEFIX
+ ("?useless assignment to&, value never "
+ & "referenced!", LA, Ent);
+ end if;
end if;
- end if;
+ end;
-- Case of assigned value overwritten
else
- Error_Msg_Sloc := Sloc (N);
+ declare
+ LA : constant Node_Id := Last_Assignment (Ent);
- if Referenced_As_Out_Parameter (Ent) then
- Error_Msg_NE
- ("?& modified by call, but value overwritten #!",
- Last_Assignment (Ent), Ent);
- else
- Error_Msg_NE -- CODEFIX
- ("?useless assignment to&, value overwritten #!",
- Last_Assignment (Ent), Ent);
- end if;
+ begin
+ Error_Msg_Sloc := Sloc (N);
+
+ -- Give appropriate message, distinguishing between
+ -- assignment statements and out parameters.
+
+ if Nkind_In (Parent (LA), N_Procedure_Call_Statement,
+ N_Parameter_Association)
+ then
+ Error_Msg_NE
+ ("?& modified by call, but value overwritten #!",
+ LA, Ent);
+ else
+ Error_Msg_NE -- CODEFIX
+ ("?useless assignment to&, value overwritten #!",
+ LA, Ent);
+ end if;
+ end;
end if;
-- Clear last assignment indication and we are done
diff --git a/gcc/ada/sigtramp-ppcvxw.c b/gcc/ada/sigtramp-ppcvxw.c
index 57a02a7d162..bebe6572ee1 100644
--- a/gcc/ada/sigtramp-ppcvxw.c
+++ b/gcc/ada/sigtramp-ppcvxw.c
@@ -55,7 +55,11 @@
Checking which variant should apply and getting at sc_pregs is simpler
to express in C (we can't use offsetof in toplevel asms and hardcoding
constants is not workable with the flurry of VxWorks variants), so this
- is the choice for our toplevel interface. */
+ is the choice for our toplevel interface.
+
+ Note that the registers we "restore" here are those to which we have
+ direct access through the system sigcontext structure, which includes
+ only a partial set of the non-volatiles ABI-wise. */
/* -----------------------------------------
-- Protypes for our internal asm stubs --
@@ -120,8 +124,9 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
/* REGNO constants, dwarf column numbers for registers of interest. */
#define REGNO_LR 65
-#define REGNO_XER 76
+#define REGNO_CTR 66
#define REGNO_CR 70
+#define REGNO_XER 76
#define REGNO_GR(N) (N)
#define REGNO_PC 67 /* ARG_POINTER_REGNUM */
@@ -139,6 +144,8 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
multine contents: */
#define TAB(S) "\t" S
#define CR(S) S "\n"
+
+#undef TCR
#define TCR(S) TAB(CR(S))
/*------------------------------
@@ -147,11 +154,18 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
/* CFA setup block
---------------
- Only non-volatile registers are suitable for a CFA base. We use r14
- here and set it to the value we need in stub body that follows. */
+ Only non-volatile registers are suitable for a CFA base. These are the
+ only ones we can expect to be able retrieve from the unwinding context
+ while walking up the chain, saved by at least the bottom-most exception
+ propagation services. We use r15 here and set it to the value we need
+ in stub body that follows. Note that r14 is inappropriate here, even
+ though it is non-volatile according to the ABI, because GCC uses it as
+ an extra SCRATCH on SPE targets. */
+
+#define CFA_REG 15
#define CFI_DEF_CFA \
-CR(".cfi_def_cfa 14, 0")
+CR(".cfi_def_cfa " S(CFA_REG) ", 0")
/* Register location blocks
------------------------
@@ -164,7 +178,18 @@ CR(".cfi_def_cfa 14, 0")
#define CFI_COMMON_REGS \
CR("# CFI for common registers\n") \
-TCR(COMMON_CFI(GR(1))) \
+TCR(COMMON_CFI(GR(2))) \
+TCR(COMMON_CFI(GR(3))) \
+TCR(COMMON_CFI(GR(4))) \
+TCR(COMMON_CFI(GR(5))) \
+TCR(COMMON_CFI(GR(6))) \
+TCR(COMMON_CFI(GR(7))) \
+TCR(COMMON_CFI(GR(8))) \
+TCR(COMMON_CFI(GR(9))) \
+TCR(COMMON_CFI(GR(10))) \
+TCR(COMMON_CFI(GR(11))) \
+TCR(COMMON_CFI(GR(12))) \
+TCR(COMMON_CFI(GR(13))) \
TCR(COMMON_CFI(GR(14))) \
TCR(COMMON_CFI(GR(15))) \
TCR(COMMON_CFI(GR(16))) \
@@ -185,6 +210,8 @@ TCR(COMMON_CFI(GR(30))) \
TCR(COMMON_CFI(GR(31))) \
TCR(COMMON_CFI(LR)) \
TCR(COMMON_CFI(CR)) \
+TCR(COMMON_CFI(CTR)) \
+TCR(COMMON_CFI(XER)) \
TCR(COMMON_CFI(PC)) \
TCR(".cfi_return_column " S(REGNO_PC))
@@ -198,10 +225,10 @@ TCR("# registers we're going to modify") \
TCR("stwu %r1,-16(%r1)") \
TCR("mflr %r0") \
TCR("stw %r0,20(%r1)") \
-TCR("stw %r14,8(%r1)") \
+TCR("stw %r" S(CFA_REG) ",8(%r1)") \
TCR("") \
-TCR("# Setup r14 = sc_pregs, that we'll retrieve as our CFA value") \
-TCR("mr %r14, %r7") \
+TCR("# Setup CFA_REG = sc_pregs, that we'll retrieve as our CFA value") \
+TCR("mr %r" S(CFA_REG) ", %r7") \
TCR("") \
TCR("# Call the real handler. The signo, siginfo and sigcontext") \
TCR("# arguments are the same as those we received in r3, r4 and r5") \
@@ -209,7 +236,7 @@ TCR("mtctr %r6") \
TCR("bctrl") \
TCR("") \
TCR("# Restore our callee-saved items, release our frame and return") \
-TCR("lwz %r14,8(%r1)") \
+TCR("lwz %r" S(CFA_REG) ",8(%r1)") \
TCR("lwz %r0,20(%r1)") \
TCR("mtlr %r0") \
TCR("") \
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 916e0ae5843..b36b930b8c4 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -254,7 +254,10 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Expanded_Name
- or else NT (N).Nkind = N_Identifier);
+ or else NT (N).Nkind = N_Explicit_Dereference
+ or else NT (N).Nkind = N_Identifier
+ or else NT (N).Nkind = N_Indexed_Component
+ or else NT (N).Nkind = N_Selected_Component);
return Flag14 (N);
end Atomic_Sync_Required;
@@ -3323,7 +3326,10 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Expanded_Name
- or else NT (N).Nkind = N_Identifier);
+ or else NT (N).Nkind = N_Explicit_Dereference
+ or else NT (N).Nkind = N_Identifier
+ or else NT (N).Nkind = N_Indexed_Component
+ or else NT (N).Nkind = N_Selected_Component);
Set_Flag14 (N, Val);
end Set_Atomic_Sync_Required;
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 0b5a52f5dc7..35a73f9ad94 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -606,10 +606,8 @@ package Sinfo is
-- harmless.
-- Atomic_Sync_Required (Flag14-Sem)
- -- This flag is set in an identifier or expanded name node if the
- -- corresponding reference (or assignment when on the left side of
- -- an assignment) requires atomic synchronization, as a result of
- -- Atomic_Synchronization being enabled for the corresponding entity.
+ -- This flag is set on a node for which atomic synchronization is
+ -- required for the corresponding reference or modification.
-- At_End_Proc (Node1)
-- This field is present in an N_Handled_Sequence_Of_Statements node.
@@ -3175,6 +3173,7 @@ package Sinfo is
-- Sloc points to ALL
-- Prefix (Node3)
-- Actual_Designated_Subtype (Node4-Sem)
+ -- Atomic_Sync_Required (Flag14-Sem)
-- plus fields for expression
-------------------------------
@@ -3197,6 +3196,7 @@ package Sinfo is
-- Sloc contains a copy of the Sloc value of the Prefix
-- Prefix (Node3)
-- Expressions (List1)
+ -- Atomic_Sync_Required (Flag14-Sem)
-- plus fields for expression
-- Note: if any of the subscripts requires a range check, then the
@@ -3240,6 +3240,7 @@ package Sinfo is
-- Associated_Node (Node4-Sem)
-- Do_Discriminant_Check (Flag13-Sem)
-- Is_In_Discriminant_Check (Flag11-Sem)
+ -- Atomic_Sync_Required (Flag14-Sem)
-- plus fields for expression
--------------------------
diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb
index 6d0be93a571..175af07969b 100644
--- a/gcc/ada/sinput.adb
+++ b/gcc/ada/sinput.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, 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- --
@@ -51,6 +51,7 @@ package body Sinput is
-- Make control characters visible
First_Time_Around : Boolean := True;
+ -- This needs a comment ???
-- Routines to support conversion between types Lines_Table_Ptr,
-- Logical_Lines_Table_Ptr and System.Address.
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 3c45d789390..674c9db05ac 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -2694,9 +2694,19 @@ package body Sprint is
if Paren_Count (Expression (Node)) /= 0 then
Sprint_Node (Expression (Node));
+
else
Write_Char ('(');
Sprint_Node (Expression (Node));
+
+ -- Odd case, for the qualified expressions used in machine
+ -- code the argument may be a procedure call, resulting in
+ -- a junk semicolon before the right parent, get rid of it.
+
+ Write_Erase_Char (';');
+
+ -- Now we can add the terminating right paren
+
Write_Char (')');
end if;
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index d6d48c7c9fc..8edf744461e 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -95,6 +95,10 @@ DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE)))
+DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
@@ -315,6 +319,20 @@ DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_LONGPTR_LONGPTR,
BT_BOOL, BT_PTR_LONG, BT_PTR_LONG)
DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
BT_BOOL, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
+DEF_FUNCTION_TYPE_2 (BT_FN_I1_CONST_VPTR_INT, BT_I1, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I2_CONST_VPTR_INT, BT_I2, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I4_CONST_VPTR_INT, BT_I4, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_VPTR_INT, BT_I8, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_INT, BT_VOID, BT_VOLATILE_PTR, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_VPTR_INT, BT_BOOL, BT_VOLATILE_PTR, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_VPTR, BT_BOOL, BT_SIZE,
+ BT_CONST_VOLATILE_PTR)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
@@ -383,6 +401,16 @@ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR,
BT_PTR, BT_UINT)
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_CONST_PTR_INT_SIZE, BT_PTR,
BT_CONST_PTR, BT_INT, BT_SIZE)
+DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_INT, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_INT, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
@@ -402,6 +430,10 @@ DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
+DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_INT)
+DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING,
@@ -409,6 +441,9 @@ DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
+DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
+
DEF_FUNCTION_TYPE_6 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE,
@@ -422,6 +457,24 @@ DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
+
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 51d7b12e687..205d586fc33 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -223,6 +223,7 @@ static tree do_mpfr_bessel_n (tree, tree, tree,
const REAL_VALUE_TYPE *, bool);
static tree do_mpfr_remquo (tree, tree, tree);
static tree do_mpfr_lgamma_r (tree, tree, tree);
+static void expand_builtin_sync_synchronize (void);
/* Return true if NAME starts with __builtin_ or __sync_. */
@@ -233,6 +234,8 @@ is_builtin_name (const char *name)
return true;
if (strncmp (name, "__sync_", 7) == 0)
return true;
+ if (strncmp (name, "__atomic_", 9) == 0)
+ return true;
return false;
}
@@ -5090,21 +5093,41 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode)
return mem;
}
+/* Make sure an argument is in the right mode.
+ EXP is the tree argument.
+ MODE is the mode it should be in. */
+
+static rtx
+expand_expr_force_mode (tree exp, enum machine_mode mode)
+{
+ rtx val;
+ enum machine_mode old_mode;
+
+ val = expand_expr (exp, NULL_RTX, mode, EXPAND_NORMAL);
+ /* If VAL is promoted to a wider mode, convert it back to MODE. Take care
+ of CONST_INTs, where we know the old_mode only from the call argument. */
+
+ old_mode = GET_MODE (val);
+ if (old_mode == VOIDmode)
+ old_mode = TYPE_MODE (TREE_TYPE (exp));
+ val = convert_modes (mode, old_mode, val, 1);
+ return val;
+}
+
+
/* Expand the __sync_xxx_and_fetch and __sync_fetch_and_xxx intrinsics.
EXP is the CALL_EXPR. CODE is the rtx code
that corresponds to the arithmetic or logical operation from the name;
an exception here is that NOT actually means NAND. TARGET is an optional
place for us to store the results; AFTER is true if this is the
- fetch_and_xxx form. IGNORE is true if we don't actually care about
- the result of the operation at all. */
+ fetch_and_xxx form. */
static rtx
expand_builtin_sync_operation (enum machine_mode mode, tree exp,
enum rtx_code code, bool after,
- rtx target, bool ignore)
+ rtx target)
{
rtx val, mem;
- enum machine_mode old_mode;
location_t loc = EXPR_LOCATION (exp);
if (code == NOT && warn_sync_nand)
@@ -5151,19 +5174,10 @@ expand_builtin_sync_operation (enum machine_mode mode, tree exp,
/* Expand the operands. */
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+ val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
- val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX, mode, EXPAND_NORMAL);
- /* If VAL is promoted to a wider mode, convert it back to MODE. Take care
- of CONST_INTs, where we know the old_mode only from the call argument. */
- old_mode = GET_MODE (val);
- if (old_mode == VOIDmode)
- old_mode = TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 1)));
- val = convert_modes (mode, old_mode, val, 1);
-
- if (ignore)
- return expand_sync_operation (mem, val, code);
- else
- return expand_sync_fetch_operation (mem, val, code, after, target);
+ return expand_atomic_fetch_op (target, mem, val, code, MEMMODEL_SEQ_CST,
+ after);
}
/* Expand the __sync_val_compare_and_swap and __sync_bool_compare_and_swap
@@ -5176,34 +5190,19 @@ expand_builtin_compare_and_swap (enum machine_mode mode, tree exp,
bool is_bool, rtx target)
{
rtx old_val, new_val, mem;
- enum machine_mode old_mode;
/* Expand the operands. */
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+ old_val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
+ new_val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 2), mode);
+ if (!expand_atomic_compare_and_swap ((is_bool ? &target : NULL),
+ (is_bool ? NULL : &target),
+ mem, old_val, new_val, false,
+ MEMMODEL_SEQ_CST, MEMMODEL_SEQ_CST))
+ return NULL_RTX;
- old_val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX,
- mode, EXPAND_NORMAL);
- /* If VAL is promoted to a wider mode, convert it back to MODE. Take care
- of CONST_INTs, where we know the old_mode only from the call argument. */
- old_mode = GET_MODE (old_val);
- if (old_mode == VOIDmode)
- old_mode = TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 1)));
- old_val = convert_modes (mode, old_mode, old_val, 1);
-
- new_val = expand_expr (CALL_EXPR_ARG (exp, 2), NULL_RTX,
- mode, EXPAND_NORMAL);
- /* If VAL is promoted to a wider mode, convert it back to MODE. Take care
- of CONST_INTs, where we know the old_mode only from the call argument. */
- old_mode = GET_MODE (new_val);
- if (old_mode == VOIDmode)
- old_mode = TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 2)));
- new_val = convert_modes (mode, old_mode, new_val, 1);
-
- if (is_bool)
- return expand_bool_compare_and_swap (mem, old_val, new_val, target);
- else
- return expand_val_compare_and_swap (mem, old_val, new_val, target);
+ return target;
}
/* Expand the __sync_lock_test_and_set intrinsic. Note that the most
@@ -5214,22 +5213,461 @@ expand_builtin_compare_and_swap (enum machine_mode mode, tree exp,
static rtx
expand_builtin_sync_lock_test_and_set (enum machine_mode mode, tree exp,
- rtx target)
+ rtx target)
{
rtx val, mem;
- enum machine_mode old_mode;
/* Expand the operands. */
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
- val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX, mode, EXPAND_NORMAL);
- /* If VAL is promoted to a wider mode, convert it back to MODE. Take care
- of CONST_INTs, where we know the old_mode only from the call argument. */
- old_mode = GET_MODE (val);
- if (old_mode == VOIDmode)
- old_mode = TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 1)));
- val = convert_modes (mode, old_mode, val, 1);
+ val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
+
+ return expand_atomic_exchange (target, mem, val, MEMMODEL_ACQUIRE, true);
+}
+
+/* Expand the __sync_lock_release intrinsic. EXP is the CALL_EXPR. */
+
+static void
+expand_builtin_sync_lock_release (enum machine_mode mode, tree exp)
+{
+ rtx mem;
+
+ /* Expand the operands. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+
+ expand_atomic_store (mem, const0_rtx, MEMMODEL_RELEASE, true);
+}
+
+/* Given an integer representing an ``enum memmodel'', verify its
+ correctness and return the memory model enum. */
+
+static enum memmodel
+get_memmodel (tree exp)
+{
+ rtx op;
+
+ /* If the parameter is not a constant, it's a run time value so we'll just
+ convert it to MEMMODEL_SEQ_CST to avoid annoying runtime checking. */
+ if (TREE_CODE (exp) != INTEGER_CST)
+ return MEMMODEL_SEQ_CST;
+
+ op = expand_normal (exp);
+ if (INTVAL (op) < 0 || INTVAL (op) >= MEMMODEL_LAST)
+ {
+ warning (OPT_Winvalid_memory_model,
+ "invalid memory model argument to builtin");
+ return MEMMODEL_SEQ_CST;
+ }
+ return (enum memmodel) INTVAL (op);
+}
+
+/* Expand the __atomic_exchange intrinsic:
+ TYPE __atomic_exchange (TYPE *object, TYPE desired, enum memmodel)
+ EXP is the CALL_EXPR.
+ TARGET is an optional place for us to store the results. */
+
+static rtx
+expand_builtin_atomic_exchange (enum machine_mode mode, tree exp, rtx target)
+{
+ rtx val, mem;
+ enum memmodel model;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 2));
+ if (model == MEMMODEL_CONSUME)
+ {
+ error ("invalid memory model for %<__atomic_exchange%>");
+ return NULL_RTX;
+ }
+
+ if (!flag_inline_atomics)
+ return NULL_RTX;
+
+ /* Expand the operands. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+ val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
+
+ return expand_atomic_exchange (target, mem, val, model, false);
+}
+
+/* Expand the __atomic_compare_exchange intrinsic:
+ bool __atomic_compare_exchange (TYPE *object, TYPE *expect,
+ TYPE desired, BOOL weak,
+ enum memmodel success,
+ enum memmodel failure)
+ EXP is the CALL_EXPR.
+ TARGET is an optional place for us to store the results. */
+
+static rtx
+expand_builtin_atomic_compare_exchange (enum machine_mode mode, tree exp,
+ rtx target)
+{
+ rtx expect, desired, mem, oldval;
+ enum memmodel success, failure;
+ tree weak;
+ bool is_weak;
+
+ success = get_memmodel (CALL_EXPR_ARG (exp, 4));
+ failure = get_memmodel (CALL_EXPR_ARG (exp, 5));
+
+ if (failure == MEMMODEL_RELEASE || failure == MEMMODEL_ACQ_REL)
+ {
+ error ("invalid failure memory model for %<__atomic_compare_exchange%>");
+ return NULL_RTX;
+ }
+
+ if (failure > success)
+ {
+ error ("failure memory model cannot be stronger than success "
+ "memory model for %<__atomic_compare_exchange%>");
+ return NULL_RTX;
+ }
+
+ if (!flag_inline_atomics)
+ return NULL_RTX;
+
+ /* Expand the operands. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+
+ expect = expand_normal (CALL_EXPR_ARG (exp, 1));
+ expect = convert_memory_address (Pmode, expect);
+ desired = expand_expr_force_mode (CALL_EXPR_ARG (exp, 2), mode);
+
+ weak = CALL_EXPR_ARG (exp, 3);
+ is_weak = false;
+ if (host_integerp (weak, 0) && tree_low_cst (weak, 0) != 0)
+ is_weak = true;
+
+ oldval = copy_to_reg (gen_rtx_MEM (mode, expect));
+
+ if (!expand_atomic_compare_and_swap (&target, &oldval, mem, oldval,
+ desired, is_weak, success, failure))
+ return NULL_RTX;
+
+ emit_move_insn (gen_rtx_MEM (mode, expect), oldval);
+ return target;
+}
+
+/* Expand the __atomic_load intrinsic:
+ TYPE __atomic_load (TYPE *object, enum memmodel)
+ EXP is the CALL_EXPR.
+ TARGET is an optional place for us to store the results. */
+
+static rtx
+expand_builtin_atomic_load (enum machine_mode mode, tree exp, rtx target)
+{
+ rtx mem;
+ enum memmodel model;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 1));
+ if (model == MEMMODEL_RELEASE
+ || model == MEMMODEL_ACQ_REL)
+ {
+ error ("invalid memory model for %<__atomic_load%>");
+ return NULL_RTX;
+ }
+
+ if (!flag_inline_atomics)
+ return NULL_RTX;
+
+ /* Expand the operand. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+
+ return expand_atomic_load (target, mem, model);
+}
+
+
+/* Expand the __atomic_store intrinsic:
+ void __atomic_store (TYPE *object, TYPE desired, enum memmodel)
+ EXP is the CALL_EXPR.
+ TARGET is an optional place for us to store the results. */
+
+static rtx
+expand_builtin_atomic_store (enum machine_mode mode, tree exp)
+{
+ rtx mem, val;
+ enum memmodel model;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 2));
+ if (model != MEMMODEL_RELAXED
+ && model != MEMMODEL_SEQ_CST
+ && model != MEMMODEL_RELEASE)
+ {
+ error ("invalid memory model for %<__atomic_store%>");
+ return NULL_RTX;
+ }
+
+ if (!flag_inline_atomics)
+ return NULL_RTX;
+
+ /* Expand the operands. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+ val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
+
+ return expand_atomic_store (mem, val, model, false);
+}
+
+/* Expand the __atomic_fetch_XXX intrinsic:
+ TYPE __atomic_fetch_XXX (TYPE *object, TYPE val, enum memmodel)
+ EXP is the CALL_EXPR.
+ TARGET is an optional place for us to store the results.
+ CODE is the operation, PLUS, MINUS, ADD, XOR, or IOR.
+ FETCH_AFTER is true if returning the result of the operation.
+ FETCH_AFTER is false if returning the value before the operation.
+ IGNORE is true if the result is not used.
+ EXT_CALL is the correct builtin for an external call if this cannot be
+ resolved to an instruction sequence. */
+
+static rtx
+expand_builtin_atomic_fetch_op (enum machine_mode mode, tree exp, rtx target,
+ enum rtx_code code, bool fetch_after,
+ bool ignore, enum built_in_function ext_call)
+{
+ rtx val, mem, ret;
+ enum memmodel model;
+ tree fndecl;
+ tree addr;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 2));
+
+ /* Expand the operands. */
+ mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
+ val = expand_expr_force_mode (CALL_EXPR_ARG (exp, 1), mode);
+
+ /* Only try generating instructions if inlining is turned on. */
+ if (flag_inline_atomics)
+ {
+ ret = expand_atomic_fetch_op (target, mem, val, code, model, fetch_after);
+ if (ret)
+ return ret;
+ }
+
+ /* Return if a different routine isn't needed for the library call. */
+ if (ext_call == BUILT_IN_NONE)
+ return NULL_RTX;
+
+ /* Change the call to the specified function. */
+ fndecl = get_callee_fndecl (exp);
+ addr = CALL_EXPR_FN (exp);
+ STRIP_NOPS (addr);
+
+ gcc_assert (TREE_OPERAND (addr, 0) == fndecl);
+ TREE_OPERAND (addr, 0) = builtin_decl_explicit(ext_call);
+
+ /* Expand the call here so we can emit trailing code. */
+ ret = expand_call (exp, target, ignore);
+
+ /* Replace the original function just in case it matters. */
+ TREE_OPERAND (addr, 0) = fndecl;
+
+ /* Then issue the arithmetic correction to return the right result. */
+ if (!ignore)
+ ret = expand_simple_binop (mode, code, ret, val, NULL_RTX, true,
+ OPTAB_LIB_WIDEN);
+ return ret;
+}
+
+/* Return true if (optional) argument ARG1 of size ARG0 is always lock free on
+ this architecture. If ARG1 is NULL, use typical alignment for size ARG0. */
+
+static tree
+fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
+{
+ int size;
+ enum machine_mode mode;
+ unsigned int mode_align, type_align;
+
+ if (TREE_CODE (arg0) != INTEGER_CST)
+ return NULL_TREE;
+
+ size = INTVAL (expand_normal (arg0)) * BITS_PER_UNIT;
+ mode = mode_for_size (size, MODE_INT, 0);
+ mode_align = GET_MODE_ALIGNMENT (mode);
+
+ if (TREE_CODE (arg1) == INTEGER_CST && INTVAL (expand_normal (arg1)) == 0)
+ type_align = mode_align;
+ else
+ {
+ tree ttype = TREE_TYPE (arg1);
+
+ /* This function is usually invoked and folded immediately by the front
+ end before anything else has a chance to look at it. The pointer
+ parameter at this point is usually cast to a void *, so check for that
+ and look past the cast. */
+ if (TREE_CODE (arg1) == NOP_EXPR && POINTER_TYPE_P (ttype)
+ && VOID_TYPE_P (TREE_TYPE (ttype)))
+ arg1 = TREE_OPERAND (arg1, 0);
+
+ ttype = TREE_TYPE (arg1);
+ gcc_assert (POINTER_TYPE_P (ttype));
+
+ /* Get the underlying type of the object. */
+ ttype = TREE_TYPE (ttype);
+ type_align = TYPE_ALIGN (ttype);
+ }
+
+ /* If the object has smaller alignment, the the lock free routines cannot
+ be used. */
+ if (type_align < mode_align)
+ return integer_zero_node;
+
+ /* Check if a compare_and_swap pattern exists for the mode which represents
+ the required size. The pattern is not allowed to fail, so the existence
+ of the pattern indicates support is present. */
+ if (can_compare_and_swap_p (mode))
+ return integer_one_node;
+ else
+ return integer_zero_node;
+}
+
+/* Return true if the parameters to call EXP represent an object which will
+ always generate lock free instructions. The first argument represents the
+ size of the object, and the second parameter is a pointer to the object
+ itself. If NULL is passed for the object, then the result is based on
+ typical alignment for an object of the specified size. Otherwise return
+ false. */
+
+static rtx
+expand_builtin_atomic_always_lock_free (tree exp)
+{
+ tree size;
+ tree arg0 = CALL_EXPR_ARG (exp, 0);
+ tree arg1 = CALL_EXPR_ARG (exp, 1);
- return expand_sync_lock_test_and_set (mem, val, target);
+ if (TREE_CODE (arg0) != INTEGER_CST)
+ {
+ error ("non-constant argument 1 to __atomic_always_lock_free");
+ return const0_rtx;
+ }
+
+ size = fold_builtin_atomic_always_lock_free (arg0, arg1);
+ if (size == integer_one_node)
+ return const1_rtx;
+ return const0_rtx;
+}
+
+/* Return a one or zero if it can be determined that object ARG1 of size ARG
+ is lock free on this architecture. */
+
+static tree
+fold_builtin_atomic_is_lock_free (tree arg0, tree arg1)
+{
+ if (!flag_inline_atomics)
+ return NULL_TREE;
+
+ /* If it isn't always lock free, don't generate a result. */
+ if (fold_builtin_atomic_always_lock_free (arg0, arg1) == integer_one_node)
+ return integer_one_node;
+
+ return NULL_TREE;
+}
+
+/* Return true if the parameters to call EXP represent an object which will
+ always generate lock free instructions. The first argument represents the
+ size of the object, and the second parameter is a pointer to the object
+ itself. If NULL is passed for the object, then the result is based on
+ typical alignment for an object of the specified size. Otherwise return
+ NULL*/
+
+static rtx
+expand_builtin_atomic_is_lock_free (tree exp)
+{
+ tree size;
+ tree arg0 = CALL_EXPR_ARG (exp, 0);
+ tree arg1 = CALL_EXPR_ARG (exp, 1);
+
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (arg0)))
+ {
+ error ("non-integer argument 1 to __atomic_is_lock_free");
+ return NULL_RTX;
+ }
+
+ if (!flag_inline_atomics)
+ return NULL_RTX;
+
+ /* If the value is known at compile time, return the RTX for it. */
+ size = fold_builtin_atomic_is_lock_free (arg0, arg1);
+ if (size == integer_one_node)
+ return const1_rtx;
+
+ return NULL_RTX;
+}
+
+/* This routine will either emit the mem_thread_fence pattern or issue a
+ sync_synchronize to generate a fence for memory model MEMMODEL. */
+
+#ifndef HAVE_mem_thread_fence
+# define HAVE_mem_thread_fence 0
+# define gen_mem_thread_fence(x) (gcc_unreachable (), NULL_RTX)
+#endif
+
+void
+expand_builtin_mem_thread_fence (enum memmodel model)
+{
+ if (HAVE_mem_thread_fence)
+ emit_insn (gen_mem_thread_fence (GEN_INT (model)));
+ else if (model != MEMMODEL_RELAXED)
+ expand_builtin_sync_synchronize ();
+}
+
+/* Expand the __atomic_thread_fence intrinsic:
+ void __atomic_thread_fence (enum memmodel)
+ EXP is the CALL_EXPR. */
+
+static void
+expand_builtin_atomic_thread_fence (tree exp)
+{
+ enum memmodel model;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 0));
+ expand_builtin_mem_thread_fence (model);
+}
+
+/* This routine will either emit the mem_signal_fence pattern or issue a
+ sync_synchronize to generate a fence for memory model MEMMODEL. */
+
+#ifndef HAVE_mem_signal_fence
+# define HAVE_mem_signal_fence 0
+# define gen_mem_signal_fence(x) (gcc_unreachable (), NULL_RTX)
+#endif
+
+static void
+expand_builtin_mem_signal_fence (enum memmodel model)
+{
+ if (HAVE_mem_signal_fence)
+ emit_insn (gen_mem_signal_fence (GEN_INT (model)));
+ else if (model != MEMMODEL_RELAXED)
+ {
+ rtx asm_op, clob;
+
+ /* By default targets are coherent between a thread and the signal
+ handler running on the same thread. Thus this really becomes a
+ compiler barrier, in that stores must not be sunk past
+ (or raised above) a given point. */
+
+ /* Generate asm volatile("" : : : "memory") as the memory barrier. */
+ asm_op = gen_rtx_ASM_OPERANDS (VOIDmode, empty_string, empty_string, 0,
+ rtvec_alloc (0), rtvec_alloc (0),
+ rtvec_alloc (0), UNKNOWN_LOCATION);
+ MEM_VOLATILE_P (asm_op) = 1;
+
+ clob = gen_rtx_SCRATCH (VOIDmode);
+ clob = gen_rtx_MEM (BLKmode, clob);
+ clob = gen_rtx_CLOBBER (VOIDmode, clob);
+
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, asm_op, clob)));
+ }
+}
+
+/* Expand the __atomic_signal_fence intrinsic:
+ void __atomic_signal_fence (enum memmodel)
+ EXP is the CALL_EXPR. */
+
+static void
+expand_builtin_atomic_signal_fence (tree exp)
+{
+ enum memmodel model;
+
+ model = get_memmodel (CALL_EXPR_ARG (exp, 0));
+ expand_builtin_mem_signal_fence (model);
}
/* Expand the __sync_synchronize intrinsic. */
@@ -5264,33 +5702,6 @@ expand_builtin_sync_synchronize (void)
expand_asm_stmt (x);
}
-/* Expand the __sync_lock_release intrinsic. EXP is the CALL_EXPR. */
-
-static void
-expand_builtin_sync_lock_release (enum machine_mode mode, tree exp)
-{
- struct expand_operand ops[2];
- enum insn_code icode;
- rtx mem;
-
- /* Expand the operands. */
- mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
-
- /* If there is an explicit operation in the md file, use it. */
- icode = direct_optab_handler (sync_lock_release_optab, mode);
- if (icode != CODE_FOR_nothing)
- {
- create_fixed_operand (&ops[0], mem);
- create_input_operand (&ops[1], const0_rtx, mode);
- if (maybe_expand_insn (icode, 2, ops))
- return;
- }
-
- /* Otherwise we can implement this operation by emitting a barrier
- followed by a store of zero. */
- expand_builtin_sync_synchronize ();
- emit_move_insn (mem, const0_rtx);
-}
/* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient
@@ -5891,8 +6302,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_ADD_8:
case BUILT_IN_SYNC_FETCH_AND_ADD_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_ADD_1);
- target = expand_builtin_sync_operation (mode, exp, PLUS,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, PLUS, false, target);
if (target)
return target;
break;
@@ -5903,8 +6313,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_SUB_8:
case BUILT_IN_SYNC_FETCH_AND_SUB_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_SUB_1);
- target = expand_builtin_sync_operation (mode, exp, MINUS,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, MINUS, false, target);
if (target)
return target;
break;
@@ -5915,8 +6324,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_OR_8:
case BUILT_IN_SYNC_FETCH_AND_OR_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_OR_1);
- target = expand_builtin_sync_operation (mode, exp, IOR,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, IOR, false, target);
if (target)
return target;
break;
@@ -5927,8 +6335,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_AND_8:
case BUILT_IN_SYNC_FETCH_AND_AND_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_AND_1);
- target = expand_builtin_sync_operation (mode, exp, AND,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, AND, false, target);
if (target)
return target;
break;
@@ -5939,8 +6346,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_XOR_8:
case BUILT_IN_SYNC_FETCH_AND_XOR_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_XOR_1);
- target = expand_builtin_sync_operation (mode, exp, XOR,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, XOR, false, target);
if (target)
return target;
break;
@@ -5951,8 +6357,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_FETCH_AND_NAND_8:
case BUILT_IN_SYNC_FETCH_AND_NAND_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_FETCH_AND_NAND_1);
- target = expand_builtin_sync_operation (mode, exp, NOT,
- false, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, NOT, false, target);
if (target)
return target;
break;
@@ -5963,8 +6368,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_ADD_AND_FETCH_8:
case BUILT_IN_SYNC_ADD_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_ADD_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, PLUS,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, PLUS, true, target);
if (target)
return target;
break;
@@ -5975,8 +6379,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_SUB_AND_FETCH_8:
case BUILT_IN_SYNC_SUB_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_SUB_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, MINUS,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, MINUS, true, target);
if (target)
return target;
break;
@@ -5987,8 +6390,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_OR_AND_FETCH_8:
case BUILT_IN_SYNC_OR_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_OR_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, IOR,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, IOR, true, target);
if (target)
return target;
break;
@@ -5999,8 +6401,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_AND_AND_FETCH_8:
case BUILT_IN_SYNC_AND_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_AND_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, AND,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, AND, true, target);
if (target)
return target;
break;
@@ -6011,8 +6412,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_XOR_AND_FETCH_8:
case BUILT_IN_SYNC_XOR_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_XOR_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, XOR,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, XOR, true, target);
if (target)
return target;
break;
@@ -6023,8 +6423,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SYNC_NAND_AND_FETCH_8:
case BUILT_IN_SYNC_NAND_AND_FETCH_16:
mode = get_builtin_sync_mode (fcode - BUILT_IN_SYNC_NAND_AND_FETCH_1);
- target = expand_builtin_sync_operation (mode, exp, NOT,
- true, target, ignore);
+ target = expand_builtin_sync_operation (mode, exp, NOT, true, target);
if (target)
return target;
break;
@@ -6082,6 +6481,236 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
expand_builtin_sync_synchronize ();
return const0_rtx;
+ case BUILT_IN_ATOMIC_EXCHANGE_1:
+ case BUILT_IN_ATOMIC_EXCHANGE_2:
+ case BUILT_IN_ATOMIC_EXCHANGE_4:
+ case BUILT_IN_ATOMIC_EXCHANGE_8:
+ case BUILT_IN_ATOMIC_EXCHANGE_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_EXCHANGE_1);
+ target = expand_builtin_atomic_exchange (mode, exp, target);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_2:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_4:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_8:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_16:
+ mode =
+ get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1);
+ target = expand_builtin_atomic_compare_exchange (mode, exp, target);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_LOAD_1:
+ case BUILT_IN_ATOMIC_LOAD_2:
+ case BUILT_IN_ATOMIC_LOAD_4:
+ case BUILT_IN_ATOMIC_LOAD_8:
+ case BUILT_IN_ATOMIC_LOAD_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_LOAD_1);
+ target = expand_builtin_atomic_load (mode, exp, target);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_STORE_1:
+ case BUILT_IN_ATOMIC_STORE_2:
+ case BUILT_IN_ATOMIC_STORE_4:
+ case BUILT_IN_ATOMIC_STORE_8:
+ case BUILT_IN_ATOMIC_STORE_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_STORE_1);
+ target = expand_builtin_atomic_store (mode, exp);
+ if (target)
+ return const0_rtx;
+ break;
+
+ case BUILT_IN_ATOMIC_ADD_FETCH_1:
+ case BUILT_IN_ATOMIC_ADD_FETCH_2:
+ case BUILT_IN_ATOMIC_ADD_FETCH_4:
+ case BUILT_IN_ATOMIC_ADD_FETCH_8:
+ case BUILT_IN_ATOMIC_ADD_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_ADD_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_ADD_1 +
+ (fcode - BUILT_IN_ATOMIC_ADD_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, PLUS, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_SUB_FETCH_1:
+ case BUILT_IN_ATOMIC_SUB_FETCH_2:
+ case BUILT_IN_ATOMIC_SUB_FETCH_4:
+ case BUILT_IN_ATOMIC_SUB_FETCH_8:
+ case BUILT_IN_ATOMIC_SUB_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_SUB_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_SUB_1 +
+ (fcode - BUILT_IN_ATOMIC_SUB_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, MINUS, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_AND_FETCH_1:
+ case BUILT_IN_ATOMIC_AND_FETCH_2:
+ case BUILT_IN_ATOMIC_AND_FETCH_4:
+ case BUILT_IN_ATOMIC_AND_FETCH_8:
+ case BUILT_IN_ATOMIC_AND_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_AND_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_AND_1 +
+ (fcode - BUILT_IN_ATOMIC_AND_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, AND, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_NAND_FETCH_1:
+ case BUILT_IN_ATOMIC_NAND_FETCH_2:
+ case BUILT_IN_ATOMIC_NAND_FETCH_4:
+ case BUILT_IN_ATOMIC_NAND_FETCH_8:
+ case BUILT_IN_ATOMIC_NAND_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_NAND_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_NAND_1 +
+ (fcode - BUILT_IN_ATOMIC_NAND_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, NOT, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_XOR_FETCH_1:
+ case BUILT_IN_ATOMIC_XOR_FETCH_2:
+ case BUILT_IN_ATOMIC_XOR_FETCH_4:
+ case BUILT_IN_ATOMIC_XOR_FETCH_8:
+ case BUILT_IN_ATOMIC_XOR_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_XOR_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_XOR_1 +
+ (fcode - BUILT_IN_ATOMIC_XOR_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, XOR, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_OR_FETCH_1:
+ case BUILT_IN_ATOMIC_OR_FETCH_2:
+ case BUILT_IN_ATOMIC_OR_FETCH_4:
+ case BUILT_IN_ATOMIC_OR_FETCH_8:
+ case BUILT_IN_ATOMIC_OR_FETCH_16:
+ {
+ enum built_in_function lib;
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_OR_FETCH_1);
+ lib = (enum built_in_function)((int)BUILT_IN_ATOMIC_FETCH_OR_1 +
+ (fcode - BUILT_IN_ATOMIC_OR_FETCH_1));
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, IOR, true,
+ ignore, lib);
+ if (target)
+ return target;
+ break;
+ }
+ case BUILT_IN_ATOMIC_FETCH_ADD_1:
+ case BUILT_IN_ATOMIC_FETCH_ADD_2:
+ case BUILT_IN_ATOMIC_FETCH_ADD_4:
+ case BUILT_IN_ATOMIC_FETCH_ADD_8:
+ case BUILT_IN_ATOMIC_FETCH_ADD_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_ADD_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, PLUS, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_FETCH_SUB_1:
+ case BUILT_IN_ATOMIC_FETCH_SUB_2:
+ case BUILT_IN_ATOMIC_FETCH_SUB_4:
+ case BUILT_IN_ATOMIC_FETCH_SUB_8:
+ case BUILT_IN_ATOMIC_FETCH_SUB_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_SUB_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, MINUS, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_FETCH_AND_1:
+ case BUILT_IN_ATOMIC_FETCH_AND_2:
+ case BUILT_IN_ATOMIC_FETCH_AND_4:
+ case BUILT_IN_ATOMIC_FETCH_AND_8:
+ case BUILT_IN_ATOMIC_FETCH_AND_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_AND_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, AND, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_FETCH_NAND_1:
+ case BUILT_IN_ATOMIC_FETCH_NAND_2:
+ case BUILT_IN_ATOMIC_FETCH_NAND_4:
+ case BUILT_IN_ATOMIC_FETCH_NAND_8:
+ case BUILT_IN_ATOMIC_FETCH_NAND_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_NAND_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, NOT, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_FETCH_XOR_1:
+ case BUILT_IN_ATOMIC_FETCH_XOR_2:
+ case BUILT_IN_ATOMIC_FETCH_XOR_4:
+ case BUILT_IN_ATOMIC_FETCH_XOR_8:
+ case BUILT_IN_ATOMIC_FETCH_XOR_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_XOR_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, XOR, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_FETCH_OR_1:
+ case BUILT_IN_ATOMIC_FETCH_OR_2:
+ case BUILT_IN_ATOMIC_FETCH_OR_4:
+ case BUILT_IN_ATOMIC_FETCH_OR_8:
+ case BUILT_IN_ATOMIC_FETCH_OR_16:
+ mode = get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_FETCH_OR_1);
+ target = expand_builtin_atomic_fetch_op (mode, exp, target, IOR, false,
+ ignore, BUILT_IN_NONE);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE:
+ return expand_builtin_atomic_always_lock_free (exp);
+
+ case BUILT_IN_ATOMIC_IS_LOCK_FREE:
+ target = expand_builtin_atomic_is_lock_free (exp);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_ATOMIC_THREAD_FENCE:
+ expand_builtin_atomic_thread_fence (exp);
+ return const0_rtx;
+
+ case BUILT_IN_ATOMIC_SIGNAL_FENCE:
+ expand_builtin_atomic_signal_fence (exp);
+ return const0_rtx;
+
case BUILT_IN_OBJECT_SIZE:
return expand_builtin_object_size (exp);
@@ -8427,7 +9056,7 @@ fold_builtin_memchr (location_t loc, tree arg1, tree arg2, tree len, tree type)
if (target_char_cast (arg2, &c))
return NULL_TREE;
- r = (char *) memchr (p1, c, tree_low_cst (len, 1));
+ r = (const char *) memchr (p1, c, tree_low_cst (len, 1));
if (r == NULL)
return build_int_cst (TREE_TYPE (arg1), 0);
@@ -10121,6 +10750,12 @@ fold_builtin_2 (location_t loc, tree fndecl, tree arg0, tree arg1, bool ignore)
return fold_builtin_fprintf (loc, fndecl, arg0, arg1, NULL_TREE,
ignore, fcode);
+ case BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE:
+ return fold_builtin_atomic_always_lock_free (arg0, arg1);
+
+ case BUILT_IN_ATOMIC_IS_LOCK_FREE:
+ return fold_builtin_atomic_is_lock_free (arg0, arg1);
+
default:
break;
}
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 7af70f00c0f..3cb29c0b3a2 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3707,6 +3707,17 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
warned = 1;
pending_xref_error ();
}
+ else if (declspecs->typespec_kind != ctsk_tagdef
+ && declspecs->typespec_kind != ctsk_tagfirstref
+ && declspecs->alignas_p)
+ {
+ if (warned != 1)
+ pedwarn (input_location, 0,
+ "empty declaration with %<_Alignas%> "
+ "does not redeclare tag");
+ warned = 1;
+ pending_xref_error ();
+ }
else
{
pending_invalid_xref = 0;
@@ -3782,6 +3793,12 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
warned = 2;
}
+ if (!warned && !in_system_header && declspecs->alignas_p)
+ {
+ warning (0, "useless %<_Alignas%> in empty declaration");
+ warned = 2;
+ }
+
if (warned != 1)
{
if (!found_tag)
@@ -4894,6 +4911,7 @@ grokdeclarator (const struct c_declarator *declarator,
tree expr_dummy;
bool expr_const_operands_dummy;
enum c_declarator_kind first_non_attr_kind;
+ unsigned int alignas_align = 0;
if (TREE_CODE (type) == ERROR_MARK)
return error_mark_node;
@@ -5737,6 +5755,46 @@ grokdeclarator (const struct c_declarator *declarator,
if (bitfield)
check_bitfield_type_and_width (&type, width, name);
+ /* Reject invalid uses of _Alignas. */
+ if (declspecs->alignas_p)
+ {
+ if (storage_class == csc_typedef)
+ error_at (loc, "alignment specified for typedef %qE", name);
+ else if (storage_class == csc_register)
+ error_at (loc, "alignment specified for %<register%> object %qE",
+ name);
+ else if (decl_context == PARM)
+ {
+ if (name)
+ error_at (loc, "alignment specified for parameter %qE", name);
+ else
+ error_at (loc, "alignment specified for unnamed parameter");
+ }
+ else if (bitfield)
+ {
+ if (name)
+ error_at (loc, "alignment specified for bit-field %qE", name);
+ else
+ error_at (loc, "alignment specified for unnamed bit-field");
+ }
+ else if (TREE_CODE (type) == FUNCTION_TYPE)
+ error_at (loc, "alignment specified for function %qE", name);
+ else if (declspecs->align_log != -1)
+ {
+ alignas_align = 1U << declspecs->align_log;
+ if (alignas_align < TYPE_ALIGN_UNIT (type))
+ {
+ if (name)
+ error_at (loc, "%<_Alignas%> specifiers cannot reduce "
+ "alignment of %qE", name);
+ else
+ error_at (loc, "%<_Alignas%> specifiers cannot reduce "
+ "alignment of unnamed field");
+ alignas_align = 0;
+ }
+ }
+ }
+
/* Did array size calculations overflow? */
if (TREE_CODE (type) == ARRAY_TYPE
@@ -6117,6 +6175,13 @@ grokdeclarator (const struct c_declarator *declarator,
/* Record constancy and volatility. */
c_apply_type_quals_to_decl (type_quals, decl);
+ /* Apply _Alignas specifiers. */
+ if (alignas_align)
+ {
+ DECL_ALIGN (decl) = alignas_align * BITS_PER_UNIT;
+ DECL_USER_ALIGN (decl) = 1;
+ }
+
/* If a type has volatile components, it should be stored in memory.
Otherwise, the fact that those components are volatile
will be ignored, and would even crash the compiler.
@@ -8709,6 +8774,7 @@ build_null_declspecs (void)
ret->expr = 0;
ret->decl_attr = 0;
ret->attrs = 0;
+ ret->align_log = -1;
ret->typespec_word = cts_none;
ret->storage_class = csc_none;
ret->expr_const_operands = true;
@@ -8732,6 +8798,7 @@ build_null_declspecs (void)
ret->volatile_p = false;
ret->restrict_p = false;
ret->saturating_p = false;
+ ret->alignas_p = false;
ret->address_space = ADDR_SPACE_GENERIC;
return ret;
}
@@ -9522,6 +9589,22 @@ declspecs_add_attrs (struct c_declspecs *specs, tree attrs)
return specs;
}
+/* Add an _Alignas specifier (expression ALIGN, or type whose
+ alignment is ALIGN) to the declaration specifiers SPECS, returning
+ SPECS. */
+struct c_declspecs *
+declspecs_add_alignas (struct c_declspecs *specs, tree align)
+{
+ int align_log;
+ specs->alignas_p = true;
+ if (align == error_mark_node)
+ return specs;
+ align_log = check_user_alignment (align, true);
+ if (align_log > specs->align_log)
+ specs->align_log = align_log;
+ return specs;
+}
+
/* Combine "long", "short", "signed", "unsigned" and "_Complex" type
specifiers with any other type specifier to determine the resulting
type. This is where ISO C checks on complex types are made, since
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 028163ccefb..04134ec444d 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,72 @@
+2011-11-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * c-common.c, c-common.h: Revert yesterday's changes.
+
+2011-11-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * c-common.c (decl_has_visibility_attr): Split out from...
+ (c_determine_visibility): ...here.
+ * c-common.h: Declare it.
+
+2011-11-06 Joseph Myers <joseph@codesourcery.com>
+
+ * c-common.c (c_common_reswords): Add _Alignas and _Alignof.
+ (c_sizeof_or_alignof_type): Diagnose alignof applied to a function
+ type.
+ (check_user_alignment): New. Split out of
+ handle_aligned_attribute. Disallow integer constants with
+ noninteger types. Conditionally allow zero.
+ (handle_aligned_attribute): Use check_user_alignment.
+ * c-common.h (RID_ALIGNAS, check_user_alignment): New.
+
+2011-11-06 Andrew MacLeod <amacleod@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ Merged from cxx-mem-model.
+
+ * c-cppbuiltin.c (c_cpp_builtins): Test both atomic and sync patterns.
+ * c-common.c (sync_resolve_params, sync_resolve_return): Only tweak
+ parameters that are the same type size.
+ (get_atomic_generic_size): New. Find size of generic
+ atomic function parameters and do typechecking.
+ (add_atomic_size_parameter): New. Insert size into parameter list.
+ (resolve_overloaded_atomic_exchange): Restructure __atomic_exchange to
+ either __atomic_exchange_n or external library call.
+ (resolve_overloaded_atomic_compare_exchange): Restructure
+ __atomic_compare_exchange to either _n variant or external library call.
+ (resolve_overloaded_atomic_load): Restructure __atomic_load to either
+ __atomic_load_n or an external library call.
+ (resolve_overloaded_atomic_store): Restructure __atomic_store to either
+ __atomic_store_n or an external library call.
+ (resolve_overloaded_builtin): Handle new __atomic builtins.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR c++/50608
+ * c-common.c (c_fully_fold_internal) <ADDR_EXPR>: Call fold_offsetof_1.
+ (fold_offsetof_1): Make global. Remove STOP_REF argument and adjust.
+ <INDIRECT_REF>: Return the argument.
+ <ARRAY_REF>: Remove special code for negative offset.
+ Call fold_build_pointer_plus instead of size_binop.
+ (fold_offsetof): Remove STOP_REF argument and adjust.
+ * c-common.h (fold_offsetof_1): Declare.
+ (fold_offsetof): Remove STOP_REF argument.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50810
+ * c-opts.c (c_common_handle_option): Enable -Wnarrowing as part
+ of -Wall; include -Wnarrowing in -Wc++0x-compat; adjust default
+ Wnarrowing for C++0x and C++98.
+ * c.opt ([Wnarrowing]): Update.
+
+2011-11-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44277
+ * c.opt: Add Wzero-as-null-pointer-constant.
+
2011-10-31 Jason Merrill <jason@redhat.com>
* c.opt (-fdeduce-init-list): Off by default.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 32daa73f90f..a6823311321 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -407,6 +407,8 @@ static int resort_field_decl_cmp (const void *, const void *);
*/
const struct c_common_resword c_common_reswords[] =
{
+ { "_Alignas", RID_ALIGNAS, D_CONLY },
+ { "_Alignof", RID_ALIGNOF, D_CONLY },
{ "_Bool", RID_BOOL, D_CONLY },
{ "_Complex", RID_COMPLEX, 0 },
{ "_Imaginary", RID_IMAGINARY, D_CONLY },
@@ -1298,12 +1300,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
&& (op1 = get_base_address (op0)) != NULL_TREE
&& TREE_CODE (op1) == INDIRECT_REF
&& TREE_CONSTANT (TREE_OPERAND (op1, 0)))
- {
- tree offset = fold_offsetof (op0, op1);
- op1
- = fold_convert_loc (loc, TREE_TYPE (expr), TREE_OPERAND (op1, 0));
- ret = fold_build_pointer_plus_loc (loc, op1, offset);
- }
+ ret = fold_convert_loc (loc, TREE_TYPE (expr), fold_offsetof_1 (op0));
else if (op0 != orig_op0 || in_init)
ret = in_init
? fold_build1_initializer_loc (loc, code, TREE_TYPE (expr), op0)
@@ -4361,7 +4358,18 @@ c_sizeof_or_alignof_type (location_t loc,
value = size_one_node;
}
else
- value = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT);
+ {
+ if (complain)
+ {
+ if (c_dialect_cxx ())
+ pedwarn (loc, OPT_pedantic, "ISO C++ does not permit "
+ "%<alignof%> applied to a function type");
+ else
+ pedwarn (loc, OPT_pedantic, "ISO C does not permit "
+ "%<_Alignof%> applied to a function type");
+ }
+ value = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT);
+ }
}
else if (type_code == VOID_TYPE || type_code == ERROR_MARK)
{
@@ -6699,6 +6707,36 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
return NULL_TREE;
}
+/* Check whether ALIGN is a valid user-specified alignment. If so,
+ return its base-2 log; if not, output an error and return -1. If
+ ALLOW_ZERO then 0 is valid and should result in a return of -1 with
+ no error. */
+int
+check_user_alignment (const_tree align, bool allow_zero)
+{
+ int i;
+
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (align))
+ || TREE_CODE (align) != INTEGER_CST)
+ {
+ error ("requested alignment is not an integer constant");
+ return -1;
+ }
+ else if (allow_zero && integer_zerop (align))
+ return -1;
+ else if ((i = tree_log2 (align)) == -1)
+ {
+ error ("requested alignment is not a power of 2");
+ return -1;
+ }
+ else if (i >= HOST_BITS_PER_INT - BITS_PER_UNIT_LOG)
+ {
+ error ("requested alignment is too large");
+ return -1;
+ }
+ return i;
+}
+
/* Handle a "aligned" attribute; arguments as in
struct attribute_spec.handler. */
@@ -6722,21 +6760,8 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
else if (TYPE_P (*node))
type = node, is_type = 1;
- if (TREE_CODE (align_expr) != INTEGER_CST)
- {
- error ("requested alignment is not a constant");
- *no_add_attrs = true;
- }
- else if ((i = tree_log2 (align_expr)) == -1)
- {
- error ("requested alignment is not a power of 2");
- *no_add_attrs = true;
- }
- else if (i >= HOST_BITS_PER_INT - BITS_PER_UNIT_LOG)
- {
- error ("requested alignment is too large");
- *no_add_attrs = true;
- }
+ if ((i = check_user_alignment (align_expr, false)) == -1)
+ *no_add_attrs = true;
else if (is_type)
{
if ((flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
@@ -8779,20 +8804,15 @@ c_common_to_target_charset (HOST_WIDE_INT c)
return uc;
}
-/* Build the result of __builtin_offsetof. EXPR is a nested sequence of
- component references, with STOP_REF, or alternatively an INDIRECT_REF of
- NULL, at the bottom; much like the traditional rendering of offsetof as a
- macro. Returns the folded and properly cast result. */
+/* Fold an offsetof-like expression. EXPR is a nested sequence of component
+ references with an INDIRECT_REF of a constant at the bottom; much like the
+ traditional rendering of offsetof as a macro. Return the folded result. */
-static tree
-fold_offsetof_1 (tree expr, tree stop_ref)
+tree
+fold_offsetof_1 (tree expr)
{
- enum tree_code code = PLUS_EXPR;
tree base, off, t;
- if (expr == stop_ref && TREE_CODE (expr) != ERROR_MARK)
- return size_zero_node;
-
switch (TREE_CODE (expr))
{
case ERROR_MARK:
@@ -8809,15 +8829,15 @@ fold_offsetof_1 (tree expr, tree stop_ref)
case NOP_EXPR:
case INDIRECT_REF:
- if (!integer_zerop (TREE_OPERAND (expr, 0)))
+ if (!TREE_CONSTANT (TREE_OPERAND (expr, 0)))
{
error ("cannot apply %<offsetof%> to a non constant address");
return error_mark_node;
}
- return size_zero_node;
+ return TREE_OPERAND (expr, 0);
case COMPONENT_REF:
- base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref);
+ base = fold_offsetof_1 (TREE_OPERAND (expr, 0));
if (base == error_mark_node)
return base;
@@ -8835,21 +8855,14 @@ fold_offsetof_1 (tree expr, tree stop_ref)
break;
case ARRAY_REF:
- base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref);
+ base = fold_offsetof_1 (TREE_OPERAND (expr, 0));
if (base == error_mark_node)
return base;
t = TREE_OPERAND (expr, 1);
- if (TREE_CODE (t) == INTEGER_CST && tree_int_cst_sgn (t) < 0)
- {
- code = MINUS_EXPR;
- t = fold_build1_loc (input_location, NEGATE_EXPR, TREE_TYPE (t), t);
- }
- 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)
+ if (TREE_CODE (t) == INTEGER_CST && tree_int_cst_sgn (t) >= 0)
{
tree upbound = array_ref_up_bound (expr);
if (upbound != NULL_TREE
@@ -8889,26 +8902,30 @@ fold_offsetof_1 (tree expr, tree stop_ref)
}
}
}
+
+ t = convert (sizetype, t);
+ off = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (TREE_TYPE (expr)), t);
break;
case COMPOUND_EXPR:
/* Handle static members of volatile structs. */
t = TREE_OPERAND (expr, 1);
gcc_assert (TREE_CODE (t) == VAR_DECL);
- return fold_offsetof_1 (t, stop_ref);
+ return fold_offsetof_1 (t);
default:
gcc_unreachable ();
}
- return size_binop (code, base, off);
+ return fold_build_pointer_plus (base, off);
}
+/* Likewise, but convert it to the return type of offsetof. */
+
tree
-fold_offsetof (tree expr, tree stop_ref)
+fold_offsetof (tree expr)
{
- /* Convert back from the internal sizetype to size_t. */
- return convert (size_type_node, fold_offsetof_1 (expr, stop_ref));
+ return convert (size_type_node, fold_offsetof_1 (expr));
}
/* Warn for A ?: C expressions (with B omitted) where A is a boolean
@@ -9261,7 +9278,8 @@ sync_resolve_size (tree function, VEC(tree,gc) *params)
was encountered; true on success. */
static bool
-sync_resolve_params (tree orig_function, tree function, VEC(tree, gc) *params)
+sync_resolve_params (location_t loc, tree orig_function, tree function,
+ VEC(tree, gc) *params, bool orig_format)
{
function_args_iterator iter;
tree ptype;
@@ -9289,21 +9307,34 @@ sync_resolve_params (tree orig_function, tree function, VEC(tree, gc) *params)
++parmnum;
if (VEC_length (tree, params) <= parmnum)
{
- error ("too few arguments to function %qE", orig_function);
+ error_at (loc, "too few arguments to function %qE", orig_function);
return false;
}
- /* ??? Ideally for the first conversion we'd use convert_for_assignment
- so that we get warnings for anything that doesn't match the pointer
- type. This isn't portable across the C and C++ front ends atm. */
- val = VEC_index (tree, params, parmnum);
- val = convert (ptype, val);
- val = convert (arg_type, val);
- VEC_replace (tree, params, parmnum, val);
+ /* Only convert parameters if the size is appropriate with new format
+ sync routines. */
+ if (orig_format
+ || tree_int_cst_equal (TYPE_SIZE (ptype), TYPE_SIZE (arg_type)))
+ {
+ /* Ideally for the first conversion we'd use convert_for_assignment
+ so that we get warnings for anything that doesn't match the pointer
+ type. This isn't portable across the C and C++ front ends atm. */
+ val = VEC_index (tree, params, parmnum);
+ val = convert (ptype, val);
+ val = convert (arg_type, val);
+ VEC_replace (tree, params, parmnum, val);
+ }
function_args_iter_next (&iter);
}
+ /* __atomic routines are not variadic. */
+ if (!orig_format && VEC_length (tree, params) != parmnum + 1)
+ {
+ error_at (loc, "too many arguments to function %qE", orig_function);
+ return false;
+ }
+
/* The definition of these primitives is variadic, with the remaining
being "an optional list of variables protected by the memory barrier".
No clue what that's supposed to mean, precisely, but we consider all
@@ -9318,13 +9349,388 @@ sync_resolve_params (tree orig_function, tree function, VEC(tree, gc) *params)
PARAMS. */
static tree
-sync_resolve_return (tree first_param, tree result)
+sync_resolve_return (tree first_param, tree result, bool orig_format)
{
tree ptype = TREE_TYPE (TREE_TYPE (first_param));
+ tree rtype = TREE_TYPE (result);
ptype = TYPE_MAIN_VARIANT (ptype);
- return convert (ptype, result);
+
+ /* New format doesn't require casting unless the types are the same size. */
+ if (orig_format || tree_int_cst_equal (TYPE_SIZE (ptype), TYPE_SIZE (rtype)))
+ return convert (ptype, result);
+ else
+ return result;
}
+/* This function verifies the PARAMS to generic atomic FUNCTION.
+ It returns the size if all the parameters are the same size, otherwise
+ 0 is returned if the parameters are invalid. */
+
+static int
+get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
+{
+ unsigned int n_param;
+ unsigned int n_model;
+ unsigned int x;
+ int size_0;
+ tree type_0;
+
+ /* Determine the parameter makeup. */
+ switch (DECL_FUNCTION_CODE (function))
+ {
+ case BUILT_IN_ATOMIC_EXCHANGE:
+ n_param = 4;
+ n_model = 1;
+ break;
+ case BUILT_IN_ATOMIC_LOAD:
+ case BUILT_IN_ATOMIC_STORE:
+ n_param = 3;
+ n_model = 1;
+ break;
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE:
+ n_param = 6;
+ n_model = 2;
+ break;
+ default:
+ return 0;
+ }
+
+ if (VEC_length (tree, params) != n_param)
+ {
+ error_at (loc, "incorrect number of arguments to function %qE", function);
+ return 0;
+ }
+
+ /* Get type of first parameter, and determine its size. */
+ type_0 = TREE_TYPE (VEC_index (tree, params, 0));
+ if (TREE_CODE (type_0) != POINTER_TYPE)
+ {
+ error_at (loc, "argument 1 of %qE must be a pointer type", function);
+ return 0;
+ }
+ size_0 = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (type_0)), 1);
+
+ /* Check each other parameter is a pointer and the same size. */
+ for (x = 0; x < n_param - n_model; x++)
+ {
+ int size;
+ tree type = TREE_TYPE (VEC_index (tree, params, x));
+ /* __atomic_compare_exchange has a bool in the 4th postion, skip it. */
+ if (n_param == 6 && x == 3)
+ continue;
+ if (!POINTER_TYPE_P (type))
+ {
+ error_at (loc, "argument %d of %qE must be a pointer type", x + 1,
+ function);
+ return 0;
+ }
+ size = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (type)), 1);
+ if (size != size_0)
+ {
+ error_at (loc, "size mismatch in argument %d of %qE", x + 1,
+ function);
+ return 0;
+ }
+ }
+
+ /* Check memory model parameters for validity. */
+ for (x = n_param - n_model ; x < n_param; x++)
+ {
+ tree p = VEC_index (tree, params, x);
+ if (TREE_CODE (p) == INTEGER_CST)
+ {
+ int i = tree_low_cst (p, 1);
+ if (i < 0 || i >= MEMMODEL_LAST)
+ {
+ warning_at (loc, OPT_Winvalid_memory_model,
+ "invalid memory model argument %d of %qE", x + 1,
+ function);
+ return MEMMODEL_SEQ_CST;
+ }
+ }
+ else
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (p)))
+ {
+ error_at (loc, "non-integer memory model argument %d of %qE", x + 1,
+ function);
+ return 0;
+ }
+ }
+
+ return size_0;
+}
+
+
+/* This will take an __atomic_ generic FUNCTION call, and add a size parameter N
+ at the beginning of the parameter list PARAMS representing the size of the
+ objects. This is to match the library ABI requirement. LOC is the location
+ of the function call.
+ The new function is returned if it needed rebuilding, otherwise NULL_TREE is
+ returned to allow the external call to be constructed. */
+
+static tree
+add_atomic_size_parameter (unsigned n, location_t loc, tree function,
+ VEC(tree,gc) *params)
+{
+ tree size_node;
+
+ /* Insert a SIZE_T parameter as the first param. If there isn't
+ enough space, allocate a new vector and recursively re-build with that. */
+ if (!VEC_space (tree, params, 1))
+ {
+ unsigned int z, len;
+ VEC(tree,gc) *vec;
+ tree f;
+
+ len = VEC_length (tree, params);
+ vec = VEC_alloc (tree, gc, len + 1);
+ for (z = 0; z < len; z++)
+ VEC_quick_push (tree, vec, VEC_index (tree, params, z));
+ f = build_function_call_vec (loc, function, vec, NULL);
+ VEC_free (tree, gc, vec);
+ return f;
+ }
+
+ /* Add the size parameter and leave as a function call for processing. */
+ size_node = build_int_cst (size_type_node, n);
+ VEC_quick_insert (tree, params, 0, size_node);
+ return NULL_TREE;
+}
+
+
+/* This will process an __atomic_exchange function call, determine whether it
+ needs to be mapped to the _N variation, or turned into a library call.
+ LOC is the location of the builtin call.
+ FUNCTION is the DECL that has been invoked;
+ PARAMS is the argument list for the call. The return value is non-null
+ TRUE is returned if it is translated into the proper format for a call to the
+ external library, and NEW_RETURN is set the tree for that function.
+ FALSE is returned if processing for the _N variation is required, and
+ NEW_RETURN is set to the the return value the result is copied into. */
+static bool
+resolve_overloaded_atomic_exchange (location_t loc, tree function,
+ VEC(tree,gc) *params, tree *new_return)
+{
+ tree p0, p1, p2, p3;
+ tree I_type, I_type_ptr;
+ int n = get_atomic_generic_size (loc, function, params);
+
+ /* If not a lock-free size, change to the library generic format. */
+ if (n != 1 && n != 2 && n != 4 && n != 8 && n != 16)
+ {
+ *new_return = add_atomic_size_parameter (n, loc, function, params);
+ return true;
+ }
+
+ /* Otherwise there is a lockfree match, transform the call from:
+ void fn(T* mem, T* desired, T* return, model)
+ into
+ *return = (T) (fn (In* mem, (In) *desired, model)) */
+
+ p0 = VEC_index (tree, params, 0);
+ p1 = VEC_index (tree, params, 1);
+ p2 = VEC_index (tree, params, 2);
+ p3 = VEC_index (tree, params, 3);
+
+ /* Create pointer to appropriate size. */
+ I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
+ I_type_ptr = build_pointer_type (I_type);
+
+ /* Convert object pointer to required type. */
+ p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
+ VEC_replace (tree, params, 0, p0);
+
+ /* Convert new value to required type, and dereference it. */
+ p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
+ p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
+ VEC_replace (tree, params, 1, p1);
+
+ /* Move memory model to the 3rd position, and end param list. */
+ VEC_replace (tree, params, 2, p3);
+ VEC_truncate (tree, params, 3);
+
+ /* Convert return pointer and dereference it for later assignment. */
+ *new_return = build_indirect_ref (loc, p2, RO_UNARY_STAR);
+
+ return false;
+}
+
+
+/* This will process an __atomic_compare_exchange function call, determine
+ whether it needs to be mapped to the _N variation, or turned into a lib call.
+ LOC is the location of the builtin call.
+ FUNCTION is the DECL that has been invoked;
+ PARAMS is the argument list for the call. The return value is non-null
+ TRUE is returned if it is translated into the proper format for a call to the
+ external library, and NEW_RETURN is set the tree for that function.
+ FALSE is returned if processing for the _N variation is required. */
+
+static bool
+resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
+ VEC(tree,gc) *params,
+ tree *new_return)
+{
+ tree p0, p1, p2;
+ tree I_type, I_type_ptr;
+ int n = get_atomic_generic_size (loc, function, params);
+
+ /* If not a lock-free size, change to the library generic format. */
+ if (n != 1 && n != 2 && n != 4 && n != 8 && n != 16)
+ {
+ /* The library generic format does not have the weak parameter, so
+ remove it from the param list. Since a parameter has been removed,
+ we can be sure that there is room for the SIZE_T parameter, meaning
+ there will not be a recursive rebuilding of the parameter list, so
+ there is no danger this will be done twice. */
+ if (n > 0)
+ {
+ VEC_replace (tree, params, 3, VEC_index (tree, params, 4));
+ VEC_replace (tree, params, 4, VEC_index (tree, params, 5));
+ VEC_truncate (tree, params, 5);
+ }
+ *new_return = add_atomic_size_parameter (n, loc, function, params);
+ return true;
+ }
+
+ /* Otherwise, there is a match, so the call needs to be transformed from:
+ bool fn(T* mem, T* desired, T* return, weak, success, failure)
+ into
+ bool fn ((In *)mem, (In *)expected, (In) *desired, weak, succ, fail) */
+
+ p0 = VEC_index (tree, params, 0);
+ p1 = VEC_index (tree, params, 1);
+ p2 = VEC_index (tree, params, 2);
+
+ /* Create pointer to appropriate size. */
+ I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
+ I_type_ptr = build_pointer_type (I_type);
+
+ /* Convert object pointer to required type. */
+ p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
+ VEC_replace (tree, params, 0, p0);
+
+ /* Convert expected pointer to required type. */
+ p1 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p1);
+ VEC_replace (tree, params, 1, p1);
+
+ /* Convert desired value to required type, and dereference it. */
+ p2 = build_indirect_ref (loc, p2, RO_UNARY_STAR);
+ p2 = build1 (VIEW_CONVERT_EXPR, I_type, p2);
+ VEC_replace (tree, params, 2, p2);
+
+ /* The rest of the parameters are fine. NULL means no special return value
+ processing.*/
+ *new_return = NULL;
+ return false;
+}
+
+
+/* This will process an __atomic_load function call, determine whether it
+ needs to be mapped to the _N variation, or turned into a library call.
+ LOC is the location of the builtin call.
+ FUNCTION is the DECL that has been invoked;
+ PARAMS is the argument list for the call. The return value is non-null
+ TRUE is returned if it is translated into the proper format for a call to the
+ external library, and NEW_RETURN is set the tree for that function.
+ FALSE is returned if processing for the _N variation is required, and
+ NEW_RETURN is set to the the return value the result is copied into. */
+
+static bool
+resolve_overloaded_atomic_load (location_t loc, tree function,
+ VEC(tree,gc) *params, tree *new_return)
+{
+ tree p0, p1, p2;
+ tree I_type, I_type_ptr;
+ int n = get_atomic_generic_size (loc, function, params);
+
+ /* If not a lock-free size, change to the library generic format. */
+ if (n != 1 && n != 2 && n != 4 && n != 8 && n != 16)
+ {
+ *new_return = add_atomic_size_parameter (n, loc, function, params);
+ return true;
+ }
+
+ /* Otherwise, there is a match, so the call needs to be transformed from:
+ void fn(T* mem, T* return, model)
+ into
+ *return = (T) (fn ((In *) mem, model)) */
+
+ p0 = VEC_index (tree, params, 0);
+ p1 = VEC_index (tree, params, 1);
+ p2 = VEC_index (tree, params, 2);
+
+ /* Create pointer to appropriate size. */
+ I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
+ I_type_ptr = build_pointer_type (I_type);
+
+ /* Convert object pointer to required type. */
+ p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
+ VEC_replace (tree, params, 0, p0);
+
+ /* Move memory model to the 2nd position, and end param list. */
+ VEC_replace (tree, params, 1, p2);
+ VEC_truncate (tree, params, 2);
+
+ /* Convert return pointer and dereference it for later assignment. */
+ *new_return = build_indirect_ref (loc, p1, RO_UNARY_STAR);
+
+ return false;
+}
+
+
+/* This will process an __atomic_store function call, determine whether it
+ needs to be mapped to the _N variation, or turned into a library call.
+ LOC is the location of the builtin call.
+ FUNCTION is the DECL that has been invoked;
+ PARAMS is the argument list for the call. The return value is non-null
+ TRUE is returned if it is translated into the proper format for a call to the
+ external library, and NEW_RETURN is set the tree for that function.
+ FALSE is returned if processing for the _N variation is required, and
+ NEW_RETURN is set to the the return value the result is copied into. */
+
+static bool
+resolve_overloaded_atomic_store (location_t loc, tree function,
+ VEC(tree,gc) *params, tree *new_return)
+{
+ tree p0, p1;
+ tree I_type, I_type_ptr;
+ int n = get_atomic_generic_size (loc, function, params);
+
+ /* If not a lock-free size, change to the library generic format. */
+ if (n != 1 && n != 2 && n != 4 && n != 8 && n != 16)
+ {
+ *new_return = add_atomic_size_parameter (n, loc, function, params);
+ return true;
+ }
+
+ /* Otherwise, there is a match, so the call needs to be transformed from:
+ void fn(T* mem, T* value, model)
+ into
+ fn ((In *) mem, (In) *value, model) */
+
+ p0 = VEC_index (tree, params, 0);
+ p1 = VEC_index (tree, params, 1);
+
+ /* Create pointer to appropriate size. */
+ I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
+ I_type_ptr = build_pointer_type (I_type);
+
+ /* Convert object pointer to required type. */
+ p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
+ VEC_replace (tree, params, 0, p0);
+
+ /* Convert new value to required type, and dereference it. */
+ p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
+ p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
+ VEC_replace (tree, params, 1, p1);
+
+ /* The memory model is in the right spot already. Return is void. */
+ *new_return = NULL_TREE;
+
+ return false;
+}
+
+
/* Some builtin functions are placeholders for other expressions. This
function should be called immediately after parsing the call expression
before surrounding code has committed to the type of the expression.
@@ -9340,6 +9746,9 @@ tree
resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
{
enum built_in_function orig_code = DECL_FUNCTION_CODE (function);
+ bool orig_format = true;
+ tree new_return = NULL_TREE;
+
switch (DECL_BUILT_IN_CLASS (function))
{
case BUILT_IN_NORMAL:
@@ -9356,6 +9765,78 @@ resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
/* Handle BUILT_IN_NORMAL here. */
switch (orig_code)
{
+ case BUILT_IN_ATOMIC_EXCHANGE:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE:
+ case BUILT_IN_ATOMIC_LOAD:
+ case BUILT_IN_ATOMIC_STORE:
+ {
+ /* Handle these 4 together so that they can fall through to the next
+ case if the call is transformed to an _N variant. */
+ switch (orig_code)
+ {
+ case BUILT_IN_ATOMIC_EXCHANGE:
+ {
+ if (resolve_overloaded_atomic_exchange (loc, function, params,
+ &new_return))
+ return new_return;
+ /* Change to the _N variant. */
+ orig_code = BUILT_IN_ATOMIC_EXCHANGE_N;
+ break;
+ }
+
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE:
+ {
+ if (resolve_overloaded_atomic_compare_exchange (loc, function,
+ params,
+ &new_return))
+ return new_return;
+ /* Change to the _N variant. */
+ orig_code = BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N;
+ break;
+ }
+ case BUILT_IN_ATOMIC_LOAD:
+ {
+ if (resolve_overloaded_atomic_load (loc, function, params,
+ &new_return))
+ return new_return;
+ /* Change to the _N variant. */
+ orig_code = BUILT_IN_ATOMIC_LOAD_N;
+ break;
+ }
+ case BUILT_IN_ATOMIC_STORE:
+ {
+ if (resolve_overloaded_atomic_store (loc, function, params,
+ &new_return))
+ return new_return;
+ /* Change to the _N variant. */
+ orig_code = BUILT_IN_ATOMIC_STORE_N;
+ break;
+ }
+ default:
+ gcc_unreachable ();
+ }
+ /* Fallthrough to the normal processing. */
+ }
+ case BUILT_IN_ATOMIC_EXCHANGE_N:
+ case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N:
+ case BUILT_IN_ATOMIC_LOAD_N:
+ case BUILT_IN_ATOMIC_STORE_N:
+ case BUILT_IN_ATOMIC_ADD_FETCH_N:
+ case BUILT_IN_ATOMIC_SUB_FETCH_N:
+ case BUILT_IN_ATOMIC_AND_FETCH_N:
+ case BUILT_IN_ATOMIC_NAND_FETCH_N:
+ case BUILT_IN_ATOMIC_XOR_FETCH_N:
+ case BUILT_IN_ATOMIC_OR_FETCH_N:
+ case BUILT_IN_ATOMIC_FETCH_ADD_N:
+ case BUILT_IN_ATOMIC_FETCH_SUB_N:
+ case BUILT_IN_ATOMIC_FETCH_AND_N:
+ case BUILT_IN_ATOMIC_FETCH_NAND_N:
+ case BUILT_IN_ATOMIC_FETCH_XOR_N:
+ case BUILT_IN_ATOMIC_FETCH_OR_N:
+ {
+ orig_format = false;
+ /* Fallthru for parameter processing. */
+ }
case BUILT_IN_SYNC_FETCH_AND_ADD_N:
case BUILT_IN_SYNC_FETCH_AND_SUB_N:
case BUILT_IN_SYNC_FETCH_AND_OR_N:
@@ -9382,15 +9863,31 @@ resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
fncode = (enum built_in_function)((int)orig_code + exact_log2 (n) + 1);
new_function = builtin_decl_explicit (fncode);
- if (!sync_resolve_params (function, new_function, params))
+ if (!sync_resolve_params (loc, function, new_function, params,
+ orig_format))
return error_mark_node;
first_param = VEC_index (tree, params, 0);
result = build_function_call_vec (loc, new_function, params, NULL);
+ if (result == error_mark_node)
+ return result;
if (orig_code != BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_N
- && orig_code != BUILT_IN_SYNC_LOCK_RELEASE_N)
- result = sync_resolve_return (first_param, result);
+ && orig_code != BUILT_IN_SYNC_LOCK_RELEASE_N
+ && orig_code != BUILT_IN_ATOMIC_STORE_N)
+ result = sync_resolve_return (first_param, result, orig_format);
+ /* If new_return is set, assign function to that expr and cast the
+ result to void since the generic interface returned void. */
+ if (new_return)
+ {
+ /* Cast function result from I{1,2,4,8,16} to the required type. */
+ result = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (new_return), result);
+ result = build2 (MODIFY_EXPR, TREE_TYPE (new_return), new_return,
+ result);
+ TREE_SIDE_EFFECTS (result) = 1;
+ protected_set_expr_location (result, loc);
+ result = convert (void_type_node, result);
+ }
return result;
}
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index db58b95a37c..4d65dd1b7f1 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -106,6 +106,9 @@ enum rid
RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128,
RID_FRACT, RID_ACCUM,
+ /* C1X */
+ RID_ALIGNAS,
+
/* This means to warn that this is a C++ keyword, and then treat it
as a normal identifier. */
RID_CXX_COMPAT_WARN,
@@ -727,6 +730,7 @@ extern void finish_fname_decls (void);
extern const char *fname_as_string (int);
extern tree fname_decl (location_t, unsigned, tree);
+extern int check_user_alignment (const_tree, bool);
extern void check_function_arguments (const_tree, int, tree *);
extern void check_function_arguments_recurse (void (*)
(void *, tree,
@@ -959,7 +963,8 @@ extern bool c_dump_tree (void *, tree);
extern void verify_sequence_points (tree);
-extern tree fold_offsetof (tree, tree);
+extern tree fold_offsetof_1 (tree);
+extern tree fold_offsetof (tree);
/* Places where an lvalue, or modifiable lvalue, may be required.
Used to select diagnostic messages in lvalue_error and
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index bb9893a9681..bf83c261c20 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -758,30 +758,50 @@ c_cpp_builtins (cpp_reader *pfile)
/* Tell source code if the compiler makes sync_compare_and_swap
builtins available. */
-#ifdef HAVE_sync_compare_and_swapqi
- if (HAVE_sync_compare_and_swapqi)
- cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
+#ifndef HAVE_sync_compare_and_swapqi
+#define HAVE_sync_compare_and_swapqi 0
+#endif
+#ifndef HAVE_atomic_compare_and_swapqi
+#define HAVE_atomic_compare_and_swapqi 0
#endif
+ if (HAVE_sync_compare_and_swapqi || HAVE_atomic_compare_and_swapqi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
-#ifdef HAVE_sync_compare_and_swaphi
- if (HAVE_sync_compare_and_swaphi)
- cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
+#ifndef HAVE_sync_compare_and_swaphi
+#define HAVE_sync_compare_and_swaphi 0
#endif
+#ifndef HAVE_atomic_compare_and_swaphi
+#define HAVE_atomic_compare_and_swaphi 0
+#endif
+ if (HAVE_sync_compare_and_swaphi || HAVE_atomic_compare_and_swaphi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
-#ifdef HAVE_sync_compare_and_swapsi
- if (HAVE_sync_compare_and_swapsi)
- cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
+#ifndef HAVE_sync_compare_and_swapsi
+#define HAVE_sync_compare_and_swapsi 0
+#endif
+#ifndef HAVE_atomic_compare_and_swapsi
+#define HAVE_atomic_compare_and_swapsi 0
#endif
+ if (HAVE_sync_compare_and_swapsi || HAVE_atomic_compare_and_swapsi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
-#ifdef HAVE_sync_compare_and_swapdi
- if (HAVE_sync_compare_and_swapdi)
- cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+#ifndef HAVE_sync_compare_and_swapdi
+#define HAVE_sync_compare_and_swapdi 0
#endif
+#ifndef HAVE_atomic_compare_and_swapdi
+#define HAVE_atomic_compare_and_swapdi 0
+#endif
+ if (HAVE_sync_compare_and_swapdi || HAVE_atomic_compare_and_swapdi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
-#ifdef HAVE_sync_compare_and_swapti
- if (HAVE_sync_compare_and_swapti)
- cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
+#ifndef HAVE_sync_compare_and_swapti
+#define HAVE_sync_compare_and_swapti 0
+#endif
+#ifndef HAVE_atomic_compare_and_swapti
+#define HAVE_atomic_compare_and_swapti 0
#endif
+ if (HAVE_sync_compare_and_swapti || HAVE_atomic_compare_and_swapti)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
#ifdef DWARF2_UNWIND_INFO
if (dwarf2out_do_cfi_asm ())
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index b56aec79906..465bce35de3 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -406,6 +406,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warn_reorder = value;
warn_cxx0x_compat = value;
warn_delnonvdtor = value;
+ warn_narrowing = value;
}
cpp_opts->warn_trigraphs = value;
@@ -436,6 +437,10 @@ c_common_handle_option (size_t scode, const char *arg, int value,
cpp_opts->warn_cxx_operator_names = value;
break;
+ case OPT_Wc__0x_compat:
+ warn_narrowing = value;
+ break;
+
case OPT_Wdeprecated:
cpp_opts->cpp_warn_deprecated = value;
break;
@@ -997,10 +1002,17 @@ c_common_post_options (const char **pfilename)
if (warn_implicit_function_declaration == -1)
warn_implicit_function_declaration = flag_isoc99;
- /* If we're allowing C++0x constructs, don't warn about C++0x
- compatibility problems. */
if (cxx_dialect == cxx0x)
- warn_cxx0x_compat = 0;
+ {
+ /* If we're allowing C++0x constructs, don't warn about C++98
+ identifiers which are keywords in C++0x. */
+ warn_cxx0x_compat = 0;
+
+ if (warn_narrowing == -1)
+ warn_narrowing = 1;
+ }
+ else if (warn_narrowing == -1)
+ warn_narrowing = 0;
if (flag_preprocess_only)
{
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 6d500975898..0d7dc88b1ca 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -494,8 +494,8 @@ C ObjC C++ ObjC++ Warning
Warn about use of multi-character character constants
Wnarrowing
-C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(1)
--Wno-narrowing In C++0x mode, ignore ill-formed narrowing conversions within { }
+C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1)
+Warn about narrowing conversions within { } that are ill-formed in C++11
Wnested-externs
C ObjC Var(warn_nested_externs) Warning
@@ -689,6 +689,10 @@ Wpointer-sign
C ObjC Var(warn_pointer_sign) Init(-1) Warning
Warn when a pointer differs in signedness in an assignment
+Wzero-as-null-pointer-constant
+C++ ObjC++ Var(warn_zero_as_null_pointer_constant) Warning
+Warn when a literal '0' is used as null pointer
+
ansi
C ObjC C++ ObjC++
A synonym for -std=c89 (for C) or -std=c++98 (for C++)
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 25a4741a1b6..aed390f31e8 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -653,6 +653,7 @@ c_token_starts_declspecs (c_token *token)
case RID_FRACT:
case RID_ACCUM:
case RID_SAT:
+ case RID_ALIGNAS:
return true;
default:
return false;
@@ -1123,6 +1124,7 @@ static struct c_typespec c_parser_enum_specifier (c_parser *);
static struct c_typespec c_parser_struct_or_union_specifier (c_parser *);
static tree c_parser_struct_declaration (c_parser *);
static struct c_typespec c_parser_typeof_specifier (c_parser *);
+static tree c_parser_alignas_specifier (c_parser *);
static struct c_declarator *c_parser_declarator (c_parser *, bool, c_dtr_syn,
bool *);
static struct c_declarator *c_parser_direct_declarator (c_parser *, bool,
@@ -1896,9 +1898,11 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
type-specifier declaration-specifiers[opt]
type-qualifier declaration-specifiers[opt]
function-specifier declaration-specifiers[opt]
+ alignment-specifier declaration-specifiers[opt]
Function specifiers (inline) are from C99, and are currently
- handled as storage class specifiers, as is __thread.
+ handled as storage class specifiers, as is __thread. Alignment
+ specifiers are from C1X.
C90 6.5.1, C99 6.7.1:
storage-class-specifier:
@@ -1997,6 +2001,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
{
struct c_typespec t;
tree attrs;
+ tree align;
location_t loc = c_parser_peek_token (parser)->location;
/* If we cannot accept a type, exit if the next token must start
@@ -2175,6 +2180,10 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
attrs = c_parser_attributes (parser);
declspecs_add_attrs (specs, attrs);
break;
+ case RID_ALIGNAS:
+ align = c_parser_alignas_specifier (parser);
+ declspecs_add_alignas (specs, align);
+ break;
default:
goto out;
}
@@ -2757,6 +2766,45 @@ c_parser_typeof_specifier (c_parser *parser)
return ret;
}
+/* Parse an alignment-specifier.
+
+ C1X 6.7.5:
+
+ alignment-specifier:
+ _Alignas ( type-name )
+ _Alignas ( constant-expression )
+*/
+
+static tree
+c_parser_alignas_specifier (c_parser * parser)
+{
+ tree ret = error_mark_node;
+ location_t loc = c_parser_peek_token (parser)->location;
+ gcc_assert (c_parser_next_token_is_keyword (parser, RID_ALIGNAS));
+ c_parser_consume_token (parser);
+ if (!flag_isoc1x)
+ {
+ if (flag_isoc99)
+ pedwarn (loc, OPT_pedantic,
+ "ISO C99 does not support %<_Alignas%>");
+ else
+ pedwarn (loc, OPT_pedantic,
+ "ISO C90 does not support %<_Alignas%>");
+ }
+ if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
+ return ret;
+ if (c_parser_next_tokens_start_typename (parser, cla_prefer_id))
+ {
+ struct c_type_name *type = c_parser_type_name (parser);
+ if (type != NULL)
+ ret = c_alignof (loc, groktypename (type, NULL, NULL));
+ }
+ else
+ ret = c_parser_expr_no_commas (parser, NULL).value;
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>");
+ return ret;
+}
+
/* Parse a declarator, possibly an abstract declarator (C90 6.5.4,
6.5.5, C99 6.7.5, 6.7.6). If TYPE_SEEN_P then a typedef name may
be redeclared; otherwise it may not. KIND indicates which kind of
@@ -5793,6 +5841,8 @@ c_parser_cast_expression (c_parser *parser, struct c_expr *after)
__alignof__ ( type-name )
&& identifier
+ (C1X permits _Alignof with type names only.)
+
unary-operator: one of
__extension__ __real__ __imag__
@@ -5985,7 +6035,21 @@ c_parser_alignof_expression (c_parser *parser)
{
struct c_expr expr;
location_t loc = c_parser_peek_token (parser)->location;
+ tree alignof_spelling = c_parser_peek_token (parser)->value;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_ALIGNOF));
+ /* A diagnostic is not required for the use of this identifier in
+ the implementation namespace; only diagnose it for the C1X
+ spelling because of existing code using the other spellings. */
+ if (!flag_isoc1x
+ && strcmp (IDENTIFIER_POINTER (alignof_spelling), "_Alignof") == 0)
+ {
+ if (flag_isoc99)
+ pedwarn (loc, OPT_pedantic, "ISO C99 does not support %qE",
+ alignof_spelling);
+ else
+ pedwarn (loc, OPT_pedantic, "ISO C90 does not support %qE",
+ alignof_spelling);
+ }
c_parser_consume_token (parser);
c_inhibit_evaluation_warnings++;
in_alignof++;
@@ -6034,6 +6098,8 @@ c_parser_alignof_expression (c_parser *parser)
mark_exp_read (expr.value);
c_inhibit_evaluation_warnings--;
in_alignof--;
+ pedwarn (loc, OPT_pedantic, "ISO C does not allow %<%E (expression)%>",
+ alignof_spelling);
ret.value = c_alignof_expr (loc, expr.value);
ret.original_code = ERROR_MARK;
ret.original_type = NULL;
@@ -6431,7 +6497,7 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_error (parser, "expected identifier");
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<)%>");
- expr.value = fold_offsetof (offsetof_ref, NULL_TREE);
+ expr.value = fold_offsetof (offsetof_ref);
}
break;
case RID_CHOOSE_EXPR:
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index bca84243984..51c660c0346 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -238,6 +238,10 @@ struct c_declspecs {
NULL; attributes (possibly from multiple lists) will be passed
separately. */
tree attrs;
+ /* The base-2 log of the greatest alignment required by an _Alignas
+ specifier, in bytes, or -1 if no such specifiers with nonzero
+ alignment. */
+ int align_log;
/* The storage class specifier, or csc_none if none. */
enum c_storage_class storage_class;
/* Any type specifier keyword used such as "int", not reflecting
@@ -294,6 +298,9 @@ struct c_declspecs {
BOOL_BITFIELD restrict_p : 1;
/* Whether "_Sat" was specified. */
BOOL_BITFIELD saturating_p : 1;
+ /* Whether any alignment specifier (even with zero alignment) was
+ specified. */
+ BOOL_BITFIELD alignas_p : 1;
/* The address space that the declaration belongs to. */
addr_space_t address_space;
};
@@ -510,6 +517,7 @@ 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 *declspecs_add_alignas (struct c_declspecs *, tree);
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 c4e8930e0fb..4a134b0e524 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2720,6 +2720,10 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
if (flag_tm)
tm_malloc_replacement (function);
fundecl = function;
+ /* Atomic functions have type checking/casting already done. They are
+ often rewritten and don't match the original parameter list. */
+ if (name && !strncmp (IDENTIFIER_POINTER (name), "__atomic_", 9))
+ origtypes = NULL;
}
if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE)
function = function_to_pointer_conversion (loc, function);
@@ -3893,10 +3897,7 @@ build_unary_op (location_t location,
if (val && TREE_CODE (val) == INDIRECT_REF
&& TREE_CONSTANT (TREE_OPERAND (val, 0)))
{
- tree op0 = fold_offsetof (arg, val), op1;
-
- op1 = fold_convert_loc (location, argtype, TREE_OPERAND (val, 0));
- ret = fold_build_pointer_plus_loc (location, op1, op0);
+ ret = fold_convert_loc (location, argtype, fold_offsetof_1 (arg));
goto return_build_unary_op;
}
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 62ac6bfe151..22d3d87e68b 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -149,6 +149,7 @@ skip_insns_after_block (basic_block bb)
break;
case NOTE_INSN_DELETED:
case NOTE_INSN_DELETED_LABEL:
+ case NOTE_INSN_DELETED_DEBUG_LABEL:
continue;
default:
reorder_insns (insn, insn, last_insn);
@@ -1174,6 +1175,10 @@ duplicate_insn_chain (rtx from, rtx to)
switch (GET_CODE (insn))
{
case DEBUG_INSN:
+ /* Don't duplicate label debug insns. */
+ if (TREE_CODE (INSN_VAR_LOCATION_DECL (insn)) == LABEL_DECL)
+ break;
+ /* FALLTHRU */
case INSN:
case CALL_INSN:
case JUMP_INSN:
@@ -1219,6 +1224,7 @@ duplicate_insn_chain (rtx from, rtx to)
case NOTE_INSN_DELETED:
case NOTE_INSN_DELETED_LABEL:
+ case NOTE_INSN_DELETED_DEBUG_LABEL:
/* No problem to strip these. */
case NOTE_INSN_FUNCTION_BEG:
/* There is always just single entry to function. */
diff --git a/gcc/collect2.c b/gcc/collect2.c
index cf39693f653..92ef7ba024e 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1091,6 +1091,9 @@ main (int argc, char **argv)
const char **ld2;
char **object_lst;
const char **object;
+#ifdef TARGET_AIX_VERSION
+ int object_nbr = argc;
+#endif
int first_file;
int num_c_args;
char **old_argv;
@@ -1440,6 +1443,57 @@ main (int argc, char **argv)
"configuration");
#endif
}
+#ifdef TARGET_AIX_VERSION
+ else
+ {
+ /* File containing a list of input files to process. */
+
+ FILE *stream;
+ char buf[MAXPATHLEN + 2];
+ /* Number of additionnal object files. */
+ int add_nbr = 0;
+ /* Maximum of additionnal object files before vector
+ expansion. */
+ int add_max = 0;
+ const char *list_filename = arg + 2;
+
+ /* Accept -fFILENAME and -f FILENAME. */
+ if (*list_filename == '\0' && argv[1])
+ {
+ ++argv;
+ list_filename = *argv;
+ *ld1++ = *ld2++ = *argv;
+ }
+
+ stream = fopen (list_filename, "r");
+ if (stream == NULL)
+ fatal_error ("can't open %s: %m", list_filename);
+
+ while (fgets (buf, sizeof buf, stream) != NULL)
+ {
+ /* Remove end of line. */
+ int len = strlen (buf);
+ if (len >= 1 && buf[len - 1] =='\n')
+ buf[len - 1] = '\0';
+
+ /* Put on object vector.
+ Note: we only expanse vector here, so we must keep
+ extra space for remaining arguments. */
+ if (add_nbr >= add_max)
+ {
+ int pos = object - (const char **)object_lst;
+ add_max = (add_max == 0) ? 16 : add_max * 2;
+ object_lst = XRESIZEVEC (char *, object_lst,
+ object_nbr + add_max);
+ object = (const char **) object_lst + pos;
+ object_nbr += add_max;
+ }
+ *object++ = xstrdup (buf);
+ add_nbr++;
+ }
+ fclose (stream);
+ }
+#endif
break;
case 'l':
diff --git a/gcc/common.opt b/gcc/common.opt
index be2a967992c..4eb5b30b1c4 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -551,6 +551,10 @@ Winline
Common Var(warn_inline) Warning
Warn when an inlined function cannot be inlined
+Winvalid-memory-model
+Common Var(warn_invalid_memory_model) Init(1) Warning
+Warn when an atomic memory model parameter is known to be outside the valid range.
+
Wlarger-than-
Common RejectNegative Joined Warning Undocumented Alias(Wlarger-than=)
@@ -1270,6 +1274,10 @@ finline-limit=
Common RejectNegative Joined UInteger
-finline-limit=<number> Limit the size of inlined functions to <number>
+finline-atomics
+Common Report Var(flag_inline_atomics) Init(1) Optimization
+Inline __atomic operations when a lock free instruction sequence is available.
+
finstrument-functions
Common Report Var(flag_instrument_function_entry_exit)
Instrument function entry and exit with profiling calls
diff --git a/gcc/common/config/alpha/alpha-common.c b/gcc/common/config/alpha/alpha-common.c
index fcf5369034d..8a366b687c9 100644
--- a/gcc/common/config/alpha/alpha-common.c
+++ b/gcc/common/config/alpha/alpha-common.c
@@ -36,6 +36,17 @@ static const struct default_options alpha_option_optimization_table[] =
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+
+static void
+alpha_option_init_struct (struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+#if TARGET_ABI_OPEN_VMS
+ /* Enable section anchors by default. */
+ opts->x_flag_section_anchors = 1;
+#endif
+}
+
/* Implement TARGET_HANDLE_OPTION. */
static bool
@@ -75,6 +86,9 @@ alpha_handle_option (struct gcc_options *opts,
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION alpha_handle_option
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT alpha_option_init_struct
+
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE alpha_option_optimization_table
diff --git a/gcc/common/config/epiphany/epiphany-common.c b/gcc/common/config/epiphany/epiphany-common.c
new file mode 100644
index 00000000000..0382cb61839
--- /dev/null
+++ b/gcc/common/config/epiphany/epiphany-common.c
@@ -0,0 +1,46 @@
+/* Common hooks for Adapteva Epiphany
+ Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "common/common-target.h"
+#include "opts.h"
+#include "flags.h"
+
+#define TARGET_OPTION_OPTIMIZATION_TABLE epiphany_option_optimization_table
+
+#define TARGET_DEFAULT_TARGET_FLAGS \
+ (MASK_CMOVE | MASK_SOFT_CMPSF | MASK_SPLIT_LOHI | MASK_ROUND_NEAREST \
+ | MASK_VECT_DOUBLE | MASK_POST_INC | MASK_POST_MODIFY)
+
+#define TARGET_HAVE_NAMED_SECTIONS true
+
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
+static const struct default_options epiphany_option_optimization_table[] =
+ {
+ { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+ { OPT_LEVELS_NONE, 0, NULL, 0 }
+ };
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 2cb8b365891..45ba919dadf 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -84,12 +84,6 @@
# build-directory files by prefixing them with "./".
# All other files should relative to $srcdir/config.
#
-# libgcc_tm_file A list of target macro files used only for code
-# built for the target, not the host. These files
-# are relative to $srcdir/../libgcc/config and
-# must not have the same names as files in
-# $srcdir/config.
-#
# tm_p_file Location of file with declarations for functions
# in $out_file.
#
@@ -138,9 +132,6 @@
# extra_passes List of extra executables compiled for this target
# machine, used for compiling from source to object.
#
-# extra_parts List of extra object files that should be compiled
-# for this target machine.
-#
# extra_programs Like extra_passes, but these are used when linking.
#
# extra_options List of target-dependent .opt files.
@@ -215,7 +206,6 @@ user_headers_inc_next_post=
use_gcc_tgmath=yes
use_gcc_stdint=none
extra_passes=
-extra_parts=
extra_programs=
extra_objs=
extra_gcc_objs=
@@ -227,7 +217,6 @@ target_has_targetcm=no
target_has_targetm_common=yes
tm_defines=
xm_defines=
-libgcc_tm_file=
# Set this to force installation and use of collect2.
use_collect2=
# Set this to override the default target model.
@@ -361,7 +350,7 @@ i[34567]86-*-*)
immintrin.h x86intrin.h avxintrin.h xopintrin.h
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
- avx2intrin.h fmaintrin.h"
+ avx2intrin.h fmaintrin.h f16cintrin.h"
;;
x86_64-*-*)
cpu_type=i386
@@ -374,7 +363,7 @@ x86_64-*-*)
immintrin.h x86intrin.h avxintrin.h xopintrin.h
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
- avx2intrin.h fmaintrin.h"
+ avx2intrin.h fmaintrin.h f16cintrin.h"
need_64bit_hwint=yes
;;
ia64-*-*)
@@ -556,24 +545,15 @@ case ${target} in
# pleases around the provided core setting.
gas=yes
gnu_ld=yes
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
- tmake_file="t-slibgcc-elf-ver t-freebsd"
+ tmake_file="t-slibgcc"
case ${enable_threads} in
no)
fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
;;
"" | yes | posix)
thread_file='posix'
- tmake_file="${tmake_file} t-freebsd-thread"
- # Before 5.0, FreeBSD can't bind shared libraries to -lc
- # when "optionally" threaded via weak pthread_* checks.
- case ${target} in
- *-*-freebsd[34] | *-*-freebsd[34].*)
- tmake_file="${tmake_file} t-slibgcc-nolc-override"
- ;;
- esac
;;
*)
echo 'Unknown thread configuration for FreeBSD'
@@ -593,13 +573,12 @@ case ${target} in
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
extra_options="$extra_options gnu-user.opt"
- extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
gas=yes
gnu_ld=yes
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
- tmake_file="t-slibgcc-elf-ver t-linux"
+ tmake_file="t-slibgcc"
case $target in
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu)
:;;
@@ -647,7 +626,7 @@ case ${target} in
esac
;;
*-*-netbsd*)
- tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
+ tmake_file="t-slibgcc"
gas=yes
gnu_ld=yes
@@ -668,15 +647,6 @@ case ${target} in
;;
esac
- # NetBSD 1.7 and later are set up to use GCC's crtstuff for
- # ELF configurations. We will clear extra_parts in the
- # a.out configurations.
- case ${target} in
- *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- ;;
- esac
-
# NetBSD 2.0 and later provide __cxa_atexit(), which we use by
# default (unless overridden by --disable-__cxa_atexit).
case ${target} in
@@ -686,11 +656,10 @@ case ${target} in
esac
;;
*-*-openbsd*)
- tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
+ tmake_file="t-openbsd"
case ${enable_threads} in
yes)
thread_file='posix'
- tmake_file="${tmake_file} t-openbsd-thread"
;;
esac
case ${target} in
@@ -730,7 +699,7 @@ case ${target} in
tm_file="usegas.h ${tm_file}"
fi
tm_p_file="${tm_p_file} sol2-protos.h"
- tmake_file="${tmake_file} t-sol2 t-slibgcc-dummy"
+ tmake_file="${tmake_file} t-sol2 t-slibgcc"
c_target_objs="${c_target_objs} sol2-c.o"
cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
extra_objs="sol2.o sol2-stubs.o"
@@ -744,10 +713,12 @@ case ${target} in
*-*-*vms*)
extra_options="${extra_options} vms/vms.opt"
xmake_file=vms/x-vms
- tmake_file="vms/t-vms"
+ tmake_file="vms/t-vms t-slibgcc"
extra_objs="vms.o"
target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
tm_p_file="${tm_p_file} vms/vms-protos.h"
+ c_target_objs="vms-c.o"
+ cxx_target_objs="vms-c.o"
if test x$gnu_ld != xyes; then
# Build wrappers for native case.
extra_programs="ld\$(exeext) ar\$(exeext)"
@@ -777,22 +748,17 @@ alpha*-*-linux*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
- tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee alpha/t-linux"
- extra_parts="${extra_parts} crtfastmath.o"
;;
alpha*-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
- tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtfastmath.o"
;;
alpha*-*-netbsd*)
tm_file="${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
alpha/elf.opt"
target_cpu_default="MASK_GAS"
- tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
;;
alpha*-*-openbsd*)
tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
@@ -800,7 +766,6 @@ alpha*-*-openbsd*)
extra_options="${extra_options} openbsd.opt alpha/elf.opt"
# default x-alpha is only appropriate for dec-osf.
target_cpu_default="MASK_GAS"
- tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
;;
alpha*-dec-osf5.1*)
if test x$stabs = xyes
@@ -814,7 +779,7 @@ alpha*-dec-osf5.1*)
extra_passes="mips-tfile mips-tdump"
fi
use_collect2=yes
- tmake_file="t-slibgcc-dummy"
+ tmake_file="t-slibgcc"
tm_file="${tm_file} alpha/osf5.h"
tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1"
extra_options="${extra_options} rpath.opt alpha/osf5.opt"
@@ -827,14 +792,14 @@ alpha*-dec-osf5.1*)
esac
;;
alpha64-dec-*vms*)
- tm_file="${tm_file} alpha/vms.h alpha/vms64.h"
+ tm_file="${tm_file} vms/vms.h vms/vms64.h alpha/vms.h"
xm_file="alpha/xm-vms.h vms/xm-vms64.h"
- tmake_file="${tmake_file} alpha/t-alpha vms/t-vms64 alpha/t-vms alpha/t-ieee"
+ tmake_file="${tmake_file} vms/t-vms64 alpha/t-vms"
;;
alpha*-dec-*vms*)
- tm_file="${tm_file} alpha/vms.h"
+ tm_file="${tm_file} vms/vms.h alpha/vms.h"
xm_file="alpha/xm-vms.h"
- tmake_file="${tmake_file} alpha/t-alpha alpha/t-vms alpha/t-ieee"
+ tmake_file="${tmake_file} alpha/t-vms"
;;
arm-wrs-vxworks)
tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
@@ -848,7 +813,7 @@ arm*-*-freebsd*)
arm*-*-netbsdelf*)
tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
- tmake_file="${tmake_file} arm/t-arm arm/t-netbsd"
+ tmake_file="${tmake_file} arm/t-arm"
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
@@ -857,12 +822,11 @@ arm*-*-linux*) # ARM GNU/Linux with ELF
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac
- tmake_file="${tmake_file} t-linux arm/t-arm"
+ tmake_file="${tmake_file} arm/t-arm"
case ${target} in
arm*-*-linux-*eabi)
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
- libgcc_tm_file="$libgcc_tm_file arm/bpabi-lib.h"
- tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
# Define multilib configuration for arm-linux-androideabi.
case ${target} in
*-androideabi)
@@ -889,7 +853,6 @@ arm*-*-uclinux*) # ARM ucLinux
case ${target} in
arm*-*-uclinux*eabi)
tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
- libgcc_tm_file="$libgcc_tm_file arm/bpabi-lib.h"
tmake_file="$tmake_file arm/t-bpabi"
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
@@ -904,14 +867,13 @@ arm*-*-ecos-elf)
tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h"
tmake_file="arm/t-arm arm/t-arm-elf"
;;
-arm*-*-eabi* | arm*-*-symbianelf* )
+arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtemseabi*)
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
need_64bit_hwint=yes
default_use_cxa_atexit=yes
tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
- libgcc_tm_file="$libgcc_tm_file arm/bpabi-lib.h"
tmake_file="arm/t-arm arm/t-arm-elf"
case ${target} in
arm*-*-eabi*)
@@ -919,9 +881,12 @@ arm*-*-eabi* | arm*-*-symbianelf* )
tmake_file="${tmake_file} arm/t-bpabi"
use_gcc_stdint=wrap
;;
+ arm*-*-rtemseabi*)
+ tm_file="${tm_file} rtems.h arm/rtems-eabi.h newlib-stdint.h"
+ tmake_file="${tmake_file} arm/t-bpabi t-rtems arm/t-rtems-eabi"
+ ;;
arm*-*-symbianelf*)
tm_file="${tm_file} arm/symbian.h"
- libgcc_tm_file="$libgcc_tm_file arm/symbian-lib.h"
# We do not include t-bpabi for Symbian OS because the system
# provides its own implementation of the BPABI functions.
tmake_file="${tmake_file} arm/t-symbian"
@@ -945,14 +910,12 @@ arm*-wince-pe*)
;;
avr-*-rtems*)
tm_file="elfos.h avr/elf.h avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
- libgcc_tm_file="$libgcc_tm_file avr/avr-lib.h"
tmake_file="avr/t-avr t-rtems avr/t-rtems"
extra_gcc_objs="driver-avr.o avr-devices.o"
extra_objs="avr-devices.o avr-log.o"
;;
avr-*-*)
tm_file="elfos.h avr/elf.h avr/avr.h dbxelf.h newlib-stdint.h"
- libgcc_tm_file="$libgcc_tm_file avr/avr-lib.h"
use_gcc_stdint=wrap
extra_gcc_objs="driver-avr.o avr-devices.o"
extra_objs="avr-devices.o avr-log.o"
@@ -969,17 +932,15 @@ bfin*-uclinux*)
;;
bfin*-linux-uclibc*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
- tmake_file="t-slibgcc-elf-ver bfin/t-bfin-linux"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ tmake_file="bfin/t-bfin-linux t-slibgcc"
use_collect2=no
;;
bfin*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
- tmake_file="bfin/t-bfin t-rtems bfin/t-rtems"
+ tmake_file="t-rtems bfin/t-rtems"
;;
bfin*-*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
- tmake_file=bfin/t-bfin
use_collect2=no
use_gcc_stdint=wrap
;;
@@ -1001,7 +962,7 @@ cris-*-elf | cris-*-none)
crisv32-*-linux* | cris-*-linux*)
tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
# We need to avoid using t-linux, so override default tmake_file
- tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+ tmake_file="cris/t-cris cris/t-linux t-slibgcc"
extra_options="${extra_options} cris/linux.opt"
case $target in
cris-*-*)
@@ -1012,34 +973,36 @@ crisv32-*-linux* | cris-*-linux*)
;;
esac
;;
+epiphany-*-elf )
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="epiphany/t-epiphany"
+ extra_options="${extra_options} fused-madd.opt"
+ extra_objs="$extra_objs mode-switch-use.o resolve-sw-modes.o"
+ tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
+ extra_headers="epiphany_intrinsics.h"
+ ;;
fr30-*-elf)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
- tmake_file=fr30/t-fr30
- extra_parts="crti.o crtn.o crtbegin.o crtend.o"
;;
frv-*-elf)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
- libgcc_tm_file="${libgcc_tm_file} frv/frv-abi.h"
tmake_file=frv/t-frv
;;
frv-*-*linux*)
tm_file="dbxelf.h elfos.h ${tm_file} \
gnu-user.h linux.h glibc-stdint.h frv/linux.h"
- libgcc_tm_file="${libgcc_tm_file} frv/frv-abi.h"
tmake_file="${tmake_file} frv/t-frv frv/t-linux"
;;
moxie-*-elf)
gas=yes
gnu_ld=yes
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
- extra_parts="crti.o crtn.o crtbegin.o crtend.o"
tmake_file="${tmake_file} moxie/t-moxie"
;;
moxie-*-uclinux*)
gas=yes
gnu_ld=yes
tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
- extra_parts="crti.o crtn.o crtbegin.o crtend.o"
tmake_file="${tmake_file} moxie/t-moxie"
;;
moxie-*-rtems*)
@@ -1047,21 +1010,18 @@ moxie-*-rtems*)
tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
;;
h8300-*-rtems*)
- tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems"
+ tmake_file="h8300/t-h8300 t-rtems h8300/t-rtems"
tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h newlib-stdint.h"
- libgcc_tm_file="$libgcc_tm_file h8300/h8300-lib.h"
;;
h8300-*-elf*)
- tmake_file="h8300/t-h8300 h8300/t-elf"
+ tmake_file="h8300/t-h8300"
tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
- libgcc_tm_file="$libgcc_tm_file h8300/h8300-lib.h"
;;
hppa*64*-*-linux*)
target_cpu_default="MASK_PA_11|MASK_PA_20"
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
pa/pa64-linux.h"
- tmake_file="${tmake_file} pa/t-linux64"
gas=yes gnu_ld=yes
need_64bit_hwint=yes
;;
@@ -1069,13 +1029,6 @@ hppa*-*-linux*)
target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
pa/pa32-regs.h pa/pa32-linux.h"
- tmake_file="${tmake_file} pa/t-linux t-slibgcc-libgcc"
- # Set the libgcc version number
- if test x$sjlj = x1; then
- tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
- else
- tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
- fi
;;
# port not yet contributed.
#hppa*-*-openbsd*)
@@ -1098,7 +1051,7 @@ hppa[12]*-*-hpux10*)
esac
use_gcc_stdint=provide
tm_file="${tm_file} hpux-stdint.h"
- tmake_file="pa/t-pa-hpux10 pa/t-pa-hpux pa/t-hpux-shlib"
+ tmake_file="t-slibgcc"
case ${enable_threads} in
"")
if test x$have_pthread_h = xyes ; then
@@ -1109,12 +1062,6 @@ hppa[12]*-*-hpux10*)
tmake_file="${tmake_file} pa/t-dce-thr"
;;
esac
- # Set the libgcc version number
- if test x$sjlj = x1; then
- tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
- else
- tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
- fi
use_collect2=yes
gas=yes
if test "x$with_dwarf2" != x; then
@@ -1147,15 +1094,7 @@ hppa*64*-*-hpux11*)
extra_options="${extra_options} pa/pa-hpux.opt \
pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
need_64bit_hwint=yes
- tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib"
- # Set the libgcc version number
- if test x$sjlj = x1; then
- tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
- else
- tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
- fi
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
- libgcc_stub.a"
+ tmake_file="t-slibgcc"
case x${enable_threads} in
x | xyes | xposix )
thread_file=posix
@@ -1193,14 +1132,7 @@ hppa[12]*-*-hpux11*)
extra_options="${extra_options} pa/pa-hpux1131.opt"
;;
esac
- tmake_file="pa/t-pa-hpux11 pa/t-pa-hpux pa/t-hpux-shlib"
- # Set the libgcc version number
- if test x$sjlj = x1; then
- tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
- else
- tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
- fi
- extra_parts="libgcc_stub.a"
+ tmake_file="t-slibgcc"
case x${enable_threads} in
x | xyes | xposix )
thread_file=posix
@@ -1227,30 +1159,24 @@ i[34567]86-*-darwin*)
need_64bit_isa=yes
# Baseline choice for a machine that allows m64 support.
with_cpu=${with_cpu:-core2}
- tmake_file="${tmake_file} t-slibgcc-dummy"
- libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
+ tmake_file="${tmake_file} t-slibgcc"
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-core2}
- tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy"
+ tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64.h"
- libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
;;
i[34567]86-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
- tmake_file="${tmake_file} i386/t-i386elf i386/t-crtstuff t-svr4"
;;
x86_64-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
- tmake_file="${tmake_file} i386/t-i386elf i386/t-crtstuff t-svr4"
;;
i[34567]86-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
- tmake_file="${tmake_file} i386/t-crtstuff"
;;
x86_64-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
- tmake_file="${tmake_file} i386/t-crtstuff"
;;
i[34567]86-*-netbsdelf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
@@ -1259,13 +1185,12 @@ i[34567]86-*-netbsdelf*)
x86_64-*-netbsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
- tmake_file="${tmake_file} i386/t-crtstuff"
;;
i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
extra_options="${extra_options} openbsd.opt"
# needed to unconfuse gdb
- tmake_file="${tmake_file} t-libc-ok t-openbsd i386/t-openbsd"
+ tmake_file="${tmake_file} t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
@@ -1337,10 +1262,6 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h"
;;
esac
- tmake_file="${tmake_file} i386/t-crtstuff"
- # This is a hack to avoid a configuration mismatch
- # until the toplevel libgcc move is complete.
- extra_parts="${extra_parts} crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
@@ -1358,7 +1279,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} knetbsd-gnu.h"
;;
esac
- tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff"
+ tmake_file="${tmake_file} i386/t-linux64"
x86_multilibs="${with_multilib_list}"
if test "$x86_multilibs" = "default"; then
x86_multilibs="m64,m32"
@@ -1388,8 +1309,7 @@ i[34567]86-pc-msdosdjgpp*)
i[34567]86-*-lynxos*)
xm_defines=POSIX
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
- tmake_file="${tmake_file} i386/t-crtstuff t-lynx"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ tmake_file="${tmake_file} t-lynx"
extra_options="${extra_options} lynx.opt"
thread_file=lynx
gnu_ld=yes
@@ -1398,7 +1318,6 @@ i[34567]86-*-lynxos*)
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
extra_options="${extra_options} i386/nto.opt"
- tmake_file="${tmake_file} i386/t-nto"
gnu_ld=yes
gas=yes
;;
@@ -1460,19 +1379,7 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
i[34567]86-*-cygwin*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-stdint.h"
xm_file=i386/xm-cygwin.h
- # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$sjlj = x0; then
- tmake_eh_file="i386/t-dw2-eh"
- else
- tmake_eh_file="i386/t-sjlj-eh"
- fi
- # Shared libgcc DLL install dir depends on cross/native build.
- if test x${host} = x${target} ; then
- tmake_dlldir_file="i386/t-dlldir"
- else
- tmake_dlldir_file="i386/t-dlldir-x"
- fi
- tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-cygming i386/t-cygwin"
+ tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt"
extra_objs="winnt.o winnt-stubs.o"
@@ -1525,19 +1432,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
;;
esac
tm_file="${tm_file} i386/mingw-stdint.h"
- # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$sjlj = x0; then
- tmake_eh_file="i386/t-dw2-eh"
- else
- tmake_eh_file="i386/t-sjlj-eh"
- fi
- # Shared libgcc DLL install dir depends on cross/native build.
- if test x${host} = x${target} ; then
- tmake_dlldir_file="i386/t-dlldir"
- else
- tmake_dlldir_file="i386/t-dlldir-x"
- fi
- tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-cygming"
+ tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
case ${target} in
x86_64-w64-*)
tmake_file="${tmake_file} i386/t-mingw-w64"
@@ -1545,9 +1440,6 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
i[34567]86-w64-*)
tmake_file="${tmake_file} i386/t-mingw-w32"
;;
- *)
- tmake_file="${tmake_file} i386/t-mingw32"
- ;;
esac
native_system_header_dir=/mingw/include
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
@@ -1565,12 +1457,11 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
case ${enable_threads} in
- "" | yes | win32) thread_file='win32'
- tmake_file="${tmake_file} i386/t-gthr-win32"
+ "" | yes | win32)
+ thread_file='win32'
;;
posix)
thread_file='posix'
- tmake_file="i386/t-mingw-pthread ${tmake_file}"
;;
esac
case ${target} in
@@ -1606,23 +1497,20 @@ ia64*-*-elf*)
then
target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
fi
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
tmake_file="${tmake_file} ia64/t-ia64"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
- tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
+ tmake_file="${tmake_file} ia64/t-ia64 t-libunwind"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-hpux*)
tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
- tmake_file="ia64/t-ia64 ia64/t-hpux"
+ tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc"
target_cpu_default="MASK_GNU_AS"
case x$enable_threads in
x | xyes | xposix )
@@ -1642,9 +1530,9 @@ ia64*-*-hpux*)
esac
;;
ia64-hp-*vms*)
- tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h ia64/vms.h ia64/vms64.h"
+ tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h vms/vms.h vms/vms64.h ia64/vms.h"
xm_file="vms/xm-vms.h vms/xm-vms64.h"
- tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64 ia64/t-vms"
+ tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64"
target_cpu_default="0"
if test x$gas = xyes
then
@@ -1654,7 +1542,6 @@ ia64-hp-*vms*)
;;
iq2000*-*-elf*)
tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
- tmake_file=iq2000/t-iq2000
out_file=iq2000/iq2000.c
md_file=iq2000/iq2000.md
;;
@@ -1666,6 +1553,7 @@ lm32-*-rtems*)
tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
tmake_file="${tmake_file} lm32/t-lm32"
tmake_file="${tmake_file} t-rtems"
+ tmake_file="${tmake_file} lm32/t-rtems"
;;
lm32-*-uclinux*)
tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
@@ -1673,21 +1561,18 @@ lm32-*-uclinux*)
;;
m32r-*-elf*)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
- extra_parts="crtinit.o crtfini.o"
;;
m32rle-*-elf*)
tm_file="dbxelf.h elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
- extra_parts="crtinit.o crtfini.o m32rx/crtinit.o m32rx/crtfini.o"
;;
m32r-*-rtems*)
tm_file="dbxelf.h elfos.h ${tm_file} m32r/rtems.h rtems.h newlib-stdint.h"
tmake_file="m32r/t-m32r t-rtems"
- extra_parts="crtinit.o crtfini.o"
;;
m32r-*-linux*)
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
# We override the tmake_file for linux -- why?
- tmake_file="t-slibgcc-elf-ver m32r/t-linux"
+ tmake_file="m32r/t-linux t-slibgcc"
gnu_ld=yes
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -1696,7 +1581,7 @@ m32r-*-linux*)
m32rle-*-linux*)
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
# We override the tmake_file for linux -- why?
- tmake_file="t-slibgcc-elf-ver m32r/t-linux"
+ tmake_file="m32r/t-linux t-slibgcc"
gnu_ld=yes
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -1732,7 +1617,6 @@ m68k-*-elf* | fido-*-elf*)
tmake_file="$tmake_file m68k/t-mlibs"
;;
esac
- extra_parts="crtbegin.o crtend.o"
;;
m68k*-*-netbsdelf*)
default_m68k_cpu=68020
@@ -1748,7 +1632,7 @@ m68k*-*-openbsd*)
tm_defines="${tm_defines} OBSD_OLD_GAS"
tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
extra_options="${extra_options} openbsd.opt"
- tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
+ tmake_file="t-openbsd m68k/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
@@ -1762,7 +1646,7 @@ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
tm_defines="${tm_defines} MOTOROLA=1"
tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
;;
-m68k-*-linux*) # Motorola m68k's running GNU/Linux
+m68k-*-linux*) # Motorola m68k's running GNU/Linux
# with ELF format using glibc 2
# aka the GNU/Linux C library 6.
default_m68k_cpu=68020
@@ -1772,11 +1656,6 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux
extra_options="${extra_options} m68k/ieee.opt"
tm_defines="${tm_defines} MOTOROLA=1"
tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
- # if not configured with --enable-sjlj-exceptions, bump the
- # libgcc version number
- if test x$sjlj != x1; then
- tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
- fi
;;
m68k-*-rtems*)
default_m68k_cpu=68020
@@ -1784,7 +1663,6 @@ m68k-*-rtems*)
tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems m68k/t-mlibs"
tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
tm_defines="${tm_defines} MOTOROLA=1"
- extra_parts="crtbegin.o crtend.o"
;;
mcore-*-elf)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
@@ -1794,7 +1672,6 @@ mcore-*-elf)
mep-*-*)
tm_file="dbxelf.h elfos.h ${tm_file}"
tmake_file=mep/t-mep
- extra_parts="crtbegin.o crtend.o"
c_target_objs="mep-pragma.o"
cxx_target_objs="mep-pragma.o"
if test -d "${srcdir}/../newlib/libc/include" &&
@@ -1807,8 +1684,6 @@ microblaze*-linux*)
tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
c_target_objs="${c_target_objs} microblaze-c.o"
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
- tmake_file="${tmake_file} t-slibgcc-elf-ver t-slibgcc-nolc-override t-linux microblaze/t-microblaze"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o"
;;
microblaze*-*-*)
tm_file="${tm_file} dbxelf.h"
@@ -1818,7 +1693,7 @@ microblaze*-*-*)
;;
mips-sgi-irix6.5*)
tm_file="elfos.h ${tm_file} mips/iris6.h"
- tmake_file="mips/t-irix6 t-slibgcc-dummy"
+ tmake_file="mips/t-irix6 t-slibgcc"
extra_options="${extra_options} rpath.opt mips/iris6.opt"
target_cpu_default="MASK_ABICALLS"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
@@ -1843,7 +1718,7 @@ mips*-*-netbsd*) # NetBSD/mips, either endian.
;;
mips64*-*-linux* | mipsisa64*-*-linux*)
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h"
- tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
+ tmake_file="${tmake_file} mips/t-linux64"
tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
case ${target} in
mips64el-st-linux-gnu)
@@ -1858,14 +1733,12 @@ mips64*-*-linux* | mipsisa64*-*-linux*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
;;
esac
- extra_parts="$extra_parts crtfastmath.o"
gnu_ld=yes
gas=yes
test x$with_llsc != x || with_llsc=yes
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
- tmake_file="${tmake_file} mips/t-libgcc-mips16"
if test x$enable_targets = xall; then
tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
tmake_file="${tmake_file} mips/t-linux64"
@@ -1877,7 +1750,6 @@ mips*-*-linux*) # Linux MIPS, either endian.
mipsisa32*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
esac
- extra_parts="$extra_parts crtfastmath.o"
test x$with_llsc != x || with_llsc=yes
;;
mips*-*-openbsd*)
@@ -1893,7 +1765,7 @@ mips*-*-openbsd*)
;;
mips*-sde-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h"
- tmake_file="mips/t-sde mips/t-libgcc-mips16"
+ tmake_file="mips/t-sde"
extra_options="${extra_options} mips/sde.opt"
case "${with_newlib}" in
yes)
@@ -1930,7 +1802,7 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
mipsisa64-*-elf* | mipsisa64el-*-elf* | \
mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
- tmake_file="mips/t-isa3264 mips/t-libgcc-mips16"
+ tmake_file="mips/t-isa3264"
case ${target} in
mipsisa32r2*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
@@ -1967,17 +1839,17 @@ mipsisa64sr71k-*-elf*)
;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
- tmake_file="mips/t-elf mips/t-libgcc-mips16 mips/t-sb1"
+ tmake_file="mips/t-elf mips/t-sb1"
target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
;;
mips-*-elf* | mipsel-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
- tmake_file="mips/t-elf mips/t-libgcc-mips16"
+ tmake_file="mips/t-elf"
;;
mips64-*-elf* | mips64el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
- tmake_file="mips/t-elf mips/t-libgcc-mips16"
+ tmake_file="mips/t-elf"
target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
;;
@@ -1988,13 +1860,13 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
;;
mips64orion-*-elf* | mips64orionel-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
- tmake_file="mips/t-elf mips/t-libgcc-mips16"
+ tmake_file="mips/t-elf"
target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
;;
mips*-*-rtems*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
- tmake_file="mips/t-elf mips/t-libgcc-mips16 t-rtems mips/t-rtems"
+ tmake_file="mips/t-elf t-rtems mips/t-rtems"
;;
mips-wrs-vxworks)
tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
@@ -2002,7 +1874,7 @@ mips-wrs-vxworks)
;;
mipstx39-*-elf* | mipstx39el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
- tmake_file="mips/t-r3900 mips/t-libgcc-mips16"
+ tmake_file="mips/t-r3900"
;;
mmix-knuth-mmixware)
tm_file="${tm_file} newlib-stdint.h"
@@ -2045,19 +1917,18 @@ powerpc-*-darwin*)
*-darwin[0-6]*)
;;
esac
- tmake_file="${tmake_file} t-slibgcc-dummy"
+ tmake_file="${tmake_file} t-slibgcc"
extra_headers=altivec.h
;;
powerpc64-*-darwin*)
extra_options="${extra_options} ${cpu_type}/darwin.opt"
- tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy"
+ tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h"
extra_headers=altivec.h
;;
powerpc-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
- tmake_file="${tmake_file} t-slibgcc-libgcc"
extra_options="${extra_options} rs6000/sysv4.opt"
;;
powerpc-*-netbsd*)
@@ -2143,7 +2014,6 @@ powerpc-*-linux* | powerpc64-*-linux*)
tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
;;
esac
- tmake_file="${tmake_file} t-slibgcc-libgcc"
case ${target} in
powerpc*-*-linux*ppc476*)
tm_file="${tm_file} rs6000/476.h"
@@ -2179,7 +2049,6 @@ powerpc-*-lynxos*)
tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
tmake_file="t-lynx rs6000/t-lynx"
extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
thread_file=lynx
gnu_ld=yes
gas=yes
@@ -2203,7 +2072,7 @@ powerpcle-*-eabi*)
;;
rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h rs6000/aix-stdint.h"
- tmake_file=rs6000/t-aix43
+ tmake_file="rs6000/t-aix43 t-slibgcc"
extra_options="${extra_options} rs6000/aix64.opt"
use_collect2=yes
thread_file='aix'
@@ -2213,7 +2082,7 @@ rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h rs6000/aix-stdint.h"
extra_options="${extra_options} rs6000/aix64.opt"
- tmake_file=rs6000/t-aix43
+ tmake_file="rs6000/t-aix43 t-slibgcc"
use_collect2=yes
thread_file='aix'
use_gcc_stdint=wrap
@@ -2221,7 +2090,7 @@ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
;;
rs6000-ibm-aix5.2.* | powerpc-ibm-aix5.2.*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h rs6000/aix-stdint.h"
- tmake_file=rs6000/t-aix52
+ tmake_file="rs6000/t-aix52 t-slibgcc"
extra_options="${extra_options} rs6000/aix64.opt"
use_collect2=yes
thread_file='aix'
@@ -2230,7 +2099,7 @@ rs6000-ibm-aix5.2.* | powerpc-ibm-aix5.2.*)
;;
rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix53.h rs6000/xcoff.h rs6000/aix-stdint.h"
- tmake_file=rs6000/t-aix52
+ tmake_file="rs6000/t-aix52 t-slibgcc"
extra_options="${extra_options} rs6000/aix64.opt"
use_collect2=yes
thread_file='aix'
@@ -2239,7 +2108,7 @@ rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
;;
rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
- tmake_file=rs6000/t-aix52
+ tmake_file="rs6000/t-aix52 t-slibgcc"
extra_options="${extra_options} rs6000/aix64.opt"
use_collect2=yes
thread_file='aix'
@@ -2248,7 +2117,6 @@ rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
;;
rx-*-elf*)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
- libgcc_tm_file="${libgcc_tm_file} rx/rx-abi.h rx/rx-lib.h"
tmake_file="${tmake_file} rx/t-rx"
;;
s390-*-linux*)
@@ -2271,7 +2139,6 @@ s390x-ibm-tpf*)
md_file=s390/s390.md
extra_modes=s390/s390-modes.def
out_file=s390/s390.c
- extra_parts="crtbeginS.o crtendS.o"
thread_file='tpf'
extra_options="${extra_options} s390/tpf.opt"
;;
@@ -2279,13 +2146,11 @@ score-*-elf)
gas=yes
gnu_ld=yes
tm_file="dbxelf.h elfos.h score/elf.h score/score.h newlib-stdint.h"
- extra_parts="crti.o crtn.o crtbegin.o crtend.o"
- tmake_file="${tmake_file} score/t-score-elf"
;;
sh-*-elf* | sh[12346l]*-*-elf* | \
sh-*-linux* | sh[2346lbe]*-*-linux* | \
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
- sh64-*-netbsd* | sh64l*-*-netbsd*)
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
if test x${with_endian} = x; then
case ${target} in
@@ -2326,7 +2191,6 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
fi
tm_file="${tm_file} sh/embed-elf.h"
tm_file="${tm_file} sh/superh.h"
- tmake_file="${tmake_file} sh/t-superh"
extra_options="${extra_options} sh/superh.opt" ;;
*) if test x$with_newlib = xyes \
&& test x$with_libgloss = xyes; then
@@ -2337,17 +2201,16 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
case ${target} in
sh5*-*-netbsd*)
# SHmedia, 32-bit ABI
- tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd"
+ tmake_file="${tmake_file} sh/t-sh64"
;;
sh64*-netbsd*)
# SHmedia, 64-bit ABI
- tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd sh/t-netbsd-sh5-64"
+ tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd-sh5-64"
;;
*-*-netbsd)
- tmake_file="${tmake_file} sh/t-netbsd"
;;
sh64*-*-linux*)
- tmake_file="${tmake_file} sh/t-sh64 sh/t-linux64"
+ tmake_file="${tmake_file} sh/t-sh64"
tm_file="${tm_file} sh/sh64.h"
extra_headers="shmedia.h ushmedia.h sshmedia.h"
;;
@@ -2461,11 +2324,11 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
tmake_file="$tmake_file t-sysroot-suffix"
;;
sh-*-rtems*)
- tmake_file="sh/t-sh sh/t-elf t-rtems sh/t-rtems"
+ tmake_file="sh/t-sh t-rtems sh/t-rtems"
tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
;;
sh-wrs-vxworks)
- tmake_file="$tmake_file sh/t-sh sh/t-elf sh/t-vxworks"
+ tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
;;
sparc-*-elf*)
@@ -2497,7 +2360,7 @@ sparc-*-linux*)
tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
;;
*)
- tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux"
+ tmake_file="${tmake_file} sparc/t-sparc"
;;
esac
if test x$enable_targets = xall; then
@@ -2506,7 +2369,6 @@ sparc-*-linux*)
else
tm_file="${tm_file} sparc/linux.h"
fi
- extra_parts="${extra_parts} crtfastmath.o"
;;
sparc-*-netbsdelf*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
@@ -2543,8 +2405,7 @@ sparc64-*-rtems*)
sparc64-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
- tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux sparc/t-linux64"
- extra_parts="${extra_parts} crtfastmath.o"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
@@ -2554,7 +2415,6 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
x) with_cpu=ultrasparc ;;
*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
esac
- extra_parts="${extra_parts} crtfastmath.o"
tmake_file="${tmake_file} sparc/t-sparc"
;;
sparc64-*-netbsd*)
@@ -2585,7 +2445,6 @@ spu-*-elf*)
tic6x-*-elf)
tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
- libgcc_tm_file="${libgcc_tm_file} c6x/c6x-abi.h"
tmake_file="c6x/t-c6x c6x/t-c6x-elf"
use_collect2=no
;;
@@ -2593,8 +2452,7 @@ tic6x-*-uclinux)
tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
tm_file="${tm_file} ./sysroot-suffix.h"
- libgcc_tm_file="${libgcc_tm_file} c6x/c6x-abi.h"
- tmake_file="t-slibgcc-elf-ver t-sysroot-suffix"
+ tmake_file="t-sysroot-suffix t-slibgcc"
tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
use_collect2=no
;;
@@ -2629,7 +2487,6 @@ v850*-*-*)
vax-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
extra_options="${extra_options} vax/elf.opt"
- 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"
@@ -2648,21 +2505,18 @@ xstormy16-*-elf)
out_file=stormy16/stormy16.c
extra_options=stormy16/stormy16.opt
tmake_file="stormy16/t-stormy16"
- extra_parts="crtbegin.o crtend.o"
;;
xtensa*-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
extra_options="${extra_options} xtensa/elf.opt"
- tmake_file="xtensa/t-xtensa xtensa/t-elf"
;;
xtensa*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
- tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux"
+ tmake_file="${tmake_file} xtensa/t-xtensa"
;;
am33_2.0-*-linux*)
tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
gas=yes gnu_ld=yes
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
use_collect2=no
;;
m32c-*-rtems*)
@@ -2685,7 +2539,6 @@ esac
case ${target} in
i[34567]86-*-linux* | x86_64-*-linux*)
tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
- libgcc_tm_file="${libgcc_tm_file} i386/value-unwind.h"
;;
i[34567]86-*-* | x86_64-*-*)
tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
@@ -3610,7 +3463,6 @@ case ${target} in
i[34567]86-*-linux* | x86_64-*-linux* | \
i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
i[34567]86-*-gnu*)
- tmake_file="${tmake_file} i386/t-linux"
;;
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
;;
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 13b5ce936b8..31551689a27 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -99,8 +99,7 @@ extern void alpha_split_lock_test_and_set_12 (enum machine_mode, rtx, rtx,
rtx, rtx, rtx);
#endif
-extern rtx alpha_need_linkage (const char *, int);
-extern rtx alpha_use_linkage (rtx, tree, int, int);
+extern rtx alpha_use_linkage (rtx, bool, bool);
#if TARGET_ABI_OPEN_VMS
extern enum avms_arg_type alpha_arg_type (enum machine_mode);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index e195df5c0d6..9a43f80243f 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -196,7 +196,7 @@ static struct machine_function *alpha_init_machine_status (void);
static rtx alpha_emit_xfloating_compare (enum rtx_code *, rtx, rtx);
#if TARGET_ABI_OPEN_VMS
-static void alpha_write_linkage (FILE *, const char *, tree);
+static void alpha_write_linkage (FILE *, const char *);
static bool vms_valid_pointer_mode (enum machine_mode);
#else
#define vms_patch_builtins() gcc_unreachable()
@@ -4509,6 +4509,8 @@ alpha_multipass_dfa_lookahead (void)
/* Machine-specific function data. */
+struct GTY(()) alpha_links;
+
struct GTY(()) machine_function
{
/* For OSF. */
@@ -4518,7 +4520,11 @@ struct GTY(()) machine_function
rtx gp_save_rtx;
/* For VMS condition handlers. */
- bool uses_condition_handler;
+ bool uses_condition_handler;
+
+ /* Linkage entries. */
+ splay_tree GTY ((param1_is (char *), param2_is (struct alpha_links *)))
+ links;
};
/* How to allocate a 'struct machine_function'. */
@@ -7862,16 +7868,17 @@ alpha_start_function (FILE *file, const char *fnname,
fprintf (file, "\t.handler_data %d\n", VMS_COND_HANDLER_FP_OFFSET);
}
- /* Ifdef'ed cause link_section are only available then. */
+#ifdef TARGET_VMS_CRASH_DEBUG
+ /* Support of minimal traceback info. */
switch_to_section (readonly_data_section);
fprintf (file, "\t.align 3\n");
assemble_name (file, fnname); fputs ("..na:\n", file);
fputs ("\t.ascii \"", file);
assemble_name (file, fnname);
fputs ("\\0\"\n", file);
- alpha_need_linkage (fnname, 1);
switch_to_section (text_section);
#endif
+#endif /* TARGET_ABI_OPEN_VMS */
}
/* Emit the .prologue note at the scheduled end of the prologue. */
@@ -8104,7 +8111,8 @@ alpha_end_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED)
output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL);
#if TARGET_ABI_OPEN_VMS
- alpha_write_linkage (file, fnname, decl);
+ /* Write the linkage entries. */
+ alpha_write_linkage (file, fnname);
#endif
/* End the function. */
@@ -9299,32 +9307,19 @@ alpha_elf_section_type_flags (tree decl, const char *name, int reloc)
/* Structure to collect function names for final output in link section. */
/* Note that items marked with GTY can't be ifdef'ed out. */
-enum links_kind {KIND_UNUSED, KIND_LOCAL, KIND_EXTERN};
-enum reloc_kind {KIND_LINKAGE, KIND_CODEADDR};
+enum reloc_kind
+{
+ KIND_LINKAGE,
+ KIND_CODEADDR
+};
struct GTY(()) alpha_links
{
- int num;
- const char *target;
+ rtx func;
rtx linkage;
- enum links_kind lkind;
enum reloc_kind rkind;
};
-struct GTY(()) alpha_funcs
-{
- int num;
- splay_tree GTY ((param1_is (char *), param2_is (struct alpha_links *)))
- links;
-};
-
-static GTY ((param1_is (char *), param2_is (struct alpha_links *)))
- splay_tree alpha_links_tree;
-static GTY ((param1_is (tree), param2_is (struct alpha_funcs *)))
- splay_tree alpha_funcs_tree;
-
-static GTY(()) int alpha_funcs_num;
-
#if TARGET_ABI_OPEN_VMS
/* Return the VMS argument type corresponding to MODE. */
@@ -9358,95 +9353,6 @@ alpha_arg_info_reg_val (CUMULATIVE_ARGS cum)
return GEN_INT (regval);
}
-/* Register the need for a (fake) .linkage entry for calls to function NAME.
- IS_LOCAL is 1 if this is for a definition, 0 if this is for a real call.
- Return a SYMBOL_REF suited to the call instruction. */
-
-rtx
-alpha_need_linkage (const char *name, int is_local)
-{
- splay_tree_node node;
- struct alpha_links *al;
- const char *target;
- tree id;
-
- if (name[0] == '*')
- name++;
-
- if (is_local)
- {
- struct alpha_funcs *cfaf;
-
- if (!alpha_funcs_tree)
- alpha_funcs_tree = splay_tree_new_ggc
- (splay_tree_compare_pointers,
- ggc_alloc_splay_tree_tree_node_tree_node_splay_tree_s,
- ggc_alloc_splay_tree_tree_node_tree_node_splay_tree_node_s);
-
-
- cfaf = ggc_alloc_alpha_funcs ();
-
- cfaf->links = 0;
- cfaf->num = ++alpha_funcs_num;
-
- splay_tree_insert (alpha_funcs_tree,
- (splay_tree_key) current_function_decl,
- (splay_tree_value) cfaf);
- }
-
- if (alpha_links_tree)
- {
- /* Is this name already defined? */
-
- node = splay_tree_lookup (alpha_links_tree, (splay_tree_key) name);
- if (node)
- {
- al = (struct alpha_links *) node->value;
- if (is_local)
- {
- /* Defined here but external assumed. */
- if (al->lkind == KIND_EXTERN)
- al->lkind = KIND_LOCAL;
- }
- else
- {
- /* Used here but unused assumed. */
- if (al->lkind == KIND_UNUSED)
- al->lkind = KIND_LOCAL;
- }
- return al->linkage;
- }
- }
- else
- alpha_links_tree = splay_tree_new_ggc
- ((splay_tree_compare_fn) strcmp,
- ggc_alloc_splay_tree_str_alpha_links_splay_tree_s,
- ggc_alloc_splay_tree_str_alpha_links_splay_tree_node_s);
-
- al = ggc_alloc_alpha_links ();
- name = ggc_strdup (name);
-
- /* Assume external if no definition. */
- al->lkind = (is_local ? KIND_UNUSED : KIND_EXTERN);
-
- /* Ensure we have an IDENTIFIER so assemble_name can mark it used
- and find the ultimate alias target like assemble_name. */
- id = get_identifier (name);
- target = NULL;
- while (IDENTIFIER_TRANSPARENT_ALIAS (id))
- {
- id = TREE_CHAIN (id);
- target = IDENTIFIER_POINTER (id);
- }
-
- al->target = target ? target : name;
- al->linkage = gen_rtx_SYMBOL_REF (Pmode, name);
-
- splay_tree_insert (alpha_links_tree, (splay_tree_key) name,
- (splay_tree_value) al);
-
- return al->linkage;
-}
/* Return a SYMBOL_REF representing the reference to the .linkage entry
of function FUNC built for calls made from CFUNDECL. LFLAG is 1 if
@@ -9455,75 +9361,48 @@ alpha_need_linkage (const char *name, int is_local)
reference (code address only), 0 if this is a full reference. */
rtx
-alpha_use_linkage (rtx func, tree cfundecl, int lflag, int rflag)
+alpha_use_linkage (rtx func, bool lflag, bool rflag)
{
- splay_tree_node cfunnode;
- struct alpha_funcs *cfaf;
- struct alpha_links *al;
+ struct alpha_links *al = NULL;
const char *name = XSTR (func, 0);
- cfaf = (struct alpha_funcs *) 0;
- al = (struct alpha_links *) 0;
-
- cfunnode = splay_tree_lookup (alpha_funcs_tree, (splay_tree_key) cfundecl);
- cfaf = (struct alpha_funcs *) cfunnode->value;
-
- if (cfaf->links)
+ if (cfun->machine->links)
{
splay_tree_node lnode;
/* Is this name already defined? */
-
- lnode = splay_tree_lookup (cfaf->links, (splay_tree_key) name);
+ lnode = splay_tree_lookup (cfun->machine->links, (splay_tree_key) name);
if (lnode)
al = (struct alpha_links *) lnode->value;
}
else
- cfaf->links = splay_tree_new_ggc
+ cfun->machine->links = splay_tree_new_ggc
((splay_tree_compare_fn) strcmp,
ggc_alloc_splay_tree_str_alpha_links_splay_tree_s,
ggc_alloc_splay_tree_str_alpha_links_splay_tree_node_s);
- if (!al)
+ if (al == NULL)
{
- size_t name_len;
- size_t buflen;
+ size_t buf_len;
char *linksym;
- splay_tree_node node = 0;
- struct alpha_links *anl;
if (name[0] == '*')
name++;
- name_len = strlen (name);
- linksym = (char *) alloca (name_len + 50);
+ buf_len = strlen (name) + 8 + 9;
+ linksym = (char *) alloca (buf_len);
+ snprintf (linksym, buf_len, "$%d..%s..lk", cfun->funcdef_no, name);
al = ggc_alloc_alpha_links ();
- al->num = cfaf->num;
- al->target = NULL;
-
- node = splay_tree_lookup (alpha_links_tree, (splay_tree_key) name);
- if (node)
- {
- anl = (struct alpha_links *) node->value;
- al->lkind = anl->lkind;
- name = anl->target;
- }
-
- sprintf (linksym, "$%d..%s..lk", cfaf->num, name);
- buflen = strlen (linksym);
-
- al->linkage = gen_rtx_SYMBOL_REF
- (Pmode, ggc_alloc_string (linksym, buflen + 1));
+ al->func = func;
+ al->linkage = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (linksym));
- splay_tree_insert (cfaf->links, (splay_tree_key) name,
+ splay_tree_insert (cfun->machine->links,
+ (splay_tree_key) ggc_strdup (name),
(splay_tree_value) al);
}
- if (rflag)
- al->rkind = KIND_CODEADDR;
- else
- al->rkind = KIND_LINKAGE;
+ al->rkind = rflag ? KIND_CODEADDR : KIND_LINKAGE;
if (lflag)
return gen_rtx_MEM (Pmode, plus_constant (al->linkage, 8));
@@ -9538,31 +9417,24 @@ alpha_write_one_linkage (splay_tree_node node, void *data)
struct alpha_links *link = (struct alpha_links *) node->value;
FILE *stream = (FILE *) data;
- fprintf (stream, "$%d..%s..lk:\n", link->num, name);
+ ASM_OUTPUT_INTERNAL_LABEL (stream, XSTR (link->linkage, 0));
if (link->rkind == KIND_CODEADDR)
{
- if (link->lkind == KIND_LOCAL)
- {
- /* Local and used */
- fprintf (stream, "\t.quad %s..en\n", name);
- }
- else
- {
- /* External and used, request code address. */
- fprintf (stream, "\t.code_address %s\n", name);
- }
+ /* External and used, request code address. */
+ fprintf (stream, "\t.code_address %s\n", name);
}
else
{
- if (link->lkind == KIND_LOCAL)
+ if (!SYMBOL_REF_EXTERNAL_P (link->func)
+ && SYMBOL_REF_LOCAL_P (link->func))
{
- /* Local and used, build linkage pair. */
+ /* Locally defined, build linkage pair. */
fprintf (stream, "\t.quad %s..en\n", name);
fprintf (stream, "\t.quad %s\n", name);
}
else
{
- /* External and used, request linkage pair. */
+ /* External, request linkage pair. */
fprintf (stream, "\t.linkage %s\n", name);
}
}
@@ -9571,21 +9443,18 @@ alpha_write_one_linkage (splay_tree_node node, void *data)
}
static void
-alpha_write_linkage (FILE *stream, const char *funname, tree fundecl)
+alpha_write_linkage (FILE *stream, const char *funname)
{
- splay_tree_node node;
- struct alpha_funcs *func;
-
fprintf (stream, "\t.link\n");
fprintf (stream, "\t.align 3\n");
in_section = NULL;
- node = splay_tree_lookup (alpha_funcs_tree, (splay_tree_key) fundecl);
- func = (struct alpha_funcs *) node->value;
-
+#ifdef TARGET_VMS_CRASH_DEBUG
fputs ("\t.name ", stream);
assemble_name (stream, funname);
fputs ("..na\n", stream);
+#endif
+
ASM_OUTPUT_LABEL (stream, funname);
fprintf (stream, "\t.pdesc ");
assemble_name (stream, funname);
@@ -9593,9 +9462,9 @@ alpha_write_linkage (FILE *stream, const char *funname, tree fundecl)
alpha_procedure_type == PT_STACK ? "stack"
: alpha_procedure_type == PT_REGISTER ? "reg" : "null");
- if (func->links)
+ if (cfun->machine->links)
{
- splay_tree_foreach (func->links, alpha_write_one_linkage, stream);
+ splay_tree_foreach (cfun->machine->links, alpha_write_one_linkage, stream);
/* splay_tree_delete (func->links); */
}
}
@@ -9641,19 +9510,10 @@ vms_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
assemble_integer (symbol, UNITS_PER_WORD, BITS_PER_WORD, 1);
}
#else
-
-rtx
-alpha_need_linkage (const char *name ATTRIBUTE_UNUSED,
- int is_local ATTRIBUTE_UNUSED)
-{
- return NULL_RTX;
-}
-
rtx
alpha_use_linkage (rtx func ATTRIBUTE_UNUSED,
- tree cfundecl ATTRIBUTE_UNUSED,
- int lflag ATTRIBUTE_UNUSED,
- int rflag ATTRIBUTE_UNUSED)
+ bool lflag ATTRIBUTE_UNUSED,
+ bool rflag ATTRIBUTE_UNUSED)
{
return NULL_RTX;
}
@@ -9783,6 +9643,14 @@ alpha_conditional_register_usage (void)
#define TARGET_STDARG_OPTIMIZE_HOOK alpha_stdarg_optimize_hook
#endif
+/* Use 16-bits anchor. */
+#undef TARGET_MIN_ANCHOR_OFFSET
+#define TARGET_MIN_ANCHOR_OFFSET -0x7fff - 1
+#undef TARGET_MAX_ANCHOR_OFFSET
+#define TARGET_MAX_ANCHOR_OFFSET 0x7fff
+#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P
+#define TARGET_USE_BLOCKS_FOR_CONSTANT_P hook_bool_mode_const_rtx_true
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS alpha_rtx_costs
#undef TARGET_ADDRESS_COST
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index b83510d7cb1..64229245065 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -3965,8 +3965,6 @@
emit_move_insn (gen_rtx_REG (DImode, 25), operands[1]);
if (GET_CODE (operands[0]) == SYMBOL_REF)
{
- alpha_need_linkage (XSTR (operands[0], 0), 0);
-
operands[2] = const0_rtx;
}
else
@@ -4042,8 +4040,6 @@
emit_move_insn (gen_rtx_REG (DImode, 25), operands[2]);
if (GET_CODE (operands[1]) == SYMBOL_REF)
{
- alpha_need_linkage (XSTR (operands[1], 0), 0);
-
operands[3] = const0_rtx;
}
else
@@ -4244,8 +4240,8 @@
case 0:
return "mov %2,$27\;jsr $26,0\;ldq $27,0($29)";
case 1:
- operands [2] = alpha_use_linkage (operands [0], cfun->decl, 1, 0);
- operands [3] = alpha_use_linkage (operands [0], cfun->decl, 0, 0);
+ operands [2] = alpha_use_linkage (operands [0], true, false);
+ operands [3] = alpha_use_linkage (operands [0], false, false);
return "ldq $26,%3\;ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)";
default:
gcc_unreachable ();
@@ -5472,7 +5468,7 @@
(clobber (reg:DI 27))])]
"TARGET_ABI_OPEN_VMS"
{
- operands[4] = alpha_need_linkage ("OTS$MOVE", 0);
+ operands[4] = gen_rtx_SYMBOL_REF (Pmode, "OTS$MOVE");
})
(define_insn "*movmemdi_1"
@@ -5491,7 +5487,7 @@
(clobber (reg:DI 27))]
"TARGET_ABI_OPEN_VMS"
{
- operands [5] = alpha_use_linkage (operands [4], cfun->decl, 0, 1);
+ operands [5] = alpha_use_linkage (operands [4], false, true);
switch (which_alternative)
{
case 0:
@@ -5539,7 +5535,7 @@
if (operands[2] != const0_rtx)
FAIL;
- operands[4] = alpha_need_linkage ("OTS$ZERO", 0);
+ operands[4] = gen_rtx_SYMBOL_REF (Pmode, "OTS$ZERO");
})
(define_insn "*clrmemdi_1"
@@ -5555,7 +5551,7 @@
(clobber (reg:DI 27))]
"TARGET_ABI_OPEN_VMS"
{
- operands [4] = alpha_use_linkage (operands [3], cfun->decl, 0, 1);
+ operands [4] = alpha_use_linkage (operands [3], false, true);
switch (which_alternative)
{
case 0:
@@ -6825,8 +6821,8 @@
case 0:
return "mov %3,$27\;jsr $26,0\;ldq $27,0($29)";
case 1:
- operands [3] = alpha_use_linkage (operands [1], cfun->decl, 1, 0);
- operands [4] = alpha_use_linkage (operands [1], cfun->decl, 0, 0);
+ operands [3] = alpha_use_linkage (operands [1], true, false);
+ operands [4] = alpha_use_linkage (operands [1], false, false);
return "ldq $26,%4\;ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)";
default:
gcc_unreachable ();
diff --git a/gcc/config/alpha/t-alpha b/gcc/config/alpha/t-alpha
deleted file mode 100644
index d0b58d69a4e..00000000000
--- a/gcc/config/alpha/t-alpha
+++ /dev/null
@@ -1,2 +0,0 @@
-# This is a support routine for longlong.h, used by libgcc2.c.
-LIB2FUNCS_EXTRA = $(srcdir)/config/alpha/qrnnd.asm
diff --git a/gcc/config/alpha/t-ieee b/gcc/config/alpha/t-ieee
deleted file mode 100644
index fe549dfc992..00000000000
--- a/gcc/config/alpha/t-ieee
+++ /dev/null
@@ -1,2 +0,0 @@
-# All alphas get an IEEE complaint set of libraries.
-TARGET_LIBGCC2_CFLAGS += -mieee
diff --git a/gcc/config/alpha/t-vms b/gcc/config/alpha/t-vms
index 410e219ff5b..760f943d063 100644
--- a/gcc/config/alpha/t-vms
+++ b/gcc/config/alpha/t-vms
@@ -1,5 +1,5 @@
# Copyright (C) 1996, 1997, 1998, 2001, 2002,
-# 2007, 2009 Free Software Foundation, Inc.
+# 2007, 2009, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -17,49 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2FUNCS_EXTRA = $(srcdir)/config/alpha/vms-gcc_shell_handler.c
-
-EXTRA_PARTS = vms-dwarf2.o vms-dwarf2eh.o $(VMS_EXTRA_PARTS) \
- crtbegin.o crtbeginS.o crtend.o crtendS.o
-
-# This object must be linked with in order to make the executable debuggable.
-# vms-ld handles it automatically when passed -g.
-$(T)vms-dwarf2.o : $(srcdir)/config/alpha/vms-dwarf2.asm
- $(GCC_FOR_TARGET) -c -x assembler $< -o $@
-
-$(T)vms-dwarf2eh.o : $(srcdir)/config/alpha/vms-dwarf2eh.asm
- $(GCC_FOR_TARGET) -c -x assembler $< -o $@
-
MULTILIB_OPTIONS = mcpu=ev6
MULTILIB_DIRNAMES = ev6
MULTILIB_OSDIRNAMES = ev6
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-shlib_version:=$(shell echo $(BASEVER_c) | sed -e 's/\./,/' -e 's/\.//g')
-SHLIB_EXT = .exe
-SHLIB_OBJS = @shlib_objs@
-SHLIB_NAME = @shlib_base_name@.exe
-SHLIB_MULTILIB =
-SHLIB_INSTALL = $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(libsubdir)/$(SHLIB_NAME)
-SHLIB_SYMVEC = \
- grep -F -e "\$$BSS\$$" -e "\$$DATA\$$" -e " sdata " -e " data.rel " -e " data.rel.ro " -e " sbss " \
- -e "\$$LINK\$$" -e "\$$READONLY\$$" | \
- sed -e "s/.*\$$LINK\$$ \(.*\)/SYMBOL_VECTOR=(\1=PROCEDURE)/" \
- -e "s/.*\$$DATA\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.* sbss \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.* sdata \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.* data.rel \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.* data.rel.ro \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.*\$$BSS\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
- -e "s/.*\$$READONLY\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/"
-SHLIB_SYMVECX2 := $(subst $$,$$$$,$(SHLIB_SYMVEC))
-SHLIB_LINK = \
- echo "case_sensitive=yes" > SYMVEC_$$$$$$$$.opt; \
- objdump --syms $(SHLIB_OBJS) | \
- $(SHLIB_SYMVECX2) >> SYMVEC_$$$$$$$$.opt ; \
- echo "case_sensitive=NO" >> SYMVEC_$$$$$$$$.opt; \
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -nodefaultlibs \
- -shared --for-linker=/noinform -o $(SHLIB_NAME) $(SHLIB_OBJS) \
- --for-linker=SYMVEC_$$$$$$$$.opt \
- --for-linker=gsmatch=equal,$(shlib_version)
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index fc74c236a37..32794c80368 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -19,9 +19,6 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#define TARGET_OBJECT_SUFFIX ".obj"
-#define TARGET_EXECUTABLE_SUFFIX ".exe"
-
/* Alpha/VMS object format is not really Elf, but this makes compiling
crtstuff.c and dealing with shared library initialization much easier. */
#define OBJECT_FORMAT_ELF
@@ -33,37 +30,26 @@ along with GCC; see the file COPYING3. If not see
#define NO_EXTERNAL_INDIRECT_ADDRESS
-#define TARGET_OS_CPP_BUILTINS() \
+#define SUBTARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define_std ("vms"); \
- builtin_define_std ("VMS"); \
- builtin_define ("__ALPHA"); \
- builtin_assert ("system=vms"); \
- if (TARGET_FLOAT_VAX) \
- builtin_define ("__G_FLOAT"); \
- else \
- builtin_define ("__IEEE_FLOAT"); \
+ builtin_define ("__ALPHA"); \
+ if (TARGET_FLOAT_VAX) \
+ builtin_define ("__G_FLOAT"); \
+ else \
+ builtin_define ("__IEEE_FLOAT"); \
} while (0)
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_FPREGS|MASK_GAS)
-#undef TARGET_ABI_OPEN_VMS
-#define TARGET_ABI_OPEN_VMS 1
+#if POINTER_SIZE == 64
+#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS | MASK_MALLOC64)
+#else
+#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS)
+#endif
#define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
#undef PCC_STATIC_STRUCT_RETURN
-/* "long" is 32 bits, but 64 bits for Ada. */
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 32
-#define ADA_LONG_TYPE_SIZE 64
-
-/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
-#undef POINTER_SIZE
-#define POINTER_SIZE 32
-#define POINTERS_EXTEND_UNSIGNED 0
-
#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
/* The maximum alignment 'malloc' honors. */
@@ -170,6 +156,12 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#define DEFAULT_PCC_STRUCT_RETURN 0
+#if POINTER_SIZE == 64
+/* Eventhough pointers are 64bits, only 32bit ever remain significant in code
+ addresses. */
+#define MASK_RETURN_ADDR (GEN_INT (0xffffffff))
+#endif
+
#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE, NAME) \
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
@@ -236,15 +228,16 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION vms_asm_named_section
-#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "\t.literals\n"); \
- in_section = NULL; \
- fprintf ((FILE), "\t"); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, " = "); \
- assemble_name (FILE, LABEL2); \
- fprintf (FILE, "\n"); \
- } while (0)
+#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
+ do \
+ { \
+ fprintf ((FILE), "\t"); \
+ assemble_name (FILE, LABEL1); \
+ fprintf (FILE, " = "); \
+ assemble_name (FILE, LABEL2); \
+ fprintf (FILE, "\n"); \
+ } \
+ while (0)
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
diff --git a/gcc/config/alpha/vms64.h b/gcc/config/alpha/vms64.h
deleted file mode 100644
index 495d3c6167d..00000000000
--- a/gcc/config/alpha/vms64.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 2001, 2007, 2009 Free Software Foundation, Inc.
- Contributed by Douglas Rupp (rupp@gnat.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/>. */
-
-#undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("vms"); \
- builtin_define_std ("VMS"); \
- builtin_define ("__ALPHA"); \
- builtin_assert ("system=vms"); \
- builtin_define ("__IEEE_FLOAT"); \
- builtin_define ("__LONG_POINTERS=1"); \
- } while (0)
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
- { "malloc64", MASK_MALLOC64, "Malloc data into P2 space" },
-
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS | MASK_MALLOC64)
-
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 64
-
-#undef POINTER_SIZE
-#define POINTER_SIZE 64
-
-/* Eventhough pointers are 64bits, only 32bit ever remain significant in code
- addresses. */
-#define MASK_RETURN_ADDR (GEN_INT (0xffffffff))
-
-/* Defaults to "long int" */
-#undef SIZE_TYPE
-#undef PTRDIFF_TYPE
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e07c8c328c6..6ef6f62d28d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -22216,6 +22216,8 @@ thumb1_expand_epilogue (void)
gcc_assert (amount >= 0);
if (amount)
{
+ emit_insn (gen_blockage ());
+
if (amount < 512)
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
GEN_INT (amount)));
@@ -23495,7 +23497,7 @@ arm_small_register_classes_for_mode_p (enum machine_mode mode ATTRIBUTE_UNUSED)
/* Implement TARGET_SHIFT_TRUNCATION_MASK. SImode shifts use normal
ARM insns and therefore guarantee that the shift count is modulo 256.
- DImode shifts (those implemented by lib1funcs.asm or by optabs.c)
+ DImode shifts (those implemented by lib1funcs.S or by optabs.c)
guarantee no particular behavior for out-of-range counts. */
static unsigned HOST_WIDE_INT
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index 20ff2f82929..64d7df4b251 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -58,6 +58,7 @@
#define BE8_LINK_SPEC \
" %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 \
|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
+ |mcpu=generic-armv7-a \
|march=armv7-m|mcpu=cortex-m3 \
|march=armv7e-m|mcpu=cortex-m4 \
|march=armv6-m|mcpu=cortex-m0 \
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index a3830955948..80bd8259375 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -97,7 +97,7 @@
#undef LIBGCC_SPEC
/* Clear the instruction cache from `beg' to `end'. This is
- implemented in lib1funcs.asm, so ensure an error if this definition
+ implemented in lib1funcs.S, so ensure an error if this definition
is used. */
#undef CLEAR_INSN_CACHE
#define CLEAR_INSN_CACHE(BEG, END) not_used
diff --git a/gcc/config/arm/rtems-eabi.h b/gcc/config/arm/rtems-eabi.h
new file mode 100644
index 00000000000..ced98a91bfd
--- /dev/null
+++ b/gcc/config/arm/rtems-eabi.h
@@ -0,0 +1,29 @@
+/* Definitions for RTEMS based ARM systems using EABI.
+ Copyright (C) 2011 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/>. */
+
+#define HAS_INIT_SECTION
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+ TARGET_BPABI_CPP_BUILTINS(); \
+ } while (0)
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index 8d5a1d7cf95..d9d24a7c83b 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -35,7 +35,7 @@
*/
#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC "\
- %{!mfloat-abi=hard: %{!mfloat-abi=soft:-mfpu=softfpa}}"
+ %{!mfloat-abi=hard: %{!mfpu=vfp: %{!mfloat-abi=soft:-mfpu=softfpa}}}"
/*
* The default includes --start-group and --end-group which conflicts
diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm
index b970ec26a35..a9a174d473d 100644
--- a/gcc/config/arm/t-arm
+++ b/gcc/config/arm/t-arm
@@ -40,9 +40,6 @@ MD_INCLUDES= $(srcdir)/config/arm/arm-tune.md \
$(srcdir)/config/arm/thumb2.md \
$(srcdir)/config/arm/arm-fixed.md
-LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi \
- _thumb1_case_uhi _thumb1_case_si
s-config s-conditions s-flags s-codes s-constants s-emit s-recog s-preds \
s-opinit s-extract s-peep s-attr s-attrtab s-output: $(MD_INCLUDES)
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index ab85293ee91..25b7acb5da4 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -17,20 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# For most CPUs we have an assembly soft-float implementations.
-# However this is not true for ARMv6M. Here we want to use the soft-fp C
-# implementation. The soft-fp code is only build for ARMv6M. This pulls
-# in the asm implementation for other CPUs.
-LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
- _call_via_rX _interwork_call_via_rX \
- _lshrdi3 _ashrdi3 _ashldi3 \
- _arm_negdf2 _arm_addsubdf3 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
- _arm_fixdfsi _arm_fixunsdfsi \
- _arm_truncdfsf2 _arm_negsf2 _arm_addsubsf3 _arm_muldivsf3 \
- _arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi \
- _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \
- _clzsi2 _clzdi2
-
MULTILIB_OPTIONS = marm/mthumb
MULTILIB_DIRNAMES = arm thumb
MULTILIB_EXCEPTIONS =
@@ -103,26 +89,3 @@ MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm600
# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm610
# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm620
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# If EXTRA_MULTILIB_PARTS is not defined above then define EXTRA_PARTS here
-# EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-# Currently there is a bug somewhere in GCC's alias analysis
-# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
-# Disabling function inlining is a workaround for this problem.
-TARGET_LIBGCC2_CFLAGS = -fno-inline
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/arm/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
-
diff --git a/gcc/config/arm/t-bpabi b/gcc/config/arm/t-bpabi
index d8a1be45dcd..ef019ea3748 100644
--- a/gcc/config/arm/t-bpabi
+++ b/gcc/config/arm/t-bpabi
@@ -1,31 +1 @@
-# Copyright (C) 2004, 2005, 2011 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/>.
-
-# Add the bpabi.S functions.
-LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
-
-# Add the BPABI C functions.
-LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \
- $(srcdir)/config/arm/unaligned-funcs.c
-
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
-
-# Add the BPABI names.
-SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
-
EXTRA_HEADERS += $(srcdir)/ginclude/unwind-arm-common.h
diff --git a/gcc/config/arm/t-linux b/gcc/config/arm/t-linux
deleted file mode 100644
index 9a2cb1aed10..00000000000
--- a/gcc/config/arm/t-linux
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006,
-# 2008, 2011 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/>.
-
-# Just for these, we omit the frame pointer since it makes such a big
-# difference.
-TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
-
-LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
- _arm_addsubdf3 _arm_addsubsf3
-
-# MULTILIB_OPTIONS = mfloat-abi=hard/mfloat-abi=soft
-# MULTILIB_DIRNAMES = hard-float soft-float
-
-# EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-
-# LIBGCC = stmp-multilib
-# INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/arm/t-linux-eabi b/gcc/config/arm/t-linux-eabi
index 3814cc09b81..8004a7d0155 100644
--- a/gcc/config/arm/t-linux-eabi
+++ b/gcc/config/arm/t-linux-eabi
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,9 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# These functions are included in shared libraries.
-TARGET_LIBGCC2_CFLAGS = -fPIC
-
# We do not build a Thumb multilib for Linux because the definition of
# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
MULTILIB_OPTIONS =
@@ -27,13 +24,3 @@ MULTILIB_DIRNAMES =
#MULTILIB_OPTIONS += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
#MULTILIB_DIRNAMES += fa606te fa626te fmp626 fa726te
#MULTILIB_EXCEPTIONS += *mthumb/*mcpu=fa606te *mthumb/*mcpu=fa626te *mthumb/*mcpu=fmp626 *mthumb/*mcpu=fa726te*
-
-# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
-LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
-
-# Multilib the standard Linux files. Don't include crti.o or crtn.o,
-# which are provided by glibc.
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
-LIB2FUNCS_STATIC_EXTRA += $(srcdir)/config/arm/linux-atomic.c
-LIB2FUNCS_STATIC_EXTRA += $(srcdir)/config/arm/linux-atomic-64bit.c
diff --git a/gcc/config/arm/t-netbsd b/gcc/config/arm/t-netbsd
deleted file mode 100644
index 22bbbe7dd4b..00000000000
--- a/gcc/config/arm/t-netbsd
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006 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/>.
-
-# Just for these, we omit the frame pointer since it makes such a big
-# difference. It is then pointless adding debugging.
-TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fpic
-LIBGCC2_DEBUG_CFLAGS = -g0
-LIB2FUNCS_EXTRA = $(srcdir)/config/floatunsidf.c $(srcdir)/config/floatunsisf.c
-
-# Build a shared libgcc library.
-SHLIB_EXT = .so
-SHLIB_NAME = @shlib_base_name@.so
-SHLIB_SONAME = @shlib_base_name@.so.1
-SHLIB_OBJS = @shlib_objs@
-
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-soname,$(SHLIB_SONAME) \
- -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
- rm -f $(SHLIB_SONAME) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
- else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \
- $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \
- rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME); \
- $(LN_S) $(SHLIB_SONAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME)
diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems
index f12387fb1b9..5eff411e76e 100644
--- a/gcc/config/arm/t-rtems
+++ b/gcc/config/arm/t-rtems
@@ -5,6 +5,41 @@ MULTILIB_DIRNAMES = arm thumb
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES = marm=mno-thumb
-MULTILIB_OPTIONS += mfloat-abi=soft/mfloat-abi=hard
-MULTILIB_DIRNAMES += soft fpu
-MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+MULTILIB_OPTIONS += mfloat-abi=hard/mfloat-abi=softfp
+MULTILIB_DIRNAMES += fpu softfp
+MULTILIB_EXCEPTIONS += *mthumb*/*mfloat-abi=hard* *mthumb*/*mfloat-abi=softfp*
+MULTILIB_MATCHES =
+
+MULTILIB_OPTIONS += mfpu=vfp
+MULTILIB_DIRNAMES += vfp
+MULTILIB_EXCEPTIONS += *mfloat-abi=hard*/*mfpu=vfp* *marm*/*mfloat-abi=softfp*/*mfpu=fpa*
+MULTILIB_EXCLUSIONS += !mthumb/mfloat-abi=softfp/!mfpu=vfp
+
+# default float model is fpa, so don't create a explicit copy of it
+MULTILIB_EXCEPTIONS += *marm*/*mfpa*
+
+# permutations of the options which are useful (+) or make no sense (-),
+# defaults are in brackets:
+# + (arm/soft/fpa)
+# + (arm/soft)/vfp
+# - (arm)/softfp(/fpa)
+# + (arm)/softfp/vfp
+# + (arm)/float-abi=hard(/fpa)
+# - (arm)/float-abi=hard/vfp
+# + thumb/(soft/fpa)
+# + thumb/(soft/)vfp
+# - thumb/softfp/fpa
+# - thumb/softfp/vfp
+# - thumb/float-abi=hard/fpa
+# - thumb/float-abi=hard/vfp
+
+# subdirs to be used for multilibs and their respective options:
+#/thumb/vfp -> thumb/soft/vfp
+#/thumb/fpa -> thumb/soft/fpa
+#/thumb -> thumb/soft/fpa
+#/vfp -> arm/soft/vfp
+#/softfp/vfp -> arm/softfp/cfp
+#/fpu/fpa -> arm/hard/fpa
+#/fpu -> arm/hard/fpa
+#/fpa -> arm/soft/fpa
+#. -> arm/soft/fpa
diff --git a/gcc/config/arm/t-rtems-eabi b/gcc/config/arm/t-rtems-eabi
new file mode 100644
index 00000000000..f0e714a9bc5
--- /dev/null
+++ b/gcc/config/arm/t-rtems-eabi
@@ -0,0 +1,8 @@
+# Custom RTEMS EABI multilibs
+
+MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7/march=armv7-m
+MULTILIB_DIRNAMES = thumb armv6-m armv7 armv7-m
+MULTILIB_EXCEPTIONS = march=armv6-m march=armv7 march=armv7-m
+MULTILIB_MATCHES =
+MULTILIB_EXCLUSIONS =
+MULTILIB_OSDIRNAMES =
diff --git a/gcc/config/arm/t-strongarm-elf b/gcc/config/arm/t-strongarm-elf
index 4a4f4533ec1..0639e695800 100644
--- a/gcc/config/arm/t-strongarm-elf
+++ b/gcc/config/arm/t-strongarm-elf
@@ -17,27 +17,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _clzsi2 _clzdi2
-
MULTILIB_OPTIONS = mlittle-endian/mbig-endian mfloat-abi=hard/mfloat-abi=soft
MULTILIB_DIRNAMES = le be fpu soft
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-# Currently there is a bug somewhere in GCC's alias analysis
-# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
-# Disabling function inlining is a workaround for this problem.
-TARGET_LIBGCC2_CFLAGS = -fno-inline
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/arm/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
diff --git a/gcc/config/arm/t-symbian b/gcc/config/arm/t-symbian
index e37d473eca0..473957e3290 100644
--- a/gcc/config/arm/t-symbian
+++ b/gcc/config/arm/t-symbian
@@ -16,23 +16,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMFUNCS += _bb_init_func _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
-
-# These functions have __aeabi equivalents and will never be called by GCC.
-# By putting them in LIB1ASMFUNCS, we avoid the standard libgcc2.c code being
-# used -- and we make sure that definitions are not available in lib1funcs.asm,
-# either, so they end up undefined.
-LIB1ASMFUNCS += \
- _ashldi3 _ashrdi3 _divdi3 _floatdidf _udivmoddi4 _umoddi3 \
- _udivdi3 _lshrdi3 _moddi3 _muldi3 _negdi2 _cmpdi2 \
- _fixdfdi _fixsfdi _fixunsdfdi _fixunssfdi _floatdisf \
- _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
- _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
- _fixsfsi _fixunssfsi
-
EXTRA_HEADERS += $(srcdir)/ginclude/unwind-arm-common.h
-# Include half-float helpers.
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
# Create a multilib for processors with VFP floating-point, and a
# multilib for those without -- using the soft-float ABI in both
@@ -40,10 +24,3 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
# enabled, so there are no separate thumb-mode libraries.
MULTILIB_OPTIONS = mfloat-abi=softfp
MULTILIB_DIRNAMES = softfp
-
-# There is no C library to link against on Symbian OS -- at least when
-# building GCC.
-SHLIB_LC =
-
-# Symbian OS provides its own startup code.
-EXTRA_MULTILIB_PARTS=
diff --git a/gcc/config/arm/t-vxworks b/gcc/config/arm/t-vxworks
index 8ac0d9bcec5..0900ffe15ed 100644
--- a/gcc/config/arm/t-vxworks
+++ b/gcc/config/arm/t-vxworks
@@ -16,8 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
-
MULTILIB_OPTIONS = \
mrtp fPIC \
t4/t4be/t4t/t4tbe/t5/t5be/t5t/t5tbe/tstrongarm/txscale/txscalebe
diff --git a/gcc/config/arm/t-wince-pe b/gcc/config/arm/t-wince-pe
index 9ce1f313140..becda7f25a4 100644
--- a/gcc/config/arm/t-wince-pe
+++ b/gcc/config/arm/t-wince-pe
@@ -17,8 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
-
pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) output.h flags.h $(TREE_H) expr.h $(TM_P_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
@@ -31,7 +29,3 @@ MULTILIB_DIRNAMES = fpu
# yet...
# MULTILIB_OPTIONS += thumb
# MULTILIB_DIRNAMES += thumb
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-TARGET_LIBGCC2_CFLAGS =
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c
index abe25ab590e..55de2d7fe4b 100644
--- a/gcc/config/avr/avr-c.c
+++ b/gcc/config/avr/avr-c.c
@@ -105,4 +105,8 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
cpp_define (pfile, "__BUILTIN_AVR_FMUL");
cpp_define (pfile, "__BUILTIN_AVR_FMULS");
cpp_define (pfile, "__BUILTIN_AVR_FMULSU");
+
+ cpp_define (pfile, "__INT24_MAX__=8388607L");
+ cpp_define (pfile, "__INT24_MIN__=(-__INT24_MAX__-1)");
+ cpp_define (pfile, "__UINT24_MAX__=16777215UL");
}
diff --git a/gcc/config/avr/avr-modes.def b/gcc/config/avr/avr-modes.def
new file mode 100644
index 00000000000..4a16f888ddf
--- /dev/null
+++ b/gcc/config/avr/avr-modes.def
@@ -0,0 +1 @@
+FRACTIONAL_INT_MODE (PSI, 24, 3);
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index b32e697f9ca..f72c5f8ab15 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -59,8 +59,10 @@ extern const char *out_movsi_mr_r (rtx insn, rtx op[], int *l);
extern const char *output_movsisf (rtx insn, rtx operands[], int *l);
extern const char *avr_out_tstsi (rtx, rtx*, int*);
extern const char *avr_out_tsthi (rtx, rtx*, int*);
+extern const char *avr_out_tstpsi (rtx, rtx*, int*);
extern const char *avr_out_compare (rtx, rtx*, int*);
extern const char *ret_cond_branch (rtx x, int len, int reverse);
+extern const char *avr_out_movpsi (rtx, rtx*, int*);
extern const char *ashlqi3_out (rtx insn, rtx operands[], int *len);
extern const char *ashlhi3_out (rtx insn, rtx operands[], int *len);
@@ -73,6 +75,11 @@ extern const char *ashrsi3_out (rtx insn, rtx operands[], int *len);
extern const char *lshrqi3_out (rtx insn, rtx operands[], int *len);
extern const char *lshrhi3_out (rtx insn, rtx operands[], int *len);
extern const char *lshrsi3_out (rtx insn, rtx operands[], int *len);
+
+extern const char *avr_out_ashlpsi3 (rtx, rtx*, int*);
+extern const char *avr_out_ashrpsi3 (rtx, rtx*, int*);
+extern const char *avr_out_lshrpsi3 (rtx, rtx*, int*);
+
extern bool avr_rotate_bytes (rtx operands[]);
extern void expand_prologue (void);
@@ -93,6 +100,7 @@ extern int extra_constraint_Q (rtx x);
extern int adjust_insn_length (rtx insn, int len);
extern const char* output_reload_inhi (rtx*, rtx, int*);
extern const char* output_reload_insisf (rtx*, rtx, int*);
+extern const char* avr_out_reload_inpsi (rtx*, rtx, int*);
extern void notice_update_cc (rtx body, rtx insn);
extern void print_operand (FILE *file, rtx x, int code);
extern void print_operand_address (FILE *file, rtx addr);
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 6435c4854f5..630b7ef19ee 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -71,7 +71,8 @@ static const char *ptrreg_to_str (int);
static const char *cond_string (enum rtx_code);
static int avr_num_arg_regs (enum machine_mode, const_tree);
static int avr_operand_rtx_cost (rtx, enum machine_mode, enum rtx_code,
- int, bool);
+ int, bool);
+static void output_reload_in_const (rtx*, rtx, int*, bool);
static struct machine_function * avr_init_machine_status (void);
@@ -217,6 +218,9 @@ bool avr_need_copy_data_p = false;
#undef TARGET_ASM_FUNCTION_RODATA_SECTION
#define TARGET_ASM_FUNCTION_RODATA_SECTION avr_asm_function_rodata_section
+#undef TARGET_SCALAR_MODE_SUPPORTED_P
+#define TARGET_SCALAR_MODE_SUPPORTED_P avr_scalar_mode_supported_p
+
/* Custom function to replace string prefix.
@@ -369,6 +373,17 @@ avr_regno_reg_class (int r)
return ALL_REGS;
}
+
+static bool
+avr_scalar_mode_supported_p (enum machine_mode mode)
+{
+ if (PSImode == mode)
+ return true;
+
+ return default_scalar_mode_supported_p (mode);
+}
+
+
/* A helper for the subsequent function attribute used to dig for
attribute 'name' in a FUNCTION_DECL or FUNCTION_TYPE */
@@ -1487,7 +1502,7 @@ avr_legitimize_reload_address (rtx *px, enum machine_mode mode,
/* Helper function to print assembler resp. track instruction
- sequence lengths.
+ sequence lengths. Always return "".
If PLEN == NULL:
Output assembler code from template TPL with operands supplied
@@ -1499,7 +1514,7 @@ avr_legitimize_reload_address (rtx *px, enum machine_mode mode,
Don't output anything.
*/
-static void
+static const char*
avr_asm_len (const char* tpl, rtx* operands, int* plen, int n_words)
{
if (NULL == plen)
@@ -1513,6 +1528,8 @@ avr_asm_len (const char* tpl, rtx* operands, int* plen, int n_words)
else
*plen += n_words;
}
+
+ return "";
}
@@ -1562,6 +1579,8 @@ cond_string (enum rtx_code code)
default:
gcc_unreachable ();
}
+
+ return "";
}
/* Output ADDR to FILE as address. */
@@ -1968,6 +1987,7 @@ avr_simplify_comparison_p (enum machine_mode mode, RTX_CODE op, rtx x)
{
unsigned int max = (mode == QImode ? 0xff :
mode == HImode ? 0xffff :
+ mode == PSImode ? 0xffffff :
mode == SImode ? 0xffffffff : 0);
if (max && op && GET_CODE (x) == CONST_INT)
{
@@ -2182,52 +2202,10 @@ output_movqi (rtx insn, rtx operands[], int *l)
return AS2 (mov,%0,%1);
}
else if (CONSTANT_P (src))
- {
- if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
- return AS2 (ldi,%0,lo8(%1));
-
- if (GET_CODE (src) == CONST_INT)
- {
- if (src == const0_rtx) /* mov r,L */
- return AS1 (clr,%0);
- else if (src == const1_rtx)
- {
- *l = 2;
- return (AS1 (clr,%0) CR_TAB
- AS1 (inc,%0));
- }
- else if (src == constm1_rtx)
- {
- /* Immediate constants -1 to any register */
- *l = 2;
- return (AS1 (clr,%0) CR_TAB
- AS1 (dec,%0));
- }
- else
- {
- int bit_nr = exact_log2 (INTVAL (src));
-
- if (bit_nr >= 0)
- {
- *l = 3;
- if (!real_l)
- output_asm_insn ((AS1 (clr,%0) CR_TAB
- "set"), operands);
- if (!real_l)
- avr_output_bld (operands, bit_nr);
-
- return "";
- }
- }
- }
-
- /* Last resort, larger than loading from memory. */
- *l = 4;
- return (AS2 (mov,__tmp_reg__,r31) CR_TAB
- AS2 (ldi,r31,lo8(%1)) CR_TAB
- AS2 (mov,%0,r31) CR_TAB
- AS2 (mov,r31,__tmp_reg__));
- }
+ {
+ output_reload_in_const (operands, NULL_RTX, real_l, false);
+ return "";
+ }
else if (GET_CODE (src) == MEM)
return out_movqi_r_mr (insn, operands, real_l); /* mov r,m */
}
@@ -2956,6 +2934,306 @@ output_movsisf (rtx insn, rtx operands[], int *l)
return "";
}
+
+/* Handle loads of 24-bit types from memory to register. */
+
+static const char*
+avr_out_load_psi (rtx insn, rtx *op, int *plen)
+{
+ rtx dest = op[0];
+ rtx src = op[1];
+ rtx base = XEXP (src, 0);
+ int reg_dest = true_regnum (dest);
+ int reg_base = true_regnum (base);
+
+ if (reg_base > 0)
+ {
+ if (reg_base == REG_X) /* (R26) */
+ {
+ if (reg_dest == REG_X)
+ /* "ld r26,-X" is undefined */
+ return avr_asm_len ("adiw r26,2" CR_TAB
+ "ld r28,X" CR_TAB
+ "ld __tmp_reg__,-X" CR_TAB
+ "sbiw r26,1" CR_TAB
+ "ld r26,X" CR_TAB
+ "mov r27,__tmp_reg__", op, plen, -6);
+ else
+ {
+ avr_asm_len ("ld %A0,X+" CR_TAB
+ "ld %B0,X+" CR_TAB
+ "ld %C0,X", op, plen, -3);
+
+ if (reg_dest != REG_X - 2
+ && !reg_unused_after (insn, base))
+ {
+ avr_asm_len ("sbiw r26,2", op, plen, 1);
+ }
+
+ return "";
+ }
+ }
+ else /* reg_base != REG_X */
+ {
+ if (reg_dest == reg_base)
+ return avr_asm_len ("ldd %C0,%1+2" CR_TAB
+ "ldd __tmp_reg__,%1+1" CR_TAB
+ "ld %A0,%1" CR_TAB
+ "mov %B0,__tmp_reg__", op, plen, -4);
+ else
+ return avr_asm_len ("ld %A0,%1" CR_TAB
+ "ldd %B0,%1+1" CR_TAB
+ "ldd %C0,%1+2", op, plen, -3);
+ }
+ }
+ else if (GET_CODE (base) == PLUS) /* (R + i) */
+ {
+ int disp = INTVAL (XEXP (base, 1));
+
+ if (disp > MAX_LD_OFFSET (GET_MODE (src)))
+ {
+ if (REGNO (XEXP (base, 0)) != REG_Y)
+ fatal_insn ("incorrect insn:",insn);
+
+ if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (src)))
+ return avr_asm_len ("adiw r28,%o1-61" CR_TAB
+ "ldd %A0,Y+61" CR_TAB
+ "ldd %B0,Y+62" CR_TAB
+ "ldd %C0,Y+63" CR_TAB
+ "sbiw r28,%o1-61", op, plen, -5);
+
+ return avr_asm_len ("subi r28,lo8(-%o1)" CR_TAB
+ "sbci r29,hi8(-%o1)" CR_TAB
+ "ld %A0,Y" CR_TAB
+ "ldd %B0,Y+1" CR_TAB
+ "ldd %C0,Y+2" CR_TAB
+ "subi r28,lo8(%o1)" CR_TAB
+ "sbci r29,hi8(%o1)", op, plen, -7);
+ }
+
+ reg_base = true_regnum (XEXP (base, 0));
+ if (reg_base == REG_X)
+ {
+ /* R = (X + d) */
+ if (reg_dest == REG_X)
+ {
+ /* "ld r26,-X" is undefined */
+ return avr_asm_len ("adiw r26,%o1+2" CR_TAB
+ "ld r28,X" CR_TAB
+ "ld __tmp_reg__,-X" CR_TAB
+ "sbiw r26,1" CR_TAB
+ "ld r26,X" CR_TAB
+ "mov r27,__tmp_reg__", op, plen, -6);
+ }
+
+ avr_asm_len ("adiw r26,%o1" CR_TAB
+ "ld r24,X+" CR_TAB
+ "ld r25,X+" CR_TAB
+ "ld r26,X", op, plen, -4);
+
+ if (reg_dest != REG_X - 2)
+ avr_asm_len ("sbiw r26,%o1+2", op, plen, 1);
+
+ return "";
+ }
+
+ if (reg_dest == reg_base)
+ return avr_asm_len ("ldd %C0,%C1" CR_TAB
+ "ldd __tmp_reg__,%B1" CR_TAB
+ "ldd %A0,%A1" CR_TAB
+ "mov %B0,__tmp_reg__", op, plen, -4);
+
+ return avr_asm_len ("ldd %A0,%A1" CR_TAB
+ "ldd %B0,%B1" CR_TAB
+ "ldd %C0,%C1", op, plen, -3);
+ }
+ else if (GET_CODE (base) == PRE_DEC) /* (--R) */
+ return avr_asm_len ("ld %C0,%1" CR_TAB
+ "ld %B0,%1" CR_TAB
+ "ld %A0,%1", op, plen, -3);
+ else if (GET_CODE (base) == POST_INC) /* (R++) */
+ return avr_asm_len ("ld %A0,%1" CR_TAB
+ "ld %B0,%1" CR_TAB
+ "ld %C0,%1", op, plen, -3);
+
+ else if (CONSTANT_ADDRESS_P (base))
+ return avr_asm_len ("lds %A0,%m1" CR_TAB
+ "lds %B0,%m1+1" CR_TAB
+ "lds %C0,%m1+2", op, plen , -6);
+
+ fatal_insn ("unknown move insn:",insn);
+ return "";
+}
+
+/* Handle store of 24-bit type from register or zero to memory. */
+
+static const char*
+avr_out_store_psi (rtx insn, rtx *op, int *plen)
+{
+ rtx dest = op[0];
+ rtx src = op[1];
+ rtx base = XEXP (dest, 0);
+ int reg_base = true_regnum (base);
+
+ if (CONSTANT_ADDRESS_P (base))
+ return avr_asm_len ("sts %m0,%A1" CR_TAB
+ "sts %m0+1,%B1" CR_TAB
+ "sts %m0+2,%C1", op, plen, -6);
+
+ if (reg_base > 0) /* (r) */
+ {
+ if (reg_base == REG_X) /* (R26) */
+ {
+ gcc_assert (!reg_overlap_mentioned_p (base, src));
+
+ avr_asm_len ("st %0+,%A1" CR_TAB
+ "st %0+,%B1" CR_TAB
+ "st %0,%C1", op, plen, -3);
+
+ if (!reg_unused_after (insn, base))
+ avr_asm_len ("sbiw r26,2", op, plen, 1);
+
+ return "";
+ }
+ else
+ return avr_asm_len ("st %0,%A1" CR_TAB
+ "std %0+1,%B1" CR_TAB
+ "std %0+2,%C1", op, plen, -3);
+ }
+ else if (GET_CODE (base) == PLUS) /* (R + i) */
+ {
+ int disp = INTVAL (XEXP (base, 1));
+ reg_base = REGNO (XEXP (base, 0));
+
+ if (disp > MAX_LD_OFFSET (GET_MODE (dest)))
+ {
+ if (reg_base != REG_Y)
+ fatal_insn ("incorrect insn:",insn);
+
+ if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
+ return avr_asm_len ("adiw r28,%o0-61" CR_TAB
+ "std Y+61,%A1" CR_TAB
+ "std Y+62,%B1" CR_TAB
+ "std Y+63,%C1" CR_TAB
+ "sbiw r28,%o0-60", op, plen, -5);
+
+ return avr_asm_len ("subi r28,lo8(-%o0)" CR_TAB
+ "sbci r29,hi8(-%o0)" CR_TAB
+ "st Y,%A1" CR_TAB
+ "std Y+1,%B1" CR_TAB
+ "std Y+2,%C1" CR_TAB
+ "subi r28,lo8(%o0)" CR_TAB
+ "sbci r29,hi8(%o0)", op, plen, -7);
+ }
+ if (reg_base == REG_X)
+ {
+ /* (X + d) = R */
+ gcc_assert (!reg_overlap_mentioned_p (XEXP (base, 0), src));
+
+ avr_asm_len ("adiw r26,%o0" CR_TAB
+ "st X+,%A1" CR_TAB
+ "st X+,%B1" CR_TAB
+ "st X,%C1", op, plen, -4);
+
+ if (!reg_unused_after (insn, XEXP (base, 0)))
+ avr_asm_len ("sbiw r26,%o0+2", op, plen, 1);
+
+ return "";
+ }
+
+ return avr_asm_len ("std %A0,%A1" CR_TAB
+ "std %B0,%B1" CR_TAB
+ "std %C0,%C1", op, plen, -3);
+ }
+ else if (GET_CODE (base) == PRE_DEC) /* (--R) */
+ return avr_asm_len ("st %0,%C1" CR_TAB
+ "st %0,%B1" CR_TAB
+ "st %0,%A1", op, plen, -3);
+ else if (GET_CODE (base) == POST_INC) /* (R++) */
+ return avr_asm_len ("st %0,%A1" CR_TAB
+ "st %0,%B1" CR_TAB
+ "st %0,%C1", op, plen, -3);
+
+ fatal_insn ("unknown move insn:",insn);
+ return "";
+}
+
+
+/* Move around 24-bit stuff. */
+
+const char *
+avr_out_movpsi (rtx insn, rtx *op, int *plen)
+{
+ rtx dest = op[0];
+ rtx src = op[1];
+
+ if (register_operand (dest, VOIDmode))
+ {
+ if (register_operand (src, VOIDmode)) /* mov r,r */
+ {
+ if (true_regnum (dest) > true_regnum (src))
+ {
+ avr_asm_len ("mov %C0,%C1", op, plen, -1);
+
+ if (AVR_HAVE_MOVW)
+ return avr_asm_len ("movw %A0,%A1", op, plen, 1);
+ else
+ return avr_asm_len ("mov %B0,%B1" CR_TAB
+ "mov %A0,%A1", op, plen, 2);
+ }
+ else
+ {
+ if (AVR_HAVE_MOVW)
+ avr_asm_len ("movw %A0,%A1", op, plen, -1);
+ else
+ avr_asm_len ("mov %A0,%A1" CR_TAB
+ "mov %B0,%B1", op, plen, -2);
+
+ return avr_asm_len ("mov %C0,%C1", op, plen, 1);
+ }
+ }
+ else if (CONST_INT_P (src))
+ {
+ return avr_out_reload_inpsi (op, NULL_RTX, plen);
+ }
+ else if (CONSTANT_P (src))
+ {
+ if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
+ {
+ return avr_asm_len ("ldi %A0,lo8(%1)" CR_TAB
+ "ldi %B0,hi8(%1)" CR_TAB
+ "ldi %C0,hh8(%1)", op, plen, -3);
+ }
+
+ /* Last resort, better than loading from memory. */
+ return avr_asm_len ("mov __tmp_reg__,r31" CR_TAB
+ "ldi r31,lo8(%1)" CR_TAB
+ "mov %A0,r31" CR_TAB
+ "ldi r31,hi8(%1)" CR_TAB
+ "mov %B0,r31" CR_TAB
+ "ldi r31,hh8(%1)" CR_TAB
+ "mov %C0,r31" CR_TAB
+ "mov r31,__tmp_reg__", op, plen, -8);
+ }
+ else if (MEM_P (src))
+ return avr_out_load_psi (insn, op, plen); /* mov r,m */
+ }
+ else if (MEM_P (dest))
+ {
+ if (src == CONST0_RTX (GET_MODE (dest)))
+ op[1] = zero_reg_rtx;
+
+ avr_out_store_psi (insn, op, plen);
+
+ op[1] = src;
+ return "";
+ }
+
+ fatal_insn ("invalid insn:", insn);
+ return "";
+}
+
+
const char *
out_movqi_mr_r (rtx insn, rtx op[], int *l)
{
@@ -3280,22 +3558,24 @@ avr_out_compare (rtx insn, rtx *xop, int *plen)
avr_asm_len ("dec %A0" CR_TAB
"or %A0,%B0", xop, plen, 2);
- if (n_bytes == 4)
- avr_asm_len ("or %A0,%C0" CR_TAB
- "or %A0,%D0", xop, plen, 2);
+ if (n_bytes >= 3)
+ avr_asm_len ("or %A0,%C0", xop, plen, 1);
+
+ if (n_bytes >= 4)
+ avr_asm_len ("or %A0,%D0", xop, plen, 1);
return "";
}
else if (xval == constm1_rtx)
{
- if (n_bytes == 4)
- avr_asm_len ("and %A0,%D0" CR_TAB
- "and %A0,%C0", xop, plen, 2);
+ if (n_bytes >= 4)
+ avr_asm_len ("and %A0,%D0", xop, plen, 1);
- avr_asm_len ("and %A0,%B0" CR_TAB
- "com %A0", xop, plen, 2);
+ if (n_bytes >= 3)
+ avr_asm_len ("and %A0,%C0", xop, plen, 1);
- return "";
+ return avr_asm_len ("and %A0,%B0" CR_TAB
+ "com %A0", xop, plen, 2);
}
}
@@ -3335,8 +3615,7 @@ avr_out_compare (rtx insn, rtx *xop, int *plen)
&& compare_eq_p (insn)
&& reg_unused_after (insn, xreg))
{
- avr_asm_len ("adiw %0,%n1", xop, plen, 1);
- break;
+ return avr_asm_len ("adiw %0,%n1", xop, plen, 1);
}
}
@@ -3410,6 +3689,31 @@ avr_out_tsthi (rtx insn, rtx *op, int *plen)
}
+/* Output test instruction for PSImode. */
+
+const char*
+avr_out_tstpsi (rtx insn, rtx *op, int *plen)
+{
+ if (compare_sign_p (insn))
+ {
+ avr_asm_len ("tst %C0", op, plen, -1);
+ }
+ else if (reg_unused_after (insn, op[0])
+ && compare_eq_p (insn))
+ {
+ /* Faster than sbiw if we can clobber the operand. */
+ avr_asm_len ("or %A0,%B0" CR_TAB
+ "or %A0,%C0", op, plen, -2);
+ }
+ else
+ {
+ avr_out_compare (insn, op, plen);
+ }
+
+ return "";
+}
+
+
/* Output test instruction for SImode. */
const char*
@@ -3938,6 +4242,69 @@ ashlhi3_out (rtx insn, rtx operands[], int *len)
}
+/* 24-bit shift left */
+
+const char*
+avr_out_ashlpsi3 (rtx insn, rtx *op, int *plen)
+{
+ if (plen)
+ *plen = 0;
+
+ if (CONST_INT_P (op[2]))
+ {
+ switch (INTVAL (op[2]))
+ {
+ default:
+ if (INTVAL (op[2]) < 24)
+ break;
+
+ return avr_asm_len ("clr %A0" CR_TAB
+ "clr %B0" CR_TAB
+ "clr %C0", op, plen, 3);
+
+ case 8:
+ {
+ int reg0 = REGNO (op[0]);
+ int reg1 = REGNO (op[1]);
+
+ if (reg0 >= reg1)
+ return avr_asm_len ("mov %C0,%B1" CR_TAB
+ "mov %B0,%A1" CR_TAB
+ "clr %A0", op, plen, 3);
+ else
+ return avr_asm_len ("clr %A0" CR_TAB
+ "mov %B0,%A1" CR_TAB
+ "mov %C0,%B1", op, plen, 3);
+ }
+
+ case 16:
+ {
+ int reg0 = REGNO (op[0]);
+ int reg1 = REGNO (op[1]);
+
+ if (reg0 + 2 != reg1)
+ avr_asm_len ("mov %C0,%A0", op, plen, 1);
+
+ return avr_asm_len ("clr %B0" CR_TAB
+ "clr %A0", op, plen, 2);
+ }
+
+ case 23:
+ return avr_asm_len ("clr %C0" CR_TAB
+ "lsr %A0" CR_TAB
+ "ror %C0" CR_TAB
+ "clr %B0" CR_TAB
+ "clr %A0", op, plen, 5);
+ }
+ }
+
+ out_shift_with_cnt ("lsl %A0" CR_TAB
+ "rol %B0" CR_TAB
+ "rol %C0", insn, op, plen, 3);
+ return "";
+}
+
+
/* 32bit shift left ((long)x << i) */
const char *
@@ -4264,6 +4631,65 @@ ashrhi3_out (rtx insn, rtx operands[], int *len)
}
+/* 24-bit arithmetic shift right */
+
+const char*
+avr_out_ashrpsi3 (rtx insn, rtx *op, int *plen)
+{
+ int dest = REGNO (op[0]);
+ int src = REGNO (op[1]);
+
+ if (CONST_INT_P (op[2]))
+ {
+ if (plen)
+ *plen = 0;
+
+ switch (INTVAL (op[2]))
+ {
+ case 8:
+ if (dest <= src)
+ return avr_asm_len ("mov %A0,%B1" CR_TAB
+ "mov %B0,%C1" CR_TAB
+ "clr %C0" CR_TAB
+ "sbrc %B0,7" CR_TAB
+ "dec %C0", op, plen, 5);
+ else
+ return avr_asm_len ("clr %C0" CR_TAB
+ "sbrc %C1,7" CR_TAB
+ "dec %C0" CR_TAB
+ "mov %B0,%C1" CR_TAB
+ "mov %A0,%B1", op, plen, 5);
+
+ case 16:
+ if (dest != src + 2)
+ avr_asm_len ("mov %A0,%C1", op, plen, 1);
+
+ return avr_asm_len ("clr %B0" CR_TAB
+ "sbrc %A0,7" CR_TAB
+ "com %B0" CR_TAB
+ "mov %C0,%B0", op, plen, 4);
+
+ default:
+ if (INTVAL (op[2]) < 24)
+ break;
+
+ /* fall through */
+
+ case 31:
+ return avr_asm_len ("lsl %C0" CR_TAB
+ "sbc %A0,%A0" CR_TAB
+ "mov %B0,%A0" CR_TAB
+ "mov %C0,%A0", op, plen, 4);
+ } /* switch */
+ }
+
+ out_shift_with_cnt ("asr %C0" CR_TAB
+ "ror %B0" CR_TAB
+ "ror %A0", insn, op, plen, 3);
+ return "";
+}
+
+
/* 32bit arithmetic shift right ((signed long)x >> i) */
const char *
@@ -4714,6 +5140,61 @@ lshrhi3_out (rtx insn, rtx operands[], int *len)
return "";
}
+
+/* 24-bit logic shift right */
+
+const char*
+avr_out_lshrpsi3 (rtx insn, rtx *op, int *plen)
+{
+ int dest = REGNO (op[0]);
+ int src = REGNO (op[1]);
+
+ if (CONST_INT_P (op[2]))
+ {
+ if (plen)
+ *plen = 0;
+
+ switch (INTVAL (op[2]))
+ {
+ case 8:
+ if (dest <= src)
+ return avr_asm_len ("mov %A0,%B1" CR_TAB
+ "mov %B0,%C1" CR_TAB
+ "clr %C0", op, plen, 3);
+ else
+ return avr_asm_len ("clr %C0" CR_TAB
+ "mov %B0,%C1" CR_TAB
+ "mov %A0,%B1", op, plen, 3);
+
+ case 16:
+ if (dest != src + 2)
+ avr_asm_len ("mov %A0,%C1", op, plen, 1);
+
+ return avr_asm_len ("clr %B0" CR_TAB
+ "clr %C0", op, plen, 2);
+
+ default:
+ if (INTVAL (op[2]) < 24)
+ break;
+
+ /* fall through */
+
+ case 23:
+ return avr_asm_len ("clr %A0" CR_TAB
+ "sbrc %C0,7" CR_TAB
+ "inc %A0" CR_TAB
+ "clr %B0" CR_TAB
+ "clr %C0", op, plen, 5);
+ } /* switch */
+ }
+
+ out_shift_with_cnt ("lsr %C0" CR_TAB
+ "ror %B0" CR_TAB
+ "ror %A0", insn, op, plen, 3);
+ return "";
+}
+
+
/* 32bit logic shift right ((unsigned int)x >> i) */
const char *
@@ -4874,7 +5355,9 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc)
if (i && !started)
*pcc = CC_CLOBBER;
- if (!started && i % 2 == 0
+ if (!started
+ && i % 2 == 0
+ && i + 2 <= n_bytes
&& test_hard_reg_class (ADDW_REGS, reg8))
{
rtx xval16 = simplify_gen_subreg (HImode, xval, mode, i);
@@ -4911,11 +5394,11 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc)
else if ((val8 == 1 || val8 == 0xff)
&& !started
&& i == n_bytes - 1)
- {
+ {
avr_asm_len ((code == PLUS) ^ (val8 == 1) ? "dec %0" : "inc %0",
op, plen, 1);
break;
- }
+ }
switch (code)
{
@@ -5399,6 +5882,7 @@ adjust_insn_length (rtx insn, int len)
switch (adjust_len)
{
case ADJUST_LEN_RELOAD_IN16: output_reload_inhi (op, op[2], &len); break;
+ case ADJUST_LEN_RELOAD_IN24: avr_out_reload_inpsi (op, op[2], &len); break;
case ADJUST_LEN_RELOAD_IN32: output_reload_insisf (op, op[2], &len); break;
case ADJUST_LEN_OUT_BITOP: avr_out_bitop (insn, op, &len); break;
@@ -5411,9 +5895,11 @@ adjust_insn_length (rtx insn, int len)
case ADJUST_LEN_MOV8: output_movqi (insn, op, &len); break;
case ADJUST_LEN_MOV16: output_movhi (insn, op, &len); break;
+ case ADJUST_LEN_MOV24: avr_out_movpsi (insn, op, &len); break;
case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
case ADJUST_LEN_TSTHI: avr_out_tsthi (insn, op, &len); break;
+ case ADJUST_LEN_TSTPSI: avr_out_tstpsi (insn, op, &len); break;
case ADJUST_LEN_TSTSI: avr_out_tstsi (insn, op, &len); break;
case ADJUST_LEN_COMPARE: avr_out_compare (insn, op, &len); break;
@@ -5429,6 +5915,10 @@ adjust_insn_length (rtx insn, int len)
case ADJUST_LEN_ASHLHI: ashlhi3_out (insn, op, &len); break;
case ADJUST_LEN_ASHLSI: ashlsi3_out (insn, op, &len); break;
+ case ADJUST_LEN_ASHLPSI: avr_out_ashlpsi3 (insn, op, &len); break;
+ case ADJUST_LEN_ASHRPSI: avr_out_ashrpsi3 (insn, op, &len); break;
+ case ADJUST_LEN_LSHRPSI: avr_out_lshrpsi3 (insn, op, &len); break;
+
case ADJUST_LEN_CALL: len = AVR_HAVE_JMP_CALL ? 2 : 1; break;
default:
@@ -6228,13 +6718,11 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
*total = COSTS_N_INSNS (1);
break;
- case HImode:
- *total = COSTS_N_INSNS (3);
- break;
-
- case SImode:
- *total = COSTS_N_INSNS (7);
- break;
+ case HImode:
+ case PSImode:
+ case SImode:
+ *total = COSTS_N_INSNS (2 * GET_MODE_SIZE (mode) - 1);
+ break;
default:
return false;
@@ -6320,6 +6808,19 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
*total = COSTS_N_INSNS (2);
break;
+ case PSImode:
+ if (!CONST_INT_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (3);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, 1,
+ speed);
+ }
+ else if (INTVAL (XEXP (x, 1)) >= -63 && INTVAL (XEXP (x, 1)) <= 63)
+ *total = COSTS_N_INSNS (2);
+ else
+ *total = COSTS_N_INSNS (3);
+ break;
+
case SImode:
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
{
@@ -6367,6 +6868,7 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
*total = COSTS_N_INSNS (1) + *total;
return true;
}
+ /* FALLTHRU */
case AND:
case IOR:
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
@@ -6437,6 +6939,13 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
return false;
break;
+ case PSImode:
+ if (!speed)
+ *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
+ else
+ *total = 10;
+ break;
+
case SImode:
if (AVR_HAVE_MUL)
{
@@ -6611,6 +7120,31 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
}
break;
+ case PSImode:
+ if (!CONST_INT_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (!speed ? 6 : 73);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ case 8:
+ case 16:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 23:
+ *total = COSTS_N_INSNS (5);
+ break;
+ default:
+ *total = COSTS_N_INSNS (!speed ? 5 : 3 * INTVAL (XEXP (x, 1)));
+ break;
+ }
+ break;
+
case SImode:
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
{
@@ -6721,6 +7255,33 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
}
break;
+ case PSImode:
+ if (!CONST_INT_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (!speed ? 6 : 73);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 16:
+ case 8:
+ *total = COSTS_N_INSNS (5);
+ break;
+ case 23:
+ *total = COSTS_N_INSNS (4);
+ break;
+ default:
+ *total = COSTS_N_INSNS (!speed ? 5 : 3 * INTVAL (XEXP (x, 1)));
+ break;
+ }
+ break;
+
case SImode:
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
{
@@ -6832,6 +7393,31 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
}
break;
+ case PSImode:
+ if (!CONST_INT_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (!speed ? 6 : 73);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ case 8:
+ case 16:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 23:
+ *total = COSTS_N_INSNS (5);
+ break;
+ default:
+ *total = COSTS_N_INSNS (!speed ? 5 : 3 * INTVAL (XEXP (x, 1)));
+ break;
+ }
+ break;
+
case SImode:
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
{
@@ -6889,6 +7475,12 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
*total += COSTS_N_INSNS (1);
break;
+ case PSImode:
+ *total = COSTS_N_INSNS (3);
+ if (CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) != 0)
+ *total += COSTS_N_INSNS (2);
+ break;
+
case SImode:
*total = COSTS_N_INSNS (4);
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
@@ -7310,8 +7902,10 @@ avr_libcall_value (enum machine_mode mode,
const_rtx func ATTRIBUTE_UNUSED)
{
int offs = GET_MODE_SIZE (mode);
- if (offs < 2)
- offs = 2;
+
+ if (offs <= 4)
+ offs = (offs + 1) & ~1;
+
return gen_rtx_REG (mode, avr_ret_register () + 2 - offs);
}
@@ -7528,8 +8122,10 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
bool set_p = false;
unsigned int n;
enum machine_mode mode = GET_MODE (dest);
+ int n_bytes = GET_MODE_SIZE (mode);
- gcc_assert (REG_P (dest));
+ gcc_assert (REG_P (dest)
+ && CONSTANT_P (src));
if (len)
*len = 0;
@@ -7537,20 +8133,21 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
/* (REG:SI 14) is special: It's neither in LD_REGS nor in NO_LD_REGS
but has some subregs that are in LD_REGS. Use the MSB (REG:QI 17). */
- if (14 == REGNO (dest)
- && 4 == GET_MODE_SIZE (mode))
+ if (REGNO (dest) < 16
+ && REGNO (dest) + GET_MODE_SIZE (mode) > 16)
{
- clobber_reg = gen_rtx_REG (QImode, 17);
+ clobber_reg = gen_rtx_REG (QImode, REGNO (dest) + n_bytes - 1);
}
- /* We might need a clobber reg but don't have one. Look at the value
- to be loaded more closely. A clobber is only needed if it contains
- a byte that is neither 0, -1 or a power of 2. */
+ /* We might need a clobber reg but don't have one. Look at the value to
+ be loaded more closely. A clobber is only needed if it is a symbol
+ or contains a byte that is neither 0, -1 or a power of 2. */
if (NULL_RTX == clobber_reg
&& !test_hard_reg_class (LD_REGS, dest)
- && !avr_popcount_each_byte (src, GET_MODE_SIZE (mode),
- (1 << 0) | (1 << 1) | (1 << 8)))
+ && (! (CONST_INT_P (src) || CONST_DOUBLE_P (src))
+ || !avr_popcount_each_byte (src, n_bytes,
+ (1 << 0) | (1 << 1) | (1 << 8))))
{
/* We have no clobber register but need one. Cook one up.
That's cheaper than loading from constant pool. */
@@ -7562,21 +8159,49 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
/* Now start filling DEST from LSB to MSB. */
- for (n = 0; n < GET_MODE_SIZE (mode); n++)
+ for (n = 0; n < n_bytes; n++)
{
+ int ldreg_p;
bool done_byte = false;
unsigned int j;
rtx xop[3];
- /* Crop the n-th sub-byte. */
-
- xval = simplify_gen_subreg (QImode, src, mode, n);
+ /* Crop the n-th destination byte. */
+
xdest[n] = simplify_gen_subreg (QImode, dest, mode, n);
+ ldreg_p = test_hard_reg_class (LD_REGS, xdest[n]);
+
+ if (!CONST_INT_P (src)
+ && !CONST_DOUBLE_P (src))
+ {
+ static const char* const asm_code[][2] =
+ {
+ { "ldi %2,lo8(%1)" CR_TAB "mov %0,%2", "ldi %0,lo8(%1)" },
+ { "ldi %2,hi8(%1)" CR_TAB "mov %0,%2", "ldi %0,hi8(%1)" },
+ { "ldi %2,hlo8(%1)" CR_TAB "mov %0,%2", "ldi %0,hlo8(%1)" },
+ { "ldi %2,hhi8(%1)" CR_TAB "mov %0,%2", "ldi %0,hhi8(%1)" }
+ };
+
+ xop[0] = xdest[n];
+ xop[1] = src;
+ xop[2] = clobber_reg;
+
+ if (n >= 2)
+ avr_asm_len ("clr %0", xop, len, 1);
+ else
+ avr_asm_len (asm_code[n][ldreg_p], xop, len, ldreg_p ? 1 : 2);
+ continue;
+ }
+
+ /* Crop the n-th source byte. */
+
+ xval = simplify_gen_subreg (QImode, src, mode, n);
ival[n] = INTVAL (xval);
/* Look if we can reuse the low word by means of MOVW. */
if (n == 2
+ && n_bytes >= 4
&& AVR_HAVE_MOVW)
{
rtx lo16 = simplify_gen_subreg (HImode, src, mode, 0);
@@ -7613,7 +8238,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
/* LD_REGS can use LDI to move a constant value */
- if (test_hard_reg_class (LD_REGS, xdest[n]))
+ if (ldreg_p)
{
xop[0] = xdest[n];
xop[1] = xval;
@@ -7716,45 +8341,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
const char*
output_reload_inhi (rtx *op, rtx clobber_reg, int *plen)
{
- if (CONST_INT_P (op[1]))
- {
- output_reload_in_const (op, clobber_reg, plen, false);
- }
- else if (test_hard_reg_class (LD_REGS, op[0]))
- {
- avr_asm_len ("ldi %A0,lo8(%1)" CR_TAB
- "ldi %B0,hi8(%1)", op, plen, -2);
- }
- else
- {
- rtx xop[3];
-
- xop[0] = op[0];
- xop[1] = op[1];
- xop[2] = clobber_reg;
-
- if (plen)
- *plen = 0;
-
- if (clobber_reg == NULL_RTX)
- {
- /* No scratch register provided: cook une up. */
-
- xop[2] = gen_rtx_REG (QImode, REG_Z + 1);
- avr_asm_len ("mov __tmp_reg__,%2", xop, plen, 1);
- }
-
- avr_asm_len ("ldi %2,lo8(%1)" CR_TAB
- "mov %A0,%2" CR_TAB
- "ldi %2,hi8(%1)" CR_TAB
- "mov %B0,%2", xop, plen, 4);
-
- if (clobber_reg == NULL_RTX)
- {
- avr_asm_len ("mov %2,__tmp_reg__", xop, plen, 1);
- }
- }
-
+ output_reload_in_const (op, clobber_reg, plen, false);
return "";
}
@@ -7774,9 +8361,6 @@ output_reload_inhi (rtx *op, rtx clobber_reg, int *plen)
const char *
output_reload_insisf (rtx *op, rtx clobber_reg, int *len)
{
- gcc_assert (REG_P (op[0])
- && CONSTANT_P (op[1]));
-
if (AVR_HAVE_MOVW
&& !test_hard_reg_class (LD_REGS, op[0]))
{
@@ -7820,6 +8404,13 @@ output_reload_insisf (rtx *op, rtx clobber_reg, int *len)
return "";
}
+const char *
+avr_out_reload_inpsi (rtx *op, rtx clobber_reg, int *len)
+{
+ output_reload_in_const (op, clobber_reg, len, false);
+ return "";
+}
+
void
avr_output_bld (rtx operands[], int bit_nr)
{
@@ -8078,6 +8669,16 @@ enum avr_builtin_id
AVR_BUILTIN_DELAY_CYCLES
};
+static void
+avr_init_builtin_int24 (void)
+{
+ tree int24_type = make_signed_type (GET_MODE_BITSIZE (PSImode));
+ tree uint24_type = make_unsigned_type (GET_MODE_BITSIZE (PSImode));
+
+ (*lang_hooks.types.register_builtin_type) (int24_type, "__int24");
+ (*lang_hooks.types.register_builtin_type) (uint24_type, "__uint24");
+}
+
#define DEF_BUILTIN(NAME, TYPE, CODE) \
do \
{ \
@@ -8133,6 +8734,8 @@ avr_init_builtins (void)
AVR_BUILTIN_FMULS);
DEF_BUILTIN ("__builtin_avr_fmulsu", int_ftype_char_uchar,
AVR_BUILTIN_FMULSU);
+
+ avr_init_builtin_int24 ();
}
#undef DEF_BUILTIN
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index f3edbbcd026..59330104fa0 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -125,11 +125,12 @@
(define_attr "adjust_len"
"out_bitop, out_plus, out_plus_noclobber, addto_sp,
- tsthi, tstsi, compare, call,
- mov8, mov16, mov32, reload_in16, reload_in32,
+ tsthi, tstpsi, tstsi, compare, call,
+ mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32,
ashlqi, ashrqi, lshrqi,
ashlhi, ashrhi, lshrhi,
ashlsi, ashrsi, lshrsi,
+ ashlpsi, ashrpsi, lshrpsi,
no"
(const_string "no"))
@@ -180,10 +181,13 @@
;; Define mode iterators
(define_mode_iterator QIHI [(QI "") (HI "")])
(define_mode_iterator QIHI2 [(QI "") (HI "")])
-(define_mode_iterator QISI [(QI "") (HI "") (SI "")])
-(define_mode_iterator QIDI [(QI "") (HI "") (SI "") (DI "")])
-(define_mode_iterator HIDI [(HI "") (SI "") (DI "")])
-(define_mode_iterator HISI [(HI "") (SI "")])
+(define_mode_iterator QISI [(QI "") (HI "") (PSI "") (SI "")])
+(define_mode_iterator QIDI [(QI "") (HI "") (PSI "") (SI "") (DI "")])
+(define_mode_iterator HIDI [(HI "") (PSI "") (SI "") (DI "")])
+(define_mode_iterator HISI [(HI "") (PSI "") (SI "")])
+
+;; All supported move-modes
+(define_mode_iterator MOVMODE [(QI "") (HI "") (SI "") (SF "") (PSI "")])
;; Define code iterators
;; Define two incarnations so that we can build the cross product.
@@ -279,6 +283,7 @@
(define_mode_iterator MPUSH
[(CQI "")
(HI "") (CHI "")
+ (PSI "")
(SI "") (CSI "")
(DI "") (CDI "")
(SF "") (SC "")])
@@ -310,6 +315,28 @@
"")
;;========================================================================
+
+;; "movqi"
+;; "movhi"
+;; "movsi"
+;; "movsf"
+;; "movpsi"
+
+(define_expand "mov<mode>"
+ [(set (match_operand:MOVMODE 0 "nonimmediate_operand" "")
+ (match_operand:MOVMODE 1 "general_operand" ""))]
+ ""
+ {
+ /* One of the ops has to be in a register. */
+ if (!register_operand (operands[0], <MODE>mode)
+ && !(register_operand (operands[1], <MODE>mode)
+ || CONST0_RTX (<MODE>mode) == operands[1]))
+ {
+ operands[1] = copy_to_mode_reg (<MODE>mode, operands[1]);
+ }
+ })
+
+;;========================================================================
;; move byte
;; The last alternative (any immediate constant to any register) is
;; very expensive. It should be optimized by peephole2 if a scratch
@@ -318,16 +345,6 @@
;; are call-saved registers, and most of LD_REGS are call-used registers,
;; so this may still be a win for registers live across function calls.
-(define_expand "movqi"
- [(set (match_operand:QI 0 "nonimmediate_operand" "")
- (match_operand:QI 1 "general_operand" ""))]
- ""
- "/* One of the ops has to be in a register. */
- if (!register_operand(operand0, QImode)
- && ! (register_operand(operand1, QImode) || const0_rtx == operand1))
- operands[1] = copy_to_mode_reg(QImode, operand1);
- ")
-
(define_insn "movqi_insn"
[(set (match_operand:QI 0 "nonimmediate_operand" "=r,d,Qm,r,q,r,*r")
(match_operand:QI 1 "general_operand" "rL,i,rL,Qm,r,q,i"))]
@@ -365,21 +382,6 @@
;;============================================================================
;; move word (16 bit)
-(define_expand "movhi"
- [(set (match_operand:HI 0 "nonimmediate_operand" "")
- (match_operand:HI 1 "general_operand" ""))]
- ""
- "
-{
- /* One of the ops has to be in a register. */
- if (!register_operand(operand0, HImode)
- && !(register_operand(operand1, HImode) || const0_rtx == operands[1]))
- {
- operands[1] = copy_to_mode_reg(HImode, operand1);
- }
-}")
-
-
;; Move register $1 to the Stack Pointer register SP.
;; This insn is emit during function prologue/epilogue generation.
;; $2 = 0: We know that IRQs are off
@@ -461,23 +463,48 @@
})
;;==========================================================================
-;; move double word (32 bit)
-
-(define_expand "movsi"
- [(set (match_operand:SI 0 "nonimmediate_operand" "")
- (match_operand:SI 1 "general_operand" ""))]
- ""
- "
-{
- /* One of the ops has to be in a register. */
- if (!register_operand (operand0, SImode)
- && !(register_operand (operand1, SImode) || const0_rtx == operand1))
- {
- operands[1] = copy_to_mode_reg (SImode, operand1);
- }
-}")
-
+;; xpointer move (24 bit)
+
+(define_peephole2 ; *reload_inpsi
+ [(match_scratch:QI 2 "d")
+ (set (match_operand:PSI 0 "l_register_operand" "")
+ (match_operand:PSI 1 "immediate_operand" ""))
+ (match_dup 2)]
+ "operands[1] != const0_rtx
+ && operands[1] != constm1_rtx"
+ [(parallel [(set (match_dup 0)
+ (match_dup 1))
+ (clobber (match_dup 2))])]
+ "")
+
+;; '*' because it is not used in rtl generation.
+(define_insn "*reload_inpsi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (match_operand:PSI 1 "immediate_operand" "i"))
+ (clobber (match_operand:QI 2 "register_operand" "=&d"))]
+ "reload_completed"
+ {
+ return avr_out_reload_inpsi (operands, operands[2], NULL);
+ }
+ [(set_attr "length" "6")
+ (set_attr "adjust_len" "reload_in24")
+ (set_attr "cc" "clobber")])
+(define_insn "*movpsi"
+ [(set (match_operand:PSI 0 "nonimmediate_operand" "=r,r,r ,Qm,!d,r")
+ (match_operand:PSI 1 "general_operand" "r,L,Qm,rL,i ,i"))]
+ "register_operand (operands[0], PSImode)
+ || register_operand (operands[1], PSImode)
+ || const0_rtx == operands[1]"
+ {
+ return avr_out_movpsi (insn, operands, NULL);
+ }
+ [(set_attr "length" "3,3,8,9,4,10")
+ (set_attr "adjust_len" "mov24")
+ (set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")])
+
+;;==========================================================================
+;; move double word (32 bit)
(define_peephole2 ; *reload_insi
[(match_scratch:QI 2 "d")
@@ -519,20 +546,6 @@
;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
;; move floating point numbers (32 bit)
-(define_expand "movsf"
- [(set (match_operand:SF 0 "nonimmediate_operand" "")
- (match_operand:SF 1 "general_operand" ""))]
- ""
- "
-{
- /* One of the ops has to be in a register. */
- if (!register_operand (operand1, SFmode)
- && !register_operand (operand0, SFmode))
- {
- operands[1] = copy_to_mode_reg (SFmode, operand1);
- }
-}")
-
(define_insn "*movsf"
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,Qm,!d,r")
(match_operand:SF 1 "general_operand" "r,G,Qm,rG,F,F"))]
@@ -739,17 +752,19 @@
; add bytes
(define_insn "addqi3"
- [(set (match_operand:QI 0 "register_operand" "=r,d,r,r")
- (plus:QI (match_operand:QI 1 "register_operand" "%0,0,0,0")
- (match_operand:QI 2 "nonmemory_operand" "r,i,P,N")))]
+ [(set (match_operand:QI 0 "register_operand" "=r,d,r,r,r,r")
+ (plus:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:QI 2 "nonmemory_operand" "r,i,P,N,K,Cm2")))]
""
"@
add %0,%2
subi %0,lo8(-(%2))
inc %0
- dec %0"
- [(set_attr "length" "1,1,1,1")
- (set_attr "cc" "set_czn,set_czn,set_zn,set_zn")])
+ dec %0
+ inc %0\;inc %0
+ dec %0\;dec %0"
+ [(set_attr "length" "1,1,1,1,2,2")
+ (set_attr "cc" "set_czn,set_czn,set_zn,set_zn,set_zn,set_zn")])
(define_expand "addhi3"
@@ -914,6 +929,33 @@
(set_attr "adjust_len" "*,*,out_plus,out_plus")
(set_attr "cc" "set_n,set_czn,out_plus,out_plus")])
+(define_insn "*addpsi3_zero_extend.qi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (plus:PSI (zero_extend:PSI (match_operand:QI 1 "register_operand" "r"))
+ (match_operand:PSI 2 "register_operand" "0")))]
+ ""
+ "add %A0,%A1\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_n")])
+
+(define_insn "*addpsi3_zero_extend.hi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (plus:PSI (zero_extend:PSI (match_operand:HI 1 "register_operand" "r"))
+ (match_operand:PSI 2 "register_operand" "0")))]
+ ""
+ "add %A0,%A1\;adc %B0,%B1\;adc %C0,__zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_n")])
+
+(define_insn "*addpsi3_sign_extend.hi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (plus:PSI (sign_extend:PSI (match_operand:HI 1 "register_operand" "r"))
+ (match_operand:PSI 2 "register_operand" "0")))]
+ ""
+ "add %A0,%1\;adc %B0,%B1\;adc %C0,__zero_reg__\;sbrc %B1,7\;dec %C0"
+ [(set_attr "length" "5")
+ (set_attr "cc" "set_n")])
+
(define_insn "*addsi3_zero_extend"
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (zero_extend:SI (match_operand:QI 1 "register_operand" "r"))
@@ -932,6 +974,66 @@
[(set_attr "length" "4")
(set_attr "cc" "set_n")])
+(define_insn "addpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,d ,d,r")
+ (plus:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0,0")
+ (match_operand:PSI 2 "nonmemory_operand" "r,s ,n,n")))
+ (clobber (match_scratch:QI 3 "=X,X ,X,&d"))]
+ ""
+ {
+ static const char * const asm_code[] =
+ {
+ "add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2",
+ "subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))",
+ "",
+ ""
+ };
+
+ if (*asm_code[which_alternative])
+ return asm_code [which_alternative];
+
+ return avr_out_plus (operands, NULL, NULL);
+ }
+ [(set_attr "length" "3,3,3,6")
+ (set_attr "adjust_len" "*,*,out_plus,out_plus")
+ (set_attr "cc" "set_n,set_czn,out_plus,out_plus")])
+
+(define_insn "subpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (minus:PSI (match_operand:PSI 1 "register_operand" "0")
+ (match_operand:PSI 2 "register_operand" "r")))]
+ ""
+ "sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_czn")])
+
+(define_insn "*subpsi3_zero_extend.qi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (minus:PSI (match_operand:SI 1 "register_operand" "0")
+ (zero_extend:PSI (match_operand:QI 2 "register_operand" "r"))))]
+ ""
+ "sub %A0,%2\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_czn")])
+
+(define_insn "*subpsi3_zero_extend.hi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (minus:PSI (match_operand:PSI 1 "register_operand" "0")
+ (zero_extend:PSI (match_operand:HI 2 "register_operand" "r"))))]
+ ""
+ "sub %A0,%2\;sbc %B0,%B2\;sbc %C0,__zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_czn")])
+
+(define_insn "*subpsi3_sign_extend.hi"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (minus:PSI (match_operand:PSI 1 "register_operand" "0")
+ (sign_extend:PSI (match_operand:HI 2 "register_operand" "r"))))]
+ ""
+ "sub %A0,%A2\;sbc %B0,%B2\;sbc %C0,__zero_reg__\;sbrc %B2,7\;inc %C0"
+ [(set_attr "length" "5")
+ (set_attr "cc" "set_czn")])
+
;-----------------------------------------------------------------------------
; sub bytes
(define_insn "subqi3"
@@ -1099,6 +1201,17 @@
[(set_attr "length" "2,3")
(set_attr "cc" "clobber")])
+(define_insn "*addpsi3.lt0"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (plus:PSI (lshiftrt:PSI (match_operand:PSI 1 "register_operand" "r")
+ (const_int 23))
+ (match_operand:PSI 2 "register_operand" "0")))]
+ ""
+ "mov __tmp_reg__,%C1\;lsl __tmp_reg__
+ adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__"
+ [(set_attr "length" "5")
+ (set_attr "cc" "clobber")])
+
(define_insn "*addsi3.lt0"
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
@@ -2062,7 +2175,7 @@
; / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / %
; divmod
-;; Generate libgcc.S calls ourselves, because:
+;; Generate lib1funcs.S calls ourselves, because:
;; - we know exactly which registers are clobbered (for QI and HI
;; modes, some of the call-used registers are preserved)
;; - we get both the quotient and the remainder at no extra cost
@@ -2199,6 +2312,80 @@
[(set_attr "type" "xcall")
(set_attr "cc" "clobber")])
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 24-bit signed/unsigned division and modulo.
+;; Notice that the libgcc implementation return the quotient in R22
+;; and the remainder in R18 whereas the 32-bit [u]divmodsi4
+;; implementation works the other way round.
+
+(define_insn_and_split "divmodpsi4"
+ [(parallel [(set (match_operand:PSI 0 "pseudo_register_operand" "")
+ (div:PSI (match_operand:PSI 1 "pseudo_register_operand" "")
+ (match_operand:PSI 2 "pseudo_register_operand" "")))
+ (set (match_operand:PSI 3 "pseudo_register_operand" "")
+ (mod:PSI (match_dup 1)
+ (match_dup 2)))
+ (clobber (reg:DI 18))
+ (clobber (reg:QI 26))])]
+ ""
+ { gcc_unreachable(); }
+ ""
+ [(set (reg:PSI 22) (match_dup 1))
+ (set (reg:PSI 18) (match_dup 2))
+ (parallel [(set (reg:PSI 22) (div:PSI (reg:PSI 22) (reg:PSI 18)))
+ (set (reg:PSI 18) (mod:PSI (reg:PSI 22) (reg:PSI 18)))
+ (clobber (reg:QI 21))
+ (clobber (reg:QI 25))
+ (clobber (reg:QI 26))])
+ (set (match_dup 0) (reg:PSI 22))
+ (set (match_dup 3) (reg:PSI 18))])
+
+(define_insn "*divmodpsi4_call"
+ [(set (reg:PSI 22) (div:PSI (reg:PSI 22) (reg:PSI 18)))
+ (set (reg:PSI 18) (mod:PSI (reg:PSI 22) (reg:PSI 18)))
+ (clobber (reg:QI 21))
+ (clobber (reg:QI 25))
+ (clobber (reg:QI 26))]
+ ""
+ "%~call __divmodpsi4"
+ [(set_attr "type" "xcall")
+ (set_attr "cc" "clobber")])
+
+(define_insn_and_split "udivmodpsi4"
+ [(parallel [(set (match_operand:PSI 0 "pseudo_register_operand" "")
+ (udiv:PSI (match_operand:PSI 1 "pseudo_register_operand" "")
+ (match_operand:PSI 2 "pseudo_register_operand" "")))
+ (set (match_operand:PSI 3 "pseudo_register_operand" "")
+ (umod:PSI (match_dup 1)
+ (match_dup 2)))
+ (clobber (reg:DI 18))
+ (clobber (reg:QI 26))])]
+ ""
+ { gcc_unreachable(); }
+ ""
+ [(set (reg:PSI 22) (match_dup 1))
+ (set (reg:PSI 18) (match_dup 2))
+ (parallel [(set (reg:PSI 22) (udiv:PSI (reg:PSI 22) (reg:PSI 18)))
+ (set (reg:PSI 18) (umod:PSI (reg:PSI 22) (reg:PSI 18)))
+ (clobber (reg:QI 21))
+ (clobber (reg:QI 25))
+ (clobber (reg:QI 26))])
+ (set (match_dup 0) (reg:PSI 22))
+ (set (match_dup 3) (reg:PSI 18))])
+
+(define_insn "*udivmodpsi4_call"
+ [(set (reg:PSI 22) (udiv:PSI (reg:PSI 22) (reg:PSI 18)))
+ (set (reg:PSI 18) (umod:PSI (reg:PSI 22) (reg:PSI 18)))
+ (clobber (reg:QI 21))
+ (clobber (reg:QI 25))
+ (clobber (reg:QI 26))]
+ ""
+ "%~call __udivmodpsi4"
+ [(set_attr "type" "xcall")
+ (set_attr "cc" "clobber")])
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
(define_insn_and_split "divmodsi4"
[(parallel [(set (match_operand:SI 0 "pseudo_register_operand" "")
(div:SI (match_operand:SI 1 "pseudo_register_operand" "")
@@ -2297,6 +2484,24 @@
(set_attr "adjust_len" "*,*,out_bitop,out_bitop,out_bitop")
(set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
+(define_insn "andpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,d,r ,r")
+ (and:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0")
+ (match_operand:PSI 2 "nonmemory_operand" "r,n,Ca3,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
+ ""
+ {
+ if (which_alternative == 0)
+ return "and %A0,%A2" CR_TAB
+ "and %B0,%B2" CR_TAB
+ "and %C0,%C2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "3,3,6,6")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber,clobber")])
+
(define_insn "andsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d,r ,r")
(and:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
@@ -2361,6 +2566,24 @@
(set_attr "adjust_len" "*,*,out_bitop,out_bitop,out_bitop")
(set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
+(define_insn "iorpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,d,r ,r")
+ (ior:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0")
+ (match_operand:PSI 2 "nonmemory_operand" "r,n,Co3,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
+ ""
+ {
+ if (which_alternative == 0)
+ return "or %A0,%A2" CR_TAB
+ "or %B0,%B2" CR_TAB
+ "or %C0,%C2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "3,3,6,6")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber,clobber")])
+
(define_insn "iorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d,r ,r")
(ior:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
@@ -2408,6 +2631,24 @@
(set_attr "adjust_len" "*,out_bitop,out_bitop")
(set_attr "cc" "set_n,clobber,clobber")])
+(define_insn "xorpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r ,r")
+ (xor:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0")
+ (match_operand:PSI 2 "nonmemory_operand" "r,Cx3,n")))
+ (clobber (match_scratch:QI 3 "=X,X ,&d"))]
+ ""
+ {
+ if (which_alternative == 0)
+ return "eor %A0,%A2" CR_TAB
+ "eor %B0,%B2" CR_TAB
+ "eor %C0,%C2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "3,6,6")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber")])
+
(define_insn "xorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r ,r")
(xor:SI (match_operand:SI 1 "register_operand" "%0,0 ,0")
@@ -2472,10 +2713,11 @@
;; HImode does not need scratch. Use attribute for this constraint.
;; Use QI scratch for DI mode as this is often split into byte sized operands.
-(define_mode_attr rotx [(DI "&r,&r,X") (SI "&r,&r,X") (HI "X,X,X")])
-(define_mode_attr rotsmode [(DI "QI") (SI "HI") (HI "QI")])
+(define_mode_attr rotx [(DI "&r,&r,X") (SI "&r,&r,X") (PSI "&r,&r,X") (HI "X,X,X")])
+(define_mode_attr rotsmode [(DI "QI") (SI "HI") (PSI "QI") (HI "QI")])
;; "rotlhi3"
+;; "rotlpsi3"
;; "rotlsi3"
;; "rotldi3"
(define_expand "rotl<mode>3"
@@ -2531,6 +2773,24 @@
[(set_attr "length" "3")
(set_attr "cc" "clobber")])
+(define_insn "*rotlpsi2.1"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (rotate:PSI (match_operand:PSI 1 "register_operand" "0")
+ (const_int 1)))]
+ ""
+ "lsl %A0\;rol %B0\;rol %C0\;adc %A0,__zero_reg__"
+ [(set_attr "length" "4")
+ (set_attr "cc" "clobber")])
+
+(define_insn "*rotlpsi2.23"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (rotate:PSI (match_operand:PSI 1 "register_operand" "0")
+ (const_int 23)))]
+ ""
+ "bst %A0,0\;ror %C0\;ror %B0\;ror %A0\;bld %C0,7"
+ [(set_attr "length" "5")
+ (set_attr "cc" "clobber")])
+
(define_insn "*rotlsi2.1"
[(set (match_operand:SI 0 "register_operand" "=r")
(rotate:SI (match_operand:SI 1 "register_operand" "0")
@@ -2567,6 +2827,7 @@
(clobber (match_scratch:<rotsmode> 3 "=<rotx>"))]
"AVR_HAVE_MOVW
&& CONST_INT_P (operands[2])
+ && GET_MODE_SIZE (<MODE>mode) % 2 == 0
&& 0 == INTVAL (operands[2]) % 16"
"#"
"&& (reload_completed || <MODE>mode == DImode)"
@@ -2580,6 +2841,7 @@
;; Split byte aligned rotates using scratch that is always QI mode.
;; "*rotbhi"
+;; "*rotbpsi"
;; "*rotbsi"
;; "*rotbdi"
(define_insn_and_split "*rotb<mode>"
@@ -2589,7 +2851,8 @@
(clobber (match_scratch:QI 3 "=<rotx>"))]
"CONST_INT_P (operands[2])
&& (8 == INTVAL (operands[2]) % 16
- || (!AVR_HAVE_MOVW
+ || ((!AVR_HAVE_MOVW
+ || GET_MODE_SIZE (<MODE>mode) % 2 != 0)
&& 0 == INTVAL (operands[2]) % 16))"
"#"
"&& (reload_completed || <MODE>mode == DImode)"
@@ -2830,6 +3093,18 @@
(set_attr "adjust_len" "ashlsi")
(set_attr "cc" "none,set_n,clobber,clobber")])
+(define_insn "ashlpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r,r,r")
+ (ashift:PSI (match_operand:PSI 1 "register_operand" "0,0,r,0")
+ (match_operand:QI 2 "nonmemory_operand" "r,P,O,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X,&d"))]
+ ""
+ {
+ return avr_out_ashlpsi3 (insn, operands, NULL);
+ }
+ [(set_attr "adjust_len" "ashlpsi")
+ (set_attr "cc" "clobber")])
+
;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
;; arithmetic shift right
@@ -2853,6 +3128,18 @@
(set_attr "adjust_len" "ashrhi")
(set_attr "cc" "clobber,none,clobber,set_n,clobber,clobber,clobber")])
+(define_insn "ashrpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r,r,r,r")
+ (ashiftrt:PSI (match_operand:PSI 1 "register_operand" "0,0,0,r,0")
+ (match_operand:QI 2 "nonmemory_operand" "r,P,K,O,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X,X,&d"))]
+ ""
+ {
+ return avr_out_ashrpsi3 (insn, operands, NULL);
+ }
+ [(set_attr "adjust_len" "ashrpsi")
+ (set_attr "cc" "clobber")])
+
(define_insn "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
@@ -2966,6 +3253,18 @@
(set_attr "adjust_len" "lshrhi")
(set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber,clobber")])
+(define_insn "lshrpsi3"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r,r,r,r")
+ (lshiftrt:PSI (match_operand:PSI 1 "register_operand" "0,0,r,0,0")
+ (match_operand:QI 2 "nonmemory_operand" "r,P,O,K,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X,X,&d"))]
+ ""
+ {
+ return avr_out_lshrpsi3 (insn, operands, NULL);
+ }
+ [(set_attr "adjust_len" "lshrpsi")
+ (set_attr "cc" "clobber")])
+
(define_insn "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
@@ -3089,6 +3388,14 @@
[(set_attr "length" "1")
(set_attr "cc" "set_zn")])
+(define_insn "*negqihi2"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (neg:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "0"))))]
+ ""
+ "clr %B0\;neg %A0\;brge .+2\;com %B0"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_n")])
+
(define_insn "neghi2"
[(set (match_operand:HI 0 "register_operand" "=!d,r,&r")
(neg:HI (match_operand:HI 1 "register_operand" "0,0,r")))]
@@ -3100,6 +3407,17 @@
[(set_attr "length" "3,4,4")
(set_attr "cc" "set_czn,set_n,set_czn")])
+(define_insn "negpsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=!d,r,&r")
+ (neg:PSI (match_operand:PSI 1 "register_operand" "0,0,r")))]
+ ""
+ "@
+ com %C0\;com %B0\;neg %A0\;sbci %B0,-1\;sbci %C0,-1
+ com %C0\;com %B0\;com %A0\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__
+ clr %A0\;clr %B0\;clr %C0\;sub %A0,%A1\;sbc %B0,%B1\;sbc %C0,%C1"
+ [(set_attr "length" "5,6,6")
+ (set_attr "cc" "set_czn,set_n,set_czn")])
+
(define_insn "negsi2"
[(set (match_operand:SI 0 "register_operand" "=!d,r,&r,&r")
(neg:SI (match_operand:SI 1 "register_operand" "0,0,r ,r")))]
@@ -3143,6 +3461,14 @@
[(set_attr "length" "2")
(set_attr "cc" "set_n")])
+(define_insn "one_cmplpsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (not:PSI (match_operand:PSI 1 "register_operand" "0")))]
+ ""
+ "com %0\;com %B0\;com %C0"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_n")])
+
(define_insn "one_cmplsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (match_operand:SI 1 "register_operand" "0")))]
@@ -3174,6 +3500,16 @@
[(set_attr "length" "3,4")
(set_attr "cc" "set_n,set_n")])
+(define_insn "extendqipsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r")
+ (sign_extend:PSI (match_operand:QI 1 "combine_pseudo_register_operand" "0,*r")))]
+ ""
+ "@
+ clr %B0\;sbrc %A0,7\;com %B0\;mov %C0,%B0
+ mov %A0,%A1\;clr %B0\;sbrc %A0,7\;com %B0\;mov %C0,%B0"
+ [(set_attr "length" "4,5")
+ (set_attr "cc" "set_n,set_n")])
+
(define_insn "extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(sign_extend:SI (match_operand:QI 1 "combine_pseudo_register_operand" "0,*r")))]
@@ -3184,6 +3520,18 @@
[(set_attr "length" "5,6")
(set_attr "cc" "set_n,set_n")])
+(define_insn "extendhipsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=r,r ,r")
+ (sign_extend:PSI (match_operand:HI 1 "combine_pseudo_register_operand" "0,*r,*r")))]
+ ""
+ "@
+ clr %C0\;sbrc %B0,7\;com %C0
+ mov %A0,%A1\;mov %B0,%B1\;clr %C0\;sbrc %B0,7\;com %C0
+ movw %A0,%A1\;clr %C0\;sbrc %B0,7\;com %C0"
+ [(set_attr "length" "3,5,4")
+ (set_attr "isa" "*,mov,movw")
+ (set_attr "cc" "set_n")])
+
(define_insn "extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=r,r ,r")
(sign_extend:SI (match_operand:HI 1 "combine_pseudo_register_operand" "0,*r,*r")))]
@@ -3196,6 +3544,14 @@
(set_attr "isa" "*,mov,movw")
(set_attr "cc" "set_n")])
+(define_insn "extendpsisi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (sign_extend:SI (match_operand:PSI 1 "combine_pseudo_register_operand" "0")))]
+ ""
+ "clr %D0\;sbrc %C0,7\;com %D0"
+ [(set_attr "length" "3")
+ (set_attr "cc" "set_n")])
+
;; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x
;; zero extend
@@ -3215,6 +3571,21 @@
operands[3] = simplify_gen_subreg (QImode, operands[0], HImode, high_off);
})
+(define_insn_and_split "zero_extendqipsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (zero_extend:PSI (match_operand:QI 1 "combine_pseudo_register_operand" "r")))]
+ ""
+ "#"
+ "reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 3) (const_int 0))
+ (set (match_dup 4) (const_int 0))]
+ {
+ operands[2] = simplify_gen_subreg (QImode, operands[0], PSImode, 0);
+ operands[3] = simplify_gen_subreg (QImode, operands[0], PSImode, 1);
+ operands[4] = simplify_gen_subreg (QImode, operands[0], PSImode, 2);
+ })
+
(define_insn_and_split "zero_extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:QI 1 "combine_pseudo_register_operand" "r")))]
@@ -3231,6 +3602,19 @@
operands[3] = simplify_gen_subreg (HImode, operands[0], SImode, high_off);
})
+(define_insn_and_split "zero_extendhipsi2"
+ [(set (match_operand:PSI 0 "register_operand" "=r")
+ (zero_extend:PSI (match_operand:HI 1 "combine_pseudo_register_operand" "r")))]
+ ""
+ "#"
+ "reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 3) (const_int 0))]
+ {
+ operands[2] = simplify_gen_subreg (HImode, operands[0], PSImode, 0);
+ operands[3] = simplify_gen_subreg (QImode, operands[0], PSImode, 2);
+ })
+
(define_insn_and_split "zero_extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:HI 1 "combine_pseudo_register_operand" "r")))]
@@ -3247,6 +3631,19 @@
operands[3] = simplify_gen_subreg (HImode, operands[0], SImode, high_off);
})
+(define_insn_and_split "zero_extendpsisi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (match_operand:PSI 1 "combine_pseudo_register_operand" "r")))]
+ ""
+ "#"
+ "reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 3) (const_int 0))]
+ {
+ operands[2] = simplify_gen_subreg (PSImode, operands[0], SImode, 0);
+ operands[3] = simplify_gen_subreg (QImode, operands[0], SImode, 3);
+ })
+
(define_insn_and_split "zero_extendqidi2"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (match_operand:QI 1 "register_operand" "r")))]
@@ -3340,6 +3737,25 @@
[(set_attr "cc" "compare")
(set_attr "length" "2")])
+(define_insn "*negated_tstpsi"
+ [(set (cc0)
+ (compare (neg:PSI (match_operand:PSI 0 "register_operand" "r"))
+ (const_int 0)))]
+ "!flag_wrapv && !flag_trapv && flag_strict_overflow"
+ "cp __zero_reg__,%A0\;cpc __zero_reg__,%B0\;cpc __zero_reg__,%C0"
+ [(set_attr "cc" "compare")
+ (set_attr "length" "3")])
+
+(define_insn "*reversed_tstpsi"
+ [(set (cc0)
+ (compare (const_int 0)
+ (match_operand:PSI 0 "register_operand" "r")))
+ (clobber (match_scratch:QI 1 "=X"))]
+ ""
+ "cp __zero_reg__,%A0\;cpc __zero_reg__,%B0\;cpc __zero_reg__,%C0"
+ [(set_attr "cc" "compare")
+ (set_attr "length" "3")])
+
(define_insn "*negated_tstsi"
[(set (cc0)
(compare (neg:SI (match_operand:SI 0 "register_operand" "r"))
@@ -3418,6 +3834,35 @@
(set_attr "length" "1,2,2,3,4,2,4")
(set_attr "adjust_len" "tsthi,tsthi,*,*,*,compare,compare")])
+(define_insn "*cmppsi"
+ [(set (cc0)
+ (compare (match_operand:PSI 0 "register_operand" "r,r,d ,r ,d,r")
+ (match_operand:PSI 1 "nonmemory_operand" "L,r,s ,s ,M,n")))
+ (clobber (match_scratch:QI 2 "=X,X,&d,&d ,X,&d"))]
+ ""
+ {
+ switch (which_alternative)
+ {
+ case 0:
+ return avr_out_tstpsi (insn, operands, NULL);
+
+ case 1:
+ return "cp %A0,%A1\;cpc %B0,%B1\;cpc %C0,%C1";
+
+ case 2:
+ return reg_unused_after (insn, operands[0])
+ ? "subi %A0,lo8(%1)\;sbci %B0,hi8(%1)\;sbci %C0,hh8(%1)"
+ : "cpi %A0,lo8(%1)\;ldi %2,hi8(%1)\;cpc %B0,%2\;ldi %2,hh8(%1)\;cpc %C0,%2";
+
+ case 3:
+ return "ldi %2,lo8(%1)\;cp %A0,%2\;ldi %2,hi8(%1)\;cpc %B0,%2\;ldi %2,hh8(%1)\;cpc %C0,%2";
+ }
+
+ return avr_out_compare (insn, operands, NULL);
+ }
+ [(set_attr "cc" "compare")
+ (set_attr "length" "3,3,5,6,3,7")
+ (set_attr "adjust_len" "tstpsi,*,*,*,compare,compare")])
(define_insn "*cmpsi"
[(set (cc0)
@@ -3456,6 +3901,18 @@
(pc)))]
"")
+(define_expand "cbranchpsi4"
+ [(parallel [(set (cc0)
+ (compare (match_operand:PSI 1 "register_operand" "")
+ (match_operand:PSI 2 "nonmemory_operand" "")))
+ (clobber (match_scratch:QI 4 ""))])
+ (set (pc)
+ (if_then_else (match_operator 0 "ordered_comparison_operator" [(cc0)
+ (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ "")
+
(define_expand "cbranchhi4"
[(parallel [(set (cc0)
(compare (match_operand:HI 1 "register_operand" "")
diff --git a/gcc/config/avr/constraints.md b/gcc/config/avr/constraints.md
index d26bff3ca19..50aae32b01a 100644
--- a/gcc/config/avr/constraints.md
+++ b/gcc/config/avr/constraints.md
@@ -103,6 +103,11 @@
(and (match_code "mem")
(match_test "extra_constraint_Q (op)")))
+(define_constraint "Cm2"
+ "Constant integer @minus{}2."
+ (and (match_code "const_int")
+ (match_test "ival == -2")))
+
(define_constraint "C03"
"Constant integer 3."
(and (match_code "const_int")
@@ -133,6 +138,11 @@
(and (match_code "const_int")
(match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<7) | (1<<8))")))
+(define_constraint "Ca3"
+ "Constant 3-byte integer that allows AND without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 3, (1<<0) | (1<<7) | (1<<8))")))
+
(define_constraint "Ca4"
"Constant 4-byte integer that allows AND without clobber register."
(and (match_code "const_int")
@@ -143,6 +153,11 @@
(and (match_code "const_int")
(match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<1) | (1<<8))")))
+(define_constraint "Co3"
+ "Constant 3-byte integer that allows OR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 3, (1<<0) | (1<<1) | (1<<8))")))
+
(define_constraint "Co4"
"Constant 4-byte integer that allows OR without clobber register."
(and (match_code "const_int")
@@ -153,6 +168,11 @@
(and (match_code "const_int")
(match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<8))")))
+(define_constraint "Cx3"
+ "Constant 3-byte integer that allows XOR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 3, (1<<0) | (1<<8))")))
+
(define_constraint "Cx4"
"Constant 4-byte integer that allows XOR without clobber register."
(and (match_code "const_int")
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 30e8d96447e..ee2dc56ced6 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -39,62 +39,6 @@ $(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh \
$(SHELL) $(srcdir)/config/avr/genopt.sh $(srcdir)/config/avr > \
$(srcdir)/config/avr/avr-tables.opt
-LIB1ASMSRC = avr/libgcc.S
-LIB1ASMFUNCS = \
- _mulqi3 \
- _mulhi3 \
- _mulhisi3 \
- _umulhisi3 \
- _usmulhisi3 \
- _muluhisi3 \
- _mulshisi3 \
- _mulsi3 \
- _udivmodqi4 \
- _divmodqi4 \
- _udivmodhi4 \
- _divmodhi4 \
- _udivmodsi4 \
- _divmodsi4 \
- _prologue \
- _epilogue \
- _exit \
- _cleanup \
- _tablejump \
- _tablejump_elpm \
- _copy_data \
- _clear_bss \
- _ctors \
- _dtors \
- _ffssi2 \
- _ffshi2 \
- _loop_ffsqi2 \
- _ctzsi2 \
- _ctzhi2 \
- _clzdi2 \
- _clzsi2 \
- _clzhi2 \
- _paritydi2 \
- _paritysi2 \
- _parityhi2 \
- _popcounthi2 \
- _popcountsi2 \
- _popcountdi2 \
- _popcountqi2 \
- _bswapsi2 \
- _bswapdi2 \
- _ashldi3 \
- _ashrdi3 \
- _lshrdi3 \
- _fmul _fmuls _fmulsu
-
-LIB2FUNCS_EXCLUDE = \
- _clz
-
-# We do not have the DF type.
-# Most of the C functions in libgcc2 use almost all registers,
-# so use -mcall-prologues for smaller code size.
-TARGET_LIBGCC2_CFLAGS = -DDF=SF -Dinhibit_libc -mcall-prologues -Os
-
MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6
MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6
@@ -243,6 +187,3 @@ MULTILIB_MATCHES = \
mmcu?avr6=mmcu?atmega2561
MULTILIB_EXCEPTIONS =
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/bfin/t-bfin b/gcc/config/bfin/t-bfin
deleted file mode 100644
index 730043e4b63..00000000000
--- a/gcc/config/bfin/t-bfin
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2005, 2007, 2011 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/>.
-
-## Target part of the Makefile
-
-LIB1ASMSRC = bfin/lib1funcs.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
-LIB1ASMFUNCS += _smulsi3_highpart
-
-EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
-
-$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s
diff --git a/gcc/config/bfin/t-bfin-elf b/gcc/config/bfin/t-bfin-elf
index 61797bfad2a..742740ebc44 100644
--- a/gcc/config/bfin/t-bfin-elf
+++ b/gcc/config/bfin/t-bfin-elf
@@ -18,13 +18,6 @@
## Target part of the Makefile
-LIB1ASMSRC = bfin/lib1funcs.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
-LIB1ASMFUNCS += _smulsi3_highpart
-
-CRTSTUFF_T_CFLAGS = -fpic
-TARGET_LIBGCC2_CFLAGS = -fpic
-
MULTILIB_OPTIONS=mcpu=bf532-none
MULTILIB_OPTIONS+=mid-shared-library/msep-data/mfdpic mleaf-id-shared-library
MULTILIB_DIRNAMES=bf532-none mid-shared-library msep-data mfdpic mleaf-id-shared-library
@@ -54,19 +47,3 @@ MULTILIB_EXCEPTIONS=mleaf-id-shared-library*
MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library*
MULTILIB_EXCEPTIONS+=*mfdpic/mleaf-id-shared-library*
MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library*
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
-
-$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s
-
-$(T)crtlibid.o: $(srcdir)/config/bfin/crtlibid.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtlibid.o -x assembler-with-cpp \
- $(srcdir)/config/bfin/crtlibid.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o
diff --git a/gcc/config/bfin/t-bfin-linux b/gcc/config/bfin/t-bfin-linux
index e7e705ef1d4..7d25358c265 100644
--- a/gcc/config/bfin/t-bfin-linux
+++ b/gcc/config/bfin/t-bfin-linux
@@ -18,13 +18,6 @@
## Target part of the Makefile
-LIB1ASMSRC = bfin/lib1funcs.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
-LIB1ASMFUNCS += _smulsi3_highpart
-
-CRTSTUFF_T_CFLAGS = -fpic
-TARGET_LIBGCC2_CFLAGS = -fpic
-
MULTILIB_OPTIONS=mcpu=bf532-none
MULTILIB_DIRNAMES=bf532-none
@@ -49,10 +42,6 @@ MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf549m-none
MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf561-none
MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf592-none
-SHLIB_MAPFILES=$(srcdir)/config/bfin/libgcc-bfin.ver
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o
-
# This rule uses MULTILIB_MATCHES to generate a definition of
# SYSROOT_SUFFIX_SPEC.
linux-sysroot-suffix.h: $(srcdir)/config/bfin/print-sysroot-suffix.sh
diff --git a/gcc/config/bfin/t-bfin-uclinux b/gcc/config/bfin/t-bfin-uclinux
index a46d7b3ac15..e3e9b13e712 100644
--- a/gcc/config/bfin/t-bfin-uclinux
+++ b/gcc/config/bfin/t-bfin-uclinux
@@ -18,13 +18,6 @@
## Target part of the Makefile
-LIB1ASMSRC = bfin/lib1funcs.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
-LIB1ASMFUNCS += _smulsi3_highpart
-
-CRTSTUFF_T_CFLAGS = -fpic
-TARGET_LIBGCC2_CFLAGS = -fpic
-
MULTILIB_OPTIONS=mcpu=bf532-none
MULTILIB_OPTIONS+=mid-shared-library/msep-data mleaf-id-shared-library
MULTILIB_DIRNAMES=bf532-none mid-shared-library msep-data mleaf-id-shared-library
@@ -53,11 +46,3 @@ MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf592-none
MULTILIB_EXCEPTIONS=mleaf-id-shared-library*
MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library*
MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library*
-
-# Assemble startup files.
-$(T)crtlibid.o: $(srcdir)/config/bfin/crtlibid.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtlibid.o -x assembler-with-cpp \
- $(srcdir)/config/bfin/crtlibid.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtlibid.o
diff --git a/gcc/config/c6x/t-c6x-elf b/gcc/config/c6x/t-c6x-elf
index 030a39ce18c..be52588ea30 100644
--- a/gcc/config/c6x/t-c6x-elf
+++ b/gcc/config/c6x/t-c6x-elf
@@ -18,25 +18,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = c6x/lib1funcs.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _udivmodsi4 _divmodsi4
-LIB1ASMFUNCS += _strasgi _strasgi_64plus _clzsi2 _clzdi2 _clz
-LIB1ASMFUNCS += _push_rts _pop_rts _call_stub
-
-LIB2FUNCS_EXCLUDE = _cmpdi2 _ucmpdi2 _gcc_bcmp _eprintf _clzsi _clzdi
EXTRA_HEADERS += $(srcdir)/ginclude/unwind-arm-common.h
-LIB2FUNCS_EXTRA = $(srcdir)/config/c6x/gef.c \
- $(srcdir)/config/c6x/gtf.c \
- $(srcdir)/config/c6x/lef.c \
- $(srcdir)/config/c6x/ltf.c \
- $(srcdir)/config/c6x/eqf.c \
- $(srcdir)/config/c6x/ged.c \
- $(srcdir)/config/c6x/gtd.c \
- $(srcdir)/config/c6x/led.c \
- $(srcdir)/config/c6x/ltd.c \
- $(srcdir)/config/c6x/eqd.c
-
# Use this variant for fully testing all CPU types
#MULTILIB_OPTIONS = mbig-endian march=c674x/march=c64x/march=c67x/march=c67x+/march=c62x
#MULTILIB_DIRNAMES = be c674x c64x c67x c67x+ c62x
@@ -45,23 +28,3 @@ MULTILIB_OPTIONS = mbig-endian march=c674x
MULTILIB_DIRNAMES = be c674x
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/c6x/crti.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o $(CRTSTUFF_T_CFLAGS) -x assembler-with-cpp \
- $(srcdir)/config/c6x/crti.s
-
-$(T)crtn.o: $(srcdir)/config/c6x/crtn.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o $(CRTSTUFF_T_CFLAGS) -x assembler-with-cpp \
- $(srcdir)/config/c6x/crtn.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crti.o crtn.o
-
-# Avoid failures when the user's GOT becomes too large.
-CRTSTUFF_T_CFLAGS = -msdata=none
-CRTSTUFF_T_CFLAGS_S = -msdata=none
-TARGET_LIBGCC2_CFLAGS = -msdata=none
-
-SHLIB_MAPFILES += $(srcdir)/config/c6x/libgcc-c6xeabi.ver
diff --git a/gcc/config/c6x/t-c6x-uclinux b/gcc/config/c6x/t-c6x-uclinux
index fdc447ac62c..e4b93908f43 100644
--- a/gcc/config/c6x/t-c6x-uclinux
+++ b/gcc/config/c6x/t-c6x-uclinux
@@ -1,7 +1,3 @@
MULTILIB_OSDIRNAMES = march.c674x=!c674x
MULTILIB_OSDIRNAMES += mbig-endian=!be
MULTILIB_OSDIRNAMES += mbig-endian/march.c674x=!be/c674x
-
-CRTSTUFF_T_CFLAGS = -fPIC -msdata=none
-CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
-TARGET_LIBGCC2_CFLAGS = -fPIC -msdata=none
diff --git a/gcc/config/cris/constraints.md b/gcc/config/cris/constraints.md
new file mode 100644
index 00000000000..42944e73f41
--- /dev/null
+++ b/gcc/config/cris/constraints.md
@@ -0,0 +1,164 @@
+;; Constraint definitions for CRIS.
+;; Copyright (C) 2011 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/>.
+
+;; Register constraints.
+(define_register_constraint "a" "ACR_REGS"
+ "@internal")
+
+(define_register_constraint "b" "GENNONACR_REGS"
+ "@internal")
+
+(define_register_constraint "h" "MOF_REGS"
+ "@internal")
+
+(define_register_constraint "x" "SPECIAL_REGS"
+ "@internal")
+
+(define_register_constraint "c" "CC0_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "MOVEQ, CMPQ, ANDQ, ORQ."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32, 31)")))
+
+(define_constraint "J"
+ "ADDQ, SUBQ."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 63)")))
+
+(define_constraint "Kc"
+ "ASRQ, BTSTQ, LSRQ, LSLQ."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 31)")))
+
+(define_constraint "Kp"
+ "A power of two."
+ (and (match_code "const_int")
+ (match_test "exact_log2 (ival) >= 0")))
+
+(define_constraint "L"
+ "A 16-bit signed number."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32768, 32767)")))
+
+(define_constraint "M"
+ "The constant 0 for CLEAR."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "N"
+ "A negative ADDQ or SUBQ."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -63, -1)")))
+
+(define_constraint "O"
+ "Quickened ints, QI and HI."
+ (and (match_code "const_int")
+ (ior (match_test "IN_RANGE (ival, (65535 - 31), 65535)")
+ (match_test "IN_RANGE (ival, (255 - 31), 255)"))))
+
+(define_constraint "P"
+ "A 16-bit number signed *or* unsigned."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32768, 65535)")))
+
+;; Floating-point constant constraints.
+(define_constraint "G"
+ "The floating point zero constant"
+ (and (match_code "const_double")
+ (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT")
+ (match_test "op == CONST0_RTX (mode)")))
+
+;; Memory constraints.
+
+;; Just an indirect register (happens to also be "all" slottable
+;; memory addressing modes not covered by other constraints, i.e. '>').
+(define_memory_constraint "Q"
+ "@internal"
+ (and (match_code "mem")
+ (match_test "cris_base_p (XEXP (op, 0), reload_in_progress
+ || reload_completed)")))
+
+;; Extra constraints.
+(define_constraint "R"
+ "An operand to BDAP or BIAP."
+ ;; A BIAP; r.S?
+ (ior (match_test "cris_biap_index_p (op, reload_in_progress
+ || reload_completed)")
+ ;; A [reg] or (int) [reg], maybe with post-increment.
+ (match_test "cris_bdap_index_p (op, reload_in_progress
+ || reload_completed)")
+ (match_test "cris_constant_index_p (op)")))
+
+(define_constraint "T"
+ "Memory three-address operand."
+ ;; All are indirect-memory:
+ (and (match_code "mem")
+ ;; Double indirect: [[reg]] or [[reg+]]?
+ (ior (and (match_code "mem" "0")
+ (match_test "cris_base_or_autoincr_p (XEXP (XEXP (op, 0), 0),
+ reload_in_progress
+ || reload_completed)"))
+ ;; Just an explicit indirect reference: [const]?
+ (match_test "CONSTANT_P (XEXP (op, 0))")
+ ;; Something that is indexed; [...+...]?
+ (and (match_code "plus" "0")
+ ;; A BDAP constant: [reg+(8|16|32)bit offset]?
+ (ior (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
+ reload_in_progress
+ || reload_completed)")
+ (match_test "cris_constant_index_p (XEXP (XEXP (op, 0), 1))"))
+ ;; A BDAP register: [reg+[reg(+)].S]?
+ (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
+ reload_in_progress
+ || reload_completed)")
+ (match_test "cris_bdap_index_p (XEXP (XEXP (op, 0), 1),
+ reload_in_progress
+ || reload_completed)"))
+ ;; Same, but with swapped arguments (no canonical
+ ;; ordering between e.g. REG and MEM as of LAST_UPDATED
+ ;; "Thu May 12 03:59:11 UTC 2005").
+ (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 1),
+ reload_in_progress
+ || reload_completed)")
+ (match_test "cris_bdap_index_p (XEXP (XEXP (op, 0), 0),
+ reload_in_progress
+ || reload_completed)"))
+ ;; A BIAP: [reg+reg.S] (MULT comes first).
+ (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 1),
+ reload_in_progress
+ || reload_completed)")
+ (match_test "cris_biap_index_p (XEXP (XEXP (op, 0), 0),
+ reload_in_progress
+ || reload_completed)")))))))
+
+(define_constraint "S"
+ "PIC-constructs for symbols."
+ (and (match_test "flag_pic")
+ (match_code "const")
+ (match_test "cris_valid_pic_const (op, false)")))
+
+(define_constraint "U"
+ "@internal"
+ (and (match_test "flag_pic")
+ (match_test "CONSTANT_P (op)")
+ (match_operand 0 "cris_nonmemory_operand_or_callable_symbol")))
+
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 4a08ae03aee..06568023051 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "debug.h"
#include "output.h"
+#include "tm-constrs.h"
#include "target.h"
#include "target-def.h"
#include "ggc.h"
@@ -703,8 +704,7 @@ cris_print_operand (FILE *file, rtx x, int code)
case 'b':
/* Print the unsigned supplied integer as if it were signed
and < 0, i.e print 255 or 65535 as -1, 254, 65534 as -2, etc. */
- if (!CONST_INT_P (x)
- || !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (x), 'O'))
+ if (!satisfies_constraint_O (x))
LOSE_AND_RETURN ("invalid operand for 'b' modifier", x);
fprintf (file, HOST_WIDE_INT_PRINT_DEC,
INTVAL (x)| (INTVAL (x) <= 255 ? ~255 : ~65535));
@@ -1692,9 +1692,7 @@ cris_normal_notice_update_cc (rtx exp, rtx insn)
&& (REGNO (SET_SRC (exp))
> CRIS_LAST_GENERAL_REGISTER))
|| (TARGET_V32
- && GET_CODE (SET_SRC (exp)) == CONST_INT
- && CRIS_CONST_OK_FOR_LETTER_P (INTVAL (SET_SRC (exp)),
- 'I')))
+ && satisfies_constraint_I (SET_SRC (exp))))
{
/* There's no CC0 change for this case. Just check
for overlap. */
@@ -2037,7 +2035,7 @@ cris_rtx_costs (rtx x, int code, int outer_code, int opno, int *total,
if (CONST_INT_P (XEXP (x, 1))
/* Two constants may actually happen before optimization. */
&& !CONST_INT_P (XEXP (x, 0))
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (XEXP (x, 1)), 'I'))
+ && !satisfies_constraint_I (XEXP (x, 1)))
{
*total
= (rtx_cost (XEXP (x, 0), (enum rtx_code) outer_code,
@@ -2118,8 +2116,7 @@ cris_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
/* A BDAP -32768 .. 32767 is like BDAP quick, but with 2 extra
bytes. */
- if (CONST_INT_P (tem2)
- && CRIS_CONST_OK_FOR_LETTER_P (INTVAL (tem2), 'L'))
+ if (satisfies_constraint_L (tem2))
return (2 + 2) / 2;
/* A BDAP with some other constant is 2 bytes extra. */
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 62461d65cc5..a9a68b8b3c1 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -84,11 +84,7 @@ extern int cris_cpu_version;
/* Changing the order used to be necessary to put the fourth __make_dp
argument (a DImode parameter) in registers, to fit with the libfunc
parameter passing scheme used for intrinsic functions. FIXME: Check
- performance and maybe remove definition from TARGET_LIBGCC2_CFLAGS now
- that it isn't strictly necessary. We used to do this through
- TARGET_LIBGCC2_CFLAGS, but that became increasingly difficult as the
- parenthesis (that needed quoting) travels through several layers of
- make and shell invocations. */
+ performance. */
#ifdef IN_LIBGCC2
#define __make_dp(a,b,c,d) __cris_make_dp(d,a,b,c)
#endif
@@ -554,16 +550,6 @@ enum reg_class
#define INDEX_REG_CLASS GENERAL_REGS
-#define REG_CLASS_FROM_LETTER(C) \
- ( \
- (C) == 'a' ? ACR_REGS : \
- (C) == 'b' ? GENNONACR_REGS : \
- (C) == 'h' ? MOF_REGS : \
- (C) == 'x' ? SPECIAL_REGS : \
- (C) == 'c' ? CC0_REGS : \
- NO_REGS \
- )
-
/* Since it uses reg_renumber, it is safe only once reg_renumber
has been allocated, which happens in local-alloc.c. */
#define REGNO_OK_FOR_BASE_P(REGNO) \
@@ -613,127 +599,6 @@ enum reg_class
? 1 /* + cris_fatal ("CLASS_MAX_NREGS with VOIDmode") */ \
: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
-/* We are now out of letters; we could use ten more. This forces us to
- use C-code in the 'md' file. FIXME: Use some EXTRA_CONSTRAINTS. */
-#define CRIS_CONST_OK_FOR_LETTER_P(VALUE, C) \
- ( \
- /* MOVEQ, CMPQ, ANDQ, ORQ. */ \
- (C) == 'I' ? (VALUE) >= -32 && (VALUE) <= 31 : \
- /* ADDQ, SUBQ. */ \
- (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 63 : \
- /* ASRQ, BTSTQ, LSRQ, LSLQ. */ \
- (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 31 : \
- /* A 16-bit signed number. */ \
- (C) == 'L' ? (VALUE) >= -32768 && (VALUE) <= 32767 : \
- /* The constant 0 for CLEAR. */ \
- (C) == 'M' ? (VALUE) == 0 : \
- /* A negative ADDQ or SUBQ. */ \
- (C) == 'N' ? (VALUE) >= -63 && (VALUE) < 0 : \
- /* Quickened ints, QI and HI. */ \
- (C) == 'O' ? (VALUE) >= 0 && (VALUE) <= 65535 \
- && ((VALUE) >= (65535-31) \
- || ((VALUE) >= (255-31) \
- && (VALUE) <= 255 )) : \
- /* A 16-bit number signed *or* unsigned. */ \
- (C) == 'P' ? (VALUE) >= -32768 && (VALUE) <= 65535 : \
- 0)
-
-#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, S) \
- ( \
- ((C) != 'K' || (S)[1] == 'c') \
- ? CRIS_CONST_OK_FOR_LETTER_P (VALUE, C) : \
- ((C) == 'K' && (S)[1] == 'p') \
- ? exact_log2 (VALUE) >= 0 : \
- 0)
-
-#define CONSTRAINT_LEN(C, S) ((C) == 'K' ? 2 : DEFAULT_CONSTRAINT_LEN (C, S))
-
-/* It is really simple to make up a 0.0; it is the same as int-0 in
- IEEE754. */
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'G' && ((VALUE) == CONST0_RTX (DFmode) \
- || (VALUE) == CONST0_RTX (SFmode)))
-
-/* We need this on cris to distinguish delay-slottable addressing modes. */
-#define EXTRA_CONSTRAINT(X, C) \
- ( \
- /* Slottable address mode? */ \
- (C) == 'Q' ? EXTRA_CONSTRAINT_Q (X) : \
- /* Operand to BDAP or BIAP? */ \
- (C) == 'R' ? EXTRA_CONSTRAINT_R (X) : \
- /* A local PIC symbol? */ \
- (C) == 'S' ? EXTRA_CONSTRAINT_S (X) : \
- /* A three-address addressing-mode? */ \
- (C) == 'T' ? EXTRA_CONSTRAINT_T (X) : \
- /* A PLT symbol? */ \
- (C) == 'U' ? EXTRA_CONSTRAINT_U (X) : \
- 0)
-
-#define EXTRA_MEMORY_CONSTRAINT(X, STR) ((X) == 'Q')
-
-#define EXTRA_CONSTRAINT_Q(X) \
- ( \
- /* Just an indirect register (happens to also be \
- "all" slottable memory addressing modes not \
- covered by other constraints, i.e. '>'). */ \
- MEM_P (X) \
- && cris_base_p (XEXP (X, 0), reload_in_progress || reload_completed) \
- )
-
-#define EXTRA_CONSTRAINT_R(X) \
- ( \
- /* An operand to BDAP or BIAP: \
- A BIAP; r.S? */ \
- cris_biap_index_p (X, reload_in_progress || reload_completed) \
- /* A [reg] or (int) [reg], maybe with post-increment. */ \
- || cris_bdap_index_p (X, reload_in_progress || reload_completed) \
- || cris_constant_index_p (X) \
- )
-
-#define EXTRA_CONSTRAINT_T(X) \
- ( \
- /* Memory three-address operand. All are indirect-memory: */ \
- MEM_P (X) \
- && ((MEM_P (XEXP (X, 0)) \
- /* Double indirect: [[reg]] or [[reg+]]? */ \
- && (cris_base_or_autoincr_p (XEXP (XEXP (X, 0), 0), \
- reload_in_progress || reload_completed))) \
- /* Just an explicit indirect reference: [const]? */ \
- || CONSTANT_P (XEXP (X, 0)) \
- /* Something that is indexed; [...+...]? */ \
- || (GET_CODE (XEXP (X, 0)) == PLUS \
- /* A BDAP constant: [reg+(8|16|32)bit offset]? */ \
- && ((cris_base_p (XEXP (XEXP (X, 0), 0), \
- reload_in_progress || reload_completed) \
- && cris_constant_index_p (XEXP (XEXP (X, 0), 1))) \
- /* A BDAP register: [reg+[reg(+)].S]? */ \
- || (cris_base_p (XEXP (XEXP (X, 0), 0), \
- reload_in_progress || reload_completed) \
- && cris_bdap_index_p (XEXP(XEXP(X, 0), 1), \
- reload_in_progress || reload_completed)) \
- /* Same, but with swapped arguments (no canonical \
- ordering between e.g. REG and MEM as of LAST_UPDATED \
- "Thu May 12 03:59:11 UTC 2005"). */ \
- || (cris_base_p (XEXP (XEXP (X, 0), 1), \
- reload_in_progress | reload_completed) \
- && cris_bdap_index_p (XEXP (XEXP (X, 0), 0), \
- reload_in_progress || reload_completed)) \
- /* A BIAP: [reg+reg.S] (MULT comes first). */ \
- || (cris_base_p (XEXP (XEXP (X, 0), 1), \
- reload_in_progress || reload_completed) \
- && cris_biap_index_p (XEXP (XEXP (X, 0), 0), \
- reload_in_progress || reload_completed))))) \
- )
-
-/* PIC-constructs for symbols. */
-#define EXTRA_CONSTRAINT_S(X) \
- (flag_pic && GET_CODE (X) == CONST && cris_valid_pic_const (X, false))
-
-#define EXTRA_CONSTRAINT_U(X) \
- (flag_pic \
- && CONSTANT_P (X) \
- && cris_nonmemory_operand_or_callable_symbol (X, VOIDmode))
-
/* Node: Frame Layout */
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 428132c2eb4..53525940109 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -242,6 +242,7 @@
;; Operand and operator predicates.
(include "predicates.md")
+(include "constraints.md")
;; Test insns.
@@ -650,8 +651,8 @@
&& (!CONST_INT_P (operands[2])
|| INTVAL (operands[2]) > 127
|| INTVAL (operands[2]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')))
+ || satisfies_constraint_N (operands[2])
+ || satisfies_constraint_J (operands[2])))
return "#";
if (which_alternative == 4)
return "move<m> [%3=%2%S1],%0";
@@ -677,8 +678,8 @@
&& (!CONST_INT_P (operands[2])
|| INTVAL (operands[2]) > 127
|| INTVAL (operands[2]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')))
+ || satisfies_constraint_N (operands[2])
+ || satisfies_constraint_J (operands[2])))
return "#";
if (which_alternative < 3)
return "move.%s0 [%3=%1%S2],%0";
@@ -796,8 +797,8 @@
&& (!CONST_INT_P (operands[1])
|| INTVAL (operands[1]) > 127
|| INTVAL (operands[1]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J')))
+ || satisfies_constraint_N (operands[1])
+ || satisfies_constraint_J (operands[1])))
return "#";
if (which_alternative == 1 || which_alternative == 5)
return "#";
@@ -830,8 +831,8 @@
&& (!CONST_INT_P (operands[1])
|| INTVAL (operands[1]) > 127
|| INTVAL (operands[1]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J')))
+ || satisfies_constraint_N (operands[1])
+ || satisfies_constraint_J (operands[1])))
return "#";
if (which_alternative == 1
|| which_alternative == 7
@@ -903,8 +904,8 @@
&& (!CONST_INT_P (operands[1])
|| INTVAL (operands[1]) > 127
|| INTVAL (operands[1]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J')))
+ || satisfies_constraint_N (operands[1])
+ || satisfies_constraint_J (operands[1])))
return "#";
if (which_alternative == 4)
return "clear<m> [%2=%1%S0]";
@@ -1246,8 +1247,8 @@
&& (!CONST_INT_P (operands[2])
|| INTVAL (operands[2]) > 127
|| INTVAL (operands[2]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')))
+ || satisfies_constraint_N (operands[2])
+ || satisfies_constraint_J (operands[2])))
return "#";
if (which_alternative == 4)
return "mov%e4.%m4 [%3=%2%S1],%0";
@@ -1270,8 +1271,8 @@
&& (!CONST_INT_P (operands[2])
|| INTVAL (operands[2]) > 127
|| INTVAL (operands[2]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')))
+ || satisfies_constraint_N (operands[2])
+ || satisfies_constraint_J (operands[2])))
return "#";
if (which_alternative == 4)
return "mov%e4<m> [%3=%2%S1],%0";
@@ -1607,8 +1608,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return "%x5.%s0 [%4=%3%S2],%0";
@@ -1665,8 +1666,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return "%x5<m> [%4=%3%S2],%0";
@@ -2097,8 +2098,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return "%x5%E6.%m6 [%4=%3%S2],%0";
@@ -2126,8 +2127,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return "%x5%E6<m> [%4=%3%S2],%0";
@@ -2206,8 +2207,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return "add%e5.b [%4=%3%S2],%0";
@@ -2234,8 +2235,8 @@
&& (!CONST_INT_P (operands[3])
|| INTVAL (operands[3]) > 127
|| INTVAL (operands[3]) < -128
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N')
- || CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J')))
+ || satisfies_constraint_N (operands[3])
+ || satisfies_constraint_J (operands[3])))
return "#";
if (which_alternative == 4)
return \"%x6%E5.%m5 [%4=%3%S2],%0\";
@@ -4681,8 +4682,8 @@
"GET_MODE_SIZE (GET_MODE (operands[4])) <= UNITS_PER_WORD
&& REGNO (operands[3]) != REGNO (operands[0])
&& (cris_base_p (operands[1], true) || cris_base_p (operands[2], true))
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
+ && !satisfies_constraint_J (operands[2])
+ && !satisfies_constraint_N (operands[2])
&& (INTVAL (operands[2]) >= -128 && INTVAL (operands[2]) < 128)
&& TARGET_SIDE_EFFECT_PREFIXES"
[(parallel
@@ -4717,8 +4718,8 @@
"GET_MODE_SIZE (GET_MODE (operands[4])) <= UNITS_PER_WORD
&& REGNO (operands[4]) != REGNO (operands[0])
&& (cris_base_p (operands[1], true) || cris_base_p (operands[2], true))
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
+ && !satisfies_constraint_J (operands[2])
+ && !satisfies_constraint_N (operands[2])
&& (INTVAL (operands[2]) >= -128 && INTVAL (operands[2]) < 128)
&& TARGET_SIDE_EFFECT_PREFIXES"
[(parallel
@@ -4755,8 +4756,8 @@
;; Change to GET_MODE_SIZE (GET_MODE (operands[3])) <= UNITS_PER_WORD?
"GET_MODE (operands[3]) != DImode
&& REGNO (operands[0]) != REGNO (operands[3])
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J')
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N')
+ && !satisfies_constraint_J (operands[2])
+ && !satisfies_constraint_N (operands[2])
&& INTVAL (operands[2]) >= -128
&& INTVAL (operands[2]) <= 127
&& TARGET_SIDE_EFFECT_PREFIXES"
@@ -4947,7 +4948,7 @@
;; don't do this for a mem-volatile access.
"REGNO (operands[2]) == REGNO (operands[0])
&& INTVAL (operands[3]) <= 65535 && INTVAL (operands[3]) >= 0
- && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'I')
+ && !satisfies_constraint_I (operands[3])
&& !side_effects_p (operands[1])
&& (!REG_P (operands[1])
|| REGNO (operands[1]) <= CRIS_LAST_GENERAL_REGISTER)"
@@ -4957,7 +4958,7 @@
{
enum machine_mode zmode = INTVAL (operands[3]) <= 255 ? QImode : HImode;
enum machine_mode amode
- = CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'O') ? SImode : zmode;
+ = satisfies_constraint_O (operands[3]) ? SImode : zmode;
rtx op1
= (REG_S_P (operands[1])
? gen_rtx_REG (zmode, REGNO (operands[1]))
diff --git a/gcc/config/cris/cris_abi_symbol.c b/gcc/config/cris/cris_abi_symbol.c
deleted file mode 100644
index db9db2cfe56..00000000000
--- a/gcc/config/cris/cris_abi_symbol.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Define symbol to recognize CRIS ABI version 2, for a.out use.
- Contributed by Axis Communications.
- Written by Hans-Peter Nilsson <hp@axis.se>, c:a 1992.
-
- Copyright (C) 2000, 2001, 2003, 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.
-
-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/>. */
-
-#include "tconfig.h"
-#include "tm.h"
-
-#ifdef __AOUT__
-
-/* ELF support was not released before the ABI was changed, so we
- restrict this awkwardness to a.out. This symbol is for gdb to
- recognize, so it can debug both old and new programs successfully. */
-__asm__ (".global " CRIS_ABI_VERSION_SYMBOL_STRING);
-__asm__ (".set " CRIS_ABI_VERSION_SYMBOL_STRING ",0");
-
-#else /* not __AOUT__ */
-
-/* The file must not be empty (declaration/definition-wise) according to
- ISO, IIRC. */
-extern int _Dummy;
-
-#endif /* not __AOUT__ */
diff --git a/gcc/config/cris/t-cris b/gcc/config/cris/t-cris
index 19d44ce8320..fdaa54e5ce3 100644
--- a/gcc/config/cris/t-cris
+++ b/gcc/config/cris/t-cris
@@ -25,17 +25,5 @@
# section "Target Fragment" in the gcc info-files (or the paper copy) of
# "Using and Porting GCC"
-LIB2FUNCS_EXTRA = _udivsi3.c _divsi3.c _umodsi3.c _modsi3.c
-CRIS_LIB1CSRC = $(srcdir)/config/cris/arit.c
-
-# The fixed-point arithmetic code is in one file, arit.c,
-# similar to libgcc2.c (or the old libgcc1.c). We need to
-# "split it up" with one file per define.
-$(LIB2FUNCS_EXTRA): $(CRIS_LIB1CSRC)
- name=`echo $@ | sed -e 's,.*/,,' | sed -e 's,.c$$,,'`; \
- echo "#define L$$name" > tmp-$@ \
- && echo '#include "$<"' >> tmp-$@ \
- && mv -f tmp-$@ $@
-
$(out_object_file): gt-cris.h
gt-cris.h : s-gtype ; @true
diff --git a/gcc/config/cris/t-elfmulti b/gcc/config/cris/t-elfmulti
index 90eeaaedf44..29ed57dec2f 100644
--- a/gcc/config/cris/t-elfmulti
+++ b/gcc/config/cris/t-elfmulti
@@ -16,7 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/cris/mulsi3.asm
MULTILIB_OPTIONS = march=v10/march=v32
MULTILIB_DIRNAMES = v10 v32
MULTILIB_MATCHES = \
@@ -29,6 +28,3 @@ MULTILIB_MATCHES = \
march?v10=mcpu?v10 \
march?v32=mcpu?v32
MULTILIB_EXTRA_OPTS = mbest-lib-options
-INSTALL_LIBGCC = install-multilib
-LIBGCC = stmp-multilib
-CRTSTUFF_T_CFLAGS = -moverride-best-lib-options
diff --git a/gcc/config/cris/t-linux b/gcc/config/cris/t-linux
index 96e861a4283..71a964936db 100644
--- a/gcc/config/cris/t-linux
+++ b/gcc/config/cris/t-linux
@@ -1,7 +1,3 @@
-TARGET_LIBGCC2_CFLAGS += -fPIC
-CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-SHLIB_MAPFILES += $(srcdir)/config/cris/libgcc.ver
-
# We *know* we have a limits.h in the glibc library, with extra
# definitions needed for e.g. libgfortran.
ifneq ($(inhibit_libc),true)
diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md
new file mode 100644
index 00000000000..d7c6c17845d
--- /dev/null
+++ b/gcc/config/epiphany/constraints.md
@@ -0,0 +1,125 @@
+;; Constraint definitions for Adaptiva epiphany
+;; Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
+;; Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+;; Integer constraints
+
+(define_constraint "U16"
+ "An unsigned 16-bit constant."
+ (ior (and (match_code "const_int")
+ (match_test "IMM16 (ival)"))
+ (and (match_code "symbol_ref,label_ref,const")
+ (match_test "epiphany_small16 (op)"))))
+
+(define_constraint "K"
+ "An unsigned 5-bit constant."
+ (and (match_code "const_int")
+ (match_test "IMM5 (ival)")))
+
+;; This could also accept symbol_ref, label_ref or const if we introduce
+;; a small area and/or attribute that satisfies the 11-bit signed range.
+(define_constraint "L"
+ "A signed 11-bit constant."
+ (and (match_code "const_int")
+ (match_test "SIMM11 (ival)")))
+
+(define_constraint "Cm1"
+ "A signed 11-bit constant added to -1"
+ (and (match_code "const_int")
+ (match_test "SIMM11 (ival+1)")
+ (match_test "epiphany_m1reg >= 0")))
+
+(define_constraint "Cl1"
+ "Left-shift of -1"
+ (and (match_code "const_int")
+ (match_test "ival == (ival | ~(ival-1))")
+ (match_test "epiphany_m1reg >= 0")))
+
+(define_constraint "Cr1"
+ "Right-shift of -1"
+ (and (match_code "const_int")
+ (match_test "ival == (ival & ~(ival+1))")
+ (match_test "epiphany_m1reg >= 0")))
+
+(define_constraint "Cal"
+ "Constant for arithmetic/logical operations"
+ (match_test "(flag_pic
+ ? nonsymbolic_immediate_operand (op, VOIDmode)
+ : immediate_operand (op, VOIDmode))"))
+
+(define_constraint "Csy"
+ "Symbolic constant for call/jump instruction"
+ (match_test "symbolic_operand (op, VOIDmode)"))
+
+;; Register constraints
+;; proper register constraints define a register class and can thus
+;; drive register allocation and reload. OTOH sometimes we want to
+;; avoid just that.
+
+;; The register class usable in short insns.
+;; Subject to TARGET_PREFER_SHORT_INSN_REGS.
+(define_register_constraint "Rcs" "SHORT_INSN_REGS"
+ "short insn register class.")
+
+; The registers that can be used to hold a sibcall call address.
+; This must not conflict with any callee-saved registers.
+(define_register_constraint "Rsc" "SIBCALL_REGS"
+ "sibcall register class")
+
+; The registers that can be used to hold a status value
+(define_register_constraint "Rct" "CORE_CONTROL_REGS"
+ "Core control register class")
+
+;; The register group usable in short insns.
+(define_constraint "Rgs"
+ "short insn register group."
+ (and (match_code "reg")
+ (match_test "REGNO (op) >= FIRST_PSEUDO_REGISTER || REGNO (op) <= 7")))
+
+;; Constant suitable for the addsi3_r pattern.
+(define_constraint "Car"
+ "addsi3_r constant."
+ (and (match_code "const_int")
+ (ior (match_test "RTX_OK_FOR_OFFSET_P (SImode, op)")
+ (match_test "RTX_OK_FOR_OFFSET_P (HImode, op)")
+ (match_test "RTX_OK_FOR_OFFSET_P (QImode, op)"))))
+
+;; The return address if it can be replaced with GPR_LR.
+(define_constraint "Rra"
+ "return address constraint - register variant"
+ (and (match_code "unspec")
+ (match_test "XINT (op, 1) == UNSPEC_RETURN_ADDR")
+ (match_test "!MACHINE_FUNCTION (cfun)->lr_clobbered")))
+
+(define_constraint "Rcc"
+ "integer condition code"
+ (and (match_code "reg")
+ (match_test "REGNO (op) == CC_REGNUM")))
+
+;; The return address, which might be a stack slot. */
+(define_constraint "Sra"
+ "return address constraint - memory variant"
+ (and (match_code "unspec")
+ (match_test "XINT (op, 1) == UNSPEC_RETURN_ADDR")))
+
+(define_constraint "Cfm"
+ "control register values to switch fp mode"
+ (and (match_code "const")
+ (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC")
+ (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_FP_MODE")))
diff --git a/gcc/config/epiphany/epiphany-modes.def b/gcc/config/epiphany/epiphany-modes.def
new file mode 100644
index 00000000000..c8375a1d75b
--- /dev/null
+++ b/gcc/config/epiphany/epiphany-modes.def
@@ -0,0 +1,40 @@
+/* Definitions of target machine for GNU compiler, Adapteva Epiphany cpu.
+ Copyright (C) 2002, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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/>. */
+
+CC_MODE (CC_Z); /* only Z valid - for add, testing result. */
+CC_MODE (CC_N_NE); /* N for not-equal (for lsl). */
+CC_MODE (CC_C_LTU); /* C for unsigned-less-than (for add with carry). */
+CC_MODE (CC_C_GTU); /* C for unsigned-greater-than (for sub with carry). */
+CC_MODE (CC_FP);
+CC_MODE (CC_FP_EQ); /* AZ for equal. */
+CC_MODE (CC_FP_ORD); /* AZ || ~AC for ordered. */
+CC_MODE (CC_FP_UNEQ); /* AZ || ~AC for unordered / equal. */
+CC_MODE (CC_FP_GTE); /* ~AC / AZ for greater than / equal. */
+#if 0 /* This would be needed for simplified NaN testing. */
+RESET_FLOAT_FORMAT (SF, motorola_single_format);
+RESET_FLOAT_FORMAT (DF, motorola_double_format);
+#endif
+VECTOR_MODES (INT, 4); /* V4QI V2HI */
+VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */
+VECTOR_MODE (FLOAT, SF, 2); /* V2SF */
+ADJUST_ALIGNMENT (V8QI, epiphany_vect_align);
+ADJUST_ALIGNMENT (V4HI, epiphany_vect_align);
+ADJUST_ALIGNMENT (V2SI, epiphany_vect_align);
+ADJUST_ALIGNMENT (V2SF, epiphany_vect_align);
diff --git a/gcc/config/epiphany/epiphany-protos.h b/gcc/config/epiphany/epiphany-protos.h
new file mode 100644
index 00000000000..334c5337f7c
--- /dev/null
+++ b/gcc/config/epiphany/epiphany-protos.h
@@ -0,0 +1,55 @@
+/* Definitions of target machine for GNU compiler, EPIPHANY cpu.
+ Copyright (C) 2000, 2004, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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/>. */
+
+#ifdef RTX_CODE
+extern enum machine_mode epiphany_select_cc_mode (enum rtx_code, rtx, rtx);
+
+/* Define the function that build the compare insn for scc and bcc. */
+extern struct rtx_def *gen_compare_reg (enum machine_mode, enum rtx_code,
+ enum machine_mode, rtx, rtx);
+#endif
+
+/* Declarations for various fns used in the .md file. */
+extern void epiphany_final_prescan_insn (rtx, rtx *, int);
+extern bool epiphany_is_long_call_p (rtx);
+extern bool epiphany_small16 (rtx);
+bool epiphany_uninterruptible_p (tree decl);
+bool epiphany_call_uninterruptible_p (rtx mem);
+extern rtx sfunc_symbol (const char *name);
+
+extern void epiphany_expand_prologue (void);
+extern void epiphany_expand_epilogue (int);
+extern int epiphany_initial_elimination_offset (int, int);
+extern void epiphany_init_expanders (void);
+extern int hard_regno_mode_ok (int regno, enum machine_mode mode);
+#ifdef HARD_CONST
+extern void emit_set_fp_mode (int entity, int mode, HARD_REG_SET regs_live);
+#endif
+extern void epiphany_insert_mode_switch_use (rtx insn, int, int);
+extern void epiphany_expand_set_fp_mode (rtx *operands);
+extern int epiphany_mode_needed (int entity, rtx insn);
+extern int epiphany_mode_entry_exit (int entity, bool);
+extern int epiphany_mode_after (int entity, int last_mode, rtx insn);
+extern int epiphany_mode_priority_to_mode (int entity, unsigned priority);
+extern bool epiphany_epilogue_uses (int regno);
+extern bool epiphany_optimize_mode_switching (int entity);
+extern bool epiphany_is_interrupt_p (tree);
+extern unsigned epiphany_special_round_type_align (tree, unsigned, unsigned);
+extern unsigned epiphany_adjust_field_align (tree, unsigned);
diff --git a/gcc/config/epiphany/epiphany-sched.md b/gcc/config/epiphany/epiphany-sched.md
new file mode 100644
index 00000000000..a2420a562ae
--- /dev/null
+++ b/gcc/config/epiphany/epiphany-sched.md
@@ -0,0 +1,135 @@
+;; DFA scheduling description for EPIPHANY
+;; Copyright (C) 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+;; Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+;; Two automata are defined to reduce number of states
+;; which a single large automaton will have. (Factoring)
+
+(define_automaton "inst_pipeline,fpu_pipe")
+
+;; This unit is basically the decode unit of the processor.
+;; Since epiphany is a dual issue machine, it is as if there are two
+;; units so that any insn can be processed by either one
+;; of the decoding unit.
+
+(define_cpu_unit "pipe_01,pipe_02" "inst_pipeline")
+
+;; The fixed point arithmetic unit.
+
+(define_cpu_unit "int" "inst_pipeline")
+
+;; The floating point unit.
+
+(define_cpu_unit "F0" "fpu_pipe")
+
+;; ----------------------------------------------------
+;; This reservation is to simplify the dual issue description.
+
+(define_reservation "issue" "pipe_01|pipe_02")
+
+;; This is to express instructions that cannot be paired.
+
+(define_reservation "d_lock" "pipe_01+pipe_02")
+
+;; We don't model all pipeline stages; we model the issue stage
+;; inasmuch as we allow only two instructions to issue simultaneously,
+;; and flow instructions prevent any simultaneous issue of another instruction.
+;; (This uses pipe_01 and pipe_02).
+;; Double issue of 'other' insns is prevented by using the int unit in the
+;; E1 stage.
+;; Double issue of float instructions is prevented by using F0 in the E1 stage.
+
+(define_insn_reservation "simple_arith" 2
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "move,cmove,compare,shift,misc,mul")
+ (eq_attr "length" "4"))
+ "issue,int")
+
+; anything but fp / fp_int has a bypass
+(define_bypass 1 "simple_arith" "simple_arith,simple_arith_2,simple_arith_4,load,store,branch,call,flow")
+
+(define_insn_reservation "simple_arith_2" 2
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "move,cmove,compare,shift,misc,mul")
+ (eq_attr "length" "8"))
+ "issue,issue+int,int")
+
+(define_insn_reservation "simple_arith_4" 4
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "move,compare,shift,misc,mul")
+ (eq_attr "length" "12,16,20,24"))
+ "issue,issue+int,issue+int,issue+int,int")
+
+;; Loads have a latency of two.
+;; Note that we fix up the latency of post_modify in epiphany.c:epiphany_adjust_cost
+
+(define_insn_reservation "load" 3
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "load"))
+ "issue,int")
+
+; anything but fp / fp_int has a bypass
+(define_bypass 2 "load" "simple_arith,simple_arith_2,simple_arith_4,load,store,branch,call,flow")
+
+(define_insn_reservation "store" 1
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "store"))
+ "issue,int")
+
+;; Branch
+;; Latency when taken: 3
+;; Issue Rate: 1
+;; The latency is 1 when the branch is not taken.
+;; We can't really do much with the latency, even if we could express it,
+;; but the pairing restrictions are useful to take into account.
+
+(define_insn_reservation "branch" 1
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "branch,uncond_branch"))
+ "d_lock")
+
+;; calls introduce a longisch delay that is likely to flush the pipelines
+;; of the caller's instructions. Both the call instruction itself and
+;; the rts at the end of the call / sfunc incurs a three cycle penalty,
+;; thus also isolating the scheduling of caller and callee.
+
+(define_insn_reservation "call" 8
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "call,sfunc,fp_sfunc"))
+ "d_lock*8")
+
+(define_insn_reservation "flow" 1
+ (and (eq_attr "pipe_model" "epiphany")
+ (eq_attr "type" "flow"))
+ "d_lock")
+
+(define_insn_reservation "fp_arith_trunc" 3
+ (and (eq_attr "pipe_model" "epiphany")
+ (and (eq_attr "type" "fp,fp_int")
+ (eq_attr "rounding" "trunc")))
+ "issue,F0")
+
+(define_insn_reservation "fp_arith_nearest" 5
+ (and (eq_attr "pipe_model" "epiphany")
+ (and (eq_attr "type" "fp,fp_int")
+ (eq_attr "rounding" "nearest")))
+ "issue,F0")
+
+(define_bypass 2 "fp_arith_trunc" "store")
+(define_bypass 4 "fp_arith_nearest" "store")
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
new file mode 100644
index 00000000000..a4652da87b8
--- /dev/null
+++ b/gcc/config/epiphany/epiphany.c
@@ -0,0 +1,2751 @@
+/* Subroutines used for code generation on the EPIPHANY cpu.
+ Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "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 "diagnostic-core.h"
+#include "recog.h"
+#include "toplev.h"
+#include "tm_p.h"
+#include "target.h"
+#include "df.h"
+#include "langhooks.h"
+#include "insn-codes.h"
+#include "ggc.h"
+#include "tm-constrs.h"
+#include "tree-pass.h"
+#include "integrate.h"
+
+/* Which cpu we're compiling for. */
+int epiphany_cpu_type;
+
+/* Name of mangle string to add to symbols to separate code compiled for each
+ cpu (or NULL). */
+const char *epiphany_mangle_cpu;
+
+/* Array of valid operand punctuation characters. */
+char epiphany_punct_chars[256];
+
+/* The rounding mode that we generally use for floating point. */
+int epiphany_normal_fp_rounding;
+
+static void epiphany_init_reg_tables (void);
+static int get_epiphany_condition_code (rtx);
+static tree epiphany_handle_interrupt_attribute (tree *, tree, tree, int, bool *);
+static bool epiphany_pass_by_reference (cumulative_args_t, enum machine_mode,
+ const_tree, bool);
+static rtx frame_insn (rtx);
+
+/* defines for the initialization of the GCC target structure. */
+#define TARGET_ATTRIBUTE_TABLE epiphany_attribute_table
+
+#define TARGET_PRINT_OPERAND epiphany_print_operand
+#define TARGET_PRINT_OPERAND_ADDRESS epiphany_print_operand_address
+
+#define TARGET_RTX_COSTS epiphany_rtx_costs
+#define TARGET_ADDRESS_COST epiphany_address_cost
+#define TARGET_MEMORY_MOVE_COST epiphany_memory_move_cost
+
+#define TARGET_PROMOTE_FUNCTION_MODE epiphany_promote_function_mode
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
+
+#define TARGET_RETURN_IN_MEMORY epiphany_return_in_memory
+#define TARGET_PASS_BY_REFERENCE epiphany_pass_by_reference
+#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
+#define TARGET_FUNCTION_VALUE epiphany_function_value
+#define TARGET_LIBCALL_VALUE epiphany_libcall_value
+#define TARGET_FUNCTION_VALUE_REGNO_P epiphany_function_value_regno_p
+
+#define TARGET_SETUP_INCOMING_VARARGS epiphany_setup_incoming_varargs
+
+/* Using the simplistic varags handling forces us to do partial reg/stack
+ argument passing for types with larger size (> 4 bytes) than alignemnt. */
+#define TARGET_ARG_PARTIAL_BYTES epiphany_arg_partial_bytes
+
+#define TARGET_FUNCTION_OK_FOR_SIBCALL epiphany_function_ok_for_sibcall
+
+#define TARGET_SCHED_ISSUE_RATE epiphany_issue_rate
+#define TARGET_SCHED_ADJUST_COST epiphany_adjust_cost
+
+#define TARGET_LEGITIMATE_ADDRESS_P epiphany_legitimate_address_p
+
+#define TARGET_SECONDARY_RELOAD epiphany_secondary_reload
+
+#define TARGET_OPTION_OVERRIDE epiphany_override_options
+
+#define TARGET_CONDITIONAL_REGISTER_USAGE epiphany_conditional_register_usage
+
+#define TARGET_FUNCTION_ARG epiphany_function_arg
+
+#define TARGET_FUNCTION_ARG_ADVANCE epiphany_function_arg_advance
+
+#define TARGET_FUNCTION_ARG_BOUNDARY epiphany_function_arg_boundary
+
+#define TARGET_TRAMPOLINE_INIT epiphany_trampoline_init
+
+/* Nonzero if the constant rtx value is a legitimate general operand.
+ We can handle any 32- or 64-bit constant. */
+#define TARGET_LEGITIMATE_CONSTANT_P hook_bool_mode_rtx_true
+
+#define TARGET_MIN_DIVISIONS_FOR_RECIP_MUL \
+ epiphany_min_divisions_for_recip_mul
+
+#define TARGET_VECTORIZE_PREFERRED_SIMD_MODE epiphany_preferred_simd_mode
+
+#define TARGET_VECTOR_MODE_SUPPORTED_P epiphany_vector_mode_supported_p
+
+#define TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE \
+ epiphany_vector_alignment_reachable
+
+#define TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT \
+ epiphany_support_vector_misalignment
+
+#define TARGET_ASM_CAN_OUTPUT_MI_THUNK \
+ hook_bool_const_tree_hwi_hwi_const_tree_true
+#define TARGET_ASM_OUTPUT_MI_THUNK epiphany_output_mi_thunk
+
+#include "target-def.h"
+
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
+bool
+epiphany_is_interrupt_p (tree decl)
+{
+ tree attrs;
+
+ attrs = DECL_ATTRIBUTES (decl);
+ if (lookup_attribute ("interrupt", attrs))
+ return true;
+ else
+ return false;
+}
+
+/* Called from epiphany_override_options.
+ We use this to initialize various things. */
+
+static void
+epiphany_init (void)
+{
+ /* N.B. this pass must not run before the first optimize_mode_switching
+ pass because of the side offect of epiphany_mode_needed on
+ MACHINE_FUNCTION(cfun)->unknown_mode_uses. But it must run before
+ pass_resolve_sw_modes. */
+ static struct register_pass_info insert_use_info
+ = { &pass_mode_switch_use.pass, "mode_sw",
+ 1, PASS_POS_INSERT_AFTER
+ };
+ static struct register_pass_info mode_sw2_info
+ = { &pass_mode_switching.pass, "mode_sw",
+ 1, PASS_POS_INSERT_AFTER
+ };
+ static struct register_pass_info mode_sw3_info
+ = { &pass_resolve_sw_modes.pass, "mode_sw",
+ 1, PASS_POS_INSERT_AFTER
+ };
+ static struct register_pass_info mode_sw4_info
+ = { &pass_split_all_insns.pass, "mode_sw",
+ 1, PASS_POS_INSERT_AFTER
+ };
+
+ epiphany_init_reg_tables ();
+
+ /* Initialize array for PRINT_OPERAND_PUNCT_VALID_P. */
+ memset (epiphany_punct_chars, 0, sizeof (epiphany_punct_chars));
+ epiphany_punct_chars['-'] = 1;
+
+ epiphany_normal_fp_rounding
+ = (epiphany_normal_fp_mode == FP_MODE_ROUND_TRUNC
+ ? FP_MODE_ROUND_TRUNC : FP_MODE_ROUND_NEAREST);
+ register_pass (&mode_sw4_info);
+ register_pass (&mode_sw2_info);
+ register_pass (&mode_sw3_info);
+ register_pass (&insert_use_info);
+ register_pass (&mode_sw2_info);
+
+#if 1 /* As long as peep2_rescan is not implemented,
+ (see http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02819.html,)
+ we need a second peephole2 pass to get reasonable code. */
+ {
+ static struct register_pass_info peep2_2_info
+ = { &pass_peephole2.pass, "peephole2",
+ 1, PASS_POS_INSERT_AFTER
+ };
+
+ register_pass (&peep2_2_info);
+ }
+#endif
+}
+
+/* The condition codes of the EPIPHANY, and the inverse function. */
+static const char *const epiphany_condition_codes[] =
+{ /* 0 1 2 3 4 5 6 7 8 9 */
+ "eq", "ne", "ltu", "gteu", "gt", "lte", "gte", "lt", "gtu", "lteu",
+ /* 10 11 12 13 */
+ "beq","bne","blt", "blte",
+};
+
+#define EPIPHANY_INVERSE_CONDITION_CODE(X) ((X) ^ 1)
+
+/* Returns the index of the EPIPHANY condition code string in
+ `epiphany_condition_codes'. COMPARISON should be an rtx like
+ `(eq (...) (...))'. */
+
+static int
+get_epiphany_condition_code (rtx comparison)
+{
+ switch (GET_MODE (XEXP (comparison, 0)))
+ {
+ case CCmode:
+ switch (GET_CODE (comparison))
+ {
+ case EQ : return 0;
+ case NE : return 1;
+ case LTU : return 2;
+ case GEU : return 3;
+ case GT : return 4;
+ case LE : return 5;
+ case GE : return 6;
+ case LT : return 7;
+ case GTU : return 8;
+ case LEU : return 9;
+
+ default : gcc_unreachable ();
+ }
+ case CC_N_NEmode:
+ switch (GET_CODE (comparison))
+ {
+ case EQ: return 6;
+ case NE: return 7;
+ default: gcc_unreachable ();
+ }
+ case CC_C_LTUmode:
+ switch (GET_CODE (comparison))
+ {
+ case GEU: return 2;
+ case LTU: return 3;
+ default: gcc_unreachable ();
+ }
+ case CC_C_GTUmode:
+ switch (GET_CODE (comparison))
+ {
+ case LEU: return 3;
+ case GTU: return 2;
+ default: gcc_unreachable ();
+ }
+ case CC_FPmode:
+ switch (GET_CODE (comparison))
+ {
+ case EQ: return 10;
+ case NE: return 11;
+ case LT: return 12;
+ case LE: return 13;
+ default: gcc_unreachable ();
+ }
+ case CC_FP_EQmode:
+ switch (GET_CODE (comparison))
+ {
+ case EQ: return 0;
+ case NE: return 1;
+ default: gcc_unreachable ();
+ }
+ case CC_FP_GTEmode:
+ switch (GET_CODE (comparison))
+ {
+ case EQ: return 0;
+ case NE: return 1;
+ case GT : return 4;
+ case GE : return 6;
+ case UNLE : return 5;
+ case UNLT : return 7;
+ default: gcc_unreachable ();
+ }
+ case CC_FP_ORDmode:
+ switch (GET_CODE (comparison))
+ {
+ case ORDERED: return 9;
+ case UNORDERED: return 8;
+ default: gcc_unreachable ();
+ }
+ case CC_FP_UNEQmode:
+ switch (GET_CODE (comparison))
+ {
+ case UNEQ: return 9;
+ case LTGT: return 8;
+ default: gcc_unreachable ();
+ }
+ default: gcc_unreachable ();
+ }
+ /*NOTREACHED*/
+ return (42);
+}
+
+
+/* Return 1 if hard register REGNO can hold a value of machine_mode MODE. */
+int
+hard_regno_mode_ok (int regno, enum machine_mode mode)
+{
+ if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
+ return (regno & 1) == 0 && GPR_P (regno);
+ else
+ return 1;
+}
+
+/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
+ return the mode to be used for the comparison. */
+
+enum machine_mode
+epiphany_select_cc_mode (enum rtx_code op,
+ rtx x ATTRIBUTE_UNUSED,
+ rtx y ATTRIBUTE_UNUSED)
+{
+ if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+ {
+ if (TARGET_SOFT_CMPSF)
+ {
+ if (op == EQ || op == NE)
+ return CC_FP_EQmode;
+ if (op == ORDERED || op == UNORDERED)
+ return CC_FP_ORDmode;
+ if (op == UNEQ || op == LTGT)
+ return CC_FP_UNEQmode;
+ return CC_FP_GTEmode;
+ }
+ return CC_FPmode;
+ }
+ /* recognize combiner pattern ashlsi_btst:
+ (parallel [
+ (set (reg:N_NE 65 cc1)
+ (compare:N_NE (zero_extract:SI (reg/v:SI 75 [ a ])
+ (const_int 1 [0x1])
+ (const_int 0 [0x0]))
+ (const_int 0 [0x0])))
+ (clobber (scratch:SI)) */
+ else if ((op == EQ || op == NE)
+ && GET_CODE (x) == ZERO_EXTRACT
+ && XEXP (x, 1) == const1_rtx
+ && CONST_INT_P (XEXP (x, 2)))
+ return CC_N_NEmode;
+ else if ((op == GEU || op == LTU) && GET_CODE (x) == PLUS)
+ return CC_C_LTUmode;
+ else if ((op == LEU || op == GTU) && GET_CODE (x) == MINUS)
+ return CC_C_GTUmode;
+ else
+ return CCmode;
+}
+
+enum reg_class epiphany_regno_reg_class[FIRST_PSEUDO_REGISTER];
+
+static void
+epiphany_init_reg_tables (void)
+{
+ int i;
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ if (i == GPR_LR)
+ epiphany_regno_reg_class[i] = LR_REGS;
+ else if (i <= 7 && TARGET_PREFER_SHORT_INSN_REGS)
+ epiphany_regno_reg_class[i] = SHORT_INSN_REGS;
+ else if (call_used_regs[i]
+ && TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i))
+ epiphany_regno_reg_class[i] = SIBCALL_REGS;
+ else if (i >= CORE_CONTROL_FIRST && i <= CORE_CONTROL_LAST)
+ epiphany_regno_reg_class[i] = CORE_CONTROL_REGS;
+ else if (i < (GPR_LAST+1)
+ || i == ARG_POINTER_REGNUM || i == FRAME_POINTER_REGNUM)
+ epiphany_regno_reg_class[i] = GENERAL_REGS;
+ else if (i == CC_REGNUM)
+ epiphany_regno_reg_class[i] = NO_REGS /* CC_REG: must be NO_REGS */;
+ else
+ epiphany_regno_reg_class[i] = NO_REGS;
+ }
+}
+
+/* EPIPHANY specific attribute support.
+
+ The EPIPHANY has these attributes:
+ interrupt - for interrupt functions.
+ short_call - the function is assumed to be reachable with the b / bl
+ instructions.
+ long_call - the function address is loaded into a register before use.
+ disinterrupt - functions which mask interrupts throughout.
+ They unmask them while calling an interruptible
+ function, though. */
+
+static const struct attribute_spec epiphany_attribute_table[] =
+{
+ /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+ { "interrupt", 1, 1, true, false, false, epiphany_handle_interrupt_attribute, true },
+ { "long_call", 0, 0, false, true, true, NULL, false },
+ { "short_call", 0, 0, false, true, true, NULL, false },
+ { "disinterrupt", 0, 0, false, true, true, NULL, false },
+ { NULL, 0, 0, false, false, false, NULL, false }
+};
+
+/* Handle an "interrupt" attribute; arguments as in
+ struct attribute_spec.handler. */
+static tree
+epiphany_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED,
+ tree name, tree args,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
+{
+ tree value = TREE_VALUE (args);
+
+ if (TREE_CODE (value) != STRING_CST)
+ {
+ warning (OPT_Wattributes,
+ "argument of %qE attribute is not a string constant", name);
+ *no_add_attrs = true;
+ }
+ else if (strcmp (TREE_STRING_POINTER (value), "reset")
+ && strcmp (TREE_STRING_POINTER (value), "software_exception")
+ && strcmp (TREE_STRING_POINTER (value), "timer")
+ && strcmp (TREE_STRING_POINTER (value), "dma0")
+ && strcmp (TREE_STRING_POINTER (value), "dma1")
+ && strcmp (TREE_STRING_POINTER (value), "static_flag")
+ && strcmp (TREE_STRING_POINTER (value), "swi"))
+ {
+ warning (OPT_Wattributes,
+ "argument of %qE attribute is not \"reset\", \"software_exception\", \"timer\", \"dma0\", \"dma1\", \"static_flag\" or \"swi\"",
+ name);
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
+
+/* Misc. utilities. */
+
+/* Generate a SYMBOL_REF for the special function NAME. When the address
+ can't be placed directly into a call instruction, and if possible, copy
+ it to a register so that cse / code hoisting is possible. */
+rtx
+sfunc_symbol (const char *name)
+{
+ rtx sym = gen_rtx_SYMBOL_REF (Pmode, name);
+
+ /* These sfuncs should be hidden, and every dso should get a copy. */
+ SYMBOL_REF_FLAGS (sym) = SYMBOL_FLAG_FUNCTION | SYMBOL_FLAG_LOCAL;
+ if (TARGET_SHORT_CALLS)
+ ; /* Nothing to be done. */
+ else if (can_create_pseudo_p ())
+ sym = copy_to_mode_reg (Pmode, sym);
+ else /* We rely on reload to fix this up. */
+ gcc_assert (!reload_in_progress || reload_completed);
+ return sym;
+}
+
+/* X and Y are two things to compare using CODE in IN_MODE.
+ Emit the compare insn, construct the the proper cc reg in the proper
+ mode, and return the rtx for the cc reg comparison in CMODE. */
+
+rtx
+gen_compare_reg (enum machine_mode cmode, enum rtx_code code,
+ enum machine_mode in_mode, rtx x, rtx y)
+{
+ enum machine_mode mode = SELECT_CC_MODE (code, x, y);
+ rtx cc_reg, pat, clob0, clob1, clob2;
+
+ if (in_mode == VOIDmode)
+ in_mode = GET_MODE (x);
+ if (in_mode == VOIDmode)
+ in_mode = GET_MODE (y);
+
+ if (mode == CC_FPmode)
+ {
+ /* The epiphany has only EQ / NE / LT / LE conditions for
+ hardware floating point. */
+ if (code == GT || code == GE || code == UNLE || code == UNLT)
+ {
+ rtx tmp = x; x = y; y = tmp;
+ code = swap_condition (code);
+ }
+ cc_reg = gen_rtx_REG (mode, CCFP_REGNUM);
+ y = force_reg (in_mode, y);
+ }
+ else
+ {
+ if (mode == CC_FP_GTEmode
+ && (code == LE || code == LT || code == UNGT || code == UNGE))
+ {
+ rtx tmp = x; x = y; y = tmp;
+ code = swap_condition (code);
+ }
+ cc_reg = gen_rtx_REG (mode, CC_REGNUM);
+ }
+ if ((mode == CC_FP_EQmode || mode == CC_FP_GTEmode
+ || mode == CC_FP_ORDmode || mode == CC_FP_UNEQmode)
+ /* mov<mode>cc might want to re-emit a comparison during ifcvt. */
+ && (!REG_P (x) || REGNO (x) != 0 || !REG_P (y) || REGNO (y) != 1))
+ {
+ rtx reg;
+
+ gcc_assert (currently_expanding_to_rtl);
+ reg = gen_rtx_REG (in_mode, 0);
+ gcc_assert (!reg_overlap_mentioned_p (reg, y));
+ emit_move_insn (reg, x);
+ x = reg;
+ reg = gen_rtx_REG (in_mode, 1);
+ emit_move_insn (reg, y);
+ y = reg;
+ }
+ else
+ x = force_reg (in_mode, x);
+
+ pat = gen_rtx_SET (VOIDmode, cc_reg, gen_rtx_COMPARE (mode, x, y));
+ if (mode == CC_FP_EQmode || mode == CC_FP_GTEmode)
+ {
+ const char *name = mode == CC_FP_EQmode ? "__eqsf2" : "__gtesf2";
+ rtx use = gen_rtx_USE (VOIDmode, sfunc_symbol (name));
+
+ clob0 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, GPR_IP));
+ clob1 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, GPR_LR));
+ pat = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (4, pat, use, clob0, clob1));
+ }
+ else if (mode == CC_FP_ORDmode || mode == CC_FP_UNEQmode)
+ {
+ const char *name = mode == CC_FP_ORDmode ? "__ordsf2" : "__uneqsf2";
+ rtx use = gen_rtx_USE (VOIDmode, sfunc_symbol (name));
+
+ clob0 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, GPR_IP));
+ clob1 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, GPR_16));
+ clob2 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, GPR_LR));
+ pat = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (5, pat, use,
+ clob0, clob1, clob2));
+ }
+ else
+ {
+ clob0 = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (in_mode));
+ pat = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, pat, clob0));
+ }
+ emit_insn (pat);
+ return gen_rtx_fmt_ee (code, cmode, cc_reg, const0_rtx);
+}
+
+/* The ROUND_ADVANCE* macros are local to this file. */
+/* Round SIZE up to a word boundary. */
+#define ROUND_ADVANCE(SIZE) \
+ (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+
+/* Round arg MODE/TYPE up to the next word boundary. */
+#define ROUND_ADVANCE_ARG(MODE, TYPE) \
+ ((MODE) == BLKmode \
+ ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \
+ : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))
+
+/* Round CUM up to the necessary point for argument MODE/TYPE. */
+#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \
+ (epiphany_function_arg_boundary ((MODE), (TYPE)) > BITS_PER_WORD \
+ ? (((CUM) + 1) & ~1) \
+ : (CUM))
+
+static unsigned int
+epiphany_function_arg_boundary (enum machine_mode mode, const_tree type)
+{
+ if ((type ? TYPE_ALIGN (type) : GET_MODE_BITSIZE (mode)) <= PARM_BOUNDARY)
+ return PARM_BOUNDARY;
+ return 2 * PARM_BOUNDARY;
+}
+
+/* Do any needed setup for a variadic function. For the EPIPHANY, we
+ actually emit the code in epiphany_expand_prologue.
+
+ CUM has not been updated for the last named argument which has type TYPE
+ and mode MODE, and we rely on this fact. */
+
+
+static void
+epiphany_setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
+ tree type, int *pretend_size, int no_rtl)
+{
+ int first_anon_arg;
+ CUMULATIVE_ARGS next_cum;
+ machine_function_t *mf = MACHINE_FUNCTION (cfun);
+
+ /* All BLKmode values are passed by reference. */
+ gcc_assert (mode != BLKmode);
+
+ next_cum = *get_cumulative_args (cum);
+ next_cum
+ = ROUND_ADVANCE_CUM (next_cum, mode, type) + ROUND_ADVANCE_ARG (mode, type);
+ first_anon_arg = next_cum;
+
+ if (first_anon_arg < MAX_EPIPHANY_PARM_REGS && !no_rtl)
+ {
+ /* Note that first_reg_offset < MAX_EPIPHANY_PARM_REGS. */
+ int first_reg_offset = first_anon_arg;
+
+ *pretend_size = ((MAX_EPIPHANY_PARM_REGS - first_reg_offset)
+ * UNITS_PER_WORD);
+ }
+ mf->args_parsed = 1;
+ mf->pretend_args_odd = ((*pretend_size & UNITS_PER_WORD) ? 1 : 0);
+}
+
+static int
+epiphany_arg_partial_bytes (cumulative_args_t cum, enum machine_mode mode,
+ tree type, bool named ATTRIBUTE_UNUSED)
+{
+ int words = 0, rounded_cum;
+
+ gcc_assert (!epiphany_pass_by_reference (cum, mode, type, /* named */ true));
+
+ rounded_cum = ROUND_ADVANCE_CUM (*get_cumulative_args (cum), mode, type);
+ if (rounded_cum < MAX_EPIPHANY_PARM_REGS)
+ {
+ words = MAX_EPIPHANY_PARM_REGS - rounded_cum;
+ if (words >= ROUND_ADVANCE_ARG (mode, type))
+ words = 0;
+ }
+ return words * UNITS_PER_WORD;
+}
+
+/* Cost functions. */
+
+/* Compute a (partial) cost for rtx X. Return true if the complete
+ cost has been computed, and false if subexpressions should be
+ scanned. In either case, *TOTAL contains the cost result. */
+
+static bool
+epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
+ int *total, bool speed ATTRIBUTE_UNUSED)
+{
+ switch (code)
+ {
+ /* Small integers in the right context are as cheap as registers. */
+ case CONST_INT:
+ if ((outer_code == PLUS || outer_code == MINUS)
+ && SIMM11 (INTVAL (x)))
+ {
+ *total = 0;
+ return true;
+ }
+ if (IMM16 (INTVAL (x)))
+ {
+ *total = outer_code == SET ? 0 : COSTS_N_INSNS (1);
+ return true;
+ }
+ /* FALLTHRU */
+
+ case CONST:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ *total = COSTS_N_INSNS ((epiphany_small16 (x) ? 0 : 1)
+ + (outer_code == SET ? 0 : 1));
+ return true;
+
+ case CONST_DOUBLE:
+ {
+ rtx high, low;
+ split_double (x, &high, &low);
+ *total = COSTS_N_INSNS (!IMM16 (INTVAL (high))
+ + !IMM16 (INTVAL (low)));
+ return true;
+ }
+
+ case ASHIFT:
+ case ASHIFTRT:
+ case LSHIFTRT:
+ *total = COSTS_N_INSNS (1);
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+
+/* Provide the costs of an addressing mode that contains ADDR.
+ If ADDR is not a valid address, its cost is irrelevant. */
+
+static int
+epiphany_address_cost (rtx addr, bool speed)
+{
+ rtx reg;
+ rtx off = const0_rtx;
+ int i;
+
+ if (speed)
+ return 0;
+ /* Return 0 for addresses valid in short insns, 1 for addresses only valid
+ in long insns. */
+ switch (GET_CODE (addr))
+ {
+ case PLUS :
+ reg = XEXP (addr, 0);
+ off = XEXP (addr, 1);
+ break;
+ case POST_MODIFY:
+ reg = XEXP (addr, 0);
+ off = XEXP (addr, 1);
+ gcc_assert (GET_CODE (off) == PLUS && rtx_equal_p (reg, XEXP (off, 0)));
+ off = XEXP (off, 1);
+ if (satisfies_constraint_Rgs (reg) && satisfies_constraint_Rgs (off))
+ return 0;
+ return 1;
+ case REG:
+ default:
+ reg = addr;
+ break;
+ }
+ if (!satisfies_constraint_Rgs (reg))
+ return 1;
+ /* ??? We don't know the mode of the memory access. We are going to assume
+ SImode, unless lack of offset alignment indicates a smaller access. */
+ /* First, make sure we have a valid integer. */
+ if (!satisfies_constraint_L (off))
+ return 1;
+ i = INTVAL (off);
+ if ((i & 1) == 0)
+ i >>= 1;
+ if ((i & 1) == 0)
+ i >>= 1;
+ if (i < -7 || i > 7)
+ return 1;
+ return 0;
+}
+
+/* Compute the cost of moving data between registers and memory.
+ For integer, load latency is twice as long as register-register moves,
+ but issue pich is the same. For floating point, load latency is three
+ times as much as a reg-reg move. */
+static int
+epiphany_memory_move_cost (enum machine_mode mode,
+ reg_class_t rclass ATTRIBUTE_UNUSED,
+ bool in ATTRIBUTE_UNUSED)
+{
+ return GET_MODE_CLASS (mode) == MODE_INT ? 3 : 4;
+}
+
+/* Function prologue/epilogue handlers. */
+
+/* EPIPHANY stack frames look like:
+
+ Before call After call
+ +-----------------------+ +-----------------------+
+ | | | |
+ high | local variables, | | local variables, |
+ mem | reg save area, etc. | | reg save area, etc. |
+ | | | |
+ +-----------------------+ +-----------------------+
+ | | | |
+ | arguments on stack. | | arguments on stack. |
+ | | | |
+ SP+8->+-----------------------+FP+8m->+-----------------------+
+ | 2 word save area for | | reg parm save area, |
+ | leaf funcs / flags | | only created for |
+ SP+0->+-----------------------+ | variable argument |
+ | functions |
+ FP+8n->+-----------------------+
+ | |
+ | register save area |
+ | |
+ +-----------------------+
+ | |
+ | local variables |
+ | |
+ FP+0->+-----------------------+
+ | |
+ | alloca allocations |
+ | |
+ +-----------------------+
+ | |
+ | arguments on stack |
+ | |
+ SP+8->+-----------------------+
+ low | 2 word save area for |
+ memory | leaf funcs / flags |
+ SP+0->+-----------------------+
+
+Notes:
+1) The "reg parm save area" does not exist for non variable argument fns.
+ The "reg parm save area" could be eliminated if we created our
+ own TARGET_GIMPLIFY_VA_ARG_EXPR, but that has tradeoffs as well
+ (so it's not done). */
+
+/* Structure to be filled in by epiphany_compute_frame_size with register
+ save masks, and offsets for the current function. */
+struct epiphany_frame_info
+{
+ unsigned int total_size; /* # bytes that the entire frame takes up. */
+ unsigned int pretend_size; /* # bytes we push and pretend caller did. */
+ unsigned int args_size; /* # bytes that outgoing arguments take up. */
+ unsigned int reg_size; /* # bytes needed to store regs. */
+ unsigned int var_size; /* # bytes that variables take up. */
+ HARD_REG_SET gmask; /* Set of saved gp registers. */
+ int initialized; /* Nonzero if frame size already calculated. */
+ int stld_sz; /* Current load/store data size for offset
+ adjustment. */
+ int need_fp; /* value to override "frame_pointer_needed */
+ int first_slot, last_slot, first_slot_offset, last_slot_offset;
+ int first_slot_size;
+ int small_threshold;
+};
+
+/* Current frame information calculated by epiphany_compute_frame_size. */
+static struct epiphany_frame_info current_frame_info;
+
+/* Zero structure to initialize current_frame_info. */
+static struct epiphany_frame_info zero_frame_info;
+
+/* The usual; we set up our machine_function data. */
+static struct machine_function *
+epiphany_init_machine_status (void)
+{
+ struct machine_function *machine;
+
+ /* Reset state info for each function. */
+ current_frame_info = zero_frame_info;
+
+ machine = ggc_alloc_cleared_machine_function_t ();
+
+ return machine;
+}
+
+/* Implements INIT_EXPANDERS. We just set up to call the above
+ * function. */
+void
+epiphany_init_expanders (void)
+{
+ init_machine_status = epiphany_init_machine_status;
+}
+
+/* Type of function DECL.
+
+ The result is cached. To reset the cache at the end of a function,
+ call with DECL = NULL_TREE. */
+
+static enum epiphany_function_type
+epiphany_compute_function_type (tree decl)
+{
+ tree a;
+ /* Cached value. */
+ static enum epiphany_function_type fn_type = EPIPHANY_FUNCTION_UNKNOWN;
+ /* Last function we were called for. */
+ static tree last_fn = NULL_TREE;
+
+ /* Resetting the cached value? */
+ if (decl == NULL_TREE)
+ {
+ fn_type = EPIPHANY_FUNCTION_UNKNOWN;
+ last_fn = NULL_TREE;
+ return fn_type;
+ }
+
+ if (decl == last_fn && fn_type != EPIPHANY_FUNCTION_UNKNOWN)
+ return fn_type;
+
+ /* Assume we have a normal function (not an interrupt handler). */
+ fn_type = EPIPHANY_FUNCTION_NORMAL;
+
+ /* Now see if this is an interrupt handler. */
+ for (a = DECL_ATTRIBUTES (decl);
+ a;
+ a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a), args = TREE_VALUE (a);
+
+ if (name == get_identifier ("interrupt")
+ && list_length (args) == 1
+ && TREE_CODE (TREE_VALUE (args)) == STRING_CST)
+ {
+ tree value = TREE_VALUE (args);
+
+ if (!strcmp (TREE_STRING_POINTER (value), "reset"))
+ fn_type = EPIPHANY_FUNCTION_RESET;
+ else if (!strcmp (TREE_STRING_POINTER (value), "software_exception"))
+ fn_type = EPIPHANY_FUNCTION_SOFTWARE_EXCEPTION;
+ else if (!strcmp (TREE_STRING_POINTER (value), "timer"))
+ fn_type = EPIPHANY_FUNCTION_TIMER;
+ else if (!strcmp (TREE_STRING_POINTER (value), "dma0"))
+ fn_type = EPIPHANY_FUNCTION_DMA0;
+ else if (!strcmp (TREE_STRING_POINTER (value), "dma1"))
+ fn_type = EPIPHANY_FUNCTION_DMA1;
+ else if (!strcmp (TREE_STRING_POINTER (value), "static_flag"))
+ fn_type = EPIPHANY_FUNCTION_STATIC_FLAG;
+ else if (!strcmp (TREE_STRING_POINTER (value), "swi"))
+ fn_type = EPIPHANY_FUNCTION_SWI;
+ else
+ gcc_unreachable ();
+ break;
+ }
+ }
+
+ last_fn = decl;
+ return fn_type;
+}
+
+#define RETURN_ADDR_REGNUM GPR_LR
+#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
+#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM))
+
+/* Tell prologue and epilogue if register REGNO should be saved / restored.
+ The return address and frame pointer are treated separately.
+ Don't consider them here. */
+#define MUST_SAVE_REGISTER(regno, interrupt_p) \
+ ((df_regs_ever_live_p (regno) \
+ || (interrupt_p && !current_function_is_leaf \
+ && call_used_regs[regno] && !fixed_regs[regno])) \
+ && (!call_used_regs[regno] || regno == GPR_LR \
+ || (interrupt_p && regno != GPR_SP)))
+
+#define MUST_SAVE_RETURN_ADDR 0
+
+/* Return the bytes needed to compute the frame pointer from the current
+ stack pointer.
+
+ SIZE is the size needed for local variables. */
+
+static unsigned int
+epiphany_compute_frame_size (int size /* # of var. bytes allocated. */)
+{
+ int regno;
+ unsigned int total_size, var_size, args_size, pretend_size, reg_size;
+ HARD_REG_SET gmask;
+ enum epiphany_function_type fn_type;
+ int interrupt_p;
+ int first_slot, last_slot, first_slot_offset, last_slot_offset;
+ int first_slot_size;
+ int small_slots = 0;
+ long lr_slot_offset;
+
+ var_size = size;
+ args_size = crtl->outgoing_args_size;
+ pretend_size = crtl->args.pretend_args_size;
+ total_size = args_size + var_size;
+ reg_size = 0;
+ CLEAR_HARD_REG_SET (gmask);
+ first_slot = -1;
+ first_slot_offset = 0;
+ last_slot = -1;
+ last_slot_offset = 0;
+ first_slot_size = UNITS_PER_WORD;
+
+ /* See if this is an interrupt handler. Call used registers must be saved
+ for them too. */
+ fn_type = epiphany_compute_function_type (current_function_decl);
+ interrupt_p = EPIPHANY_INTERRUPT_P (fn_type);
+
+ /* Calculate space needed for registers. */
+
+ for (regno = MAX_EPIPHANY_PARM_REGS - 1; pretend_size > reg_size; regno--)
+ {
+ reg_size += UNITS_PER_WORD;
+ SET_HARD_REG_BIT (gmask, regno);
+ if (epiphany_stack_offset - reg_size == 0)
+ first_slot = regno;
+ }
+
+ if (interrupt_p)
+ reg_size += 2 * UNITS_PER_WORD;
+ else
+ small_slots = epiphany_stack_offset / UNITS_PER_WORD;
+
+ if (frame_pointer_needed)
+ {
+ current_frame_info.need_fp = 1;
+ if (!interrupt_p && first_slot < 0)
+ first_slot = GPR_FP;
+ }
+ else
+ current_frame_info.need_fp = 0;
+ for (regno = 0; regno <= GPR_LAST; regno++)
+ {
+ if (MUST_SAVE_REGISTER (regno, interrupt_p))
+ {
+ gcc_assert (!TEST_HARD_REG_BIT (gmask, regno));
+ reg_size += UNITS_PER_WORD;
+ SET_HARD_REG_BIT (gmask, regno);
+ /* FIXME: when optimizing for speed, take schedling into account
+ when selecting these registers. */
+ if (regno == first_slot)
+ gcc_assert (regno == GPR_FP && frame_pointer_needed);
+ else if (!interrupt_p && first_slot < 0)
+ first_slot = regno;
+ else if (last_slot < 0
+ && (first_slot ^ regno) != 1
+ && (!interrupt_p || regno > GPR_0 + 1))
+ last_slot = regno;
+ }
+ }
+ if (TEST_HARD_REG_BIT (gmask, GPR_LR))
+ MACHINE_FUNCTION (cfun)->lr_clobbered = 1;
+ /* ??? Could sometimes do better than that. */
+ current_frame_info.small_threshold
+ = (optimize >= 3 || interrupt_p ? 0
+ : pretend_size ? small_slots
+ : 4 + small_slots - (first_slot == GPR_FP));
+
+ /* If there might be variables with 64-bit alignment requirement, align the
+ start of the variables. */
+ if (var_size >= 2 * UNITS_PER_WORD
+ /* We don't want to split a double reg save/restore across two unpaired
+ stack slots when optimizing. This rounding could be avoided with
+ more complex reordering of the register saves, but that would seem
+ to be a lot of code complexity for little gain. */
+ || (reg_size > 8 && optimize))
+ reg_size = EPIPHANY_STACK_ALIGN (reg_size);
+ if (total_size + reg_size <= (unsigned) epiphany_stack_offset
+ && !interrupt_p
+ && current_function_is_leaf && !frame_pointer_needed)
+ {
+ first_slot = -1;
+ last_slot = -1;
+ goto alloc_done;
+ }
+ else if (reg_size
+ && !interrupt_p
+ && reg_size < (unsigned HOST_WIDE_INT) epiphany_stack_offset)
+ reg_size = epiphany_stack_offset;
+ if (interrupt_p)
+ {
+ if (total_size + reg_size < 0x3fc)
+ {
+ first_slot_offset = EPIPHANY_STACK_ALIGN (total_size + reg_size);
+ first_slot_offset += EPIPHANY_STACK_ALIGN (epiphany_stack_offset);
+ last_slot = -1;
+ }
+ else
+ {
+ first_slot_offset = EPIPHANY_STACK_ALIGN (reg_size);
+ last_slot_offset = EPIPHANY_STACK_ALIGN (total_size);
+ last_slot_offset += EPIPHANY_STACK_ALIGN (epiphany_stack_offset);
+ if (last_slot >= 0)
+ CLEAR_HARD_REG_BIT (gmask, last_slot);
+ }
+ }
+ else if (total_size + reg_size < 0x1ffc && first_slot >= 0)
+ {
+ first_slot_offset = EPIPHANY_STACK_ALIGN (total_size + reg_size);
+ last_slot = -1;
+ }
+ else
+ {
+ if (total_size + reg_size <= (unsigned) epiphany_stack_offset)
+ {
+ gcc_assert (first_slot < 0);
+ gcc_assert (reg_size == 0);
+ last_slot_offset = EPIPHANY_STACK_ALIGN (total_size + reg_size);
+ }
+ else
+ {
+ first_slot_offset
+ = (reg_size
+ ? EPIPHANY_STACK_ALIGN (reg_size - epiphany_stack_offset) : 0);
+ if (!first_slot_offset)
+ {
+ if (first_slot != GPR_FP || !current_frame_info.need_fp)
+ last_slot = first_slot;
+ first_slot = -1;
+ }
+ last_slot_offset = EPIPHANY_STACK_ALIGN (total_size);
+ if (reg_size)
+ last_slot_offset += EPIPHANY_STACK_ALIGN (epiphany_stack_offset);
+ }
+ if (last_slot >= 0)
+ CLEAR_HARD_REG_BIT (gmask, last_slot);
+ }
+ alloc_done:
+ if (first_slot >= 0)
+ {
+ CLEAR_HARD_REG_BIT (gmask, first_slot);
+ if (TEST_HARD_REG_BIT (gmask, first_slot ^ 1)
+ && epiphany_stack_offset - pretend_size >= 2 * UNITS_PER_WORD)
+ {
+ CLEAR_HARD_REG_BIT (gmask, first_slot ^ 1);
+ first_slot_size = 2 * UNITS_PER_WORD;
+ first_slot &= ~1;
+ }
+ }
+ total_size = first_slot_offset + last_slot_offset;
+
+ lr_slot_offset
+ = (frame_pointer_needed ? first_slot_offset : (long) total_size);
+ if (first_slot != GPR_LR)
+ {
+ int stack_offset = epiphany_stack_offset - UNITS_PER_WORD;
+
+ for (regno = 0; ; regno++)
+ {
+ if (stack_offset + UNITS_PER_WORD - first_slot_size == 0
+ && first_slot >= 0)
+ {
+ stack_offset -= first_slot_size;
+ regno--;
+ }
+ else if (regno == GPR_LR)
+ break;
+ else if TEST_HARD_REG_BIT (gmask, regno)
+ stack_offset -= UNITS_PER_WORD;
+ }
+ lr_slot_offset += stack_offset;
+ }
+
+ /* Save computed information. */
+ current_frame_info.total_size = total_size;
+ current_frame_info.pretend_size = pretend_size;
+ current_frame_info.var_size = var_size;
+ current_frame_info.args_size = args_size;
+ current_frame_info.reg_size = reg_size;
+ COPY_HARD_REG_SET (current_frame_info.gmask, gmask);
+ current_frame_info.first_slot = first_slot;
+ current_frame_info.last_slot = last_slot;
+ current_frame_info.first_slot_offset = first_slot_offset;
+ current_frame_info.first_slot_size = first_slot_size;
+ current_frame_info.last_slot_offset = last_slot_offset;
+ MACHINE_FUNCTION (cfun)->lr_slot_offset = lr_slot_offset;
+
+ current_frame_info.initialized = reload_completed;
+
+ /* Ok, we're done. */
+ return total_size;
+}
+
+/* Print operand X (an rtx) in assembler syntax to file FILE.
+ CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
+ For `%' followed by punctuation, CODE is the punctuation and X is null. */
+
+static void
+epiphany_print_operand (FILE *file, rtx x, int code)
+{
+ switch (code)
+ {
+ case 'd':
+ fputs (epiphany_condition_codes[get_epiphany_condition_code (x)], file);
+ return;
+ case 'D':
+ fputs (epiphany_condition_codes[EPIPHANY_INVERSE_CONDITION_CODE
+ (get_epiphany_condition_code (x))],
+ file);
+ return;
+
+ case 'X':
+ current_frame_info.stld_sz = 8;
+ break;
+
+ case 'C' :
+ current_frame_info.stld_sz = 4;
+ break;
+
+ case 'c' :
+ current_frame_info.stld_sz = 2;
+ break;
+
+ case 'f':
+ fputs (REG_P (x) ? "jalr " : "bl ", file);
+ break;
+
+ case '-':
+ fprintf (file, "r%d", epiphany_m1reg);
+ return;
+
+ case 0 :
+ /* Do nothing special. */
+ break;
+ default :
+ /* Unknown flag. */
+ output_operand_lossage ("invalid operand output code");
+ }
+
+ switch (GET_CODE (x))
+ {
+ rtx addr;
+ rtx offset;
+
+ case REG :
+ fputs (reg_names[REGNO (x)], file);
+ break;
+ case MEM :
+ if (code == 0)
+ current_frame_info.stld_sz = 1;
+ fputc ('[', file);
+ addr = XEXP (x, 0);
+ switch (GET_CODE (addr))
+ {
+ case POST_INC:
+ offset = GEN_INT (GET_MODE_SIZE (GET_MODE (x)));
+ addr = XEXP (addr, 0);
+ break;
+ case POST_DEC:
+ offset = GEN_INT (-GET_MODE_SIZE (GET_MODE (x)));
+ addr = XEXP (addr, 0);
+ break;
+ case POST_MODIFY:
+ offset = XEXP (XEXP (addr, 1), 1);
+ addr = XEXP (addr, 0);
+ break;
+ default:
+ offset = 0;
+ break;
+ }
+ output_address (addr);
+ fputc (']', file);
+ if (offset)
+ {
+ fputc (',', file);
+ if (CONST_INT_P (offset)) switch (GET_MODE_SIZE (GET_MODE (x)))
+ {
+ default:
+ gcc_unreachable ();
+ case 8:
+ offset = GEN_INT (INTVAL (offset) >> 3);
+ break;
+ case 4:
+ offset = GEN_INT (INTVAL (offset) >> 2);
+ break;
+ case 2:
+ offset = GEN_INT (INTVAL (offset) >> 1);
+ break;
+ case 1:
+ break;
+ }
+ output_address (offset);
+ }
+ break;
+ case CONST_DOUBLE :
+ /* We handle SFmode constants here as output_addr_const doesn't. */
+ if (GET_MODE (x) == SFmode)
+ {
+ REAL_VALUE_TYPE d;
+ long l;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (d, x);
+ REAL_VALUE_TO_TARGET_SINGLE (d, l);
+ fprintf (file, "%s0x%08lx", IMMEDIATE_PREFIX, l);
+ break;
+ }
+ /* Fall through. Let output_addr_const deal with it. */
+ case CONST_INT:
+ fprintf(file,"%s",IMMEDIATE_PREFIX);
+ if (code == 'C' || code == 'X')
+ {
+ fprintf (file, "%ld",
+ (long) (INTVAL (x) / current_frame_info.stld_sz));
+ break;
+ }
+ /* Fall through */
+ default :
+ output_addr_const (file, x);
+ break;
+ }
+}
+
+/* Print a memory address as an operand to reference that memory location. */
+
+static void
+epiphany_print_operand_address (FILE *file, rtx addr)
+{
+ register rtx base, index = 0;
+ int offset = 0;
+
+ switch (GET_CODE (addr))
+ {
+ case REG :
+ fputs (reg_names[REGNO (addr)], file);
+ break;
+ case SYMBOL_REF :
+ if (/*???*/ 0 && SYMBOL_REF_FUNCTION_P (addr))
+ {
+ output_addr_const (file, addr);
+ }
+ else
+ {
+ output_addr_const (file, addr);
+ }
+ break;
+ case PLUS :
+ if (GET_CODE (XEXP (addr, 0)) == CONST_INT)
+ offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1);
+ else if (GET_CODE (XEXP (addr, 1)) == CONST_INT)
+ offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);
+ else
+ base = XEXP (addr, 0), index = XEXP (addr, 1);
+ gcc_assert (GET_CODE (base) == REG);
+ fputs (reg_names[REGNO (base)], file);
+ if (index == 0)
+ {
+ /*
+ ** ++rk quirky method to scale offset for ld/str.......
+ */
+ fprintf (file, ",%s%d", IMMEDIATE_PREFIX,
+ offset/current_frame_info.stld_sz);
+ }
+ else
+ {
+ switch (GET_CODE (index))
+ {
+ case REG:
+ fprintf (file, ",%s", reg_names[REGNO (index)]);
+ break;
+ case SYMBOL_REF:
+ fputc (',', file), output_addr_const (file, index);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ break;
+ case PRE_INC: case PRE_DEC: case POST_INC: case POST_DEC: case POST_MODIFY:
+ /* We shouldn't get here as we've lost the mode of the memory object
+ (which says how much to inc/dec by. */
+ gcc_unreachable ();
+ break;
+ default:
+ output_addr_const (file, addr);
+ break;
+ }
+}
+
+void
+epiphany_final_prescan_insn (rtx insn ATTRIBUTE_UNUSED,
+ rtx *opvec ATTRIBUTE_UNUSED,
+ int noperands ATTRIBUTE_UNUSED)
+{
+ int i = epiphany_n_nops;
+ rtx pat ATTRIBUTE_UNUSED;
+
+ while (i--)
+ fputs ("\tnop\n", asm_out_file);
+}
+
+
+/* Worker function for TARGET_RETURN_IN_MEMORY. */
+
+static bool
+epiphany_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+{
+ HOST_WIDE_INT size = int_size_in_bytes (type);
+
+ if (AGGREGATE_TYPE_P (type)
+ && (TYPE_MODE (type) == BLKmode || TYPE_NEEDS_CONSTRUCTING (type)))
+ return true;
+ return (size == -1 || size > 8);
+}
+
+/* For EPIPHANY, All aggregates and arguments greater than 8 bytes are
+ passed by reference. */
+
+static bool
+epiphany_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED,
+ enum machine_mode mode, const_tree type,
+ bool named ATTRIBUTE_UNUSED)
+{
+ if (type)
+ {
+ if (AGGREGATE_TYPE_P (type)
+ && (mode == BLKmode || TYPE_NEEDS_CONSTRUCTING (type)))
+ return true;
+ }
+ return false;
+}
+
+
+static rtx
+epiphany_function_value (const_tree ret_type,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ enum machine_mode mode;
+
+ mode = TYPE_MODE (ret_type);
+ /* We must change the mode like PROMOTE_MODE does.
+ ??? PROMOTE_MODE is ignored for non-scalar types.
+ The set of types tested here has to be kept in sync
+ with the one in explow.c:promote_mode. */
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) < 4
+ && (TREE_CODE (ret_type) == INTEGER_TYPE
+ || TREE_CODE (ret_type) == ENUMERAL_TYPE
+ || TREE_CODE (ret_type) == BOOLEAN_TYPE
+ || TREE_CODE (ret_type) == OFFSET_TYPE))
+ mode = SImode;
+ return gen_rtx_REG (mode, 0);
+}
+
+static rtx
+epiphany_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, 0);
+}
+
+bool
+epiphany_function_value_regno_p (const unsigned int regno ATTRIBUTE_UNUSED)
+{
+ return regno == 0;
+}
+
+/* Fix up invalid option settings. */
+static void
+epiphany_override_options (void)
+{
+ if (epiphany_stack_offset < 4)
+ error ("stack_offset must be at least 4");
+ if (epiphany_stack_offset & 3)
+ error ("stack_offset must be a multiple of 4");
+ epiphany_stack_offset = (epiphany_stack_offset + 3) & -4;
+
+ /* This needs to be done at start up. It's convenient to do it here. */
+ epiphany_init ();
+}
+
+/* For a DImode load / store SET, make a SImode set for a
+ REG_FRAME_RELATED_EXPR note, using OFFSET to create a high or lowpart
+ subreg. */
+static rtx
+frame_subreg_note (rtx set, int offset)
+{
+ rtx src = simplify_gen_subreg (SImode, SET_SRC (set), DImode, offset);
+ rtx dst = simplify_gen_subreg (SImode, SET_DEST (set), DImode, offset);
+
+ set = gen_rtx_SET (VOIDmode, dst ,src);
+ RTX_FRAME_RELATED_P (set) = 1;
+ return set;
+}
+
+static rtx
+frame_insn (rtx x)
+{
+ int i;
+ rtx note = NULL_RTX;
+
+ if (GET_CODE (x) == PARALLEL)
+ {
+ rtx part = XVECEXP (x, 0, 0);
+
+ if (GET_MODE (SET_DEST (part)) == DImode)
+ {
+ note = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (XVECLEN (x, 0) + 1));
+ XVECEXP (note, 0, 0) = frame_subreg_note (part, 0);
+ XVECEXP (note, 0, 1) = frame_subreg_note (part, UNITS_PER_WORD);
+ for (i = XVECLEN (x, 0) - 1; i >= 1; i--)
+ {
+ part = copy_rtx (XVECEXP (x, 0, i));
+
+ if (GET_CODE (part) == SET)
+ RTX_FRAME_RELATED_P (part) = 1;
+ XVECEXP (note, 0, i + 1) = part;
+ }
+ }
+ else
+ {
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ {
+ part = XVECEXP (x, 0, i);
+
+ if (GET_CODE (part) == SET)
+ RTX_FRAME_RELATED_P (part) = 1;
+ }
+ }
+ }
+ else if (GET_CODE (x) == SET && GET_MODE (SET_DEST (x)) == DImode)
+ note = gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (2, frame_subreg_note (x, 0),
+ frame_subreg_note (x, UNITS_PER_WORD)));
+ x = emit_insn (x);
+ RTX_FRAME_RELATED_P (x) = 1;
+ if (note)
+ add_reg_note (x, REG_FRAME_RELATED_EXPR, note);
+ return x;
+}
+
+static rtx
+frame_move_insn (rtx to, rtx from)
+{
+ return frame_insn (gen_rtx_SET (VOIDmode, to, from));
+}
+
+/* Generate a MEM referring to a varargs argument slot. */
+
+static rtx
+gen_varargs_mem (enum machine_mode mode, rtx addr)
+{
+ rtx mem = gen_rtx_MEM (mode, addr);
+ MEM_NOTRAP_P (mem) = 1;
+ set_mem_alias_set (mem, get_varargs_alias_set ());
+ return mem;
+}
+
+/* Emit instructions to save or restore registers in the range [MIN..LIMIT) .
+ If EPILOGUE_P is 0, save; if it is one, restore.
+ ADDR is the stack slot to save the first register to; subsequent
+ registers are written to lower addresses.
+ However, the order of register pairs can be reversed in order to
+ use double-word load-store instructions. Likewise, an unpaired single
+ word save slot can be skipped while double saves are carried out, and
+ reused when a single register is to be saved. */
+
+static void
+epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
+{
+ int i;
+ int stack_offset
+ = current_frame_info.first_slot >= 0 ? epiphany_stack_offset : 0;
+ rtx skipped_mem = NULL_RTX;
+ int last_saved = limit - 1;
+
+ if (!optimize)
+ while (last_saved >= 0
+ && !TEST_HARD_REG_BIT (current_frame_info.gmask, last_saved))
+ last_saved--;
+ for (i = 0; i < limit; i++)
+ {
+ enum machine_mode mode = word_mode;
+ rtx mem, reg;
+ int n = i;
+ rtx (*gen_mem) (enum machine_mode, rtx) = gen_frame_mem;
+
+ /* Make sure we push the arguments in the right order. */
+ if (n < MAX_EPIPHANY_PARM_REGS && crtl->args.pretend_args_size)
+ {
+ n = MAX_EPIPHANY_PARM_REGS - 1 - n;
+ gen_mem = gen_varargs_mem;
+ }
+ if (stack_offset == current_frame_info.first_slot_size
+ && current_frame_info.first_slot >= 0)
+ {
+ if (current_frame_info.first_slot_size > UNITS_PER_WORD)
+ {
+ mode = DImode;
+ addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ }
+ if (i-- < min || !epilogue_p)
+ goto next_slot;
+ n = current_frame_info.first_slot;
+ gen_mem = gen_frame_mem;
+ }
+ else if (n == UNKNOWN_REGNUM
+ && stack_offset > current_frame_info.first_slot_size)
+ {
+ i--;
+ goto next_slot;
+ }
+ else if (!TEST_HARD_REG_BIT (current_frame_info.gmask, n))
+ continue;
+ else if (i < min)
+ goto next_slot;
+
+ /* Check for a register pair to save. */
+ if (n == i
+ && (n >= MAX_EPIPHANY_PARM_REGS || crtl->args.pretend_args_size == 0)
+ && (n & 1) == 0 && n+1 < limit
+ && TEST_HARD_REG_BIT (current_frame_info.gmask, n+1))
+ {
+ /* If it fits in the current stack slot pair, place it there. */
+ if (GET_CODE (addr) == PLUS && (stack_offset & 7) == 0
+ && stack_offset != 2 * UNITS_PER_WORD
+ && (current_frame_info.last_slot < 0
+ || INTVAL (XEXP (addr, 1)) != UNITS_PER_WORD)
+ && (n+1 != last_saved || !skipped_mem))
+ {
+ mode = DImode;
+ i++;
+ addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ }
+ /* If it fits in the following stack slot pair, that's fine, too. */
+ else if (GET_CODE (addr) == PLUS && (stack_offset & 7) == 4
+ && stack_offset != 2 * UNITS_PER_WORD
+ && stack_offset != 3 * UNITS_PER_WORD
+ && (current_frame_info.last_slot < 0
+ || INTVAL (XEXP (addr, 1)) != 2 * UNITS_PER_WORD)
+ && n + 1 != last_saved)
+ {
+ gcc_assert (!skipped_mem);
+ stack_offset -= GET_MODE_SIZE (mode);
+ skipped_mem = gen_mem (mode, addr);
+ mode = DImode;
+ i++;
+ addr = plus_constant (addr, - (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
+ }
+ }
+ reg = gen_rtx_REG (mode, n);
+ if (mode != DImode && skipped_mem)
+ mem = skipped_mem;
+ else
+ mem = gen_mem (mode, addr);
+ if (!epilogue_p)
+ frame_move_insn (mem, reg);
+ else if (n >= MAX_EPIPHANY_PARM_REGS || !crtl->args.pretend_args_size)
+ emit_move_insn (reg, mem);
+ if (mem == skipped_mem)
+ {
+ skipped_mem = NULL_RTX;
+ continue;
+ }
+ next_slot:
+ addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ stack_offset -= GET_MODE_SIZE (mode);
+ }
+}
+
+void
+epiphany_expand_prologue (void)
+{
+ int interrupt_p;
+ enum epiphany_function_type fn_type;
+ rtx addr, mem, off, reg;
+ rtx save_config;
+
+ if (!current_frame_info.initialized)
+ epiphany_compute_frame_size (get_frame_size ());
+
+ /* It is debatable if we should adjust this by epiphany_stack_offset. */
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = current_frame_info.total_size;
+
+ fn_type = epiphany_compute_function_type (current_function_decl);
+ interrupt_p = EPIPHANY_INTERRUPT_P (fn_type);
+
+ if (interrupt_p)
+ {
+ addr = plus_constant (stack_pointer_rtx,
+ - (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
+ frame_move_insn (gen_frame_mem (DImode, addr),
+ gen_rtx_REG (DImode, GPR_0));
+ frame_move_insn (gen_rtx_REG (SImode, GPR_0),
+ gen_rtx_REG (word_mode, STATUS_REGNUM));
+ frame_move_insn (gen_rtx_REG (SImode, GPR_0+1),
+ gen_rtx_REG (word_mode, IRET_REGNUM));
+ mem = gen_frame_mem (BLKmode, stack_pointer_rtx);
+ off = GEN_INT (-current_frame_info.first_slot_offset);
+ frame_insn (gen_stack_adjust_add (off, mem));
+ if (!epiphany_uninterruptible_p (current_function_decl))
+ emit_insn (gen_gie ());
+ addr = plus_constant (stack_pointer_rtx,
+ current_frame_info.first_slot_offset
+ - (HOST_WIDE_INT) 3 * UNITS_PER_WORD);
+ }
+ else
+ {
+ addr = plus_constant (stack_pointer_rtx,
+ epiphany_stack_offset
+ - (HOST_WIDE_INT) UNITS_PER_WORD);
+ epiphany_emit_save_restore (0, current_frame_info.small_threshold,
+ addr, 0);
+ /* Allocate register save area; for small to medium size frames,
+ allocate the entire frame; this is joint with one register save. */
+ if (current_frame_info.first_slot >= 0)
+ {
+ enum machine_mode mode
+ = (current_frame_info.first_slot_size == UNITS_PER_WORD
+ ? word_mode : DImode);
+
+ off = GEN_INT (-current_frame_info.first_slot_offset);
+ mem = gen_frame_mem (BLKmode,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx, off));
+ frame_insn (gen_stack_adjust_str
+ (gen_frame_mem (mode, stack_pointer_rtx),
+ gen_rtx_REG (mode, current_frame_info.first_slot),
+ off, mem));
+ addr = plus_constant (addr, current_frame_info.first_slot_offset);
+ }
+ }
+ epiphany_emit_save_restore (current_frame_info.small_threshold,
+ FIRST_PSEUDO_REGISTER, addr, 0);
+ if (current_frame_info.need_fp)
+ frame_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
+ /* For large frames, allocate bulk of frame. This is usually joint with one
+ register save. */
+ if (current_frame_info.last_slot >= 0)
+ {
+ gcc_assert (current_frame_info.last_slot != GPR_FP
+ || (!current_frame_info.need_fp
+ && current_frame_info.first_slot < 0));
+ off = GEN_INT (-current_frame_info.last_slot_offset);
+ mem = gen_frame_mem (BLKmode,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx, off));
+ reg = gen_rtx_REG (Pmode, GPR_IP);
+ frame_move_insn (reg, off);
+ frame_insn (gen_stack_adjust_str
+ (gen_frame_mem (word_mode, stack_pointer_rtx),
+ gen_rtx_REG (word_mode, current_frame_info.last_slot),
+ reg, mem));
+ }
+ /* If there is only one or no register to save, yet we have a large frame,
+ use an add. */
+ else if (current_frame_info.last_slot_offset)
+ {
+ mem = gen_frame_mem (BLKmode,
+ plus_constant (stack_pointer_rtx,
+ current_frame_info.last_slot_offset));
+ off = GEN_INT (-current_frame_info.last_slot_offset);
+ if (!SIMM11 (INTVAL (off)))
+ {
+ reg = gen_rtx_REG (Pmode, GPR_IP);
+ frame_move_insn (reg, off);
+ off = reg;
+ }
+ frame_insn (gen_stack_adjust_add (off, mem));
+ }
+
+ /* Mode switching uses get_hard_reg_initial_val after
+ emit_initial_value_sets, so we have to fix this up now. */
+ save_config = has_hard_reg_initial_val (SImode, CONFIG_REGNUM);
+ if (save_config)
+ {
+ if (REG_P (save_config))
+ {
+ if (REGNO (save_config) >= FIRST_PSEUDO_REGISTER)
+ gcc_assert (!df_regs_ever_live_p (REGNO (save_config)));
+ else
+ frame_move_insn (save_config,
+ get_hard_reg_initial_reg (save_config));
+ }
+ else
+ {
+ rtx save_dst = save_config;
+
+ reg = gen_rtx_REG (SImode, GPR_IP);
+ gcc_assert (MEM_P (save_dst));
+ if (!memory_operand (save_dst, SImode))
+ {
+ rtx addr = XEXP (save_dst, 0);
+ rtx reg2 = gen_rtx_REG (SImode, GPR_16);
+
+ gcc_assert (GET_CODE (addr) == PLUS);
+ gcc_assert (XEXP (addr, 0) == hard_frame_pointer_rtx
+ || XEXP (addr, 0) == stack_pointer_rtx);
+ emit_move_insn (reg2, XEXP (addr, 1));
+ save_dst
+ = replace_equiv_address (save_dst,
+ gen_rtx_PLUS (Pmode, XEXP (addr, 0),
+ reg2));
+ }
+ emit_move_insn (reg, get_hard_reg_initial_reg (save_config));
+ emit_move_insn (save_dst, reg);
+ }
+ }
+}
+
+void
+epiphany_expand_epilogue (int sibcall_p)
+{
+ int interrupt_p;
+ enum epiphany_function_type fn_type;
+ rtx mem, addr, reg, off;
+ HOST_WIDE_INT restore_offset;
+
+ fn_type = epiphany_compute_function_type( current_function_decl);
+ interrupt_p = EPIPHANY_INTERRUPT_P (fn_type);
+
+ /* For variable frames, deallocate bulk of frame. */
+ if (current_frame_info.need_fp)
+ {
+ mem = gen_frame_mem (BLKmode, stack_pointer_rtx);
+ emit_insn (gen_stack_adjust_mov (mem));
+ }
+ /* Else for large static frames, deallocate bulk of frame. */
+ else if (current_frame_info.last_slot_offset)
+ {
+ mem = gen_frame_mem (BLKmode, stack_pointer_rtx);
+ reg = gen_rtx_REG (Pmode, GPR_IP);
+ emit_move_insn (reg, GEN_INT (current_frame_info.last_slot_offset));
+ emit_insn (gen_stack_adjust_add (reg, mem));
+ }
+ restore_offset = (interrupt_p
+ ? - 3 * UNITS_PER_WORD
+ : epiphany_stack_offset - (HOST_WIDE_INT) UNITS_PER_WORD);
+ addr = plus_constant (stack_pointer_rtx,
+ (current_frame_info.first_slot_offset
+ + restore_offset));
+ epiphany_emit_save_restore (current_frame_info.small_threshold,
+ FIRST_PSEUDO_REGISTER, addr, 1);
+
+ if (interrupt_p && !epiphany_uninterruptible_p (current_function_decl))
+ emit_insn (gen_gid ());
+
+ off = GEN_INT (current_frame_info.first_slot_offset);
+ mem = gen_frame_mem (BLKmode, stack_pointer_rtx);
+ /* For large / variable size frames, deallocating the register save area is
+ joint with one register restore; for medium size frames, we use a
+ dummy post-increment load to dealloacte the whole frame. */
+ if (!SIMM11 (INTVAL (off)) || current_frame_info.last_slot >= 0)
+ {
+ emit_insn (gen_stack_adjust_ldr
+ (gen_rtx_REG (word_mode,
+ (current_frame_info.last_slot >= 0
+ ? current_frame_info.last_slot : GPR_IP)),
+ gen_frame_mem (word_mode, stack_pointer_rtx),
+ off,
+ mem));
+ }
+ /* While for small frames, we deallocate the entire frame with one add. */
+ else if (INTVAL (off))
+ {
+ emit_insn (gen_stack_adjust_add (off, mem));
+ }
+ if (interrupt_p)
+ {
+ frame_move_insn (gen_rtx_REG (word_mode, STATUS_REGNUM),
+ gen_rtx_REG (SImode, GPR_0));
+ frame_move_insn (gen_rtx_REG (word_mode, IRET_REGNUM),
+ gen_rtx_REG (SImode, GPR_0+1));
+ addr = plus_constant (stack_pointer_rtx,
+ - (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
+ frame_move_insn (gen_rtx_REG (DImode, GPR_0),
+ gen_frame_mem (DImode, addr));
+ }
+ addr = plus_constant (stack_pointer_rtx,
+ epiphany_stack_offset - (HOST_WIDE_INT) UNITS_PER_WORD);
+ epiphany_emit_save_restore (0, current_frame_info.small_threshold, addr, 1);
+ if (!sibcall_p)
+ {
+ if (interrupt_p)
+ emit_jump_insn (gen_return_internal_interrupt());
+ else
+ emit_jump_insn (gen_return_i ());
+ }
+}
+
+int
+epiphany_initial_elimination_offset (int from, int to)
+{
+ epiphany_compute_frame_size (get_frame_size ());
+ if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ return current_frame_info.total_size - current_frame_info.reg_size;
+ if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
+ return current_frame_info.first_slot_offset - current_frame_info.reg_size;
+ if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ return (current_frame_info.total_size
+ - ((current_frame_info.pretend_size + 4) & -8));
+ if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
+ return (current_frame_info.first_slot_offset
+ - ((current_frame_info.pretend_size + 4) & -8));
+ gcc_unreachable ();
+}
+
+static int
+epiphany_issue_rate (void)
+{
+ return 2;
+}
+
+/* Function to update the integer COST
+ based on the relationship between INSN that is dependent on
+ DEP_INSN through the dependence LINK. The default is to make no
+ adjustment to COST. This can be used for example to specify to
+ the scheduler that an output- or anti-dependence does not incur
+ the same cost as a data-dependence. The return value should be
+ the new value for COST. */
+static int
+epiphany_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
+{
+ if (REG_NOTE_KIND (link) == 0)
+ {
+ rtx dep_set;
+
+ if (recog_memoized (insn) < 0
+ || recog_memoized (dep_insn) < 0)
+ return cost;
+
+ dep_set = single_set (dep_insn);
+
+ /* The latency that we specify in the scheduling description refers
+ to the actual output, not to an auto-increment register; for that,
+ the latency is one. */
+ if (dep_set && MEM_P (SET_SRC (dep_set)) && cost > 1)
+ {
+ rtx set = single_set (insn);
+
+ if (set
+ && !reg_mentioned_p (SET_DEST (dep_set), SET_SRC (set))
+ && (!MEM_P (SET_DEST (set))
+ || !reg_mentioned_p (SET_DEST (dep_set),
+ XEXP (SET_DEST (set), 0))))
+ cost = 1;
+ }
+ }
+ return cost;
+}
+
+#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
+
+#define RTX_OK_FOR_BASE_P(X) \
+ (REG_P (X) && REG_OK_FOR_BASE_P (X))
+
+#define RTX_OK_FOR_INDEX_P(MODE, X) \
+ ((GET_MODE_CLASS (MODE) != MODE_VECTOR_INT \
+ || epiphany_vect_align >= GET_MODE_SIZE (MODE)) \
+ && (REG_P (X) && REG_OK_FOR_INDEX_P (X)))
+
+#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
+(GET_CODE (X) == PLUS \
+ && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
+ && (RTX_OK_FOR_INDEX_P (MODE, XEXP (X, 1)) \
+ || RTX_OK_FOR_OFFSET_P (MODE, XEXP (X, 1))))
+
+static bool
+epiphany_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
+{
+#define REG_OK_FOR_BASE_P(X) \
+ (strict ? GPR_P (REGNO (X)) : GPR_AP_OR_PSEUDO_P (REGNO (X)))
+ if (RTX_OK_FOR_BASE_P (x))
+ return true;
+ if (RTX_FRAME_OFFSET_P (x))
+ return true;
+ if (LEGITIMATE_OFFSET_ADDRESS_P (mode, x))
+ return true;
+ if (TARGET_POST_INC
+ && (GET_CODE (x) == POST_DEC || GET_CODE (x) == POST_INC)
+ && RTX_OK_FOR_BASE_P (XEXP ((x), 0)))
+ return true;
+ if ((TARGET_POST_MODIFY || reload_completed)
+ && GET_CODE (x) == POST_MODIFY
+ && GET_CODE (XEXP ((x), 1)) == PLUS
+ && rtx_equal_p (XEXP ((x), 0), XEXP (XEXP ((x), 1), 0))
+ && LEGITIMATE_OFFSET_ADDRESS_P (mode, XEXP ((x), 1)))
+ return true;
+ if (mode == BLKmode)
+ return true;
+ return false;
+}
+
+static reg_class_t
+epiphany_secondary_reload (bool in_p, rtx x, reg_class_t rclass,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ secondary_reload_info *sri)
+{
+ /* This could give more reload inheritance, but we are missing some
+ reload infrastructure. */
+ if (0)
+ if (in_p && GET_CODE (x) == UNSPEC
+ && satisfies_constraint_Sra (x) && !satisfies_constraint_Rra (x))
+ {
+ gcc_assert (rclass == GENERAL_REGS);
+ sri->icode = CODE_FOR_reload_insi_ra;
+ return NO_REGS;
+ }
+ return NO_REGS;
+}
+
+bool
+epiphany_is_long_call_p (rtx x)
+{
+ tree decl = SYMBOL_REF_DECL (x);
+ bool ret_val = !TARGET_SHORT_CALLS;
+ tree attrs;
+
+ /* ??? Is it safe to default to ret_val if decl is NULL? We should
+ probably encode information via encode_section_info, and also
+ have (an) option(s) to take SYMBOL_FLAG_LOCAL and/or SYMBOL_FLAG_EXTERNAL
+ into account. */
+ if (decl)
+ {
+ attrs = TYPE_ATTRIBUTES (TREE_TYPE (decl));
+ if (lookup_attribute ("long_call", attrs))
+ ret_val = true;
+ else if (lookup_attribute ("short_call", attrs))
+ ret_val = false;
+ }
+ return ret_val;
+}
+
+bool
+epiphany_small16 (rtx x)
+{
+ rtx base = x;
+ rtx offs ATTRIBUTE_UNUSED = const0_rtx;
+
+ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
+ {
+ base = XEXP (XEXP (x, 0), 0);
+ offs = XEXP (XEXP (x, 0), 1);
+ }
+ if (GET_CODE (base) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (base)
+ && epiphany_is_long_call_p (base))
+ return false;
+ return TARGET_SMALL16 != 0;
+}
+
+/* Return nonzero if it is ok to make a tail-call to DECL. */
+static bool
+epiphany_function_ok_for_sibcall (tree decl, tree exp)
+{
+ bool cfun_interrupt_p, call_interrupt_p;
+
+ cfun_interrupt_p = EPIPHANY_INTERRUPT_P (epiphany_compute_function_type
+ (current_function_decl));
+ if (decl)
+ call_interrupt_p = EPIPHANY_INTERRUPT_P (epiphany_compute_function_type (decl));
+ else
+ {
+ tree fn_type = TREE_TYPE (CALL_EXPR_FN (exp));
+
+ gcc_assert (POINTER_TYPE_P (fn_type));
+ fn_type = TREE_TYPE (fn_type);
+ gcc_assert (TREE_CODE (fn_type) == FUNCTION_TYPE
+ || TREE_CODE (fn_type) == METHOD_TYPE);
+ call_interrupt_p
+ = lookup_attribute ("interrupt", TYPE_ATTRIBUTES (fn_type)) != NULL;
+ }
+
+ /* Don't tailcall from or to an ISR routine - although we could in
+ principle tailcall from one ISR routine to another, we'd need to
+ handle this in sibcall_epilogue to make it work. */
+ if (cfun_interrupt_p || call_interrupt_p)
+ return false;
+
+ /* Everything else is ok. */
+ return true;
+}
+
+/* T is a function declaration or the MEM_EXPR of a MEM passed to a call
+ expander.
+ Return true iff the type of T has the uninterruptible attribute.
+ If T is NULL, return false. */
+bool
+epiphany_uninterruptible_p (tree t)
+{
+ tree attrs;
+
+ if (t)
+ {
+ attrs = TYPE_ATTRIBUTES (TREE_TYPE (t));
+ if (lookup_attribute ("disinterrupt", attrs))
+ return true;
+ }
+ return false;
+}
+
+bool
+epiphany_call_uninterruptible_p (rtx mem)
+{
+ rtx addr = XEXP (mem, 0);
+ tree t = NULL_TREE;
+
+ if (GET_CODE (addr) == SYMBOL_REF)
+ t = SYMBOL_REF_DECL (addr);
+ if (!t)
+ t = MEM_EXPR (mem);
+ return epiphany_uninterruptible_p (t);
+}
+
+static enum machine_mode
+epiphany_promote_function_mode (const_tree type, enum machine_mode mode,
+ int *punsignedp ATTRIBUTE_UNUSED,
+ const_tree funtype ATTRIBUTE_UNUSED,
+ int for_return ATTRIBUTE_UNUSED)
+{
+ int dummy;
+
+ return promote_mode (type, mode, &dummy);
+}
+
+static void
+epiphany_conditional_register_usage (void)
+{
+ int i;
+
+ if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
+ {
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
+ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
+ }
+ if (TARGET_HALF_REG_FILE)
+ {
+ for (i = 32; i <= 63; i++)
+ {
+ fixed_regs[i] = 1;
+ call_used_regs[i] = 1;
+ }
+ }
+ if (epiphany_m1reg >= 0)
+ {
+ fixed_regs[epiphany_m1reg] = 1;
+ call_used_regs[epiphany_m1reg] = 1;
+ }
+ if (!TARGET_PREFER_SHORT_INSN_REGS)
+ CLEAR_HARD_REG_SET (reg_class_contents[SHORT_INSN_REGS]);
+ COPY_HARD_REG_SET (reg_class_contents[SIBCALL_REGS],
+ reg_class_contents[GENERAL_REGS]);
+ /* It would be simpler and quicker if we could just use
+ AND_COMPL_HARD_REG_SET, alas, call_used_reg_set is yet uninitialized;
+ it is set up later by our caller. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (!call_used_regs[i])
+ CLEAR_HARD_REG_BIT (reg_class_contents[SIBCALL_REGS], i);
+}
+
+/* Determine where to put an argument to a function.
+ Value is zero to push the argument on the stack,
+ or a hard register in which to store the argument.
+
+ MODE is the argument's machine mode.
+ TYPE is the data type of the argument (as a tree).
+ This is null for libcalls where that information may
+ not be available.
+ CUM is a variable of type CUMULATIVE_ARGS which gives info about
+ the preceding args and about the function being called.
+ NAMED is nonzero if this argument is a named parameter
+ (otherwise it is an extra parameter matching an ellipsis). */
+/* On the EPIPHANY the first MAX_EPIPHANY_PARM_REGS args are normally in
+ registers and the rest are pushed. */
+static rtx
+epiphany_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
+{
+ CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v);
+
+ if (PASS_IN_REG_P (cum, mode, type))
+ return gen_rtx_REG (mode, ROUND_ADVANCE_CUM (cum, mode, type));
+ return 0;
+}
+
+/* Update the data in CUM to advance over an argument
+ of mode MODE and data type TYPE.
+ (TYPE is null for libcalls where that information may not be available.) */
+static void
+epiphany_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
+{
+ CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
+
+ *cum = ROUND_ADVANCE_CUM (*cum, mode, type) + ROUND_ADVANCE_ARG (mode, type);
+}
+
+/* Nested function support.
+ An epiphany trampoline looks like this:
+ mov r16,%low(fnaddr)
+ movt r16,%high(fnaddr)
+ mov ip,%low(cxt)
+ movt ip,%high(cxt)
+ jr r16 */
+
+#define EPIPHANY_LOW_RTX(X) \
+ (gen_rtx_IOR (SImode, \
+ gen_rtx_ASHIFT (SImode, \
+ gen_rtx_AND (SImode, (X), GEN_INT (0xff)), GEN_INT (5)), \
+ gen_rtx_ASHIFT (SImode, \
+ gen_rtx_AND (SImode, (X), GEN_INT (0xff00)), GEN_INT (12))))
+#define EPIPHANY_HIGH_RTX(X) \
+ EPIPHANY_LOW_RTX (gen_rtx_LSHIFTRT (SImode, (X), GEN_INT (16)))
+
+/* Emit RTL insns to initialize the variable parts of a trampoline.
+ FNADDR is an RTX for the address of the function's pure code.
+ CXT is an RTX for the static chain value for the function. */
+static void
+epiphany_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
+
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)),
+ gen_rtx_IOR (SImode, GEN_INT (0x4002000b),
+ EPIPHANY_LOW_RTX (fnaddr)));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ gen_rtx_IOR (SImode, GEN_INT (0x5002000b),
+ EPIPHANY_HIGH_RTX (fnaddr)));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ gen_rtx_IOR (SImode, GEN_INT (0x2002800b),
+ EPIPHANY_LOW_RTX (cxt)));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ gen_rtx_IOR (SImode, GEN_INT (0x3002800b),
+ EPIPHANY_HIGH_RTX (cxt)));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 16)),
+ GEN_INT (0x0802014f));
+}
+
+bool
+epiphany_optimize_mode_switching (int entity)
+{
+ if (MACHINE_FUNCTION (cfun)->sw_entities_processed & (1 << entity))
+ return false;
+ switch (entity)
+ {
+ case EPIPHANY_MSW_ENTITY_AND:
+ case EPIPHANY_MSW_ENTITY_OR:
+ return true;
+ case EPIPHANY_MSW_ENTITY_NEAREST:
+ case EPIPHANY_MSW_ENTITY_TRUNC:
+ return optimize > 0;
+ case EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN:
+ return MACHINE_FUNCTION (cfun)->unknown_mode_uses != 0;
+ case EPIPHANY_MSW_ENTITY_ROUND_KNOWN:
+ return (MACHINE_FUNCTION (cfun)->sw_entities_processed
+ & (1 << EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN)) != 0;
+ case EPIPHANY_MSW_ENTITY_FPU_OMNIBUS:
+ return optimize == 0 || current_pass == &pass_mode_switch_use.pass;
+ }
+ gcc_unreachable ();
+}
+
+int
+epiphany_mode_priority_to_mode (int entity, unsigned priority)
+{
+ if (entity == EPIPHANY_MSW_ENTITY_AND || entity == EPIPHANY_MSW_ENTITY_OR)
+ return priority;
+ if (priority > 3)
+ switch (priority)
+ {
+ case 4: return FP_MODE_ROUND_UNKNOWN;
+ case 5: return FP_MODE_NONE;
+ default: gcc_unreachable ();
+ }
+ switch ((enum attr_fp_mode) epiphany_normal_fp_mode)
+ {
+ case FP_MODE_INT:
+ switch (priority)
+ {
+ case 0: return FP_MODE_INT;
+ case 1: return epiphany_normal_fp_rounding;
+ case 2: return (epiphany_normal_fp_rounding == FP_MODE_ROUND_NEAREST
+ ? FP_MODE_ROUND_TRUNC : FP_MODE_ROUND_NEAREST);
+ case 3: return FP_MODE_CALLER;
+ }
+ case FP_MODE_ROUND_NEAREST:
+ case FP_MODE_CALLER:
+ switch (priority)
+ {
+ case 0: return FP_MODE_ROUND_NEAREST;
+ case 1: return FP_MODE_ROUND_TRUNC;
+ case 2: return FP_MODE_INT;
+ case 3: return FP_MODE_CALLER;
+ }
+ case FP_MODE_ROUND_TRUNC:
+ switch (priority)
+ {
+ case 0: return FP_MODE_ROUND_TRUNC;
+ case 1: return FP_MODE_ROUND_NEAREST;
+ case 2: return FP_MODE_INT;
+ case 3: return FP_MODE_CALLER;
+ }
+ case FP_MODE_ROUND_UNKNOWN:
+ case FP_MODE_NONE:
+ gcc_unreachable ();
+ }
+ gcc_unreachable ();
+}
+
+int
+epiphany_mode_needed (int entity, rtx insn)
+{
+ enum attr_fp_mode mode;
+
+ if (recog_memoized (insn) < 0)
+ {
+ if (entity == EPIPHANY_MSW_ENTITY_AND
+ || entity == EPIPHANY_MSW_ENTITY_OR)
+ return 2;
+ return FP_MODE_NONE;
+ }
+ mode = get_attr_fp_mode (insn);
+
+ switch (entity)
+ {
+ case EPIPHANY_MSW_ENTITY_AND:
+ return mode != FP_MODE_INT ? 1 : 2;
+ case EPIPHANY_MSW_ENTITY_OR:
+ return mode == FP_MODE_INT ? 1 : 2;
+ case EPIPHANY_MSW_ENTITY_ROUND_KNOWN:
+ if (recog_memoized (insn) == CODE_FOR_set_fp_mode)
+ mode = (enum attr_fp_mode) epiphany_mode_after (entity, mode, insn);
+ /* Fall through. */
+ case EPIPHANY_MSW_ENTITY_NEAREST:
+ case EPIPHANY_MSW_ENTITY_TRUNC:
+ if (mode == FP_MODE_ROUND_UNKNOWN)
+ {
+ MACHINE_FUNCTION (cfun)->unknown_mode_uses++;
+ return FP_MODE_NONE;
+ }
+ return mode;
+ case EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN:
+ if (mode == FP_MODE_ROUND_NEAREST || mode == FP_MODE_ROUND_TRUNC)
+ return FP_MODE_ROUND_UNKNOWN;
+ return mode;
+ case EPIPHANY_MSW_ENTITY_FPU_OMNIBUS:
+ if (mode == FP_MODE_ROUND_UNKNOWN)
+ return epiphany_normal_fp_rounding;
+ return mode;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+int
+epiphany_mode_entry_exit (int entity, bool exit)
+{
+ int normal_mode = epiphany_normal_fp_mode ;
+
+ MACHINE_FUNCTION (cfun)->sw_entities_processed |= (1 << entity);
+ if (epiphany_is_interrupt_p (current_function_decl))
+ normal_mode = FP_MODE_CALLER;
+ switch (entity)
+ {
+ case EPIPHANY_MSW_ENTITY_AND:
+ if (exit)
+ return normal_mode != FP_MODE_INT ? 1 : 2;
+ return 0;
+ case EPIPHANY_MSW_ENTITY_OR:
+ if (exit)
+ return normal_mode == FP_MODE_INT ? 1 : 2;
+ return 0;
+ case EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN:
+ if (normal_mode == FP_MODE_ROUND_NEAREST
+ || normal_mode == FP_MODE_ROUND_TRUNC)
+ return FP_MODE_ROUND_UNKNOWN;
+ /* Fall through. */
+ case EPIPHANY_MSW_ENTITY_NEAREST:
+ case EPIPHANY_MSW_ENTITY_TRUNC:
+ case EPIPHANY_MSW_ENTITY_ROUND_KNOWN:
+ case EPIPHANY_MSW_ENTITY_FPU_OMNIBUS:
+ return normal_mode;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+int
+epiphany_mode_after (int entity, int last_mode, rtx insn)
+{
+ /* We have too few call-saved registers to hope to keep the masks across
+ calls. */
+ if (entity == EPIPHANY_MSW_ENTITY_AND || entity == EPIPHANY_MSW_ENTITY_OR)
+ {
+ if (GET_CODE (insn) == CALL_INSN)
+ return 0;
+ return last_mode;
+ }
+ if (recog_memoized (insn) < 0)
+ return last_mode;
+ if (get_attr_fp_mode (insn) == FP_MODE_ROUND_UNKNOWN
+ && last_mode != FP_MODE_ROUND_NEAREST && last_mode != FP_MODE_ROUND_TRUNC)
+ {
+ if (entity == EPIPHANY_MSW_ENTITY_NEAREST)
+ return FP_MODE_ROUND_NEAREST;
+ if (entity == EPIPHANY_MSW_ENTITY_TRUNC)
+ return FP_MODE_ROUND_TRUNC;
+ }
+ if (recog_memoized (insn) == CODE_FOR_set_fp_mode)
+ {
+ rtx src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
+ int fp_mode;
+
+ if (REG_P (src))
+ return FP_MODE_CALLER;
+ fp_mode = INTVAL (XVECEXP (XEXP (src, 0), 0, 0));
+ if (entity == EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN
+ && (fp_mode == FP_MODE_ROUND_NEAREST
+ || fp_mode == EPIPHANY_MSW_ENTITY_TRUNC))
+ return FP_MODE_ROUND_UNKNOWN;
+ return fp_mode;
+ }
+ return last_mode;
+}
+
+void
+emit_set_fp_mode (int entity, int mode, HARD_REG_SET regs_live ATTRIBUTE_UNUSED)
+{
+ rtx save_cc, cc_reg, mask, src, src2;
+ enum attr_fp_mode fp_mode;
+
+ if (!MACHINE_FUNCTION (cfun)->and_mask)
+ {
+ MACHINE_FUNCTION (cfun)->and_mask = gen_reg_rtx (SImode);
+ MACHINE_FUNCTION (cfun)->or_mask = gen_reg_rtx (SImode);
+ }
+ if (entity == EPIPHANY_MSW_ENTITY_AND)
+ {
+ gcc_assert (mode >= 0 && mode <= 2);
+ if (mode == 1)
+ emit_move_insn (MACHINE_FUNCTION (cfun)->and_mask,
+ gen_int_mode (0xfff1fffe, SImode));
+ return;
+ }
+ else if (entity == EPIPHANY_MSW_ENTITY_OR)
+ {
+ gcc_assert (mode >= 0 && mode <= 2);
+ if (mode == 1)
+ emit_move_insn (MACHINE_FUNCTION (cfun)->or_mask, GEN_INT(0x00080000));
+ return;
+ }
+ fp_mode = (enum attr_fp_mode) mode;
+ src = NULL_RTX;
+
+ switch (fp_mode)
+ {
+ case FP_MODE_CALLER:
+ src = get_hard_reg_initial_val (SImode, CONFIG_REGNUM);
+ mask = MACHINE_FUNCTION (cfun)->and_mask;
+ break;
+ case FP_MODE_ROUND_UNKNOWN:
+ MACHINE_FUNCTION (cfun)->unknown_mode_sets++;
+ mask = MACHINE_FUNCTION (cfun)->and_mask;
+ break;
+ case FP_MODE_ROUND_NEAREST:
+ if (entity == EPIPHANY_MSW_ENTITY_TRUNC)
+ return;
+ mask = MACHINE_FUNCTION (cfun)->and_mask;
+ break;
+ case FP_MODE_ROUND_TRUNC:
+ if (entity == EPIPHANY_MSW_ENTITY_NEAREST)
+ return;
+ mask = MACHINE_FUNCTION (cfun)->and_mask;
+ break;
+ case FP_MODE_INT:
+ mask = MACHINE_FUNCTION (cfun)->or_mask;
+ break;
+ case FP_MODE_NONE:
+ default:
+ gcc_unreachable ();
+ }
+ save_cc = gen_reg_rtx (CCmode);
+ cc_reg = gen_rtx_REG (CCmode, CC_REGNUM);
+ emit_move_insn (save_cc, cc_reg);
+ mask = force_reg (SImode, mask);
+ if (!src)
+ {
+ rtvec v = gen_rtvec (1, GEN_INT (fp_mode));
+
+ src = gen_rtx_CONST (SImode, gen_rtx_UNSPEC (SImode, v, UNSPEC_FP_MODE));
+ }
+ if (entity == EPIPHANY_MSW_ENTITY_ROUND_KNOWN
+ || entity == EPIPHANY_MSW_ENTITY_FPU_OMNIBUS)
+ src2 = copy_rtx (src);
+ else
+ {
+ rtvec v = gen_rtvec (1, GEN_INT (FP_MODE_ROUND_UNKNOWN));
+
+ src2 = gen_rtx_CONST (SImode, gen_rtx_UNSPEC (SImode, v, UNSPEC_FP_MODE));
+ }
+ emit_insn (gen_set_fp_mode (src, src2, mask));
+ emit_move_insn (cc_reg, save_cc);
+}
+
+void
+epiphany_expand_set_fp_mode (rtx *operands)
+{
+ rtx ctrl = gen_rtx_REG (SImode, CONFIG_REGNUM);
+ rtx src = operands[0];
+ rtx mask_reg = operands[2];
+ rtx scratch = operands[3];
+ enum attr_fp_mode fp_mode;
+
+
+ gcc_assert (rtx_equal_p (src, operands[1])
+ /* Sometimes reload gets silly and reloads the same pseudo
+ into different registers. */
+ || (REG_P (src) && REG_P (operands[1])));
+
+ if (!epiphany_uninterruptible_p (current_function_decl))
+ emit_insn (gen_gid ());
+ emit_move_insn (scratch, ctrl);
+
+ if (GET_CODE (src) == REG)
+ {
+ /* FP_MODE_CALLER */
+ emit_insn (gen_xorsi3 (scratch, scratch, src));
+ emit_insn (gen_andsi3 (scratch, scratch, mask_reg));
+ emit_insn (gen_xorsi3 (scratch, scratch, src));
+ }
+ else
+ {
+ gcc_assert (GET_CODE (src) == CONST);
+ src = XEXP (src, 0);
+ fp_mode = (enum attr_fp_mode) INTVAL (XVECEXP (src, 0, 0));
+ switch (fp_mode)
+ {
+ case FP_MODE_ROUND_NEAREST:
+ emit_insn (gen_andsi3 (scratch, scratch, mask_reg));
+ break;
+ case FP_MODE_ROUND_TRUNC:
+ emit_insn (gen_andsi3 (scratch, scratch, mask_reg));
+ emit_insn (gen_add2_insn (scratch, const1_rtx));
+ break;
+ case FP_MODE_INT:
+ emit_insn (gen_iorsi3 (scratch, scratch, mask_reg));
+ break;
+ case FP_MODE_CALLER:
+ case FP_MODE_ROUND_UNKNOWN:
+ case FP_MODE_NONE:
+ gcc_unreachable ();
+ }
+ }
+ emit_move_insn (ctrl, scratch);
+ if (!epiphany_uninterruptible_p (current_function_decl))
+ emit_insn (gen_gie ());
+}
+
+void
+epiphany_insert_mode_switch_use (rtx insn,
+ int entity ATTRIBUTE_UNUSED,
+ int mode ATTRIBUTE_UNUSED)
+{
+ rtx pat = PATTERN (insn);
+ rtvec v;
+ int len, i;
+ rtx near = gen_rtx_REG (SImode, FP_NEAREST_REGNUM);
+ rtx trunc = gen_rtx_REG (SImode, FP_TRUNCATE_REGNUM);
+
+ if (entity != EPIPHANY_MSW_ENTITY_FPU_OMNIBUS)
+ return;
+ switch ((enum attr_fp_mode) get_attr_fp_mode (insn))
+ {
+ case FP_MODE_ROUND_NEAREST:
+ near = gen_rtx_USE (VOIDmode, near);
+ trunc = gen_rtx_CLOBBER (VOIDmode, trunc);
+ break;
+ case FP_MODE_ROUND_TRUNC:
+ near = gen_rtx_CLOBBER (VOIDmode, near);
+ trunc = gen_rtx_USE (VOIDmode, trunc);
+ break;
+ case FP_MODE_ROUND_UNKNOWN:
+ near = gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, FP_ANYFP_REGNUM));
+ trunc = copy_rtx (near);
+ /* Fall through. */
+ case FP_MODE_INT:
+ case FP_MODE_CALLER:
+ near = gen_rtx_USE (VOIDmode, near);
+ trunc = gen_rtx_USE (VOIDmode, trunc);
+ break;
+ case FP_MODE_NONE:
+ gcc_unreachable ();
+ }
+ gcc_assert (GET_CODE (pat) == PARALLEL);
+ len = XVECLEN (pat, 0);
+ v = rtvec_alloc (len + 2);
+ for (i = 0; i < len; i++)
+ RTVEC_ELT (v, i) = XVECEXP (pat, 0, i);
+ RTVEC_ELT (v, len) = near;
+ RTVEC_ELT (v, len + 1) = trunc;
+ pat = gen_rtx_PARALLEL (VOIDmode, v);
+ PATTERN (insn) = pat;
+ MACHINE_FUNCTION (cfun)->control_use_inserted = true;
+}
+
+bool
+epiphany_epilogue_uses (int regno)
+{
+ if (regno == GPR_LR)
+ return true;
+ if (reload_completed && epiphany_is_interrupt_p (current_function_decl))
+ {
+ if (fixed_regs[regno]
+ && regno != STATUS_REGNUM && regno != IRET_REGNUM
+ && regno != FP_NEAREST_REGNUM && regno != FP_TRUNCATE_REGNUM)
+ return false;
+ return true;
+ }
+ if (regno == FP_NEAREST_REGNUM
+ && epiphany_normal_fp_mode != FP_MODE_ROUND_TRUNC)
+ return true;
+ if (regno == FP_TRUNCATE_REGNUM
+ && epiphany_normal_fp_mode != FP_MODE_ROUND_NEAREST)
+ return true;
+ return false;
+}
+
+static unsigned int
+epiphany_min_divisions_for_recip_mul (enum machine_mode mode)
+{
+ if (flag_reciprocal_math && mode == SFmode)
+ /* We'll expand into a multiply-by-reciprocal anyway, so we might a well do
+ it already at the tree level and expose it to further optimizations. */
+ return 1;
+ return default_min_divisions_for_recip_mul (mode);
+}
+
+static enum machine_mode
+epiphany_preferred_simd_mode (enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return TARGET_VECT_DOUBLE ? DImode : SImode;
+}
+
+static bool
+epiphany_vector_mode_supported_p (enum machine_mode mode)
+{
+ if (mode == V2SFmode)
+ return true;
+ if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
+ && (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8))
+ return true;
+ return false;
+}
+
+static bool
+epiphany_vector_alignment_reachable (const_tree type, bool is_packed)
+{
+ /* Vectors which aren't in packed structures will not be less aligned than
+ the natural alignment of their element type, so this is safe. */
+ if (TYPE_ALIGN_UNIT (type) == 4)
+ return !is_packed;
+
+ return default_builtin_vector_alignment_reachable (type, is_packed);
+}
+
+static bool
+epiphany_support_vector_misalignment (enum machine_mode mode, const_tree type,
+ int misalignment, bool is_packed)
+{
+ if (GET_MODE_SIZE (mode) == 8 && misalignment % 4 == 0)
+ return true;
+ return default_builtin_support_vector_misalignment (mode, type, misalignment,
+ is_packed);
+}
+
+/* STRUCTURE_SIZE_BOUNDARY seems a bit crude in how it enlarges small
+ structs. Make structs double-word-aligned it they are a double word or
+ (potentially) larger; failing that, do the same for a size of 32 bits. */
+unsigned
+epiphany_special_round_type_align (tree type, unsigned computed,
+ unsigned specified)
+{
+ unsigned align = MAX (computed, specified);
+ tree field;
+ HOST_WIDE_INT total, max;
+ unsigned try_align = FASTEST_ALIGNMENT;
+
+ if (maximum_field_alignment && try_align > maximum_field_alignment)
+ try_align = maximum_field_alignment;
+ if (align >= try_align)
+ return align;
+ for (max = 0, field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
+ {
+ tree offset, size;
+
+ if (TREE_CODE (field) != FIELD_DECL
+ || TREE_TYPE (field) == error_mark_node)
+ continue;
+ offset = bit_position (field);
+ size = DECL_SIZE (field);
+ if (!host_integerp (offset, 1) || !host_integerp (size, 1)
+ || TREE_INT_CST_LOW (offset) >= try_align
+ || TREE_INT_CST_LOW (size) >= try_align)
+ return try_align;
+ total = TREE_INT_CST_LOW (offset) + TREE_INT_CST_LOW (size);
+ if (total > max)
+ max = total;
+ }
+ if (max >= (HOST_WIDE_INT) try_align)
+ align = try_align;
+ else if (try_align > 32 && max >= 32)
+ align = max > 32 ? 64 : 32;
+ return align;
+}
+
+/* Upping the alignment of arrays in structs is not only a performance
+ enhancement, it also helps preserve assumptions about how
+ arrays-at-the-end-of-structs work, like for struct gcov_fn_info in
+ libgcov.c . */
+unsigned
+epiphany_adjust_field_align (tree field, unsigned computed)
+{
+ if (computed == 32
+ && TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE)
+ {
+ tree elmsz = TYPE_SIZE (TREE_TYPE (TREE_TYPE (field)));
+
+ if (!host_integerp (elmsz, 1) || tree_low_cst (elmsz, 1) >= 32)
+ return 64;
+ }
+ return computed;
+}
+
+/* Output code to add DELTA to the first argument, and then jump
+ to FUNCTION. Used for C++ multiple inheritance. */
+static void
+epiphany_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset,
+ tree function)
+{
+ int this_regno
+ = aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function) ? 1 : 0;
+ const char *this_name = reg_names[this_regno];
+ const char *fname;
+
+ /* We use IP and R16 as a scratch registers. */
+ gcc_assert (call_used_regs [GPR_IP]);
+ gcc_assert (call_used_regs [GPR_16]);
+
+ /* Add DELTA. When possible use a plain add, otherwise load it into
+ a register first. */
+ if (delta == 0)
+ ; /* Done. */
+ else if (SIMM11 (delta))
+ asm_fprintf (file, "\tadd\t%s,%s,%d\n", this_name, this_name, (int) delta);
+ else if (delta < 0 && delta >= -0xffff)
+ {
+ asm_fprintf (file, "\tmov\tip,%d\n", (int) -delta);
+ asm_fprintf (file, "\tsub\t%s,%s,ip\n", this_name, this_name);
+ }
+ else
+ {
+ asm_fprintf (file, "\tmov\tip,%%low(%ld)\n", (long) delta);
+ if (delta & ~0xffff)
+ asm_fprintf (file, "\tmovt\tip,%%high(%ld)\n", (long) delta);
+ asm_fprintf (file, "\tadd\t%s,%s,ip\n", this_name, this_name);
+ }
+
+ /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */
+ if (vcall_offset != 0)
+ {
+ /* ldr ip,[this] --> temp = *this
+ ldr ip,[ip,vcall_offset] > temp = *(*this + vcall_offset)
+ add this,this,ip --> this+ = *(*this + vcall_offset) */
+ asm_fprintf (file, "\tldr\tip, [%s]\n", this_name);
+ if (vcall_offset < -0x7ff * 4 || vcall_offset > 0x7ff * 4
+ || (vcall_offset & 3) != 0)
+ {
+ asm_fprintf (file, "\tmov\tr16, %%low(%ld)\n", (long) vcall_offset);
+ asm_fprintf (file, "\tmovt\tr16, %%high(%ld)\n", (long) vcall_offset);
+ asm_fprintf (file, "\tldr\tip, [ip,r16]\n");
+ }
+ else
+ asm_fprintf (file, "\tldr\tip, [ip,%d]\n", (int) vcall_offset / 4);
+ asm_fprintf (file, "\tadd\t%s, %s, ip\n", this_name, this_name);
+ }
+
+ fname = XSTR (XEXP (DECL_RTL (function), 0), 0);
+ if (epiphany_is_long_call_p (XEXP (DECL_RTL (function), 0)))
+ {
+ fputs ("\tmov\tip,%low(", file);
+ assemble_name (file, fname);
+ fputs (")\n\tmovt\tip,%high(", file);
+ assemble_name (file, fname);
+ fputs (")\n\tjr ip\n", file);
+ }
+ else
+ {
+ fputs ("\tb\t", file);
+ assemble_name (file, fname);
+ fputc ('\n', file);
+ }
+}
+
+struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
new file mode 100644
index 00000000000..9d03ee909b8
--- /dev/null
+++ b/gcc/config/epiphany/epiphany.h
@@ -0,0 +1,881 @@
+/* Definitions of target machine for GNU compiler, Argonaut EPIPHANY cpu.
+ Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
+ 2007, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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_EPIPHANY_H
+#define GCC_EPIPHANY_H
+
+#undef LINK_SPEC
+#undef STARTFILE_SPEC
+#undef ENDFILE_SPEC
+#undef SIZE_TYPE
+#undef PTRDIFF_TYPE
+#undef WCHAR_TYPE
+#undef WCHAR_TYPE_SIZE
+
+/* Names to predefine in the preprocessor for this target machine. */
+#define TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__epiphany__"); \
+ builtin_define ("__little_endian__"); \
+ builtin_define_with_int_value ("__EPIPHANY_STACK_OFFSET__", \
+ epiphany_stack_offset); \
+ builtin_assert ("cpu=epiphany"); \
+ builtin_assert ("machine=epiphany"); \
+ } while (0)
+
+/* Pick up the libgloss library. One day we may do this by linker script, but
+ for now its static. */
+#undef LIB_SPEC
+#define LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} -lepiphany"
+
+#define LINK_SPEC "%{v}"
+
+#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s " \
+ "%{mfp-mode=int:crtint.o%s} %{mfp-mode=truncate:crtrunc.o%s} " \
+ "%{m1reg-r43:crtm1reg-r43.o%s} %{m1reg-r63:crtm1reg-r63.o%s} " \
+ "crtbegin.o%s"
+
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX "_"
+
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+ asm (SECTION_OP "\n\
+ mov r0,%low(" USER_LABEL_PREFIX #FUNC")\n\
+ movt r0,%high(" USER_LABEL_PREFIX #FUNC")\n\
+ jalr r0\n\
+ .text");
+
+#if 0 /* We would like to use Posix for profiling, but the simulator
+ interface still lacks mkdir. */
+#define TARGET_POSIX_IO
+#endif
+
+/* Target machine storage layout. */
+
+/* Define this if most significant bit is lowest numbered
+ in instructions that operate on numbered bit-fields. */
+#define BITS_BIG_ENDIAN 0
+
+/* Define this if most significant byte of a word is the lowest numbered. */
+#define BYTES_BIG_ENDIAN 0
+
+/* Define this if most significant word of a multiword number is the lowest
+ numbered. */
+#define WORDS_BIG_ENDIAN 0
+
+/* Width of a word, in units (bytes). */
+#define UNITS_PER_WORD 4
+
+/* Define this macro if it is advisable to hold scalars in registers
+ in a wider mode than that declared by the program. In such cases,
+ the value is constrained to be within the bounds of the declared
+ type, but kept valid in the wider mode. The signedness of the
+ extension may differ from that of the type. */
+/* It is far faster to zero extend chars than to sign extend them */
+
+#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
+ if (GET_MODE_CLASS (MODE) == MODE_INT \
+ && GET_MODE_SIZE (MODE) < 4) \
+ { \
+ if (MODE == QImode) \
+ UNSIGNEDP = 1; \
+ else if (MODE == HImode) \
+ UNSIGNEDP = 1; \
+ (MODE) = SImode; \
+ }
+
+/* Allocation boundary (in *bits*) for storing arguments in argument list. */
+#define PARM_BOUNDARY 32
+
+/* Boundary (in *bits*) on which stack pointer should be aligned. */
+#define STACK_BOUNDARY 64
+
+/* ALIGN FRAMES on word boundaries */
+#define EPIPHANY_STACK_ALIGN(LOC) (((LOC)+7) & ~7)
+
+/* Allocation boundary (in *bits*) for the code of a function. */
+#define FUNCTION_BOUNDARY 32
+
+/* Every structure's size must be a multiple of this. */
+#define STRUCTURE_SIZE_BOUNDARY 8
+
+/* A bit-field declared as `int' forces `int' alignment for the struct. */
+#define PCC_BITFIELD_TYPE_MATTERS 1
+
+/* No data type wants to be aligned rounder than this. */
+/* This is bigger than currently necessary for the EPIPHANY. If 8 byte floats are
+ ever added it's not clear whether they'll need such alignment or not. For
+ now we assume they will. We can always relax it if necessary but the
+ reverse isn't true. */
+#define BIGGEST_ALIGNMENT 64
+
+/* The best alignment to use in cases where we have a choice. */
+#define FASTEST_ALIGNMENT 64
+
+#define MALLOC_ABI_ALIGNMENT BIGGEST_ALIGNMENT
+
+/* Make strings dword-aligned so strcpy from constants will be faster. */
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ ((TREE_CODE (EXP) == STRING_CST \
+ && (ALIGN) < FASTEST_ALIGNMENT) \
+ ? FASTEST_ALIGNMENT : (ALIGN))
+
+/* Make arrays of chars dword-aligned for the same reasons.
+ Also, align arrays of SImode items. */
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+ (TREE_CODE (TYPE) == ARRAY_TYPE \
+ && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
+ && (ALIGN) < FASTEST_ALIGNMENT \
+ ? FASTEST_ALIGNMENT \
+ : (TREE_CODE (TYPE) == ARRAY_TYPE \
+ && TYPE_MODE (TREE_TYPE (TYPE)) == SImode \
+ && (ALIGN) < FASTEST_ALIGNMENT) \
+ ? FASTEST_ALIGNMENT \
+ : (ALIGN))
+
+/* Set this nonzero if move instructions will actually fail to work
+ when given unaligned data. */
+/* On the EPIPHANY the lower address bits are masked to 0 as necessary. The chip
+ won't croak when given an unaligned address, but the insn will still fail
+ to produce the correct result. */
+#define STRICT_ALIGNMENT 1
+
+/* layout_type overrides our ADJUST_ALIGNMENT settings from epiphany-modes.def
+ for vector modes, so we have to override it back. */
+#define ROUND_TYPE_ALIGN(TYPE, MANGLED_ALIGN, SPECIFIED_ALIGN) \
+ (TREE_CODE (TYPE) == VECTOR_TYPE && !TYPE_USER_ALIGN (TYPE) \
+ && SPECIFIED_ALIGN <= GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
+ ? GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
+ : ((TREE_CODE (TYPE) == RECORD_TYPE \
+ || TREE_CODE (TYPE) == UNION_TYPE \
+ || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
+ && !TYPE_PACKED (TYPE)) \
+ ? epiphany_special_round_type_align ((TYPE), (MANGLED_ALIGN), \
+ (SPECIFIED_ALIGN)) \
+ : MAX ((MANGLED_ALIGN), (SPECIFIED_ALIGN)))
+
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+ epiphany_adjust_field_align((FIELD), (COMPUTED))
+
+/* Layout of source language data types. */
+
+#define SHORT_TYPE_SIZE 16
+#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 64
+#define LONG_DOUBLE_TYPE_SIZE 64
+
+/* Define this as 1 if `char' should by default be signed; else as 0. */
+#define DEFAULT_SIGNED_CHAR 0
+
+#define SIZE_TYPE "long unsigned int"
+#define PTRDIFF_TYPE "long int"
+#define WCHAR_TYPE "unsigned int"
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+/* Standard register usage. */
+
+/* Number of actual hardware registers.
+ The hardware registers are assigned numbers for the compiler
+ from 0 to just below FIRST_PSEUDO_REGISTER.
+ All registers that the compiler knows about must be given numbers,
+ even those that are not normally considered general registers. */
+
+#define FIRST_PSEUDO_REGISTER 78
+
+
+/* General purpose registers. */
+#define GPR_FIRST 0 /* First gpr */
+
+#define PIC_REGNO (GPR_FIRST + 28) /* PIC register. */
+#define GPR_LAST (GPR_FIRST + 63) /* Last gpr */
+#define CORE_CONTROL_FIRST CONFIG_REGNUM
+#define CORE_CONTROL_LAST IRET_REGNUM
+
+#define GPR_P(R) IN_RANGE (R, GPR_FIRST, GPR_LAST)
+#define GPR_OR_AP_P(R) (GPR_P (R) || (R) == ARG_POINTER_REGNUM)
+
+#define GPR_OR_PSEUDO_P(R) (GPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
+#define GPR_AP_OR_PSEUDO_P(R) (GPR_OR_AP_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
+
+#define FIXED_REGISTERS \
+{ /* Integer Registers */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 000-007, gr0 - gr7 */ \
+ 0, 0, 0, 0, 0, 1, 0, 0, /* 008-015, gr8 - gr15 */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 016-023, gr16 - gr23 */ \
+ 0, 0, 0, 0, 1, 1, 1, 1, /* 024-031, gr24 - gr31 */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 032-039, gr32 - gr39 */ \
+ 1, 1, 1, 1, 0, 0, 0, 0, /* 040-047, gr40 - gr47 */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 048-055, gr48 - gr55 */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 056-063, gr56 - gr63 */ \
+ /* Other registers */ \
+ 1, /* 64 AP - fake arg ptr */ \
+ 1, /* soft frame pointer */ \
+ 1, /* CC_REGNUM - integer conditions */\
+ 1, /* CCFP_REGNUM - fp conditions */\
+ 1, 1, 1, 1, 1, 1, /* Core Control Registers. */ \
+ 1, 1, 1, /* FP_{NEAREST,...}_REGNUM */\
+ 1, /* UNKNOWN_REGNUM - placeholder. */\
+}
+
+/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
+ general) by function calls as well as for fixed registers. This macro
+ therefore identifies the registers that are not available for general
+ allocation of values that must live across function calls.
+
+ If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
+ saves it on function entry and restores it on function exit, if the register
+ is used within the function. */
+
+#define CALL_USED_REGISTERS \
+{ /* Integer Registers */ \
+ 1, 1, 1, 1, 0, 0, 0, 0, /* 000-007, gr0 - gr7 */ \
+ 0, 0, 0, 0, 1, 1, 1, 0, /* 008-015, gr8 - gr15 */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 016-023, gr16 - gr23 */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 024-031, gr24 - gr31 */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 032-039, gr32 - gr38 */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 040-047, gr40 - gr47 */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 048-055, gr48 - gr55 */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 056-063, gr56 - gr63 */ \
+ 1, /* 64 AP - fake arg ptr */ \
+ 1, /* soft frame pointer */ \
+ 1, /* 66 CC_REGNUM */ \
+ 1, /* 67 CCFP_REGNUM */ \
+ 1, 1, 1, 1, 1, 1, /* Core Control Registers. */ \
+ 1, 1, 1, /* FP_{NEAREST,...}_REGNUM */\
+ 1, /* UNKNOWN_REGNUM - placeholder. */\
+}
+
+#define REG_ALLOC_ORDER \
+ { \
+ 0, 1, 2, 3, /* Caller-saved 'small' registers. */ \
+ 12, /* Caller-saved unpaired register. */ \
+ /* Caller-saved registers. */ \
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, \
+ 44, 45, 46, 47, \
+ 48, 49, 50, 51, 52, 53, 54, 55, \
+ 56, 57, 58, 59, 60, 61, 62, 63, \
+ 4, 5, 6, 7, /* Calle-saved 'small' registers. */ \
+ 15, /* Calle-saved unpaired register. */ \
+ 8, 9, 10, 11, /* Calle-saved registers. */ \
+ 32, 33, 34, 35, 36, 37, 38, 39, \
+ 14, 13, /* Link register, stack pointer. */ \
+ 40, 41, 42, 43, /* Usually constant, but might be made callee-saved. */ \
+ /* Can't allocate, but must name these... */ \
+ 28, 29, 30, 31, \
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 \
+ }
+
+/* Return number of consecutive hard regs needed starting at reg REGNO
+ to hold something of mode MODE.
+ This is ordinarily the length in words of a value of mode MODE
+ but can be less for certain modes in special long registers. */
+#define HARD_REGNO_NREGS(REGNO, MODE) \
+((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+
+/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
+extern const unsigned int epiphany_hard_regno_mode_ok[];
+extern unsigned int epiphany_mode_class[];
+#define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE))
+
+/* A C expression that is nonzero if it is desirable to choose
+ register allocation so as to avoid move instructions between a
+ value of mode MODE1 and a value of mode MODE2.
+
+ If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
+ MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
+ MODE2)' must be zero. */
+
+#define MODES_TIEABLE_P(MODE1, MODE2) 1
+
+/* Register classes and constants. */
+
+/* Define the classes of registers for register constraints in the
+ machine description. Also define ranges of constants.
+
+ One of the classes must always be named ALL_REGS and include all hard regs.
+ If there is more than one class, another class must be named NO_REGS
+ and contain no registers.
+
+ The name GENERAL_REGS must be the name of a class (or an alias for
+ another name such as ALL_REGS). This is the class of registers
+ that is allowed by "g" or "r" in a register constraint.
+ Also, registers outside this class are allocated only when
+ instructions express preferences for them.
+
+ The classes must be numbered in nondecreasing order; that is,
+ a larger-numbered class must never be contained completely
+ in a smaller-numbered class.
+
+ For any two classes, it is very desirable that there be another
+ class that represents their union.
+
+ It is important that any condition codes have class NO_REGS.
+ See `register_operand'. */
+
+enum reg_class {
+ NO_REGS,
+ LR_REGS,
+ SHORT_INSN_REGS,
+ SIBCALL_REGS,
+ GENERAL_REGS,
+ CORE_CONTROL_REGS,
+ ALL_REGS,
+ LIM_REG_CLASSES
+};
+
+#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
+
+/* Give names of register classes as strings for dump file. */
+#define REG_CLASS_NAMES \
+{ \
+ "NO_REGS", \
+ "LR_REGS", \
+ "SHORT_INSN_REGS", \
+ "SIBCALL_REGS", \
+ "GENERAL_REGS", \
+ "CORE_CONTROL_REGS", \
+ "ALL_REGS" \
+}
+
+/* Define which registers fit in which classes.
+ This is an initializer for a vector of HARD_REG_SET
+ of length N_REG_CLASSES. */
+
+#define REG_CLASS_CONTENTS \
+{ /* r0-r31 r32-r63 ap/sfp/cc1/cc2/iret/status */ \
+ { 0x00000000,0x00000000,0x0}, /* NO_REGS */ \
+ { 0x00004000,0x00000000,0x0}, /* LR_REGS */ \
+ { 0x000000ff,0x00000000,0x0}, /* SHORT_INSN_REGS */ \
+ { 0xffff100f,0xffffff00,0x0}, /* SIBCALL_REGS */ \
+ { 0xffffffff,0xffffffff,0x0003}, /* GENERAL_REGS */ \
+ { 0x00000000,0x00000000,0x03f0}, /* CORE_CONTROL_REGS */ \
+ { 0xffffffff,0xffffffff,0x3fff}, /* ALL_REGS */ \
+}
+
+
+/* The same information, inverted:
+ Return the class number of the smallest class containing
+ reg number REGNO. This could be a conditional expression
+ or could index an array. */
+extern enum reg_class epiphany_regno_reg_class[FIRST_PSEUDO_REGISTER];
+#define REGNO_REG_CLASS(REGNO) \
+(epiphany_regno_reg_class[REGNO])
+
+/* The class value for index registers, and the one for base regs. */
+#define BASE_REG_CLASS GENERAL_REGS
+#define INDEX_REG_CLASS GENERAL_REGS
+
+/* These assume that REGNO is a hard or pseudo reg number.
+ They give nonzero only if REGNO is a hard reg of the suitable class
+ or a pseudo reg currently allocated to a suitable hard reg.
+ Since they use reg_renumber, they are safe only once reg_renumber
+ has been allocated, which happens in local-alloc.c. */
+#define REGNO_OK_FOR_BASE_P(REGNO) \
+((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
+#define REGNO_OK_FOR_INDEX_P(REGNO) \
+((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
+
+
+
+/* Given an rtx X being reloaded into a reg required to be
+ in class CLASS, return the class of reg to actually use.
+ In general this is just CLASS; but on some machines
+ in some cases it is preferable to use a more restrictive class. */
+#define PREFERRED_RELOAD_CLASS(X,CLASS) \
+(CLASS)
+
+/* Return the maximum number of consecutive registers
+ needed to represent mode MODE in a register of class CLASS. */
+#define CLASS_MAX_NREGS(CLASS, MODE) \
+((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+
+/* The letters I, J, K, L, M, N, O, P in a register constraint string
+ can be used to stand for particular ranges of immediate operands.
+ This macro defines what the ranges are.
+ C is the letter, and VALUE is a constant value.
+ Return 1 if VALUE is in the range specified by C. */
+
+/* 'I' is used for 16 bit unsigned.
+ 'Cal' is used for long immediates (32 bits)
+ 'K' is used for any constant up to 5 bits.
+ 'L' is used for any 11 bit signed.
+*/
+
+#define IMM16(X) (IN_RANGE ((X), 0, 0xFFFF))
+#define SIMM16(X) (IN_RANGE ((X), -65536, 65535))
+#define SIMM11(X) (IN_RANGE ((X), -1024, 1023))
+#define IMM5(X) (IN_RANGE ((X), 0, 0x1F))
+
+typedef struct GTY (()) machine_function
+{
+ unsigned args_parsed : 1;
+ unsigned pretend_args_odd : 1;
+ unsigned lr_clobbered : 1;
+ unsigned control_use_inserted : 1;
+ unsigned sw_entities_processed : 6;
+ long lr_slot_offset;
+ rtx and_mask;
+ rtx or_mask;
+ unsigned unknown_mode_uses;
+ unsigned unknown_mode_sets;
+} machine_function_t;
+
+#define MACHINE_FUNCTION(fun) (fun)->machine
+
+#define INIT_EXPANDERS epiphany_init_expanders ()
+
+/* Stack layout and stack pointer usage. */
+
+/* Define this macro if pushing a word onto the stack moves the stack
+ pointer to a smaller address. */
+#define STACK_GROWS_DOWNWARD
+
+/* Define this to nonzero if the nominal address of the stack frame
+ is at the high-address end of the local variables;
+ that is, each additional local variable allocated
+ goes at a more negative offset in the frame. */
+#define FRAME_GROWS_DOWNWARD 1
+
+/* Offset within stack frame to start allocating local variables at.
+ If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
+ first local allocated. Otherwise, it is the offset to the BEGINNING
+ of the first local allocated. */
+#define STARTING_FRAME_OFFSET epiphany_stack_offset
+
+/* Offset from the stack pointer register to the first location at which
+ outgoing arguments are placed. */
+#define STACK_POINTER_OFFSET epiphany_stack_offset
+
+/* Offset of first parameter from the argument pointer register value. */
+/* 4 bytes for each of previous fp, return address, and previous gp.
+ 4 byte reserved area for future considerations. */
+#define FIRST_PARM_OFFSET(FNDECL) \
+ (epiphany_stack_offset \
+ + (MACHINE_FUNCTION (DECL_STRUCT_FUNCTION (FNDECL))->pretend_args_odd \
+ ? 4 : 0))
+
+#define INCOMING_FRAME_SP_OFFSET epiphany_stack_offset
+
+/* Register to use for pushing function arguments. */
+#define STACK_POINTER_REGNUM GPR_SP
+
+/* Base register for access to local variables of the function. */
+#define HARD_FRAME_POINTER_REGNUM GPR_FP
+
+/* Register in which static-chain is passed to a function. This must
+ not be a register used by the prologue. */
+#define STATIC_CHAIN_REGNUM GPR_IP
+
+/* Define the offset between two registers, one to be eliminated, and the other
+ its replacement, at the start of a routine. */
+
+#define ELIMINABLE_REGS \
+{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
+ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
+}
+
+/* Define the offset between two registers, one to be eliminated, and the other
+ its replacement, at the start of a routine. */
+
+#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+ ((OFFSET) = epiphany_initial_elimination_offset ((FROM), (TO)))
+
+/* Function argument passing. */
+
+/* If defined, the maximum amount of space required for outgoing
+ arguments will be computed and placed into the variable
+ `current_function_outgoing_args_size'. No space will be pushed
+ onto the stack for each call; instead, the function prologue should
+ increase the stack frame size by this amount. */
+#define ACCUMULATE_OUTGOING_ARGS 1
+
+/* Define a data type for recording info about an argument list
+ during the scan of that argument list. This data type should
+ hold all necessary information about the function itself
+ and about the args processed so far, enough to enable macros
+ such as FUNCTION_ARG to determine where the next arg should go. */
+#define CUMULATIVE_ARGS int
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+ for a call to a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+((CUM) = 0)
+
+/* The number of registers used for parameter passing. Local to this file. */
+#define MAX_EPIPHANY_PARM_REGS 4
+
+/* 1 if N is a possible register number for function argument passing. */
+#define FUNCTION_ARG_REGNO_P(N) \
+((unsigned) (N) < MAX_EPIPHANY_PARM_REGS)
+
+/* Return boolean indicating arg of type TYPE and mode MODE will be passed in
+ a reg. This includes arguments that have to be passed by reference as the
+ pointer to them is passed in a reg if one is available (and that is what
+ we're given).
+ This macro is only used in this file. */
+/* We must use partial argument passing because of the chosen mode
+ of varargs handling. */
+#define PASS_IN_REG_P(CUM, MODE, TYPE) \
+ (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) < MAX_EPIPHANY_PARM_REGS)
+
+/* Tell GCC to use TARGET_RETURN_IN_MEMORY. */
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
+ the stack pointer does not matter. The value is tested only in
+ functions that have frame pointers.
+ No definition is equivalent to always zero. */
+#define EXIT_IGNORE_STACK 1
+
+#define EPILOGUE_USES(REGNO) epiphany_epilogue_uses (REGNO)
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. */
+#define FUNCTION_PROFILER(FILE, LABELNO)
+
+/* Given an rtx for the frame pointer,
+ return an rtx for the address of the frame. */
+#define FRAME_ADDR_RTX(frame) \
+ ((frame) == hard_frame_pointer_rtx ? arg_pointer_rtx : NULL)
+
+/* This is not only for dwarf unwind info, but also for the benefit of
+ df-scan.c to tell it that LR is live at the function start. */
+#define INCOMING_RETURN_ADDR_RTX \
+ gen_rtx_REG (Pmode, \
+ (current_function_decl != NULL \
+ && epiphany_is_interrupt_p (current_function_decl) \
+ ? IRET_REGNUM : GPR_LR))
+
+/* However, we haven't implemented the rest needed for dwarf2 unwind info. */
+#define DWARF2_UNWIND_INFO 0
+
+#define RETURN_ADDR_RTX(count, frame) \
+ (count ? NULL_RTX \
+ : gen_rtx_UNSPEC (SImode, gen_rtvec (1, const0_rtx), UNSPEC_RETURN_ADDR))
+
+/* Trampolines.
+ An epiphany trampoline looks like this:
+ mov r16,%low(fnaddr)
+ movt r16,%high(fnaddr)
+ mov ip,%low(cxt)
+ movt ip,%high(cxt)
+ jr r16 */
+
+/* Length in units of the trampoline for entering a nested function. */
+#define TRAMPOLINE_SIZE 20
+
+/* Addressing modes, and classification of registers for them. */
+
+/* Maximum number of registers that can appear in a valid memory address. */
+#define MAX_REGS_PER_ADDRESS 2
+
+/* We have post_modify (load/store with update). */
+#define HAVE_POST_INCREMENT TARGET_POST_INC
+#define HAVE_POST_DECREMENT TARGET_POST_INC
+#define HAVE_POST_MODIFY_DISP TARGET_POST_MODIFY
+#define HAVE_POST_MODIFY_REG TARGET_POST_MODIFY
+
+/* Recognize any constant value that is a valid address. */
+#define CONSTANT_ADDRESS_P(X) \
+(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
+ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST)
+
+#define RTX_OK_FOR_OFFSET_P(MODE, X) \
+ RTX_OK_FOR_OFFSET_1 (GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
+ && epiphany_vect_align == 4 ? SImode : (MODE), X)
+#define RTX_OK_FOR_OFFSET_1(MODE, X) \
+ (GET_CODE (X) == CONST_INT \
+ && !(INTVAL (X) & (GET_MODE_SIZE (MODE) - 1)) \
+ && INTVAL (X) >= -2047 * (int) GET_MODE_SIZE (MODE) \
+ && INTVAL (X) <= 2047 * (int) GET_MODE_SIZE (MODE))
+
+/* Frame offsets cannot be evaluated till the frame pointer is eliminated. */
+#define RTX_FRAME_OFFSET_P(X) \
+ ((X) == frame_pointer_rtx \
+ || (GET_CODE (X) == PLUS && XEXP ((X), 0) == frame_pointer_rtx \
+ && CONST_INT_P (XEXP ((X), 1))))
+
+/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
+ return the mode to be used for the comparison. */
+#define SELECT_CC_MODE(OP, X, Y) \
+ epiphany_select_cc_mode (OP, X, Y)
+
+/* Return nonzero if SELECT_CC_MODE will never return MODE for a
+ floating point inequality comparison. */
+
+#define REVERSE_CONDITION(CODE, MODE) \
+ ((MODE) == CC_FPmode || (MODE) == CC_FP_EQmode || (MODE) == CC_FP_GTEmode \
+ || (MODE) == CC_FP_ORDmode || (MODE) == CC_FP_UNEQmode \
+ ? reverse_condition_maybe_unordered (CODE) \
+ : (MODE) == CCmode ? reverse_condition (CODE) \
+ : UNKNOWN)
+
+/* We can reverse all CCmodes with REVERSE_CONDITION. */
+#define REVERSIBLE_CC_MODE(MODE) \
+ ((MODE) == CCmode || (MODE) == CC_FPmode || (MODE) == CC_FP_EQmode \
+ || (MODE) == CC_FP_GTEmode || (MODE) == CC_FP_ORDmode \
+ || (MODE) == CC_FP_UNEQmode)
+
+/* Costs. */
+
+/* The cost of a branch insn. */
+/* ??? What's the right value here? Branches are certainly more
+ expensive than reg->reg moves. */
+#define BRANCH_COST(speed_p, predictable_p) \
+ (speed_p ? epiphany_branch_cost : 1)
+
+/* Nonzero if access to memory by bytes is slow and undesirable.
+ For RISC chips, it means that access to memory by bytes is no
+ better than access by words when possible, so grab a whole word
+ and maybe make use of that. */
+#define SLOW_BYTE_ACCESS 1
+
+/* Define this macro if it is as good or better to call a constant
+ function address than to call an address kept in a register. */
+/* On the EPIPHANY, calling through registers is slow. */
+#define NO_FUNCTION_CSE
+
+/* Section selection. */
+/* WARNING: These section names also appear in dwarf2out.c. */
+
+#define TEXT_SECTION_ASM_OP "\t.section .text"
+#define DATA_SECTION_ASM_OP "\t.section .data"
+
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"
+
+#define BSS_SECTION_ASM_OP "\t.section .bss"
+
+/* Define this macro if jump tables (for tablejump insns) should be
+ output in the text section, along with the assembler instructions.
+ Otherwise, the readonly data section is used.
+ This macro is irrelevant if there is no separate readonly data section. */
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+/* PIC */
+
+/* The register number of the register used to address a table of static
+ data addresses in memory. In some cases this register is defined by a
+ processor's ``application binary interface'' (ABI). When this macro
+ is defined, RTL is generated for this register once, as with the stack
+ pointer and frame pointer registers. If this macro is not defined, it
+ is up to the machine-dependent files to allocate such a register (if
+ necessary). */
+#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? PIC_REGNO : INVALID_REGNUM)
+
+/* Control the assembler format that we output. */
+
+/* A C string constant describing how to begin a comment in the target
+ assembler language. The compiler assumes that the comment will
+ end at the end of the line. */
+#define ASM_COMMENT_START ";"
+
+/* Output to assembler file text saying following lines
+ may contain character constants, extra white space, comments, etc. */
+#define ASM_APP_ON ""
+
+/* Output to assembler file text saying following lines
+ no longer contain unusual constructs. */
+#define ASM_APP_OFF ""
+
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP "\t.global\t"
+
+/* How to refer to registers in assembler output.
+ This sequence is indexed by compiler's hard-register-number (see above). */
+
+#define REGISTER_NAMES \
+{ \
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "r8", "r9", "r10", "fp", "ip", "sp", "lr", "r15", \
+ "r16", "r17","r18", "r19", "r20", "r21", "r22", "r23", \
+ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \
+ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
+ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \
+ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
+ "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", \
+ "ap", "sfp", "cc1", "cc2", \
+ "config", "status", "lc", "ls", "le", "iret", \
+ "fp_near", "fp_trunc", "fp_anyfp", "unknown" \
+}
+
+#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
+ epiphany_final_prescan_insn (INSN, OPVEC, NOPERANDS)
+
+#define LOCAL_LABEL_PREFIX "."
+
+/* A C expression which evaluates to true if CODE is a valid
+ punctuation character for use in the `PRINT_OPERAND' macro. */
+extern char epiphany_punct_chars[256];
+#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
+ epiphany_punct_chars[(unsigned char) (CHAR)]
+
+/* This is how to output an element of a case-vector that is absolute. */
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+do { \
+ if (CASE_VECTOR_MODE == Pmode) \
+ asm_fprintf ((FILE), "\t.word %LL%d\n", (VALUE)); \
+ else \
+ asm_fprintf ((FILE), "\t.short %LL%d\n", (VALUE)); \
+} while (0)
+
+/* This is how to output an element of a case-vector that is relative. */
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+do { \
+ if (CASE_VECTOR_MODE == Pmode) \
+ asm_fprintf ((FILE), "\t.word"); \
+ else \
+ asm_fprintf ((FILE), "\t.short"); \
+ asm_fprintf ((FILE), " %LL%d-%LL%d\n", (VALUE), (REL)); \
+} while (0)
+
+/* This is how to output an assembler line
+ that says to advance the location counter
+ to a multiple of 2**LOG bytes. */
+#define ASM_OUTPUT_ALIGN(FILE,LOG) \
+do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
+
+/* Debugging information. */
+
+/* Generate DBX and DWARF debugging information. */
+#define DBX_DEBUGGING_INFO 1
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+/* Turn off splitting of long stabs. */
+#define DBX_CONTIN_LENGTH 0
+
+/* Miscellaneous. */
+
+/* Specify the machine mode that this machine uses
+ for the index in the tablejump instruction. */
+#define CASE_VECTOR_MODE (TARGET_SMALL16 && optimize_size ? HImode : Pmode)
+
+/* Define if operations between registers always perform the operation
+ on the full register even if a narrower mode is specified. */
+#define WORD_REGISTER_OPERATIONS
+
+/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
+ will either zero-extend or sign-extend. The value of this macro should
+ be the code that says which one of the two operations is implicitly
+ done, UNKNOWN if none. */
+#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
+
+/* Max number of bytes we can move from memory to memory
+ in one reasonably fast instruction. */
+#define MOVE_MAX 8
+
+/* Define this to be nonzero if shift instructions ignore all but the low-order
+ few bits. */
+#define SHIFT_COUNT_TRUNCATED 1
+
+/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
+ is done just by pretending it is already truncated. */
+#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
+
+/* Specify the machine mode that pointers have.
+ After generation of rtl, the compiler makes no further distinction
+ between pointers and any other objects of this machine mode. */
+
+#define Pmode SImode
+
+/* A function address in a call instruction. */
+#define FUNCTION_MODE SImode
+
+/* EPIPHANY function types. */
+enum epiphany_function_type
+{
+ EPIPHANY_FUNCTION_UNKNOWN, EPIPHANY_FUNCTION_NORMAL,
+ /* These are interrupt handlers. The name corresponds to the register
+ name that contains the return address. */
+ EPIPHANY_FUNCTION_ILINK1, EPIPHANY_FUNCTION_ILINK2,
+ /* These are interrupt handlers. The name corresponds to which type
+ of interrupt handler we're dealing with. */
+ EPIPHANY_FUNCTION_RESET, EPIPHANY_FUNCTION_SOFTWARE_EXCEPTION,
+ EPIPHANY_FUNCTION_TIMER, EPIPHANY_FUNCTION_DMA0,
+ EPIPHANY_FUNCTION_DMA1, EPIPHANY_FUNCTION_STATIC_FLAG,
+ EPIPHANY_FUNCTION_SWI
+};
+
+#define EPIPHANY_INTERRUPT_P(TYPE) \
+ ((TYPE) >= EPIPHANY_FUNCTION_RESET && (TYPE) <= EPIPHANY_FUNCTION_SWI)
+
+/* Compute the type of a function from its DECL. */
+
+#define IMMEDIATE_PREFIX "#"
+
+#define OPTIMIZE_MODE_SWITCHING(ENTITY) \
+ (epiphany_optimize_mode_switching (ENTITY))
+
+/* We have two fake entities for lazy code motion of the mask constants,
+ one entity each for round-to-nearest / truncating
+ with a different idea what FP_MODE_ROUND_UNKNOWN will be, and
+ finally an entity that runs in a second mode switching pass to
+ resolve FP_MODE_ROUND_UNKNOWN. */
+#define NUM_MODES_FOR_MODE_SWITCHING \
+ { 2, 2, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE }
+
+#define MODE_NEEDED(ENTITY, INSN) epiphany_mode_needed((ENTITY), (INSN))
+
+#define MODE_PRIORITY_TO_MODE(ENTITY, N) \
+ (epiphany_mode_priority_to_mode ((ENTITY), (N)))
+
+#define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \
+ emit_set_fp_mode ((ENTITY), (MODE), (HARD_REGS_LIVE))
+
+#define MODE_ENTRY(ENTITY) (epiphany_mode_entry_exit ((ENTITY), false))
+#define MODE_EXIT(ENTITY) (epiphany_mode_entry_exit ((ENTITY), true))
+#define MODE_AFTER(LAST_MODE, INSN) \
+ (epiphany_mode_after (e, (LAST_MODE), (INSN)))
+
+#define TARGET_INSERT_MODE_SWITCH_USE epiphany_insert_mode_switch_use
+
+/* Mode switching entities. */
+enum
+{
+ EPIPHANY_MSW_ENTITY_AND,
+ EPIPHANY_MSW_ENTITY_OR,
+ EPIPHANY_MSW_ENTITY_NEAREST,
+ EPIPHANY_MSW_ENTITY_TRUNC,
+ EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN,
+ EPIPHANY_MSW_ENTITY_ROUND_KNOWN,
+ EPIPHANY_MSW_ENTITY_FPU_OMNIBUS
+};
+
+extern int epiphany_normal_fp_rounding;
+extern struct rtl_opt_pass pass_mode_switch_use;
+extern struct rtl_opt_pass pass_resolve_sw_modes;
+
+/* This will need to be adjusted when FP_CONTRACT_ON is properly
+ implemented. */
+#define TARGET_FUSED_MADD (flag_fp_contract_mode == FP_CONTRACT_FAST)
+
+#endif /* !GCC_EPIPHANY_H */
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
new file mode 100644
index 00000000000..c8354e8eddb
--- /dev/null
+++ b/gcc/config/epiphany/epiphany.md
@@ -0,0 +1,2447 @@
+;; Machine description of the Adaptiva epiphany cpu for GNU C compiler
+;; Copyright (C) 1994, 1997, 1998, 1999, 2000, 2004, 2005, 2007, 2009, 2010,
+;; 2011 Free Software Foundation, Inc.
+;; Contributed by Embecosm on behalf of Adapteva, 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 file "rtl.def" for documentation on define_insn, match_*, et. al.
+
+(define_constants
+ [(GPR_0 0)
+ (GPR_FP 11)
+ (GPR_IP 12)
+ (GPR_SP 13)
+ (GPR_LR 14)
+ (GPR_16 16)
+ (GPR_18 18)
+ (GPR_20 20)
+ (ARG_POINTER_REGNUM 64)
+ (FRAME_POINTER_REGNUM 65)
+ (CC_REGNUM 66) ;; 66 or 17
+ (CCFP_REGNUM 67) ;; 67 or 18
+ (CONFIG_REGNUM 68)
+ (STATUS_REGNUM 69)
+ (LC_REGNUM 70)
+ (LS_REGNUM 71)
+ (LE_REGNUM 72)
+ (IRET_REGNUM 73)
+ (FP_NEAREST_REGNUM 74)
+ (FP_TRUNCATE_REGNUM 75)
+ (FP_ANYFP_REGNUM 76)
+ (UNKNOWN_REGNUM 77) ; used for addsi3_r and friends
+ ; We represent the return address as an unspec rather than a reg.
+ ; If we used a reg, we could use register elimination, but eliminating
+ ; to GPR_LR would make the latter visible to dataflow, thus making it
+ ; harder to determine when it must be saved.
+ (UNSPEC_RETURN_ADDR 0)
+ (UNSPEC_FP_MODE 1)
+
+ (UNSPECV_GID 0)
+ (UNSPECV_GIE 1)])
+
+;; Insn type. Used to default other attribute values.
+
+(define_attr "type"
+ "move,load,store,cmove,unary,compare,shift,mul,uncond_branch,branch,call,fp,fp_int,misc,sfunc,fp_sfunc,flow"
+ (const_string "misc"))
+
+;; Length (in # bytes)
+
+(define_attr "length" "" (const_int 4))
+
+;; The length here is the length of a single asm.
+
+(define_asm_attributes
+ [(set_attr "length" "4")
+ (set_attr "type" "misc")])
+
+;; pipeline model; so far we have only one.
+(define_attr "pipe_model" "epiphany" (const_string "epiphany"))
+
+(define_attr "rounding" "trunc,nearest"
+ (cond [(ne (symbol_ref "TARGET_ROUND_NEAREST") (const_int 0))
+ (const_string "nearest")]
+ (const_string "trunc")))
+
+(define_attr "fp_mode" "round_unknown,round_nearest,round_trunc,int,caller,none"
+ (cond [(eq_attr "type" "fp,fp_sfunc")
+ (symbol_ref "(enum attr_fp_mode) epiphany_normal_fp_rounding")
+ (eq_attr "type" "call")
+ (symbol_ref "(enum attr_fp_mode) epiphany_normal_fp_mode")
+ (eq_attr "type" "fp_int")
+ (const_string "int")]
+ (const_string "none")))
+
+(include "epiphany-sched.md")
+
+(include "predicates.md")
+(include "constraints.md")
+
+;; modes that are held in a single register, and hence, a word.
+(define_mode_iterator WMODE [SI SF HI QI V2HI V4QI])
+(define_mode_iterator WMODE2 [SI SF HI QI V2HI V4QI])
+
+;; modes that are held in a two single registers
+(define_mode_iterator DWMODE [DI DF V2SI V2SF V4HI V8QI])
+
+;; Double-word mode made up of two single-word mode values.
+(define_mode_iterator DWV2MODE [V2SI V2SF])
+(define_mode_attr vmode_part [(V2SI "si") (V2SF "sf")])
+(define_mode_attr vmode_PART [(V2SI "SI") (V2SF "SF")])
+(define_mode_attr vmode_fp_type [(V2SI "fp_int") (V2SF "fp")])
+(define_mode_attr vmode_ccmode [(V2SI "CC") (V2SF "CC_FP")])
+(define_mode_attr vmode_cc [(V2SI "CC_REGNUM") (V2SF "CCFP_REGNUM")])
+
+;; Move instructions.
+
+(define_expand "mov<mode>"
+ [(set (match_operand:WMODE 0 "general_operand" "")
+ (match_operand:WMODE 1 "general_operand" ""))]
+ ""
+{
+ if (<MODE>mode == V4QImode || <MODE>mode == V2HImode)
+ {
+ operands[0] = simplify_gen_subreg (SImode, operands[0], <MODE>mode, 0);
+ operands[1] = simplify_gen_subreg (SImode, operands[1], <MODE>mode, 0);
+ emit_insn (gen_movsi (operands[0], operands[1]));
+ DONE;
+ }
+ if (GET_CODE (operands[0]) == MEM)
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+ if (<MODE>mode == SImode
+ && (operands[1] == frame_pointer_rtx || operands[1] == arg_pointer_rtx))
+ {
+ rtx reg = operands[0];
+
+ if (!REG_P (reg))
+ reg = gen_reg_rtx (SImode);
+ emit_insn (gen_move_frame (reg, operands[1]));
+ operands[1] = reg;
+ if (operands[0] == reg)
+ DONE;
+ }
+})
+
+(define_insn "*movqi_insn"
+ [(set (match_operand:QI 0 "move_dest_operand" "=Rcs, r, r,r,m")
+ (match_operand:QI 1 "move_src_operand" "Rcs,rU16,Cal,m,r"))]
+;; ??? Needed?
+ "gpr_operand (operands[0], QImode)
+ || gpr_operand (operands[1], QImode)"
+ "@
+ mov %0,%1
+ mov %0,%1
+ mov %0,%1
+ ldrb %0,%1
+ strb %1,%0"
+ [(set_attr "type" "move,move,move,load,store")])
+
+(define_insn_and_split "*movhi_insn"
+ [(set (match_operand:HI 0 "move_dest_operand" "=r, r,r,m")
+ (match_operand:HI 1 "move_src_operand""rU16,Cal,m,r"))]
+ "gpr_operand (operands[0], HImode)
+ || gpr_operand (operands[1], HImode)"
+ "@
+ mov %0,%1
+ mov %0,%%low(%1); %1
+ ldrh %0,%c1
+ strh %1,%c0"
+ "reload_completed && CONSTANT_P (operands[1])
+ && !satisfies_constraint_U16 (operands[1]) && TARGET_SPLIT_LOHI"
+ [(set (match_dup 2) (match_dup 3))]
+ "operands[2] = simplify_gen_subreg (SImode, operands[0], HImode, 0);
+ operands[3] = simplify_gen_subreg (SImode, operands[1], HImode, 0);"
+ [(set_attr "type" "move,move,load,store")])
+
+;; We use a special pattern for a move from the frame pointer to
+;; show the flag clobber that is needed when this move is changed
+;; to an add by register elimination.
+;; ??? A pseudo register might be equivalent to a function invariant,
+;; and thus placed by reload into reg_equiv_invariant; if the pseudo
+;; does not get a hard register, we then end up with the function
+;; invariant in its place, i.e. an unexpected clobber of the flags
+;; register.
+;;
+;; N.B. operand 1 is an operand so that reload will perform elimination.
+;;
+;; The post-reload pattern recognition and splitting is done in frame_move_1.
+(define_insn "move_frame"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (match_operand:SI 1 "register_operand" "r"))
+ (clobber (reg:CC CC_REGNUM))]
+ "operands[1] == frame_pointer_rtx || operands[1] == arg_pointer_rtx"
+ "#")
+
+(define_insn "movsi_high"
+ [(set (match_operand:SI 0 "gpr_operand" "+r")
+ (ior:SI (and:SI (match_dup 0) (const_int 65535))
+ (high:SI (match_operand:SI 1 "move_src_operand" "i"))))]
+ ""
+ "movt %0, %%high(%1)"
+ [(set_attr "type" "move")
+ (set_attr "length" "4")])
+
+(define_insn "movsi_lo_sum"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (lo_sum:SI (const_int 0)
+ (match_operand:SI 1 "move_src_operand" "i")))]
+ ""
+ "mov %0, %%low(%1)"
+ [(set_attr "type" "move")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*movsi_insn"
+ [(set (match_operand:SI 0 "move_dest_operand"
+ "= r, r, r, r, r, r, m, r, Rct")
+ (match_operand:SI 1 "move_src_operand"
+ "rU16Rra,Cm1,Cl1,Cr1,Cal,mSra,rRra,Rct,r"))]
+ "gpr_operand (operands[0], SImode)
+ || gpr_operand (operands[1], SImode)
+ || satisfies_constraint_Sra (operands[1])"
+{
+ switch (which_alternative)
+ {
+ case 0: return "mov %0,%1";
+ case 1: return "add %0,%-,(1+%1)";
+ case 2: operands[1] = GEN_INT (exact_log2 (-INTVAL (operands[1])));
+ return "lsl %0,%-,%1";
+ case 3: operands[1] = GEN_INT (32 - exact_log2 (INTVAL (operands[1]) + 1));
+ return "lsr %0,%-,%1";
+ case 4: return "mov %0,%%low(%1)\;movt %0,%%high(%1) ; %1";
+ case 5: return "ldr %0,%C1";
+ case 6: return "str %1,%C0";
+ case 7: return "movfs %0,%1";
+ case 8: return "movts %0,%1";
+ default: gcc_unreachable ();
+ }
+}
+ "reload_completed && CONSTANT_P (operands[1])
+ && !satisfies_constraint_U16 (operands[1])
+ && !satisfies_constraint_Cm1 (operands[1])
+ && !satisfies_constraint_Cl1 (operands[1])
+ && !satisfies_constraint_Cr1 (operands[1])
+ && TARGET_SPLIT_LOHI"
+ [(match_dup 2) (match_dup 3)]
+ "operands[2] = gen_movsi_lo_sum (operands[0], operands[1]);
+ operands[3] = gen_movsi_high (operands[0], operands[1]);"
+ [(set_attr "type" "move,misc,misc,misc,move,load,store,flow,flow")
+ (set_attr "length" "4,4,4,4,8,4,4,4,4")])
+
+(define_split
+ [(set (match_operand:SI 0 "nonimmediate_operand")
+ (unspec:SI [(const_int 0)] UNSPEC_RETURN_ADDR))]
+ "reload_completed && !MACHINE_FUNCTION (cfun)->lr_clobbered"
+ [(set (match_dup 0) (reg:SI GPR_LR))])
+
+(define_split
+ [(set (match_operand:SI 0 "gpr_operand")
+ (unspec:SI [(const_int 0)] UNSPEC_RETURN_ADDR))]
+ "reload_completed"
+ [(set (match_dup 0) (match_dup 1))]
+{
+ emit_insn (gen_reload_insi_ra (operands[0], operands[1]));
+ DONE;
+})
+
+(define_expand "reload_insi_ra"
+ [(set (match_operand:SI 0 "gpr_operand" "r") (match_operand:SI 1 "" "Sra"))]
+ ""
+{
+ rtx addr
+ = (frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx);
+
+ addr = plus_constant (addr, MACHINE_FUNCTION (cfun)->lr_slot_offset);
+ operands[1] = gen_frame_mem (SImode, addr);
+})
+
+;; If the frame pointer elimination offset is zero, we'll use this pattern.
+;; Note that the splitter can accept any gpr in operands[1]; this is
+;; necessary, (e.g. for compile/20021015-1.c -O0,)
+;; because when register elimination cannot be done with the constant
+;; as an immediate operand of the add instruction, reload will resort to
+;; loading the constant into a reload register, using gen_add2_insn to add
+;; the stack pointer, and then use the reload register as new source in
+;; the move_frame pattern.
+(define_insn_and_split "*move_frame_1"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (match_operand:SI 1 "gpr_operand" "r"))
+ (clobber (reg:CC CC_REGNUM))]
+ "(reload_in_progress || reload_completed)
+ && (operands[1] == stack_pointer_rtx
+ || operands[1] == hard_frame_pointer_rtx)"
+ "#"
+ "reload_in_progress || reload_completed"
+ [(set (match_dup 0) (match_dup 1))])
+
+(define_expand "mov<mode>"
+ [(set (match_operand:DWMODE 0 "general_operand" "")
+ (match_operand:DWMODE 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (GET_MODE_CLASS (<MODE>mode) == MODE_VECTOR_INT
+ || GET_MODE_CLASS (<MODE>mode) == MODE_VECTOR_FLOAT)
+ {
+ if (epiphany_vect_align == 4 && TARGET_SPLIT_VECMOVE_EARLY)
+ {
+ rtx o0l, o0h, o1l, o1h;
+
+ o0l = simplify_gen_subreg (SImode, operands[0], <MODE>mode, 0);
+ o0h = simplify_gen_subreg (SImode, operands[0], <MODE>mode,
+ UNITS_PER_WORD);
+ o1l = simplify_gen_subreg (SImode, operands[1], <MODE>mode, 0);
+ o1h = simplify_gen_subreg (SImode, operands[1], <MODE>mode,
+ UNITS_PER_WORD);
+ if (reg_overlap_mentioned_p (o0l, o1h))
+ {
+ emit_move_insn (o0h, o1h);
+ emit_move_insn (o0l, o1l);
+ }
+ else
+ {
+ emit_move_insn (o0l, o1l);
+ emit_move_insn (o0h, o1h);
+ }
+ DONE;
+ }
+ /* lower_subreg has a tendency to muck up vectorized code.
+ To protect the wide memory accesses, we must use same-size
+ subregs. */
+ if (epiphany_vect_align != 4 /* == 8 */
+ && !reload_in_progress
+ && (GET_CODE (operands[0]) == MEM || GET_CODE (operands[1]) == MEM)
+ && (GET_CODE (operands[0]) != SUBREG
+ || (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0])))
+ != GET_MODE_SIZE (<MODE>mode)
+ && GET_CODE (operands[1]) != SUBREG)))
+ {
+ operands[0]
+ = simplify_gen_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[1]
+ = simplify_gen_subreg (DImode, operands[1], <MODE>mode, 0);
+ emit_insn (gen_movdi (operands[0], operands[1]));
+ DONE;
+ }
+ }
+ /* Everything except mem = const or mem = mem can be done easily. */
+
+ if (GET_CODE (operands[0]) == MEM)
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+}")
+
+(define_insn_and_split "*mov<mode>_insn"
+ [(set (match_operand:DWMODE 0 "move_dest_operand" "=r, r,r,m")
+ (match_operand:DWMODE 1 "move_double_src_operand" "r,CalE,m,r"))]
+ "(gpr_operand (operands[0], <MODE>mode)
+ || gpr_operand (operands[1], <MODE>mode))"
+ "@
+ #
+ #
+ ldrd %0,%X1
+ strd %1,%X0"
+ "reload_completed
+ && ((!MEM_P (operands[0]) && !MEM_P (operands[1]))
+ || epiphany_vect_align == 4)"
+ [(set (match_dup 2) (match_dup 3))
+ (set (match_dup 4) (match_dup 5))]
+{
+ int word0 = 0, word1 = UNITS_PER_WORD;
+
+ if (post_modify_operand (operands[0], <MODE>mode)
+ || post_modify_operand (operands[1], <MODE>mode))
+ word0 = UNITS_PER_WORD, word1 = 0;
+
+ operands[2] = simplify_gen_subreg (SImode, operands[0], <MODE>mode, word0);
+ operands[3] = simplify_gen_subreg (SImode, operands[1], <MODE>mode, word0);
+ operands[4] = simplify_gen_subreg (SImode, operands[0], <MODE>mode, word1);
+ operands[5] = simplify_gen_subreg (SImode, operands[1], <MODE>mode, word1);
+ if (post_modify_operand (operands[0], <MODE>mode))
+ operands[2]
+ = change_address (operands[2], VOIDmode,
+ plus_constant (XEXP (XEXP (operands[0], 0), 0),
+ UNITS_PER_WORD));
+ if (post_modify_operand (operands[1], <MODE>mode))
+ operands[3]
+ = change_address (operands[3], VOIDmode,
+ plus_constant (XEXP (XEXP (operands[1], 0), 0),
+ UNITS_PER_WORD));
+}
+ [(set_attr "type" "move,move,load,store")
+ (set_attr "length" "8,16,4,4")])
+
+
+(define_insn_and_split "*movsf_insn"
+ [(set (match_operand:SF 0 "move_dest_operand" "=r,r,r,m")
+ (match_operand:SF 1 "move_src_operand" "r,E,m,r"))]
+ "gpr_operand (operands[0], SFmode)
+ || gpr_operand (operands[1], SFmode)"
+ "@
+ mov %0,%1
+ mov %0,%%low(%1)\;movt %0,%%high(%1) ; %1
+ ldr %0,%C1
+ str %1,%C0"
+ "reload_completed && CONSTANT_P (operands[1]) && TARGET_SPLIT_LOHI"
+ [(set (match_dup 2) (match_dup 3))]
+ "operands[2] = simplify_gen_subreg (SImode, operands[0], SFmode, 0);
+ operands[3] = simplify_gen_subreg (SImode, operands[1], SFmode, 0);"
+ [(set_attr "type" "move,move,load,store")
+ (set_attr "length" "4,8,4,4")])
+
+(define_expand "addsi3"
+ [(set (match_operand:SI 0 "add_reg_operand" "")
+ (plus:SI (match_operand:SI 1 "add_reg_operand" "")
+ (match_operand:SI 2 "add_operand" "")))]
+ ""
+ "
+{
+ if (reload_in_progress || reload_completed)
+ emit_insn (gen_addsi3_r (operands[0], operands[1], operands[2]));
+ else
+ emit_insn (gen_addsi3_i (operands[0], operands[1], operands[2]));
+ DONE;
+}")
+
+(define_insn "addsi3_i"
+ [(set (match_operand:SI 0 "add_reg_operand" "=r")
+ (plus:SI (match_operand:SI 1 "add_reg_operand" "%r")
+ (match_operand:SI 2 "add_operand" "rL")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "add %0,%1,%2"
+[(set_attr "type" "misc")])
+
+; We use a clobber of UNKNOWN_REGNUM here so that the peephole optimizers
+; can identify the unresolved flags clobber problem, and also to
+; avoid unwanted matches.
+;
+; At -O0 / -O1 we don't peephole all instances away. We could get better
+; debug unwinding through the emitted code if we added a splitter.
+(define_insn "addsi3_r"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "%r")
+ (match_operand:SI 2 "nonmemory_operand" "rCar")))
+ (clobber (reg:CC UNKNOWN_REGNUM))]
+ "reload_in_progress || reload_completed"
+{
+ int scratch = (0x17
+ ^ (true_regnum (operands[0]) & 1)
+ ^ (true_regnum (operands[1]) & 2)
+ ^ (true_regnum (operands[2]) & 4));
+ asm_fprintf (asm_out_file, "\tstr r%d,[sp,#0]\n", scratch);
+ asm_fprintf (asm_out_file, "\tmovfs r%d,status\n", scratch);
+ output_asm_insn ("add %0,%1,%2", operands);
+ asm_fprintf (asm_out_file, "\tmovts status,r%d\n", scratch);
+ asm_fprintf (asm_out_file, "\tldr r%d,[sp,#0]\n", scratch);
+ return "";
+}
+ [(set_attr "length" "20")
+ (set_attr "type" "misc")])
+
+;; reload uses gen_addsi2 because it doesn't understand the need for
+;; the clobber.
+(define_peephole2
+ [(set (match_operand:SI 0 "gpr_operand" "")
+ (match_operand:SI 1 "const_int_operand" ""))
+ (parallel [(set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (match_operand:SI 2 "gpr_operand")))
+ (clobber (reg:CC UNKNOWN_REGNUM))])]
+ "satisfies_constraint_L (operands[1])
+ || ((operands[2] == stack_pointer_rtx
+ || (operands[2] == hard_frame_pointer_rtx && frame_pointer_needed))
+ && !peep2_regno_dead_p (2, CC_REGNUM)
+ && satisfies_constraint_Car (operands[1]))"
+ [(parallel [(set (match_dup 0)
+ (plus:SI (match_dup 2) (match_dup 1)))
+ (clobber (reg:CC UNKNOWN_REGNUM))])]
+ ;; FIXME:
+ ;; need this patch: http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02819.html
+ ;; "peep2_rescan = true;"
+)
+
+(define_peephole2
+ [(match_parallel 5 ""
+ [(set (match_operand 3 "cc_operand" "") (match_operand 4 "" ""))])
+ (parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC UNKNOWN_REGNUM))])]
+ "REGNO (operands[3]) == CC_REGNUM
+ && (gpr_operand (operands[2], SImode)
+ || satisfies_constraint_L (operands[2]))
+ && !reg_overlap_mentioned_p (operands[0], operands[5])
+ && !reg_set_p (operands[1], operands[5])
+ && !reg_set_p (operands[2], operands[5])"
+ [(parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC CC_REGNUM))])
+ (match_dup 5)]
+ "")
+
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC UNKNOWN_REGNUM))])]
+ "peep2_regno_dead_p (1, CC_REGNUM)
+ && (gpr_operand (operands[2], SImode)
+ || satisfies_constraint_L (operands[2]))"
+ [(parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC CC_REGNUM))])]
+ "")
+
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (reg:SI GPR_SP)
+ (match_operand:SI 1 "nonmemory_operand" "")))
+ (clobber (reg:CC UNKNOWN_REGNUM))])]
+ "(REG_P (operands[1]) && !reg_overlap_mentioned_p (operands[0], operands[1]))
+ || RTX_OK_FOR_OFFSET_P (<MODE>mode, operands[1])"
+ [(set (match_dup 0) (reg:SI GPR_SP))
+ (set (mem:WMODE (post_modify (match_dup 0)
+ (plus:SI (match_dup 0) (match_dup 1))))
+ (reg:WMODE GPR_SP))]
+ "")
+
+
+
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "gpr_operand" "")
+ (plus:SI (reg:SI GPR_FP)
+ (match_operand:SI 1 "nonmemory_operand" "")))
+ (clobber (reg:CC UNKNOWN_REGNUM))])
+ (match_scratch:WMODE 2 "r")]
+ "frame_pointer_needed
+ && ((REG_P (operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[1]))
+ || RTX_OK_FOR_OFFSET_P (<MODE>mode, operands[1]))"
+ [(set (match_dup 0) (reg:SI GPR_FP))
+ (set (match_dup 2)
+ (mem:WMODE (post_modify (match_dup 0)
+ (plus:SI (match_dup 0) (match_dup 1)))))]
+ "")
+
+(define_insn "subsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (minus:SI (match_operand:SI 1 "add_reg_operand" "r")
+ (match_operand:SI 2 "arith_operand" "rL")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "sub %0,%1,%2"
+ [(set_attr "type" "misc")])
+
+; After mode-switching, floating point operations, fp_sfuncs and calls
+; must exhibit the use of the control register, lest the setting of the
+; control register could be deleted or moved. OTOH a use of a hard register
+; greatly coundounds optimizers like the rtl loop optimizers or combine.
+; Therefore, we put an extra pass immediately after the mode switching pass
+; that inserts the USEs of the control registers, and sets a flag in struct
+; machine_function that float_operation can henceforth only match with that
+; USE.
+
+;; Addition
+(define_expand "addsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (plus:SF (match_operand:SF 1 "gpr_operand" "")
+ (match_operand:SF 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*addsf3_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (plus:SF (match_operand:SF 1 "gpr_operand" "%r")
+ (match_operand:SF 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fadd %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+;; Subtraction
+(define_expand "subsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (minus:SF (match_operand:SF 1 "gpr_operand" "")
+ (match_operand:SF 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*subsf3_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (minus:SF (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fsub %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+(define_expand "subsf3_f"
+ [(parallel
+ [(set (reg:CC_FP CCFP_REGNUM)
+ (compare:CC_FP (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r")))
+ (set (match_operand:SF 0 "gpr_operand" "=r")
+ (minus:SF (match_dup 1) (match_dup 2)))])]
+ "!TARGET_SOFT_CMPSF")
+
+(define_insn "*subsf3_f_i"
+ [(match_parallel 3 "float_operation"
+ [(set (reg:CC_FP CCFP_REGNUM)
+ (compare:CC_FP (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r")))
+ (set (match_operand:SF 0 "gpr_operand" "=r")
+ (minus:SF (match_dup 1) (match_dup 2)))])]
+ "!TARGET_SOFT_CMPSF"
+ "fsub %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+; There is an fabs instruction, but it has longer latency.
+(define_expand "abssf2"
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (abs:SF (match_operand:SF 1 "gpr_operand" "")))]
+ ""
+ "
+{
+ rtx op1 = copy_to_mode_reg (SImode, simplify_gen_subreg (SImode, operands[1],
+ SFmode, 0));
+ rtx op0 = simplify_gen_subreg (SImode, operands[0], SFmode, 0);
+
+ emit_insn (gen_ashlsi3 (op1, op1, const1_rtx));
+ emit_insn (gen_lshrsi3 (op0, op1, const1_rtx));
+ DONE;
+}")
+
+;; Multiplication
+(define_expand "mulsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (mult:SF (match_operand:SF 1 "gpr_operand" "")
+ (match_operand:SF 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*mulsf3_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (mult:SF (match_operand:SF 1 "gpr_operand" "%r")
+ (match_operand:SF 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fmul %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+;; Division
+(define_expand "divsf3"
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (div:SF (match_operand:SF 1 "gpr_operand" "")
+ (match_operand:SF 2 "gpr_operand" "")))]
+ "flag_reciprocal_math"
+{
+ rtx one = CONST1_RTX (SFmode);
+ rtx dst = operands[0];
+
+ if (rtx_equal_p (dst, operands[1]))
+ {
+ emit_move_insn (dst, one);
+ DONE;
+ }
+ else if (!register_operand (dst, SFmode) && can_create_pseudo_p ())
+ dst = gen_reg_rtx (SFmode);
+ emit_insn (gen_recipsf2 (dst, one, operands[2],
+ sfunc_symbol (\"__fast_recipsf2\")));
+ emit_insn (gen_mulsf3 (operands[0], operands[1], dst));
+ DONE;
+})
+
+;; Before reload, keep the hard reg usage to clobbers so that the loop
+;; optimizers can more easily move this insn.
+;; It would be nicer to use a constraint for a GPR_0 - only register class,
+;; but sched1 can still cause trouble then, and there is no guarantee of
+;; better register allocations.
+;; Neither is there when using the opposite strategy - putting explicit
+;; hard register references into pre-reload rtl.
+(define_expand "recipsf2"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (div:SF (match_operand:SF 1 "const_float_1_operand" "")
+ (match_operand:SF 2 "move_src_operand" "")))
+ (use (match_operand:SI 3 "move_src_operand" ""))
+ (clobber (reg:SF 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SF GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn_and_split "*recipsf2_1"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r,r")
+ (div:SF (match_operand:SF 1 "const_float_1_operand" "")
+ (match_operand:SF 2 "move_src_operand" "rU16m,rU16mCal")))
+ (use (match_operand:SI 3 "move_src_operand" "rU16m,rU16mCal"))
+ (clobber (reg:SF 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SF GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "flag_reciprocal_math"
+ "#"
+ "&& reload_completed"
+ [(set (reg:SI 1) (match_dup 3))
+ (set (reg:SF 0) (match_dup 2))
+ (parallel
+ [(set (reg:SF 0)
+ (div:SF (match_dup 1)
+ (reg:SF 0)))
+ (use (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 5)
+ (match_dup 6)])
+ (set (match_dup 0) (reg:SF 0))]
+ "operands[5] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[6] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);"
+ [(set_attr "type" "fp_sfunc")
+ (set_attr "length" "16,24")])
+
+(define_insn "*recipsf2_2"
+ [(match_parallel 1 "float_operation"
+ [(set (reg:SF 0)
+ (div:SF (match_operand:SF 0 "const_float_1_operand" "")
+ (reg:SF 0)))
+ (use (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "flag_reciprocal_math"
+ "jalr r1"
+ [(set_attr "type" "fp_sfunc")])
+
+
+;; Fused multiply-add
+(define_expand "fmasf4"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (fma:SF (match_operand:SF 1 "gpr_operand" "")
+ (match_operand:SF 2 "gpr_operand" "")
+ (match_operand:SF 3 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "")
+
+; The multiply operands are commutative, but since they have the
+; same constraints, there is no point in telling reload about this.
+(define_insn "*fmadd"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (fma:SF (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r")
+ (match_operand:SF 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fmadd %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+; Once vetorization consistently works for this port, should check
+; if the fmadd / fmsub patterns still serve a purpose. With the
+; introduction of fma / fnma handling by the SSA optimizers,
+; at least scalars should be handled by these optimizers, would
+; have to see how well they do on vectors from auto-vectorization.
+;
+; combiner pattern, also used by vector combiner pattern
+(define_expand "maddsf"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (plus:SF (mult:SF (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r"))
+ (match_operand:SF 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "TARGET_FUSED_MADD")
+
+(define_insn "*maddsf_combine"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (plus:SF (mult:SF (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r"))
+ (match_operand:SF 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "TARGET_FUSED_MADD"
+ "fmadd %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+;; Fused multiply-sub
+(define_expand "fnmasf4"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (fma:SF (neg:SF (match_operand:SF 1 "gpr_operand" ""))
+ (match_operand:SF 2 "gpr_operand" "")
+ (match_operand:SF 3 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "")
+
+(define_insn "*fmsub"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (fma:SF (neg:SF (match_operand:SF 1 "gpr_operand" "r"))
+ (match_operand:SF 2 "gpr_operand" "r")
+ (match_operand:SF 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fmsub %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+(define_insn "*fmsub_combine"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (minus:SF (match_operand:SF 3 "gpr_operand" "0")
+ (mult:SF (match_operand:SF 1 "gpr_operand" "r")
+ (match_operand:SF 2 "gpr_operand" "r"))))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "TARGET_FUSED_MADD"
+ "fmsub %0,%1,%2"
+ [(set_attr "type" "fp")])
+
+;; float / integer conversions
+
+(define_expand "floatsisf2"
+ [(parallel
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (float:SF (match_operand:SI 1 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*floatsisf2_i"
+ [(match_parallel 2 "float_operation"
+ [(set (match_operand:SF 0 "gpr_operand" "=r")
+ (float:SF (match_operand:SI 1 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "float %0, %1"
+ [(set_attr "type" "fp")])
+
+(define_expand "floatsisf2_cmp"
+ [(parallel
+ [(set (reg:CC_FP CCFP_REGNUM)
+ (compare:CC_FP (float:SF (match_operand:SF 1 "gpr_operand" "r"))
+ (match_dup 2)))
+ (set (match_operand:SF 0 "gpr_operand" "=r")
+ (float:SF (match_dup 1)))])]
+ ""
+ "operands[2] = CONST0_RTX (SFmode);")
+
+(define_insn "*floatsisf2_cmp_i"
+ [(match_parallel 3 "float_operation"
+ [(set (reg:CC_FP CCFP_REGNUM)
+ (compare:CC_FP (float:SF (match_operand:SF 1 "gpr_operand" "r"))
+ (match_operand:SF 2 "const0_operand" "")))
+ (set (match_operand:SF 0 "gpr_operand" "=r")
+ (float:SF (match_dup 1)))])]
+ ""
+ "float %0, %1"
+ [(set_attr "type" "fp")])
+
+(define_expand "floatunssisf2"
+ [(set (match_operand:SF 0 "gpr_operand" "")
+ (float:SF (match_operand:SI 1 "gpr_operand" "")))]
+ "epiphany_normal_fp_rounding == /*FP_MODE_ROUND_TRUNC*/ 2"
+{
+ rtx cst = force_reg (SImode, gen_int_mode (0xb0800000, SImode));
+ rtx tmp = gen_reg_rtx (SImode);
+ rtx cmp = gen_rtx_GTU (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM), const0_rtx);
+
+ if (reg_overlap_mentioned_p (operands[0], operands[1]))
+ operands[1] = copy_to_mode_reg (SImode, operands[1]);
+ emit_insn (gen_floatsisf2 (operands[0], operands[1]));
+ emit_insn (gen_ashrsi3 (tmp, operands[1], GEN_INT (8)));
+ emit_insn (gen_sub_f (tmp, tmp, cst));
+ emit_insn (gen_movsfcc (operands[0], cmp,
+ simplify_gen_subreg (SFmode, tmp, SImode, 0),
+ operands[0]));
+ DONE;
+})
+
+(define_expand "fix_truncsfsi2"
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "")
+ (fix:SI (match_operand:SF 1 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*fix_truncsfsi2_i"
+ [(match_parallel 2 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (fix:SI (match_operand:SF 1 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "fix %0, %1"
+ [(set_attr "type" "fp")
+ (set_attr "fp_mode" "round_trunc")])
+
+(define_expand "fixuns_truncsfsi2"
+ [(set (match_operand:SI 0 "gpr_operand" "")
+ (unsigned_fix:SI (match_operand:SF 1 "gpr_operand" "")))]
+ ""
+{
+ if (reg_overlap_mentioned_p (operands[0], operands[1]))
+ operands[1] = copy_to_mode_reg (SImode, operands[1]);
+ if (TARGET_SOFT_CMPSF || optimize_function_for_speed_p (cfun))
+ {
+ rtx op1si;
+ /* By toggling what it to be bit31 before the shift, we get a chance to
+ use a short movt insn. */
+ rtx bit31 = force_reg (SImode, GEN_INT (0x800000));
+ rtx tmp = gen_reg_rtx (SImode);
+ rtx limit = force_reg (SImode, gen_int_mode (0x4f000000, SImode));
+ rtx cmp
+ = gen_rtx_GE (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM), const0_rtx);
+
+ op1si = simplify_gen_subreg (SImode, operands[1], SFmode, 0);
+ emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
+ emit_insn (gen_subsi3 (tmp, op1si, bit31));
+ emit_insn (gen_ashlsi3 (tmp, tmp, GEN_INT (8)));
+ emit_insn (gen_cmpsi_cc_insn (op1si, limit));
+ emit_insn (gen_movsicc (operands[0], cmp, tmp, operands[0]));
+ }
+ else
+ {
+ REAL_VALUE_TYPE offset;
+ rtx limit;
+ rtx tmp = gen_reg_rtx (SFmode);
+ rtx label = gen_label_rtx ();
+ rtx bit31;
+ rtx cc1 = gen_rtx_REG (CC_FPmode, CCFP_REGNUM);
+ rtx cmp = gen_rtx_LT (VOIDmode, cc1, CONST0_RTX (SFmode));
+
+ real_2expN (&offset, 31, SFmode);
+ limit = CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode);
+ limit = force_reg (SFmode, limit);
+ emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
+ emit_insn (gen_subsf3_f (tmp, operands[1], limit));
+ emit_jump_insn (gen_branch_insn (label, cmp, cc1));
+ bit31 = force_reg (SImode, gen_int_mode (0x80000000, SImode));
+ emit_insn (gen_fix_truncsfsi2 (operands[0], tmp));
+ emit_insn (gen_xorsi3 (operands[0], operands[0], bit31));
+ emit_label (label);
+ }
+ DONE;
+})
+
+(define_insn "*iadd"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (plus:SI (match_operand:SI 1 "gpr_operand" "%r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "iadd %0, %1, %2"
+ [(set_attr "type" "fp_int")])
+
+(define_insn "*isub"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (minus:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "isub %0, %1, %2"
+ [(set_attr "type" "fp_int")])
+
+(define_expand "mulsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "")
+ (mult:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_operand:SI 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn "*imul"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (mult:SI (match_operand:SI 1 "gpr_operand" "%r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "imul %0, %1, %2"
+ [(set_attr "type" "fp_int")])
+
+; combiner pattern, also used by vector combiner pattern
+(define_expand "maddsi"
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (plus:SI (mult:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r"))
+ (match_operand:SI 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "")
+
+(define_insn "*maddsi_combine"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (plus:SI (mult:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r"))
+ (match_operand:SI 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "imsub %0, %1, %2"
+ [(set_attr "type" "fp_int")])
+
+(define_insn "*imsub"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (minus:SI (match_operand:SI 3 "gpr_operand" "0")
+ (mult:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r"))))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "imsub %0, %1, %2"
+ [(set_attr "type" "fp_int")])
+
+(define_expand "divsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "move_dest_operand" "")
+ (div:SI (match_operand:SI 1 "move_src_operand" "")
+ (match_operand:SI 2 "move_src_operand" "")))
+ (use (match_dup 3))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "operands[3] = sfunc_symbol (\"__divsi3\");")
+
+;; Before reload, keep the hard reg usage to clobbers so that the loop
+;; optimizers can more easily move this insn.
+(define_insn_and_split "*divsi3_1"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "move_dest_operand" "=r,r")
+ (div:SI (match_operand:SI 1 "move_src_operand" "rU16m,rU16mCal")
+ (match_operand:SI 2 "move_src_operand" "rU16m,rU16mCal")))
+ (use (match_operand:SI 3 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "&& reload_completed"
+ [(set (reg:SI 0) (match_dup 1))
+ (set (reg:SI 1) (match_dup 2))
+ (parallel
+ [(set (reg:SI 0) (div:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_dup 3))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 5)
+ (match_dup 6)])
+ (set (match_dup 0) (reg:SI 0))]
+ "operands[5] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[6] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);"
+ [(set_attr "type" "fp_sfunc")
+ (set_attr "length" "16,24")])
+
+(define_insn "*divsi3_2"
+ [(match_parallel 1 "float_operation"
+ [(set (reg:SI 0) (div:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_20))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "%f0"
+ [(set_attr "type" "fp_sfunc")])
+
+(define_expand "udivsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "move_dest_operand" "")
+ (udiv:SI (match_operand:SI 1 "move_src_operand" "")
+ (match_operand:SI 2 "move_src_operand" "")))
+ (use (match_dup 3))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "operands[3] = sfunc_symbol (\"__udivsi3\");")
+
+;; Before reload, keep the hard reg usage to clobbers so that the loop
+;; optimizers can more easily move this insn.
+(define_insn_and_split "*udivsi3_1"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "move_dest_operand" "=r,r")
+ (udiv:SI (match_operand:SI 1 "move_src_operand" "rU16m,rU16mCal")
+ (match_operand:SI 2 "move_src_operand" "rU16m,rU16mCal")))
+ (use (match_operand:SI 3 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "&& reload_completed"
+ [(set (reg:SI 0) (match_dup 1))
+ (set (reg:SI 1) (match_dup 2))
+ (parallel
+ [(set (reg:SI 0) (udiv:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_dup 3))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 5)
+ (match_dup 6)])
+ (set (match_dup 0) (reg:SI 0))]
+ "operands[5] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[6] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);"
+ [(set_attr "type" "fp_sfunc")
+ (set_attr "length" "16,24")])
+
+(define_insn "*udivsi3_2"
+ [(match_parallel 1 "float_operation"
+ [(set (reg:SI 0) (udiv:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "%f0"
+ [(set_attr "type" "fp_sfunc")])
+
+(define_expand "modsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "move_dest_operand" "")
+ (mod:SI (match_operand:SI 1 "move_src_operand" "")
+ (match_operand:SI 2 "move_src_operand" "")))
+ (use (match_dup 3))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "operands[3] = sfunc_symbol (\"__modsi3\");")
+
+;; Before reload, keep the hard reg usage to clobbers so that the loop
+;; optimizers can more easily move this insn.
+(define_insn_and_split "*modsi3_1"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "move_dest_operand" "=r,r")
+ (mod:SI (match_operand:SI 1 "move_src_operand" "rU16m,rU16mCal")
+ (match_operand:SI 2 "move_src_operand" "rU16m,rU16mCal")))
+ (use (match_operand:SI 3 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "&& reload_completed"
+ [(set (reg:SI 0) (match_dup 1))
+ (set (reg:SI 1) (match_dup 2))
+ (parallel
+ [(set (reg:SI 0) (mod:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_dup 3))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 5)
+ (match_dup 6)])
+ (set (match_dup 0) (reg:SI 0))]
+ "operands[5] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[6] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);"
+ [(set_attr "type" "fp_sfunc")
+ (set_attr "length" "16,24")])
+
+(define_insn "*modsi3_2"
+ [(match_parallel 1 "float_operation"
+ [(set (reg:SI 0) (mod:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:DI GPR_18))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "%f0"
+ [(set_attr "type" "fp_sfunc")])
+
+(define_expand "umodsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "move_dest_operand" "")
+ (umod:SI (match_operand:SI 1 "move_src_operand" "")
+ (match_operand:SI 2 "move_src_operand" "")))
+ (use (match_dup 3))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "operands[3] = sfunc_symbol (\"__umodsi3\");")
+
+;; Before reload, keep the hard reg usage to clobbers so that the loop
+;; optimizers can more easily move this insn.
+(define_insn_and_split "*umodsi3_1"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:SI 0 "move_dest_operand" "=r,r")
+ (umod:SI (match_operand:SI 1 "move_src_operand" "rU16m,rU16mCal")
+ (match_operand:SI 2 "move_src_operand" "rU16m,rU16mCal")))
+ (use (match_operand:SI 3 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 0))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "&& reload_completed"
+ [(set (reg:SI 0) (match_dup 1))
+ (set (reg:SI 1) (match_dup 2))
+ (parallel
+ [(set (reg:SI 0) (umod:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_dup 3))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 5)
+ (match_dup 6)])
+ (set (match_dup 0) (reg:SI 0))]
+ "operands[5] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[6] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);"
+ [(set_attr "type" "fp_sfunc")
+ (set_attr "length" "16,24")])
+
+(define_insn "*umodsi3_2"
+ [(match_parallel 1 "float_operation"
+ [(set (reg:SI 0) (umod:SI (reg:SI 0) (reg:SI 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:DI GPR_16))
+ (clobber (reg:SI GPR_LR))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "%f0"
+ [(set_attr "type" "fp_sfunc")])
+
+; Disable interrupts.
+; Any earlier values read from CONFIG_REGNUM are out of date, since interrupts
+; might have changed settings that we do not want to mess with.
+(define_insn "gid"
+ [(set (reg:SI CONFIG_REGNUM)
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_GID))]
+ ""
+ "gid"
+ [(set_attr "type" "flow")])
+
+; Enable interrupts.
+; Present CONTROL_REGNUM here to make sure it is live before the
+; actual uses in floating point insns / calls are inserted.
+; FWIW, interrupts also do mind what is in the control register.
+(define_insn "gie"
+ [(unspec_volatile [(reg:SI CONFIG_REGNUM)] UNSPECV_GIE)]
+ ""
+ "gie"
+ [(set_attr "type" "flow")])
+
+; Floating point instructions require manipulating the control register.
+; Manipulating the control register needs aritmetic.
+; Arithmetic clobbers flags.
+; The flags are in the status register, which also contains the alternate
+; flag and the interrupt enable/disable bits.
+; saving/restoring status and mixing up the order with gid/gie could
+; lead to disaster.
+; Usually, saving/restoring the status is unnecessary, and will be optimized
+; away. But when we really need it, we must make sure that we don't change
+; anything but the flags.
+; N.B.: We could make the constant easier to load by inverting it, but
+; then we'd need to clobber the saved value - and that would make optimizing
+; away unneeded saves/restores harder / less likely.
+(define_expand "movcc"
+ [(parallel [(set (match_operand:CC 0 "cc_move_operand" "")
+ (match_operand:CC 1 "cc_move_operand" ""))
+ (use (match_dup 2))
+ (clobber (match_scratch:SI 3 "=X, &r"))])]
+ ""
+ "operands[2] = gen_int_mode (~0x10f0, SImode);")
+
+(define_insn "*movcc_i"
+ [(set (match_operand:CC 0 "cc_move_operand" "=r,Rcc")
+ (match_operand:CC 1 "cc_move_operand" "Rcc, r"))
+ (use (match_operand:SI 2 "nonmemory_operand" "X, r"))
+ (clobber (match_scratch:SI 3 "=X, &r"))]
+ ""
+ "@
+ movfs %0,status
+ movfs %3,status\;eor %3,%3,%1\;and %3,%3,%2\;eor %3,%3,%1\;movts status,%3"
+ [(set_attr "type" "flow")
+ (set_attr "length" "20,4")])
+
+(define_insn_and_split "set_fp_mode"
+ [(set (reg:SI FP_NEAREST_REGNUM)
+ (match_operand:SI 0 "set_fp_mode_operand" "rCfm"))
+ (set (reg:SI FP_TRUNCATE_REGNUM) (match_dup 0))
+ (set (reg:SI FP_ANYFP_REGNUM)
+ (match_operand:SI 1 "set_fp_mode_operand" "rCfm"))
+ (use (match_operand:SI 2 "gpr_operand" "r"))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (match_scratch:SI 3 "=&r"))]
+ ""
+ "#"
+ "reload_completed || !rtx_equal_p (operands[0], operands[1])"
+ [(const_int 0)]
+{
+ if (!reload_completed)
+ emit_note (NOTE_INSN_DELETED);
+ else
+ epiphany_expand_set_fp_mode (operands);
+ DONE;
+})
+
+
+;; Boolean instructions.
+;;
+;; We don't define the DImode versions as expand_binop does a good enough job.
+
+(define_insn "andsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (and:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "and %0,%1,%2")
+
+(define_insn "iorsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (ior:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "orr %0,%1,%2")
+
+(define_insn "xorsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (xor:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "eor %0,%1,%2")
+
+(define_expand "one_cmplsi2"
+ [(set (match_operand:SI 0 "gpr_operand" "")
+ (xor:SI (match_operand:SI 1 "gpr_operand" "")
+ (match_dup 2)))]
+ ""
+{
+ if (epiphany_m1reg >= 0)
+ emit_insn (gen_one_cmplsi2_i (operands[0], operands[1]));
+ else
+ emit_insn (gen_xorsi3 (operands[0], operands[1],
+ force_reg (SImode, GEN_INT (-1))));
+ DONE;
+})
+
+; Note that folding this pattern into the xorsi3 pattern would make combine
+; less effective.
+(define_insn "one_cmplsi2_i"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (not:SI (match_operand:SI 1 "gpr_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))]
+ "epiphany_m1reg >= 0"
+ "eor %0,%1,%-")
+
+;; Shift instructions.
+;; In principle we could support arbitrary symbolic values as shift constant
+;; (truncating the value appropriately), but that would require a suitable
+;; relocation and assembler & linker support.
+(define_insn "ashrsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (ashiftrt:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,K")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "asr %0,%1,%2"
+ [(set_attr "length" "4")
+ (set_attr "type" "shift")])
+
+(define_insn "ashrsi3_tst"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC
+ (ashiftrt:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,K"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (ashiftrt:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "asr %0,%1,%2"
+ [(set_attr "length" "4")
+ (set_attr "type" "shift")])
+
+;; Logical Shift Right
+(define_insn "lshrsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (lshiftrt:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,K")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "lsr %0,%1,%2"
+ [(set_attr "length" "4")
+ (set_attr "type" "shift")])
+
+(define_insn "lshrsi3_tst"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC
+ (lshiftrt:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,K"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (lshiftrt:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "lsr %0,%1,%2"
+ [(set_attr "length" "4")
+ (set_attr "type" "shift")])
+
+;; Logical/Arithmetic Shift Left
+(define_insn "ashlsi3"
+ [(set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (ashift:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,K")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "lsl %0,%1,%2"
+ [(set_attr "length" "4")
+ (set_attr "type" "shift")])
+
+(define_insn "*ashlsi_btst"
+ [(set (reg:CC_N_NE CC_REGNUM)
+ (compare:CC_N_NE
+ (zero_extract:SI (match_operand:SI 1 "gpr_operand" "r")
+ (const_int 1)
+ (match_operand 2 "const_int_operand" "K"))
+ (const_int 0)))
+ (clobber (match_scratch:SI 0 "=r"))]
+ ""
+{
+ rtx xop[3];
+
+ xop[0] = operands[0];
+ xop[1] = operands[1];
+ xop[2] = GEN_INT (31-INTVAL (operands[2]));
+ output_asm_insn ("lsl %0,%1,%2", xop);
+ return "";
+})
+
+;; zero extensions
+(define_insn_and_split "zero_extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "@
+ #
+ ldrb %0,%1"
+ "reload_completed
+ ? true_regnum (operands[1]) >= 0
+ : REG_P (operands[1]) && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER"
+ [(parallel [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 24)))
+ (clobber (reg:CC CC_REGNUM))])
+ (parallel [(set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 24)))
+ (clobber (reg:CC CC_REGNUM))])]
+ "operands[2] = simplify_gen_subreg (SImode, operands[1], QImode, 0);")
+
+(define_insn "zero_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,m")))]
+ ""
+ "@
+ movt %0, 0
+ ldrh %0,%c1")
+
+
+;; Compare instructions.
+
+(define_insn "cmpsi_cc_insn"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 0 "add_reg_operand" "r,r")
+ (match_operand:SI 1 "arith_operand" "r,L")))
+ (clobber (match_scratch:SI 2 "=r,r"))]
+ ""
+ "sub %2,%0,%1"
+ [(set_attr "type" "compare")])
+
+(define_insn "sub_f"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,L")))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (minus:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "sub %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_insn "*sub_f_add_imm"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "arith_int_operand" "L")))
+ (set (match_operand:SI 0 "gpr_operand" "=r")
+ (plus:SI (match_dup 1) (match_operand:SI 3 "const_int_operand" "L")))]
+ "INTVAL (operands[2]) == -INTVAL (operands[3])"
+ "sub %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_expand "abssi2"
+ [(set (match_dup 2) (const_int 0))
+ (parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 2)
+ (match_operand:SI 1 "nonmemory_operand" "")))
+ (set (match_dup 3)
+ (minus:SI (match_dup 2) (match_dup 1)))])
+ (set (match_operand:SI 0 "gpr_operand" "=r")
+ (if_then_else:SI (gt:SI (reg:CC CC_REGNUM) (const_int 0))
+ (match_dup 3)
+ (match_dup 1)))]
+ "TARGET_CMOVE"
+ "operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode);")
+
+(define_insn "*add_c"
+ [(set (reg:CC_C_LTU CC_REGNUM)
+ (compare:CC_C_LTU
+ (plus:SI (match_operand:SI 1 "gpr_operand" "%r,r")
+ (match_operand:SI 2 "arith_operand" "r,L"))
+ (match_dup 1)))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (plus:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "add %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_insn "*add_c_rev"
+ [(set (reg:CC_C_LTU CC_REGNUM)
+ (compare:CC_C_LTU
+ (plus:SI (match_operand:SI 1 "gpr_operand" "%r,r")
+ (match_operand:SI 2 "arith_operand" "r,L"))
+ (match_dup 1)))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (plus:SI (match_dup 2) (match_dup 1)))]
+ ""
+ "add %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_insn "*sub_c"
+ [(set (reg:CC_C_GTU CC_REGNUM)
+ (compare:CC_C_GTU
+ (minus:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,L"))
+ (match_dup 1)))
+ (set (match_operand:SI 0 "gpr_operand" "=r,r")
+ (minus:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "sub %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_insn "*sub_c_void"
+ [(set (reg:CC_C_GTU CC_REGNUM)
+ (compare:CC_C_GTU
+ (minus:SI (match_operand:SI 1 "gpr_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "r,L"))
+ (match_dup 1)))
+ (clobber (match_scratch:SI 0 "=r,r"))]
+ ""
+ "sub %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+; floating point comparisons
+
+(define_insn "*cmpsf_cc_insn"
+ [(match_parallel 3 "float_operation"
+ [(set (reg:CC_FP CCFP_REGNUM)
+ (compare:CC_FP (match_operand:SF 0 "gpr_operand" "r")
+ (match_operand:SF 1 "gpr_operand" "r")))
+ (clobber (match_scratch:SF 2 "=r"))])]
+ "!TARGET_SOFT_CMPSF"
+ "fsub %2,%0,%1"
+ [(set_attr "type" "fp")
+ (set_attr "fp_mode" "round_unknown")])
+
+;; ??? do we have to relax the operand0 predicate to immediate_operand
+;; to allow the rtl loop optimizer to generate comparisons? OTOH
+;; we want call_address_operand to enforce valid operands so that
+;; combine won't do silly things, allowing instruction scheduling to do
+;; a proper job.
+(define_insn "*cmpsf_eq"
+ [(set (reg:CC_FP_EQ CC_REGNUM) (compare:CC_FP_EQ (reg:SF 0) (reg:SF 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:SI GPR_LR))]
+ "TARGET_SOFT_CMPSF"
+ "%f0"
+ [(set_attr "type" "sfunc")])
+
+(define_insn "*cmpsf_gte"
+ [(set (reg:CC_FP_GTE CC_REGNUM) (compare:CC_FP_GTE (reg:SF 0) (reg:SF 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:SI GPR_LR))]
+ "TARGET_SOFT_CMPSF"
+ "%f0"
+ [(set_attr "type" "sfunc")])
+
+(define_insn "*cmpsf_ord"
+ [(set (reg:CC_FP_ORD CC_REGNUM) (compare:CC_FP_ORD (reg:SF 0) (reg:SF 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:SI GPR_16))
+ (clobber (reg:SI GPR_LR))]
+ "TARGET_SOFT_CMPSF"
+ "%f0"
+ [(set_attr "type" "sfunc")])
+
+(define_insn "*cmpsf_uneq"
+ [(set (reg:CC_FP_UNEQ CC_REGNUM) (compare:CC_FP_UNEQ (reg:SF 0) (reg:SF 1)))
+ (use (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (clobber (reg:SI GPR_IP))
+ (clobber (reg:SI GPR_16))
+ (clobber (reg:SI GPR_LR))]
+ "TARGET_SOFT_CMPSF"
+ "%f0"
+ [(set_attr "type" "sfunc")])
+
+;; conditional moves
+
+(define_expand "mov<mode>cc"
+ [(set (match_operand:WMODE 0 "gpr_operand" "")
+ (if_then_else:WMODE (match_operand 1 "comparison_operator" "")
+ (match_operand:WMODE 2 "gpr_operand" "")
+ (match_operand:WMODE 3 "gpr_operand" "")))]
+ "TARGET_CMOVE"
+{
+ rtx cmp_op0 = XEXP (operands[1], 0);
+ rtx cmp_op1 = XEXP (operands[1], 1);
+ enum machine_mode cmp_in_mode;
+ enum rtx_code code = GET_CODE (operands[1]);
+
+ cmp_in_mode = GET_MODE (cmp_op0);
+ if (cmp_in_mode == VOIDmode)
+ cmp_in_mode = GET_MODE (cmp_op0);
+ if (cmp_in_mode == VOIDmode)
+ cmp_in_mode = SImode;
+ /* If the operands are a better match when reversed, swap them now.
+ This allows combine to see the proper comparison codes. */
+ if (rtx_equal_p (operands[0], operands[2])
+ && !rtx_equal_p (operands[0], operands[3]))
+ {
+ rtx tmp = operands[2]; operands[2] = operands[3]; operands[3] = tmp;
+ code = (FLOAT_MODE_P (GET_MODE (cmp_op0))
+ ? reverse_condition_maybe_unordered (code)
+ : reverse_condition (code));
+ }
+
+ if (proper_comparison_operator (operands[1], VOIDmode))
+ operands[1] = gen_rtx_fmt_ee (code, cmp_in_mode, cmp_op0, cmp_op1);
+ else
+ {
+ if (!currently_expanding_to_rtl)
+ {
+ /* ??? It would seem safest to FAIL here, but that would defeat
+ the purpose of having an if-conversion pass; its logic currently
+ assumes that the backend should be safe to insert condition code
+ setting instructions, as the same condition codes were presumably
+ set by the if-conversion input code. */
+ }
+ /* What mode to give as first operand to gen_compare_reg here is
+ debatable. VOIDmode would be minimalist; telling gen_compare_reg
+ to use the mode of CC_REGNUM (or putting it on the comparison
+ operator afterwards) is also a logical choice. OTOH, by using
+ <MODE>mode, we have mode combine opportunities with flag setting
+ operations - if we get some. */
+ operands[1]
+ = gen_compare_reg (<MODE>mode, code, cmp_in_mode, cmp_op0, cmp_op1);
+ }
+})
+
+(define_insn "*mov<mode>cc_insn"
+ [(set (match_operand:WMODE 0 "gpr_operand" "=r")
+ (if_then_else:WMODE (match_operator 3 "proper_comparison_operator"
+ [(match_operand 4 "cc_operand") (const_int 0)])
+ (match_operand:WMODE 1 "gpr_operand" "r")
+ (match_operand:WMODE 2 "gpr_operand" "0")))]
+ "TARGET_CMOVE"
+ "mov%d3 %0,%1"
+ [(set_attr "type" "cmove")])
+
+(define_peephole2
+ [(parallel [(set (match_operand:WMODE 0 "gpr_operand" "")
+ (match_operand:WMODE 1 "" ""))
+ (clobber (match_operand 8 "cc_operand"))])
+ (match_operand 2 "" "")
+ (set (match_operand:WMODE2 3 "gpr_operand" "")
+ (match_operand:WMODE2 9 "gpr_operand" ""))
+ (set (match_dup 3)
+ (if_then_else:WMODE2 (match_operator 5 "proper_comparison_operator"
+ [(match_operand 6 "cc_operand")
+ (match_operand 7 "const0_operand")])
+ (match_operand:WMODE2 4 "nonmemory_operand" "")
+ (match_dup 3)))]
+ "REGNO (operands[0]) == REGNO (operands[9])
+ && peep2_reg_dead_p (3, operands[0])
+ && !reg_set_p (operands[0], operands[2])
+ && !reg_set_p (operands[3], operands[2])
+ && !reg_overlap_mentioned_p (operands[3], operands[2])"
+ [(parallel [(set (match_dup 10) (match_dup 1))
+ (clobber (match_dup 8))])
+ (match_dup 2)
+ (set (match_dup 3)
+ (if_then_else:WMODE2 (match_dup 5) (match_dup 4) (match_dup 3)))]
+{
+ operands[10] = simplify_gen_subreg (<WMODE:MODE>mode, operands[3],
+ <WMODE2:MODE>mode, 0);
+ replace_rtx (operands[2], operands[9], operands[3]);
+ replace_rtx (operands[2], operands[0], operands[10]);
+ gcc_assert (!reg_overlap_mentioned_p (operands[0], operands[2]));
+})
+
+(define_peephole2
+ [(parallel [(set (match_operand 6 "cc_operand") (match_operand 2 "" ""))
+ (set (match_operand:WMODE 0 "gpr_operand" "")
+ (match_operand:WMODE 1 "" ""))])
+ (set (match_operand:WMODE2 3 "gpr_operand" "")
+ (match_operand:WMODE2 4 "gpr_operand"))
+ (set (match_dup 3)
+ (if_then_else:WMODE2 (match_operator 5 "proper_comparison_operator"
+ [(match_dup 6)
+ (match_operand:WMODE 7 "const0_operand")])
+ (match_operand:WMODE2 8 "gpr_operand")
+ (match_dup 3)))]
+ "REGNO (operands[0]) == REGNO (operands[8])
+ && REVERSIBLE_CC_MODE (GET_MODE (operands[6]))
+ && peep2_reg_dead_p (3, operands[6])
+ && peep2_reg_dead_p (3, operands[0])
+ && !reg_overlap_mentioned_p (operands[4], operands[3])"
+ [(parallel [(set (match_dup 6) (match_dup 2))
+ (set (match_dup 9) (match_dup 1))])
+ (set (match_dup 3)
+ (if_then_else:WMODE2 (match_dup 5) (match_dup 4) (match_dup 3)))]
+ "
+{
+ operands[5]
+ = gen_rtx_fmt_ee (REVERSE_CONDITION (GET_CODE (operands[5]),
+ GET_MODE (operands[6])),
+ GET_MODE (operands[5]), operands[6], operands[7]);
+ operands[9] = simplify_gen_subreg (<WMODE:MODE>mode, operands[3],
+ <WMODE2:MODE>mode, 0);
+}")
+
+;; These control RTL generation for conditional jump insns
+
+;; To signal to can_compare_p that the cbranchs?4 patterns work,
+;; they must allow const0_rtx for both comparison operands
+(define_expand "cbranchsi4"
+ [(set (reg CC_REGNUM)
+ (compare (match_operand:SI 1 "add_operand" "")
+ (match_operand:SI 2 "arith_operand" "")))
+ (set (pc)
+ (if_then_else
+ (match_operator 0 "ordered_comparison_operator" [(reg CC_REGNUM)
+ (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ ""
+{
+ rtx cmp = gen_compare_reg (VOIDmode, GET_CODE (operands[0]), SImode,
+ operands[1], operands[2]);
+ emit_jump_insn (gen_branch_insn (operands[3], cmp, XEXP (cmp, 0)));
+ DONE;
+})
+
+(define_expand "cbranchsf4"
+ [(set (reg CC_REGNUM)
+ (compare (match_operand:SF 1 "arith_operand" "")
+ (match_operand:SF 2 "arith_operand" "")))
+ (set (pc)
+ (if_then_else
+ (match_operator 0 "comparison_operator" [(reg CC_REGNUM)
+ (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ ""
+{
+ rtx cmp = gen_compare_reg (VOIDmode, GET_CODE (operands[0]), SFmode,
+ operands[1], operands[2]);
+ emit_jump_insn (gen_branch_insn (operands[3], cmp, XEXP (cmp, 0)));
+ DONE;
+})
+
+;; Now match both normal and inverted jump.
+
+(define_insn "branch_insn"
+ [(set (pc)
+ (if_then_else (match_operator 1 "proper_comparison_operator"
+ [(match_operand 2 "cc_operand")
+ (const_int 0)])
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "b%d1 %l0"
+ [(set_attr "type" "branch")])
+
+(define_insn "*rev_branch_insn"
+ [(set (pc)
+ (if_then_else (match_operator 1 "proper_comparison_operator"
+ [(reg CC_REGNUM) (const_int 0)])
+ (pc)
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ "b%D1 %l0"
+ [(set_attr "type" "branch")])
+
+;; Unconditional and other jump instructions.
+
+(define_insn "jump"
+ [(set (pc) (label_ref (match_operand 0 "" "")))]
+ ""
+ "b %l0"
+ [(set_attr "type" "uncond_branch")])
+
+(define_insn "indirect_jump"
+ [(set (pc) (match_operand:SI 0 "gpr_operand" "r"))]
+ ""
+ "jr %0"
+ [(set_attr "type" "uncond_branch")])
+
+(define_expand "tablejump"
+ [(parallel [(set (pc) (match_operand:SI 0 "gpr_operand" ""))
+ (use (label_ref (match_operand 1 "" "")))])]
+ ""
+{
+ /* In PIC mode, the table entries are stored PC relative.
+ Convert the relative address to an absolute address. */
+ if (flag_pic)
+ {
+ rtx op1 = gen_rtx_LABEL_REF (Pmode, operands[1]);
+
+ operands[0] = expand_simple_binop (Pmode, PLUS, operands[0],
+ op1, NULL_RTX, 0, OPTAB_DIRECT);
+ }
+})
+
+(define_insn "*tablejump_internal"
+ [(set (pc) (match_operand:SI 0 "gpr_operand" "r"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "jr %0;"
+ [(set_attr "type" "uncond_branch")])
+
+(define_insn "*tablejump_hi_internal"
+ [(set (pc) (match_operand:HI 0 "gpr_operand" "r"))
+ (use (label_ref (match_operand 1 "" "")))]
+ "optimize_size && TARGET_SMALL16"
+ "jr %0;"
+ [(set_attr "type" "uncond_branch")])
+
+
+(define_expand "call"
+ ;; operands[1] is stack_size_rtx
+ ;; operands[2] is next_arg_register
+ [(parallel [(call (match_operand:SI 0 "call_operand" "")
+ (match_operand 1 "" ""))
+ (clobber (reg:SI GPR_LR))])]
+ ""
+{
+ bool target_uninterruptible = epiphany_call_uninterruptible_p (operands[0]);
+
+ if (!call_operand (operands[1], VOIDmode))
+ operands[0]
+ = change_address (operands[0], VOIDmode,
+ copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
+ if (epiphany_uninterruptible_p (current_function_decl)
+ != target_uninterruptible)
+ {
+ emit_insn (target_uninterruptible ? gen_gid (): gen_gie ());
+ emit_call_insn
+ (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2, gen_rtx_CALL (VOIDmode, operands[0], operands[1]),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (SImode, GPR_LR)))));
+ emit_insn (target_uninterruptible ? gen_gie (): gen_gid ());
+ DONE;
+ }
+})
+
+(define_insn "*call_i"
+ [(match_parallel 2 "float_operation"
+ [(call (mem:SI (match_operand:SI 0 "call_address_operand" "Csy,r"))
+ (match_operand 1 "" ""))
+ (clobber (reg:SI GPR_LR))])]
+ ""
+ "%f0"
+ [(set_attr "type" "call")])
+
+(define_expand "sibcall"
+ ;; operands[1] is stack_size_rtx
+ ;; operands[2] is next_arg_register
+ [(parallel [(call (match_operand:SI 0 "call_operand" "")
+ (match_operand 1 "" ""))
+ (return)])]
+ ""
+{
+ bool target_uninterruptible = epiphany_call_uninterruptible_p (operands[0]);
+
+ if (!call_operand (operands[1], VOIDmode))
+ operands[0]
+ = change_address (operands[0], VOIDmode,
+ copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
+ if (epiphany_uninterruptible_p (current_function_decl)
+ != target_uninterruptible)
+ {
+ emit_insn (target_uninterruptible ? gen_gid (): gen_gie ());
+ emit_call_insn
+ (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2, gen_rtx_CALL (VOIDmode, operands[0], operands[1]),
+ ret_rtx)));
+ emit_insn (target_uninterruptible ? gen_gie (): gen_gid ());
+ DONE;
+ }
+})
+
+(define_insn "*sibcall_i"
+ [(call (mem:SI (match_operand:SI 0 "call_address_operand" "Csy,Rsc"))
+ (match_operand 1 "" ""))
+ (return)]
+ ""
+ "@
+ b %0
+ jr %0"
+ [(set_attr "type" "call")])
+
+(define_expand "call_value"
+ ;; operand 2 is stack_size_rtx
+ ;; operand 3 is next_arg_register
+ [(parallel [(set (match_operand 0 "gpr_operand" "=r")
+ (call (match_operand:SI 1 "call_operand" "")
+ (match_operand 2 "" "")))
+ (clobber (reg:SI GPR_LR))])]
+ ""
+{
+ bool target_uninterruptible = epiphany_call_uninterruptible_p (operands[1]);
+
+ if (!call_operand (operands[1], VOIDmode))
+ operands[1]
+ = change_address (operands[1], VOIDmode,
+ copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
+ if (epiphany_uninterruptible_p (current_function_decl)
+ != target_uninterruptible)
+ {
+ emit_insn (target_uninterruptible ? gen_gid (): gen_gie ());
+ emit_call_insn
+ (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2, gen_rtx_SET
+ (VOIDmode, operands[0],
+ gen_rtx_CALL (VOIDmode, operands[1], operands[2])),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (SImode, GPR_LR)))));
+ emit_insn (target_uninterruptible ? gen_gie (): gen_gid ());
+ DONE;
+ }
+})
+
+(define_insn "*call_value_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand 0 "gpr_operand" "=r,r")
+ (call (mem:SI (match_operand:SI 1 "call_address_operand" "Csy,r"))
+ (match_operand 2 "" "")))
+ (clobber (reg:SI GPR_LR))])]
+ ""
+ "%f1"
+ [(set_attr "type" "call")
+ (set_attr "length" "4")])
+
+(define_expand "sibcall_value"
+ ;; operand 2 is stack_size_rtx
+ ;; operand 3 is next_arg_register
+ [(parallel [(set (match_operand 0 "gpr_operand" "=r")
+ (call (match_operand:SI 1 "call_operand" "")
+ (match_operand 2 "" "")))
+ (return)])]
+ ""
+{
+ bool target_uninterruptible = epiphany_call_uninterruptible_p (operands[1]);
+
+ if (!call_operand (operands[1], VOIDmode))
+ operands[1]
+ = change_address (operands[1], VOIDmode,
+ copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
+ if (epiphany_uninterruptible_p (current_function_decl)
+ != target_uninterruptible)
+ {
+ emit_insn (target_uninterruptible ? gen_gid (): gen_gie ());
+ emit_call_insn
+ (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2, gen_rtx_SET
+ (VOIDmode, operands[0],
+ gen_rtx_CALL (VOIDmode, operands[1], operands[2])),
+ ret_rtx)));
+ emit_insn (target_uninterruptible ? gen_gie (): gen_gid ());
+ DONE;
+ }
+})
+
+(define_insn "*sibcall_value_i"
+ [(set (match_operand 0 "gpr_operand" "=r,r")
+ (call (mem:SI (match_operand:SI 1 "call_address_operand" "Csy,Rsc"))
+ (match_operand 2 "" "")))
+ (return)]
+ ""
+ "@
+ b %1
+ jr %1"
+ [(set_attr "type" "call")
+ (set_attr "length" "4")])
+
+(define_expand "prologue"
+ [(pc)]
+ ""
+{
+ epiphany_expand_prologue ();
+ DONE;
+})
+
+(define_expand "epilogue"
+ [(pc)]
+ ""
+{
+ epiphany_expand_epilogue (0);
+ DONE;
+})
+
+(define_expand "sibcall_epilogue"
+ [(pc)]
+ ""
+{
+ epiphany_expand_epilogue (1);
+ DONE;
+})
+
+; Since the demise of REG_N_SETS, it is no longer possible to find out
+; in the prologue / epilogue expanders how many times lr is set.
+; Using df_regs_ever_live_p to decide if lr needs saving means that
+; any explicit use of lr will cause it to be saved; hence we cannot
+; represent the blink use in return / sibcall instructions themselves, and
+; instead have to show it in EPILOGUE_USES.
+(define_insn "return_i"
+ [(return)]
+ "reload_completed"
+ "rts"
+ [(set_attr "type" "uncond_branch")])
+
+(define_insn "return_internal_interrupt"
+ [(return)
+ (unspec_volatile [(const_int 0)] 1)]
+ ""
+ "rti"
+ [(set_attr "type" "uncond_branch")])
+
+(define_insn "stack_adjust_add"
+ [(set (reg:SI GPR_SP)
+ (plus:SI (reg:SI GPR_SP) (match_operand:SI 0 "arith_operand" "rL")))
+ (clobber (reg:CC CC_REGNUM))
+ (clobber (reg:SI STATUS_REGNUM))
+ (clobber (match_operand:BLK 1 "memory_operand" "=m"))]
+ "reload_completed"
+ "add sp,sp,%0")
+
+(define_insn "stack_adjust_mov"
+ [(set (reg:SI GPR_SP) (reg:SI GPR_FP))
+ (clobber (match_operand:BLK 0 "memory_operand" "=m"))]
+ "reload_completed"
+ "mov sp,fp"
+ [(set_attr "type" "move")])
+
+(define_insn "stack_adjust_str"
+ [(set (match_operand 0 "stacktop_operand" "=m")
+ (match_operand 1 "any_gpr_operand" "r"))
+ (set (reg:SI GPR_SP)
+ (plus:SI (reg:SI GPR_SP) (match_operand:SI 2 "nonmemory_operand" "rn")))
+ (clobber (match_operand:BLK 3 "memory_operand" "=m"))]
+ "reload_completed"
+{
+ return (GET_MODE_SIZE (GET_MODE (operands[0])) <= 4
+ ? \"str %1,%0,%C2\" : \"strd %1,%0,%X2\");
+}
+ [(set_attr "type" "store")])
+
+(define_insn "stack_adjust_ldr"
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (match_operand:SI 1 "stacktop_operand" "m"))
+ (set (reg:SI GPR_SP)
+ (plus:SI (reg:SI GPR_SP) (match_operand:SI 2 "nonmemory_operand" "rn")))
+ (clobber (match_operand:BLK 3 "memory_operand" "=m"))]
+ "reload_completed"
+ "ldr %0,%1,%C2"
+ [(set_attr "type" "load")])
+
+;; Define some fake vector operations so that the vectorizer is happy to use
+;; 64 bit loads/stores.
+(define_expand "vec_unpacks_lo_v4hi"
+ [(match_operand:V2SI 0 "gpr_operand")
+ (match_operand:V4HI 1 "gpr_operand")]
+ ""
+{
+ rtx in = simplify_gen_subreg (SImode, operands[1], V4HImode, 0);
+ rtx outl = simplify_gen_subreg (SImode, operands[0], V2SImode, 0);
+ rtx outh
+ = simplify_gen_subreg (SImode, operands[0], V2SImode, UNITS_PER_WORD);
+
+ if (reg_overlap_mentioned_p (outl, in))
+ in = copy_to_mode_reg (SImode, in);
+ emit_insn (gen_ashlsi3 (outl, in, GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (outl, outl, GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (outh, in, GEN_INT (16)));
+ DONE;
+})
+
+(define_expand "vec_unpacks_hi_v4hi"
+ [(match_operand:V2SI 0 "gpr_operand")
+ (match_operand:V4HI 1 "gpr_operand")]
+ ""
+{
+ rtx in = simplify_gen_subreg (SImode, operands[1], V4HImode, UNITS_PER_WORD);
+ rtx outl = simplify_gen_subreg (SImode, operands[0], V2SImode, 0);
+ rtx outh
+ = simplify_gen_subreg (SImode, operands[0], V2SImode, UNITS_PER_WORD);
+
+ if (reg_overlap_mentioned_p (outl, in))
+ in = copy_to_mode_reg (SImode, in);
+ emit_insn (gen_ashlsi3 (outl, in, GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (outl, outl, GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (outh, in, GEN_INT (16)));
+ DONE;
+})
+
+(define_code_iterator addsub [plus minus])
+
+(define_code_iterator alu_binop
+ [plus minus and ior xor])
+
+(define_code_attr insn_opname
+ [(plus "add") (minus "sub") (mult "mul") (div "div")
+ (and "and") (ior "ior") (xor "xor")])
+
+; You might think that this would work better as a define_expand, but
+; again lower_subreg pessimizes the code if it sees indiviudual operations.
+; We need to keep inputs and outputs as register pairs if we want to
+; get sensible register allocation for double-word load and store operations.
+(define_insn_and_split "<insn_opname>v2si3"
+ [(set (match_operand:V2SI 0 "gpr_operand" "=r")
+ (alu_binop:V2SI (match_operand:V2SI 1 "gpr_operand" "r")
+ (match_operand:V2SI 2 "gpr_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))]
+ ""
+ "#"
+ "reload_completed || (epiphany_vect_align == 4 && TARGET_SPLIT_VECMOVE_EARLY)"
+ [(const_int 0)]
+{
+ rtx o0l, o0h, o1l, o1h, o2l, o2h;
+
+ o0l = simplify_gen_subreg (SImode, operands[0], V2SImode, 0);
+ o0h = simplify_gen_subreg (SImode, operands[0], V2SImode, UNITS_PER_WORD);
+ o1l = simplify_gen_subreg (SImode, operands[1], V2SImode, 0);
+ o1h = simplify_gen_subreg (SImode, operands[1], V2SImode, UNITS_PER_WORD);
+ o2l = simplify_gen_subreg (SImode, operands[2], V2SImode, 0);
+ o2h = simplify_gen_subreg (SImode, operands[2], V2SImode, UNITS_PER_WORD);
+ if (reg_overlap_mentioned_p (o0l, o1h))
+ o1h = copy_to_mode_reg (SImode, o1h);
+ if (reg_overlap_mentioned_p (o0l, o2h))
+ o2h = copy_to_mode_reg (SImode, o2h);
+ emit_insn (gen_<insn_opname>si3 (o0l, o1l, o2l));
+ emit_insn (gen_<insn_opname>si3 (o0h, o1h, o2h));
+ DONE;
+}
+ [(set_attr "length" "8")])
+
+(define_expand "<insn_opname>v2sf3"
+ [(parallel
+ [(set (match_operand:V2SF 0 "gpr_operand" "")
+ (addsub:V2SF (match_operand:V2SF 1 "gpr_operand" "")
+ (match_operand:V2SF 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn_and_split "<insn_opname>v2sf3_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:V2SF 0 "gpr_operand" "=r")
+ (addsub:V2SF (match_operand:V2SF 1 "gpr_operand" "r")
+ (match_operand:V2SF 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "reload_completed || (epiphany_vect_align == 4 && TARGET_SPLIT_VECMOVE_EARLY)"
+ [(parallel
+ [(set (match_dup 4) (addsub:SF (match_dup 5) (match_dup 6)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 10)
+ (match_dup 11)])
+ (parallel
+ [(set (match_dup 7) (addsub:SF (match_dup 8) (match_dup 9)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 10)
+ (match_dup 11)])]
+{
+ operands[4] = simplify_gen_subreg (SFmode, operands[0], V2SFmode, 0);
+ operands[5] = simplify_gen_subreg (SFmode, operands[1], V2SFmode, 0);
+ operands[6] = simplify_gen_subreg (SFmode, operands[2], V2SFmode, 0);
+ operands[7]
+ = simplify_gen_subreg (SFmode, operands[0], V2SFmode, UNITS_PER_WORD);
+ operands[8]
+ = simplify_gen_subreg (SFmode, operands[1], V2SFmode, UNITS_PER_WORD);
+ operands[9]
+ = simplify_gen_subreg (SFmode, operands[2], V2SFmode, UNITS_PER_WORD);
+ if (!reload_completed)
+ {
+ if (reg_overlap_mentioned_p (operands[4], operands[8]))
+ operands[8] = copy_to_mode_reg (SFmode, operands[8]);
+ if (reg_overlap_mentioned_p (operands[4], operands[9]))
+ operands[9] = copy_to_mode_reg (SFmode, operands[9]);
+ emit_insn (gen_<insn_opname>sf3 (operands[4], operands[5], operands[6]));
+ emit_insn (gen_<insn_opname>sf3 (operands[7], operands[8], operands[9]));
+ DONE;
+ }
+ gcc_assert (!reg_overlap_mentioned_p (operands[4], operands[8]));
+ gcc_assert (!reg_overlap_mentioned_p (operands[4], operands[9]));
+ operands[10] = XVECEXP (operands[3], 0, XVECLEN (operands[3], 0) - 2);
+ operands[11] = XVECEXP (operands[3], 0, XVECLEN (operands[3], 0) - 1);
+}
+ [(set_attr "length" "8")
+ (set_attr "type" "fp")])
+
+(define_expand "mul<mode>3"
+ [(parallel
+ [(set (match_operand:DWV2MODE 0 "gpr_operand" "")
+ (mult:DWV2MODE (match_operand:DWV2MODE 1 "gpr_operand" "")
+ (match_operand:DWV2MODE 2 "gpr_operand" "")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])])
+
+(define_insn_and_split "mul<mode>3_i"
+ [(match_parallel 3 "float_operation"
+ [(set (match_operand:DWV2MODE 0 "gpr_operand" "=r")
+ (mult:DWV2MODE (match_operand:DWV2MODE 1 "gpr_operand" "r")
+ (match_operand:DWV2MODE 2 "gpr_operand" "r")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ ""
+ "#"
+ "reload_completed || (epiphany_vect_align == 4 && TARGET_SPLIT_VECMOVE_EARLY)"
+ [(parallel
+ [(set (match_dup 4) (mult:<vmode_PART> (match_dup 5) (match_dup 6)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 10)
+ (match_dup 11)])
+ (parallel
+ [(set (match_dup 7) (mult:<vmode_PART> (match_dup 8) (match_dup 9)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 10)
+ (match_dup 11)])]
+{
+ operands[4]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[0], <MODE>mode, 0);
+ operands[5]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[1], <MODE>mode, 0);
+ operands[6]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[2], <MODE>mode, 0);
+ operands[7] = simplify_gen_subreg (<vmode_PART>mode, operands[0],
+ <MODE>mode, UNITS_PER_WORD);
+ operands[8] = simplify_gen_subreg (<vmode_PART>mode, operands[1],
+ <MODE>mode, UNITS_PER_WORD);
+ operands[9] = simplify_gen_subreg (<vmode_PART>mode, operands[2],
+ <MODE>mode, UNITS_PER_WORD);
+ if (!reload_completed)
+ {
+ if (reg_overlap_mentioned_p (operands[4], operands[8]))
+ operands[8] = copy_to_mode_reg (<vmode_PART>mode, operands[8]);
+ if (reg_overlap_mentioned_p (operands[4], operands[9]))
+ operands[9] = copy_to_mode_reg (<vmode_PART>mode, operands[9]);
+ emit_insn (gen_mul<vmode_part>3 (operands[4], operands[5], operands[6]));
+ emit_insn (gen_mul<vmode_part>3 (operands[7], operands[8], operands[9]));
+ DONE;
+ }
+ gcc_assert (!reg_overlap_mentioned_p (operands[4], operands[8]));
+ gcc_assert (!reg_overlap_mentioned_p (operands[4], operands[9]));
+ operands[10] = XVECEXP (operands[3], 0, XVECLEN (operands[3], 0) - 2);
+ operands[11] = XVECEXP (operands[3], 0, XVECLEN (operands[3], 0) - 1);
+}
+ [(set_attr "length" "8")
+ (set_attr "type" "<vmode_fp_type>")])
+
+(define_insn_and_split "*fmadd<mode>_combine"
+ [(match_parallel 4 "float_operation"
+ [(set (match_operand:DWV2MODE 0 "gpr_operand" "=r")
+ (plus:DWV2MODE (mult:<MODE>
+ (match_operand:<MODE> 1 "gpr_operand" "r")
+ (match_operand:<MODE> 2 "gpr_operand" "r"))
+ (match_operand:<MODE> 3 "gpr_operand" "0")))
+ (clobber (reg:CC_FP CCFP_REGNUM))])]
+ "TARGET_FUSED_MADD || <MODE>mode == V2SImode"
+ "#"
+ "reload_completed || (epiphany_vect_align == 4 && TARGET_SPLIT_VECMOVE_EARLY)"
+ [(parallel
+ [(set (match_dup 5)
+ (plus:<vmode_PART> (mult:<vmode_PART> (match_dup 6) (match_dup 7))
+ (match_dup 8)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 13)
+ (match_dup 14)])
+ (parallel
+ [(set (match_dup 9)
+ (plus:<vmode_PART> (mult:<vmode_PART> (match_dup 10) (match_dup 11))
+ (match_dup 12)))
+ (clobber (reg:CC_FP CCFP_REGNUM))
+ (match_dup 13)
+ (match_dup 14)])]
+{
+ operands[5]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[0], <MODE>mode, 0);
+ operands[6]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[1], <MODE>mode, 0);
+ operands[7]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[2], <MODE>mode, 0);
+ operands[8]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[3], <MODE>mode, 0);
+ operands[9] = simplify_gen_subreg (<vmode_PART>mode, operands[0],
+ <MODE>mode, UNITS_PER_WORD);
+ operands[10] = simplify_gen_subreg (<vmode_PART>mode, operands[1],
+ <MODE>mode, UNITS_PER_WORD);
+ operands[11] = simplify_gen_subreg (<vmode_PART>mode, operands[2],
+ <MODE>mode, UNITS_PER_WORD);
+ operands[12] = simplify_gen_subreg (<vmode_PART>mode, operands[3],
+ <MODE>mode, UNITS_PER_WORD);
+ if (!reload_completed)
+ {
+ if (reg_overlap_mentioned_p (operands[5], operands[10]))
+ operands[10] = copy_to_mode_reg (<vmode_PART>mode, operands[10]);
+ if (reg_overlap_mentioned_p (operands[5], operands[11]))
+ operands[11] = copy_to_mode_reg (<vmode_PART>mode, operands[11]);
+ if (reg_overlap_mentioned_p (operands[5], operands[12]))
+ operands[12] = copy_to_mode_reg (<vmode_PART>mode, operands[12]);
+ emit_insn (gen_madd<vmode_part> (operands[5], operands[6], operands[7],
+ operands[8]));
+ emit_insn (gen_madd<vmode_part> (operands[9], operands[10], operands[11],
+ operands[12]));
+ DONE;
+ }
+ gcc_assert (!reg_overlap_mentioned_p (operands[5], operands[10]));
+ gcc_assert (!reg_overlap_mentioned_p (operands[5], operands[11]));
+ gcc_assert (!reg_overlap_mentioned_p (operands[5], operands[12]));
+ operands[13] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 2);
+ operands[14] = XVECEXP (operands[4], 0, XVECLEN (operands[4], 0) - 1);
+}
+ [(set_attr "length" "8")
+ (set_attr "type" "<vmode_fp_type>")])
+
+(define_expand "vec_set<mode>"
+ [(match_operand:DWV2MODE 0 "register_operand")
+ (match_operand:<vmode_PART> 1 "register_operand")
+ (match_operand 2 "const_int_operand" "")]
+ ""
+{
+ operands[0]
+ = simplify_gen_subreg (<vmode_PART>mode, operands[0], <MODE>mode,
+ UNITS_PER_WORD * INTVAL (operands[2]));
+ emit_move_insn (operands[0], operands[1]);
+ DONE;
+})
+
+(define_insn "nop"
+ [(const_int 0)]
+ ""
+ "nop"
+ [(set_attr "type" "flow")])
diff --git a/gcc/config/epiphany/epiphany.opt b/gcc/config/epiphany/epiphany.opt
new file mode 100644
index 00000000000..374018260d4
--- /dev/null
+++ b/gcc/config/epiphany/epiphany.opt
@@ -0,0 +1,140 @@
+; Options for the Adapteva EPIPHANY port of the compiler
+;
+; Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+; Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+mhalf-reg-file
+Target Mask(HALF_REG_FILE)
+Don't use any of r32..r63.
+
+mprefer-short-insn-regs
+Target Mask(PREFER_SHORT_INSN_REGS)
+preferentially allocate registers that allow short instruction generation.
+
+mbranch-cost=
+Target RejectNegative Joined UInteger Var(epiphany_branch_cost) Init(3)
+Set branch cost
+
+mcmove
+Target Mask(CMOVE)
+enable conditional move instruction usage.
+
+mnops=
+Target RejectNegative Joined UInteger Var(epiphany_n_nops) Init(0)
+set number of nops to emit before each insn pattern
+
+; Problems with using the flags from fsub for comparison are:
+; - Because of underflow (lack of subnormal numbers), different small numbers
+; can compare as equal.
+; - the set of comparisons is limited, and reversing comparisons doesn't work
+; in the presence of NaNs.
+; The latter problem might be tolerated with -ffinite-math-only , but nothing
+; in -funsafe-math-optimizations says different small numbers may be considered
+; equal.
+msoft-cmpsf
+Target Mask(SOFT_CMPSF)
+Use software floating point comparisons
+
+msplit-lohi
+Target Mask(SPLIT_LOHI)
+Enable split of 32 bit immediate loads into low / high part
+
+mpost-inc
+Target Mask(POST_INC)
+Enable use of POST_INC / POST_DEC
+
+mpost-modify
+Target Mask(POST_MODIFY)
+Enable use of POST_MODIFY
+
+mstack-offset=
+Target RejectNegative Joined UInteger Var(epiphany_stack_offset) Init(EPIPHANY_STACK_OFFSET)
+Set number of bytes on the stack preallocated for use by the callee.
+
+mround-nearest
+target Mask(ROUND_NEAREST)
+Assume round to nearest is selected for purposes of scheduling.
+
+mlong-calls
+Target Mask(LONG_CALLS)
+Generate call insns as indirect calls
+
+mshort-calls
+Target Mask(SHORT_CALLS)
+Generate call insns as direct calls
+
+msmall16
+Target Mask(SMALL16)
+Assume labels and symbols can be addressed using 16 bit absolute addresses.
+
+mfp-mode=
+Target RejectNegative Joined Var(epiphany_normal_fp_mode) Enum(attr_fp_mode) Init(FP_MODE_CALLER)
+
+; The values are from enum attr_fp_mode, but using that enum would bring
+; problems with enum forward declarations.
+Enum
+Name(attr_fp_mode) Type(int)
+
+EnumValue
+Enum(attr_fp_mode) String(caller) Value(FP_MODE_CALLER)
+
+EnumValue
+Enum(attr_fp_mode) String(round-nearest) Value(FP_MODE_ROUND_NEAREST)
+
+EnumValue
+Enum(attr_fp_mode) String(truncate) Value(FP_MODE_ROUND_TRUNC)
+
+EnumValue
+Enum(attr_fp_mode) String(int) Value(FP_MODE_INT)
+
+mvect-double
+Target Mask(VECT_DOUBLE)
+Vectorize for double-word operations.
+
+max-vect-align=
+Target RejectNegative Joined Var(epiphany_vect_align) Enum(vect_align) Init(8)
+
+Enum
+Name(vect_align) Type(int)
+
+EnumValue
+Enum(vect_align) String(4) Value(4)
+
+EnumValue
+Enum(vect_align) String(8) Value(8)
+
+msplit-vecmove-early
+Target Mask(SPLIT_VECMOVE_EARLY)
+Split unaligned 8 byte vector moves before post-modify address generation.
+
+m1reg-
+Target RejectNegative Joined Var(epiphany_m1reg) Enum(m1reg) Init(-1)
+Set register to hold -1.
+
+Enum
+Name(m1reg) Type(int)
+
+EnumValue
+Enum(m1reg) String(none) Value(-1)
+
+EnumValue
+Enum(m1reg) String(r43) Value(43)
+
+EnumValue
+Enum(m1reg) String(r63) Value(63)
diff --git a/gcc/config/epiphany/epiphany_intrinsics.h b/gcc/config/epiphany/epiphany_intrinsics.h
new file mode 100644
index 00000000000..2c06b0c2504
--- /dev/null
+++ b/gcc/config/epiphany/epiphany_intrinsics.h
@@ -0,0 +1,27 @@
+/* Epiphany intrinsic functions
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#define __builtin_epiphany_fmadd(a, b, c) __builtin_fmaf (b, c, a)
+#define __builtin_epiphany_fmsub(a, b, c) __builtin_fmaf (-(b), c, a)
diff --git a/gcc/config/epiphany/mode-switch-use.c b/gcc/config/epiphany/mode-switch-use.c
new file mode 100644
index 00000000000..a7020f4393b
--- /dev/null
+++ b/gcc/config/epiphany/mode-switch-use.c
@@ -0,0 +1,91 @@
+/* Insert USEs in instructions that require mode switching.
+ This should probably be merged into mode-switching.c .
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "function.h"
+#include "emit-rtl.h"
+#include "tree-pass.h"
+#include "insn-attr.h"
+#include "insn-config.h"
+#include "recog.h"
+#include "tm_p.h"
+#include "df.h"
+
+#ifndef TARGET_INSERT_MODE_SWITCH_USE
+#define TARGET_INSERT_MODE_SWITCH_USE NULL
+#endif
+
+static unsigned int
+insert_uses (void)
+{
+ static const int num_modes[] = NUM_MODES_FOR_MODE_SWITCHING;
+#define N_ENTITIES ARRAY_SIZE (num_modes)
+ int e;
+ void (*target_insert_mode_switch_use) (rtx insn, int, int)
+ = TARGET_INSERT_MODE_SWITCH_USE;
+
+ for (e = N_ENTITIES - 1; e >= 0; e--)
+ {
+ int no_mode = num_modes[e];
+ rtx insn;
+ int mode;
+
+ if (!OPTIMIZE_MODE_SWITCHING (e))
+ continue;
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ if (!INSN_P (insn))
+ continue;
+ mode = MODE_NEEDED (e, insn);
+ if (mode == no_mode)
+ continue;
+ if (target_insert_mode_switch_use)
+ {
+ target_insert_mode_switch_use (insn, e, mode);
+ df_insn_rescan (insn);
+ }
+ }
+ }
+ return 0;
+}
+
+struct rtl_opt_pass pass_mode_switch_use =
+{
+ {
+ RTL_PASS,
+ "mode_switch_use", /* name */
+ NULL, /* gate */
+ insert_uses, /* 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 */
+ }
+};
diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md
new file mode 100644
index 00000000000..6e96af9fed4
--- /dev/null
+++ b/gcc/config/epiphany/predicates.md
@@ -0,0 +1,352 @@
+;; Predicate definitions for code generation on the EPIPHANY cpu.
+;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Free Software Foundation, Inc.
+;; Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+;; Returns true iff OP is a symbol reference that is a valid operand
+;; in a jump or call instruction.
+
+(define_predicate "symbolic_operand"
+ (match_code "symbol_ref,label_ref,const")
+{
+ if (GET_CODE (op) == SYMBOL_REF)
+ return (!epiphany_is_long_call_p (op)
+ && (!flag_pic || SYMBOL_REF_LOCAL_P (op)));
+ if (GET_CODE (op) == LABEL_REF)
+ return true;
+ if (GET_CODE (op) == CONST)
+ {
+ op = XEXP (op, 0);
+ if (GET_CODE (op) != PLUS || !symbolic_operand (XEXP (op, 0), mode))
+ return false;
+ /* The idea here is that a 'small' constant offset should be OK.
+ What exactly is considered 'small' is a bit arbitrary. */
+ return satisfies_constraint_L (XEXP (op, 1));
+ }
+ gcc_unreachable ();
+})
+
+;; Acceptable arguments to the call insn.
+
+(define_predicate "call_address_operand"
+ (ior (match_code "reg")
+ (match_operand 0 "symbolic_operand")))
+
+(define_predicate "call_operand"
+ (match_code "mem")
+{
+ op = XEXP (op, 0);
+ return call_address_operand (op, mode);
+})
+
+;; general purpose register.
+(define_predicate "gpr_operand"
+ (match_code "reg,subreg")
+{
+ int regno;
+
+ if (!register_operand (op, mode))
+ return 0;
+ if (GET_CODE (op) == SUBREG)
+ op = XEXP (op, 0);
+ regno = REGNO (op);
+ return regno >= FIRST_PSEUDO_REGISTER || regno <= 63;
+})
+
+(define_special_predicate "any_gpr_operand"
+ (match_code "subreg,reg")
+{
+ return gpr_operand (op, mode);
+})
+
+;; register suitable for integer add / sub operations; besides general purpose
+;; registers we allow fake hard registers that are eliminated to a real
+;; hard register via an offset.
+(define_predicate "add_reg_operand"
+ (match_code "reg,subreg")
+{
+ int regno;
+
+ if (!register_operand (op, mode))
+ return 0;
+ if (GET_CODE (op) == SUBREG)
+ op = XEXP (op, 0);
+ regno = REGNO (op);
+ return (regno >= FIRST_PSEUDO_REGISTER || regno <= 63
+ || regno == FRAME_POINTER_REGNUM
+ || regno == ARG_POINTER_REGNUM);
+})
+
+;; Also allows suitable constants
+(define_predicate "add_operand"
+ (match_code "reg,subreg,const_int,symbol_ref,label_ref,const")
+{
+ if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
+ return add_reg_operand (op, mode);
+ return satisfies_constraint_L (op);
+})
+
+;; Ordinary 3rd operand for arithmetic operations
+(define_predicate "arith_operand"
+ (match_code "reg,subreg,const_int,symbol_ref,label_ref,const")
+{
+ if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
+ return register_operand (op, mode);
+ return satisfies_constraint_L (op);
+})
+
+;; Constant integer 3rd operand for arithmetic operations
+(define_predicate "arith_int_operand"
+ (match_code "const_int,symbol_ref,label_ref,const")
+{
+ return satisfies_constraint_L (op);
+})
+
+;; Return true if OP is an acceptable argument for a single word move source.
+
+(define_predicate "move_src_operand"
+ (match_code
+ "symbol_ref,label_ref,const,const_int,const_double,reg,subreg,mem,unspec")
+{
+ switch (GET_CODE (op))
+ {
+ case SYMBOL_REF :
+ case LABEL_REF :
+ case CONST :
+ return 1;
+ case CONST_INT :
+ return immediate_operand (op, mode);
+ case CONST_DOUBLE :
+ /* SImode constants should always fit into a CONST_INT. Large
+ unsigned 32-bit constants are represented as negative CONST_INTs. */
+ gcc_assert (GET_MODE (op) != SImode);
+ /* We can handle 32-bit floating point constants. */
+ if (mode == SFmode)
+ return GET_MODE (op) == SFmode;
+ return 0;
+ case REG :
+ return op != frame_pointer_rtx && register_operand (op, mode);
+ case SUBREG :
+ /* (subreg (mem ...) ...) can occur here if the inner part was once a
+ pseudo-reg and is now a stack slot. */
+ if (GET_CODE (SUBREG_REG (op)) == MEM)
+ return address_operand (XEXP (SUBREG_REG (op), 0), mode);
+ else
+ return register_operand (op, mode);
+ case MEM :
+ return address_operand (XEXP (op, 0), mode);
+ case UNSPEC:
+ return satisfies_constraint_Sra (op);
+ default :
+ return 0;
+ }
+})
+
+;; Return true if OP is an acceptable argument for a double word move source.
+
+(define_predicate "move_double_src_operand"
+ (match_code "reg,subreg,mem,const_int,const_double,const_vector")
+{
+ return general_operand (op, mode);
+})
+
+;; Return true if OP is an acceptable argument for a move destination.
+
+(define_predicate "move_dest_operand"
+ (match_code "reg,subreg,mem")
+{
+ switch (GET_CODE (op))
+ {
+ case REG :
+ return register_operand (op, mode);
+ case SUBREG :
+ /* (subreg (mem ...) ...) can occur here if the inner part was once a
+ pseudo-reg and is now a stack slot. */
+ if (GET_CODE (SUBREG_REG (op)) == MEM)
+ {
+ return address_operand (XEXP (SUBREG_REG (op), 0), mode);
+ }
+ else
+ {
+ return register_operand (op, mode);
+ }
+ case MEM :
+ return address_operand (XEXP (op, 0), mode);
+ default :
+ return 0;
+ }
+})
+
+(define_special_predicate "stacktop_operand"
+ (match_code "mem")
+{
+ if (mode != VOIDmode && GET_MODE (op) != mode)
+ return false;
+ return rtx_equal_p (XEXP (op, 0), stack_pointer_rtx);
+})
+
+;; Return 1 if OP is a comparison operator valid for the mode of CC.
+;; This allows the use of MATCH_OPERATOR to recognize all the branch insns.
+;;
+;; Some insns only set a few bits in the condition code. So only allow those
+;; comparisons that use the bits that are valid.
+
+(define_predicate "proper_comparison_operator"
+ (match_code "eq, ne, le, lt, ge, gt, leu, ltu, geu, gtu, unordered, ordered, uneq, unge, ungt, unle, unlt, ltgt")
+{
+ enum rtx_code code = GET_CODE (op);
+ rtx cc = XEXP (op, 0);
+
+ /* combine can try strange things. */
+ if (!REG_P (cc))
+ return 0;
+ switch (GET_MODE (cc))
+ {
+ case CC_Zmode:
+ case CC_N_NEmode:
+ case CC_FP_EQmode:
+ return REGNO (cc) == CC_REGNUM && (code == EQ || code == NE);
+ case CC_C_LTUmode:
+ return REGNO (cc) == CC_REGNUM && (code == LTU || code == GEU);
+ case CC_C_GTUmode:
+ return REGNO (cc) == CC_REGNUM && (code == GTU || code == LEU);
+ case CC_FPmode:
+ return (REGNO (cc) == CCFP_REGNUM
+ && (code == EQ || code == NE || code == LT || code == LE));
+ case CC_FP_GTEmode:
+ return (REGNO (cc) == CC_REGNUM
+ && (code == EQ || code == NE || code == GT || code == GE
+ || code == UNLE || code == UNLT));
+ case CC_FP_ORDmode:
+ return REGNO (cc) == CC_REGNUM && (code == ORDERED || code == UNORDERED);
+ case CC_FP_UNEQmode:
+ return REGNO (cc) == CC_REGNUM && (code == UNEQ || code == LTGT);
+ case CCmode:
+ return REGNO (cc) == CC_REGNUM;
+ /* From combiner. */
+ case QImode: case SImode: case SFmode: case HImode:
+ /* From cse.c:dead_libcall_p. */
+ case DFmode:
+ return 0;
+ default:
+ gcc_unreachable ();
+ }
+})
+
+(define_predicate "cc_operand"
+ (and (match_code "reg")
+ (match_test "REGNO (op) == CC_REGNUM || REGNO (op) == CCFP_REGNUM")))
+
+(define_predicate "const0_operand"
+ (match_code "const_int, const_double")
+{
+ if (mode == VOIDmode)
+ mode = GET_MODE (op);
+ return op == CONST0_RTX (mode);
+})
+
+(define_predicate "const_float_1_operand"
+ (match_code "const_double")
+{
+ return op == CONST1_RTX (mode);
+})
+
+(define_predicate "cc_move_operand"
+ (and (match_code "reg")
+ (ior (match_test "REGNO (op) == CC_REGNUM")
+ (match_test "gpr_operand (op, mode)"))))
+
+(define_predicate "float_operation"
+ (match_code "parallel")
+{
+ /* Most patterns start out with one SET and one CLOBBER, and gain a USE
+ or two of FP_NEAREST_REGNUM / FP_TRUNCATE_REGNUM / FP_ANYFP_REGNUM
+ after mode switching. The longer patterns are
+ all beyond length 4, and before mode switching, end with a
+ CLOBBER of CCFP_REGNUM. */
+ int count = XVECLEN (op, 0);
+ bool inserted = MACHINE_FUNCTION (cfun)->control_use_inserted;
+ int i;
+
+ if (count == 2)
+ return !inserted;
+
+ /* combine / recog will pass any old garbage here before checking the
+ rest of the insn. */
+ if (count <= 3)
+ return false;
+
+ i = 1;
+ if (count > 4)
+ for (i = 4; i < count; i++)
+ {
+ rtx x = XVECEXP (op, 0, i);
+
+ if (GET_CODE (x) == CLOBBER)
+ {
+ if (!REG_P (XEXP (x, 0)))
+ return false;
+ if (REGNO (XEXP (x, 0)) == CCFP_REGNUM)
+ {
+ if (count == i + 1)
+ return !inserted;
+ break;
+ }
+ /* Just an ordinary clobber, keep looking. */
+ }
+ else if (GET_CODE (x) == USE
+ || (GET_CODE (x) == SET && i == 2))
+ continue;
+ else
+ return false;
+ }
+ if (count != i + 3 || !inserted)
+ return false;
+ for (i = i+1; i < count; i++)
+ {
+ rtx x = XVECEXP (op, 0, i);
+
+ if (GET_CODE (x) != USE && GET_CODE (x) != CLOBBER)
+ return false;
+ x = XEXP (x, 0);
+ if (!REG_P (x)
+ || (REGNO (x) != FP_NEAREST_REGNUM
+ && REGNO (x) != FP_TRUNCATE_REGNUM
+ && REGNO (x) != FP_ANYFP_REGNUM))
+ return false;
+ }
+ return true;
+})
+
+(define_predicate "set_fp_mode_operand"
+ (ior (match_test "gpr_operand (op, mode)")
+ (and (match_code "const")
+ (match_test "satisfies_constraint_Cfm (op)"))))
+
+(define_predicate "post_modify_address"
+ (match_code "post_modify,post_inc,post_dec"))
+
+(define_predicate "post_modify_operand"
+ (and (match_code "mem")
+ (match_test "post_modify_address (XEXP (op, 0), Pmode)")))
+
+(define_predicate "nonsymbolic_immediate_operand"
+ (ior (match_test "immediate_operand (op, mode)")
+ (match_code "const_vector"))) /* Is this specific enough? */
diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c
new file mode 100644
index 00000000000..9564d752c4f
--- /dev/null
+++ b/gcc/config/epiphany/resolve-sw-modes.c
@@ -0,0 +1,182 @@
+/* Mode switching cleanup pass for the EPIPHANY cpu.
+ Copyright (C) 2000, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "machmode.h"
+#include "tm.h"
+#include "hard-reg-set.h"
+#include "tm_p.h"
+#include "vec.h"
+#include "sbitmap.h"
+#include "basic-block.h"
+#include "df.h"
+#include "rtl.h"
+#include "insn-config.h"
+#include "insn-codes.h"
+#include "emit-rtl.h"
+#include "recog.h"
+#include "function.h"
+#include "insn-attr-common.h"
+#include "tree-pass.h"
+
+/* Clean-up after mode switching:
+ Check for mode setting insns that have FP_MODE_ROUND_UNKNOWN.
+ If only one rounding mode is required, select that one.
+ Else we have to choose one to use in this mode setting insn and
+ insert new mode setting insns on the edges where the other mode
+ becomes unambigous. */
+
+static bool
+gate_resolve_sw_modes (void)
+{
+ return optimize;
+}
+
+static unsigned
+resolve_sw_modes (void)
+{
+ basic_block bb;
+ rtx insn, src;
+ VEC (basic_block, heap) *todo;
+ sbitmap pushed;
+ bool need_commit = false;
+ bool finalize_fp_sets = (MACHINE_FUNCTION (cfun)->unknown_mode_sets == 0);
+
+ todo = VEC_alloc (basic_block, heap, last_basic_block);
+ pushed = sbitmap_alloc (last_basic_block);
+ sbitmap_zero (pushed);
+ if (!finalize_fp_sets)
+ {
+ df_note_add_problem ();
+ df_analyze ();
+ }
+ FOR_EACH_BB (bb)
+ FOR_BB_INSNS (bb, insn)
+ {
+ enum attr_fp_mode selected_mode;
+
+ if (!NONJUMP_INSN_P (insn)
+ || recog_memoized (insn) != CODE_FOR_set_fp_mode)
+ continue;
+ src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
+ if (finalize_fp_sets)
+ {
+ SET_SRC (XVECEXP (PATTERN (insn), 0, 2)) = copy_rtx (src);
+ if (REG_P (src))
+ df_insn_rescan (insn);
+ continue;
+ }
+ if (REG_P (src)
+ || XINT (XVECEXP (XEXP (src, 0), 0, 0), 0) != FP_MODE_ROUND_UNKNOWN)
+ continue;
+ if (find_regno_note (insn, REG_UNUSED, FP_TRUNCATE_REGNUM))
+ selected_mode = FP_MODE_ROUND_NEAREST;
+ else if (find_regno_note (insn, REG_UNUSED, FP_NEAREST_REGNUM))
+ selected_mode = FP_MODE_ROUND_TRUNC;
+ else
+ {
+ /* We could get more fancy in the selection of the mode by
+ checking the total frequency of the affected edges. */
+ selected_mode = (enum attr_fp_mode) epiphany_normal_fp_rounding;
+
+ VEC_quick_push (basic_block, todo, bb);
+ SET_BIT (pushed, bb->index);
+ }
+ XVECEXP (XEXP (src, 0), 0, 0) = GEN_INT (selected_mode);
+ SET_SRC (XVECEXP (PATTERN (insn), 0, 1)) = copy_rtx (src);
+ SET_SRC (XVECEXP (PATTERN (insn), 0, 2)) = copy_rtx (src);
+ df_insn_rescan (insn);
+ }
+ while (VEC_length (basic_block, todo))
+ {
+ basic_block bb = VEC_pop (basic_block, todo);
+ int selected_reg, jilted_reg;
+ enum attr_fp_mode jilted_mode;
+ edge e;
+ edge_iterator ei;
+
+ SET_BIT (pushed, bb->index);
+ SET_BIT (pushed, bb->index);
+
+ if (epiphany_normal_fp_rounding == FP_MODE_ROUND_NEAREST)
+ {
+ selected_reg = FP_NEAREST_REGNUM;
+ jilted_reg = FP_TRUNCATE_REGNUM;
+ jilted_mode = FP_MODE_ROUND_TRUNC;
+ }
+ else
+ {
+ selected_reg = FP_TRUNCATE_REGNUM;
+ jilted_reg = FP_NEAREST_REGNUM;
+ jilted_mode = FP_MODE_ROUND_NEAREST;
+ }
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ basic_block succ = e->dest;
+ rtx seq;
+
+ if (!REGNO_REG_SET_P (DF_LIVE_IN (succ), jilted_reg))
+ continue;
+ if (REGNO_REG_SET_P (DF_LIVE_IN (succ), selected_reg))
+ {
+ if (TEST_BIT (pushed, succ->index))
+ continue;
+ VEC_quick_push (basic_block, todo, succ);
+ SET_BIT (pushed, bb->index);
+ continue;
+ }
+ start_sequence ();
+ emit_set_fp_mode (EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN,
+ jilted_mode, NULL);
+ seq = get_insns ();
+ end_sequence ();
+ need_commit = true;
+ insert_insn_on_edge (seq, e);
+ }
+ }
+ VEC_free (basic_block, heap, todo);
+ sbitmap_free (pushed);
+ if (need_commit)
+ commit_edge_insertions ();
+ return 0;
+}
+
+struct rtl_opt_pass pass_resolve_sw_modes =
+{
+ {
+ RTL_PASS,
+ "resolve_sw_modes", /* name */
+ gate_resolve_sw_modes, /* gate */
+ resolve_sw_modes, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_MODE_SWITCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_df_finish | TODO_verify_rtl_sharing |
+ 0 /* todo_flags_finish */
+ }
+};
diff --git a/gcc/config/epiphany/t-epiphany b/gcc/config/epiphany/t-epiphany
new file mode 100644
index 00000000000..33db4acef13
--- /dev/null
+++ b/gcc/config/epiphany/t-epiphany
@@ -0,0 +1,32 @@
+# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003,
+# 2004, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+mode-switch-use.o : $(srcdir)/config/epiphany/mode-switch-use.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TM_P_H) $(RTL_H) \
+ $(TREE_PASS_H) $(INSN_ATTR_H) $(EMIT_RTL_H) $(FUNCTION_H) $(RECOG_H) \
+ insn-config.h $(DF_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $<
+
+resolve-sw-modes.o : $(srcdir)/config/epiphany/resolve-sw-modes.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(MACHMODE_H) $(TM_H) hard-reg-set.h \
+ $(TM_P_H) $(VEC_H) sbitmap.h $(BASIC_BLOCK_H) $(DF_H) $(RTL_H) \
+ insn-config.h insn-codes.h $(EMIT_RTL_H) $(RECOG_H) $(FUNCTION_H) \
+ insn-attr-common.h $(TREE_PASS_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $<
diff --git a/gcc/config/fr30/t-fr30 b/gcc/config/fr30/t-fr30
deleted file mode 100644
index fa786d6e50a..00000000000
--- a/gcc/config/fr30/t-fr30
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 1999, 2001, 2007, 2011 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/>.
-
-LIB1ASMSRC = fr30/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/fr30/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o $(T)crti.o -x assembler $(srcdir)/config/fr30/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/fr30/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o $(T)crtn.o -x assembler $(srcdir)/config/fr30/crtn.asm
-
-# If any special flags are necessary when building libgcc2 put them here.
-#
-# TARGET_LIBGCC2_CFLAGS
-
-# Enable the following if multilibs are needed.
-# See gcc/genmultilib, gcc/gcc.texi and gcc/tm.texi for a
-# description of the options and their values.
-#
-# MULTILIB_OPTIONS =
-# MULTILIB_DIRNAMES =
-# MULTILIB_MATCHES =
-# MULTILIB_EXCEPTIONS =
-# MULTILIB_EXTRA_OPTS =
-#
-# LIBGCC = stmp-multilib
-# INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/frv/t-frv b/gcc/config/frv/t-frv
index 395a679747a..c5c7bdc237c 100644
--- a/gcc/config/frv/t-frv
+++ b/gcc/config/frv/t-frv
@@ -16,66 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Name of assembly file containing libgcc1 functions.
-# This entry must be present, but it can be empty if the target does
-# not need any assembler functions to support its code generation.
-#
-# Alternatively if assembler functions *are* needed then define the
-# entries below:
-CROSS_LIBGCC1 = libgcc1-asm.a
-LIB1ASMSRC = frv/lib1funcs.asm
-LIB1ASMFUNCS = _cmpll _cmpf _cmpd _addll _subll _andll _orll _xorll _notll _cmov
-LIB2FUNCS_EXTRA = cmovh.c cmovw.c cmovd.c modi.c umodi.c uitof.c uitod.c ulltof.c ulltod.c
-
-# If any special flags are necessary when building libgcc2 put them here.
-TARGET_LIBGCC2_CFLAGS =
-
-cmovh.c: $(srcdir)/config/frv/cmovh.c
- $(LN_S) $(srcdir)/config/frv/cmovh.c .
-
-cmovw.c: $(srcdir)/config/frv/cmovw.c
- $(LN_S) $(srcdir)/config/frv/cmovw.c .
-
-cmovd.c: $(srcdir)/config/frv/cmovd.c
- $(LN_S) $(srcdir)/config/frv/cmovd.c .
-
-modi.c: $(srcdir)/config/frv/modi.c
- $(LN_S) $(srcdir)/config/frv/modi.c .
-
-umodi.c: $(srcdir)/config/frv/umodi.c
- $(LN_S) $(srcdir)/config/frv/umodi.c .
-
-uitof.c: $(srcdir)/config/frv/uitof.c
- $(LN_S) $(srcdir)/config/frv/uitof.c .
-
-uitod.c: $(srcdir)/config/frv/uitod.c
- $(LN_S) $(srcdir)/config/frv/uitod.c .
-
-ulltof.c: $(srcdir)/config/frv/ulltof.c
- $(LN_S) $(srcdir)/config/frv/ulltof.c .
-
-ulltod.c: $(srcdir)/config/frv/ulltod.c
- $(LN_S) $(srcdir)/config/frv/ulltod.c .
-
-# Build frvbegin.o and frvend.o
-EXTRA_MULTILIB_PARTS=frvbegin.o frvend.o
-
-# Compile two additional files that are linked with every program
-# linked using GCC on systems using COFF or ELF, for the sake of C++
-# constructors.
-
-FRVSTUFF_CFLAGS = $(TARGET_LIBGCC2_CFLAGS)
-
-$(T)frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c $(GCC_PASSES) \
- $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
- -c $(srcdir)/config/frv/frvbegin.c -o $(T)frvbegin$(objext)
-
-$(T)frvend$(objext): $(srcdir)/config/frv/frvend.c $(GCC_PASSES) \
- $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
- -c $(srcdir)/config/frv/frvend.c -o $(T)frvend$(objext)
-
# Enable the following if multilibs are needed.
# See gcc/genmultilib, gcc/gcc.texi and gcc/tm.texi for a
# description of the options and their values.
@@ -93,7 +33,4 @@ MULTILIB_MATCHES = mcpu?simple=mcpu?fr300 \
mcpu?fr400=mcpu?fr405 mcpu?fr400=mcpu?fr450
MULTILIB_EXCEPTIONS = mcpu=frv/mno-pack* mcpu=simple/mno-pack*
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
EXTRA_HEADERS = $(srcdir)/config/frv/frv-asm.h
diff --git a/gcc/config/frv/t-linux b/gcc/config/frv/t-linux
index 5b094518a1d..4f18e4baf9a 100644
--- a/gcc/config/frv/t-linux
+++ b/gcc/config/frv/t-linux
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -22,12 +22,3 @@ MULTILIB_DIRNAMES=
MULTILIB_MATCHES=
MULTILIB_EXCEPTIONS=
MULTILIB_EXTRA_OPTS=
-
-# We don't use frvbegin.o or frvend.o.
-EXTRA_MULTILIB_PARTS =
-
-CRTSTUFF_T_CFLAGS = -fPIC
-TARGET_LIBGCC2_CFLAGS = -fPIC
-
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
- $(srcdir)/config/frv/libgcc-frv.ver
diff --git a/gcc/config/h8300/t-elf b/gcc/config/h8300/t-elf
deleted file mode 100644
index c1f1dac32c7..00000000000
--- a/gcc/config/h8300/t-elf
+++ /dev/null
@@ -1,6 +0,0 @@
-EXTRA_MULTILIB_PARTS= crti.o crtn.o crtbegin.o crtend.o
-
-$(T)crti.o: $(srcdir)/config/h8300/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/h8300/crti.asm
-$(T)crtn.o: $(srcdir)/config/h8300/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/h8300/crtn.asm
diff --git a/gcc/config/h8300/t-h8300 b/gcc/config/h8300/t-h8300
index 616849007b4..e29cd2d335c 100644
--- a/gcc/config/h8300/t-h8300
+++ b/gcc/config/h8300/t-h8300
@@ -17,27 +17,10 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = h8300/lib1funcs.asm
-LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
- _fixunssfsi_asm
-
-LIB2FUNCS_EXTRA = \
- $(srcdir)/config/h8300/clzhi2.c \
- $(srcdir)/config/h8300/ctzhi2.c \
- $(srcdir)/config/h8300/parityhi2.c \
- $(srcdir)/config/h8300/popcounthi2.c \
- $(srcdir)/config/h8300/fixunssfsi.c
-
-# We do not have DF type, so fake out the libgcc2 compilation.
-TARGET_LIBGCC2_CFLAGS = -DDF=SF
-
MULTILIB_OPTIONS = mh/ms/msx mn mint32
MULTILIB_DIRNAMES = h8300h h8300s h8sx normal int32
MULTILIB_EXCEPTIONS = mint32 mn mn/mint32
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
s-config s-conditions s-flags s-codes s-constants s-emit s-recog \
s-opinit s-extract s-peep s-attr s-attrtab s-output: \
$(srcdir)/config/h8300/mova.md
diff --git a/gcc/config/i386/avx2intrin.h b/gcc/config/i386/avx2intrin.h
index 3c8f3600d68..12ed05fe029 100644
--- a/gcc/config/i386/avx2intrin.h
+++ b/gcc/config/i386/avx2intrin.h
@@ -1252,7 +1252,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_i32gather_pd (double const *base, __m128i index, const int scale)
{
__v4df src = _mm256_setzero_pd ();
- __v4df mask = _mm256_set1_pd((double)(long long int) -1);
+ __v4df mask = _mm256_cmp_pd (src, src, _CMP_EQ_OQ);
return (__m256d) __builtin_ia32_gathersiv4df (src,
base,
@@ -1304,7 +1304,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_i64gather_pd (double const *base, __m256i index, const int scale)
{
__v4df src = _mm256_setzero_pd ();
- __v4df mask = _mm256_set1_pd((double)(long long int) -1);
+ __v4df mask = _mm256_cmp_pd (src, src, _CMP_EQ_OQ);
return (__m256d) __builtin_ia32_gatherdiv4df (src,
base,
@@ -1356,7 +1356,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_i32gather_ps (float const *base, __m256i index, const int scale)
{
__v8sf src = _mm256_setzero_ps ();
- __v8sf mask = _mm256_set1_ps((float)(int) -1);
+ __v8sf mask = _mm256_cmp_ps (src, src, _CMP_EQ_OQ);
return (__m256) __builtin_ia32_gathersiv8sf (src,
base,
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index cf17e1e1d89..d84c5c3aed8 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -136,5 +136,5 @@ along with GCC; see the file COPYING3. If not see
#define LIBGCC_SONAME "cyggcc_s" LIBGCC_EH_EXTN "-1.dll"
/* We should find a way to not have to update this manually. */
-#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-12.dll"
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-13.dll"
diff --git a/gcc/config/i386/f16cintrin.h b/gcc/config/i386/f16cintrin.h
new file mode 100644
index 00000000000..ac827ca0e12
--- /dev/null
+++ b/gcc/config/i386/f16cintrin.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
+# error "Never use <f16intrin.h> directly; include <x86intrin.h> or <immintrin.h> instead."
+#endif
+
+#ifndef __F16C__
+# error "F16C instruction set not enabled"
+#else
+
+#ifndef _F16CINTRIN_H_INCLUDED
+#define _F16CINTRIN_H_INCLUDED
+
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_cvtsh_ss (unsigned short __S)
+{
+ __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
+ __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
+ return __builtin_ia32_vec_ext_v4sf (__A, 0);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtph_ps (__m128i __A)
+{
+ return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtph_ps (__m128i __A)
+{
+ return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_cvtss_sh (float __F, const int __I)
+{
+ __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 };
+ __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I);
+ return (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_ph (__m128 __A, const int __I)
+{
+ return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtps_ph (__m256 __A, const int __I)
+{
+ return (__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf) __A, __I);
+}
+#else
+#define _cvtss_sh(__F, __I) \
+ (__extension__ \
+ ({ \
+ __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 }; \
+ __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I); \
+ (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0); \
+ }))
+
+#define _mm_cvtps_ph(A, I) \
+ ((__m128i) __builtin_ia32_vcvtps2ph ((__v4sf)(__m128) A, (int) (I)))
+
+#define _mm256_cvtps_ph(A, I) \
+ ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) A, (int) (I)))
+#endif /* __OPTIMIZE */
+
+#endif /* _F16CINTRIN_H_INCLUDED */
+#endif /* __F16C__ */
diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def
index 9a3db0725db..5dcb68c2d43 100644
--- a/gcc/config/i386/i386-builtin-types.def
+++ b/gcc/config/i386/i386-builtin-types.def
@@ -337,6 +337,7 @@ DEF_FUNCTION_TYPE (V16HI, V16HI, INT)
DEF_FUNCTION_TYPE (V16HI, V16HI, SI)
DEF_FUNCTION_TYPE (V16HI, V16HI, V16HI, INT)
DEF_FUNCTION_TYPE (V32QI, V32QI, V32QI, INT)
+DEF_FUNCTION_TYPE (V8SI, V4DF, V4DF)
DEF_FUNCTION_TYPE (V8SI, V8SI, V4SI)
DEF_FUNCTION_TYPE (V8SI, V8SI, V8SI)
DEF_FUNCTION_TYPE (V8SI, V16HI, V16HI)
@@ -440,20 +441,24 @@ DEF_FUNCTION_TYPE (V8QI, QI, QI, QI, QI, QI, QI, QI, QI)
DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE, V4SI, V2DF, INT)
DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V4SI, V4DF, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V8SI, V4DF, INT)
DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE, V2DI, V2DF, INT)
DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V4DI, V4DF, INT)
DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V4SI, V4SF, INT)
DEF_FUNCTION_TYPE (V8SF, V8SF, PCFLOAT, V8SI, V8SF, INT)
DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V2DI, V4SF, INT)
DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V4DI, V4SF, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, PCFLOAT, V4DI, V8SF, INT)
DEF_FUNCTION_TYPE (V2DI, V2DI, PCINT64, V4SI, V2DI, INT)
DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V4SI, V4DI, INT)
+DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V8SI, V4DI, INT)
DEF_FUNCTION_TYPE (V2DI, V2DI, PCINT64, V2DI, V2DI, INT)
DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V4DI, V4DI, INT)
DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V4SI, V4SI, INT)
DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V8SI, V8SI, INT)
DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V2DI, V4SI, INT)
DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V4DI, V4SI, INT)
+DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V4DI, V8SI, INT)
DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF, ROUND)
DEF_FUNCTION_TYPE_ALIAS (V4DF_FTYPE_V4DF, ROUND)
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 5486e618dc8..6bfe13d47d6 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -93,6 +93,7 @@ extern bool ix86_binary_operator_ok (enum rtx_code, enum machine_mode, rtx[]);
extern bool ix86_lea_outperforms (rtx, unsigned int, unsigned int,
unsigned int, unsigned int);
extern bool ix86_avoid_lea_for_add (rtx, rtx[]);
+extern bool ix86_use_lea_for_mov (rtx, rtx[]);
extern bool ix86_avoid_lea_for_addr (rtx, rtx[]);
extern void ix86_split_lea_for_addr (rtx[], enum machine_mode);
extern bool ix86_lea_for_add_ok (rtx, rtx[]);
@@ -109,7 +110,8 @@ extern void ix86_expand_convert_uns_sixf_sse (rtx, rtx);
extern void ix86_expand_convert_uns_sidf_sse (rtx, rtx);
extern void ix86_expand_convert_uns_sisf_sse (rtx, rtx);
extern void ix86_expand_convert_sign_didf_sse (rtx, rtx);
-extern rtx ix86_expand_adjust_ufix_to_sfix_si (rtx);
+extern void ix86_expand_vector_convert_uns_vsivsf (rtx, rtx);
+extern rtx ix86_expand_adjust_ufix_to_sfix_si (rtx, rtx *);
extern enum ix86_fpcmp_strategy ix86_fp_comparison_strategy (enum rtx_code);
extern void ix86_expand_fp_absneg_operator (enum rtx_code, enum machine_mode,
rtx[]);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 47ee8e154df..799e12b2b14 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -10913,15 +10913,28 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
it looks like we might want one, insert a NOP. */
{
rtx insn = get_last_insn ();
+ rtx deleted_debug_label = NULL_RTX;
while (insn
&& NOTE_P (insn)
&& NOTE_KIND (insn) != NOTE_INSN_DELETED_LABEL)
- insn = PREV_INSN (insn);
+ {
+ /* Don't insert a nop for NOTE_INSN_DELETED_DEBUG_LABEL
+ notes only, instead set their CODE_LABEL_NUMBER to -1,
+ otherwise there would be code generation differences
+ in between -g and -g0. */
+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_DELETED_DEBUG_LABEL)
+ deleted_debug_label = insn;
+ insn = PREV_INSN (insn);
+ }
if (insn
&& (LABEL_P (insn)
|| (NOTE_P (insn)
&& NOTE_KIND (insn) == NOTE_INSN_DELETED_LABEL)))
fputs ("\tnop\n", file);
+ else if (deleted_debug_label)
+ for (insn = deleted_debug_label; insn; insn = NEXT_INSN (insn))
+ if (NOTE_KIND (insn) == NOTE_INSN_DELETED_DEBUG_LABEL)
+ CODE_LABEL_NUMBER (insn) = -1;
}
#endif
@@ -16530,6 +16543,29 @@ ix86_avoid_lea_for_add (rtx insn, rtx operands[])
return !ix86_lea_outperforms (insn, regno0, regno1, regno2, 1);
}
+/* Return true if we should emit lea instruction instead of mov
+ instruction. */
+
+bool
+ix86_use_lea_for_mov (rtx insn, rtx operands[])
+{
+ unsigned int regno0;
+ unsigned int regno1;
+
+ /* Check if we need to optimize. */
+ if (!TARGET_OPT_AGU || optimize_function_for_size_p (cfun))
+ return false;
+
+ /* Use lea for reg to reg moves only. */
+ if (!REG_P (operands[0]) || !REG_P (operands[1]))
+ return false;
+
+ regno0 = true_regnum (operands[0]);
+ regno1 = true_regnum (operands[1]);
+
+ return ix86_lea_outperforms (insn, regno0, regno1, -1, 0);
+}
+
/* Return true if we need to split lea into a sequence of
instructions to avoid AGU stalls. */
@@ -17050,18 +17086,56 @@ ix86_expand_convert_uns_sisf_sse (rtx target, rtx input)
emit_move_insn (target, fp_hi);
}
+/* floatunsv{4,8}siv{4,8}sf2 expander. Expand code to convert
+ a vector of unsigned ints VAL to vector of floats TARGET. */
+
+void
+ix86_expand_vector_convert_uns_vsivsf (rtx target, rtx val)
+{
+ rtx tmp[8];
+ REAL_VALUE_TYPE TWO16r;
+ enum machine_mode intmode = GET_MODE (val);
+ enum machine_mode fltmode = GET_MODE (target);
+ rtx (*cvt) (rtx, rtx);
+
+ if (intmode == V4SImode)
+ cvt = gen_floatv4siv4sf2;
+ else
+ cvt = gen_floatv8siv8sf2;
+ tmp[0] = ix86_build_const_vector (intmode, 1, GEN_INT (0xffff));
+ tmp[0] = force_reg (intmode, tmp[0]);
+ tmp[1] = expand_simple_binop (intmode, AND, val, tmp[0], NULL_RTX, 1,
+ OPTAB_DIRECT);
+ tmp[2] = expand_simple_binop (intmode, LSHIFTRT, val, GEN_INT (16),
+ NULL_RTX, 1, OPTAB_DIRECT);
+ tmp[3] = gen_reg_rtx (fltmode);
+ emit_insn (cvt (tmp[3], tmp[1]));
+ tmp[4] = gen_reg_rtx (fltmode);
+ emit_insn (cvt (tmp[4], tmp[2]));
+ real_ldexp (&TWO16r, &dconst1, 16);
+ tmp[5] = const_double_from_real_value (TWO16r, SFmode);
+ tmp[5] = force_reg (fltmode, ix86_build_const_vector (fltmode, 1, tmp[5]));
+ tmp[6] = expand_simple_binop (fltmode, MULT, tmp[4], tmp[5], NULL_RTX, 1,
+ OPTAB_DIRECT);
+ tmp[7] = expand_simple_binop (fltmode, PLUS, tmp[3], tmp[6], target, 1,
+ OPTAB_DIRECT);
+ if (tmp[7] != target)
+ emit_move_insn (target, tmp[7]);
+}
+
/* Adjust a V*SFmode/V*DFmode value VAL so that *sfix_trunc* resp. fix_trunc*
pattern can be used on it instead of *ufix_trunc* resp. fixuns_trunc*.
- This is done by subtracting 0x1p32 from VAL if VAL is greater or equal
- (non-signalling) than 0x1p31. */
+ This is done by doing just signed conversion if < 0x1p31, and otherwise by
+ subtracting 0x1p31 first and xoring in 0x80000000 from *XORP afterwards. */
rtx
-ix86_expand_adjust_ufix_to_sfix_si (rtx val)
+ix86_expand_adjust_ufix_to_sfix_si (rtx val, rtx *xorp)
{
- REAL_VALUE_TYPE MTWO32r, TWO31r;
- rtx two31r, mtwo32r, tmp[3];
+ REAL_VALUE_TYPE TWO31r;
+ rtx two31r, tmp[4];
enum machine_mode mode = GET_MODE (val);
enum machine_mode scalarmode = GET_MODE_INNER (mode);
+ enum machine_mode intmode = GET_MODE_SIZE (mode) == 32 ? V8SImode : V4SImode;
rtx (*cmp) (rtx, rtx, rtx, rtx);
int i;
@@ -17071,22 +17145,33 @@ ix86_expand_adjust_ufix_to_sfix_si (rtx val)
two31r = const_double_from_real_value (TWO31r, scalarmode);
two31r = ix86_build_const_vector (mode, 1, two31r);
two31r = force_reg (mode, two31r);
- real_ldexp (&MTWO32r, &dconstm1, 32);
- mtwo32r = const_double_from_real_value (MTWO32r, scalarmode);
- mtwo32r = ix86_build_const_vector (mode, 1, mtwo32r);
- mtwo32r = force_reg (mode, mtwo32r);
switch (mode)
{
- case V8SFmode: cmp = gen_avx_cmpv8sf3; break;
- case V4SFmode: cmp = gen_avx_cmpv4sf3; break;
- case V4DFmode: cmp = gen_avx_cmpv4df3; break;
- case V2DFmode: cmp = gen_avx_cmpv2df3; break;
+ case V8SFmode: cmp = gen_avx_maskcmpv8sf3; break;
+ case V4SFmode: cmp = gen_sse_maskcmpv4sf3; break;
+ case V4DFmode: cmp = gen_avx_maskcmpv4df3; break;
+ case V2DFmode: cmp = gen_sse2_maskcmpv2df3; break;
default: gcc_unreachable ();
}
- emit_insn (cmp (tmp[0], val, two31r, GEN_INT (29)));
- tmp[1] = expand_simple_binop (mode, AND, tmp[0], mtwo32r, tmp[1],
+ tmp[3] = gen_rtx_LE (mode, two31r, val);
+ emit_insn (cmp (tmp[0], two31r, val, tmp[3]));
+ tmp[1] = expand_simple_binop (mode, AND, tmp[0], two31r, tmp[1],
0, OPTAB_DIRECT);
- return expand_simple_binop (mode, PLUS, val, tmp[1], tmp[2],
+ if (intmode == V4SImode || TARGET_AVX2)
+ *xorp = expand_simple_binop (intmode, ASHIFT,
+ gen_lowpart (intmode, tmp[0]),
+ GEN_INT (31), NULL_RTX, 0,
+ OPTAB_DIRECT);
+ else
+ {
+ rtx two31 = GEN_INT ((unsigned HOST_WIDE_INT) 1 << 31);
+ two31 = ix86_build_const_vector (intmode, 1, two31);
+ *xorp = expand_simple_binop (intmode, AND,
+ gen_lowpart (intmode, tmp[0]),
+ two31, NULL_RTX, 0,
+ OPTAB_DIRECT);
+ }
+ return expand_simple_binop (mode, MINUS, val, tmp[1], tmp[2],
0, OPTAB_DIRECT);
}
@@ -24779,6 +24864,7 @@ enum ix86_builtins
IX86_BUILTIN_VEC_SET_V16QI,
IX86_BUILTIN_VEC_PACK_SFIX,
+ IX86_BUILTIN_VEC_PACK_SFIX256,
/* SSE4.2. */
IX86_BUILTIN_CRC32QI,
@@ -25139,6 +25225,13 @@ enum ix86_builtins
IX86_BUILTIN_GATHERDIV4SI,
IX86_BUILTIN_GATHERDIV8SI,
+ /* Alternate 4 element gather for the vectorizer where
+ all operands are 32-byte wide. */
+ IX86_BUILTIN_GATHERALTSIV4DF,
+ IX86_BUILTIN_GATHERALTDIV8SF,
+ IX86_BUILTIN_GATHERALTSIV4DI,
+ IX86_BUILTIN_GATHERALTDIV8SI,
+
/* TFmode support builtins. */
IX86_BUILTIN_INFQ,
IX86_BUILTIN_HUGE_VALQ,
@@ -26223,7 +26316,7 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtpd2ps256, "__builtin_ia32_cvtpd2ps256", IX86_BUILTIN_CVTPD2PS256, UNKNOWN, (int) V4SF_FTYPE_V4DF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtps2dq256, "__builtin_ia32_cvtps2dq256", IX86_BUILTIN_CVTPS2DQ256, UNKNOWN, (int) V8SI_FTYPE_V8SF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtps2pd256, "__builtin_ia32_cvtps2pd256", IX86_BUILTIN_CVTPS2PD256, UNKNOWN, (int) V4DF_FTYPE_V4SF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_fix_truncv4sfv4si2, "__builtin_ia32_cvttpd2dq256", IX86_BUILTIN_CVTTPD2DQ256, UNKNOWN, (int) V4SI_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_fix_truncv4dfv4si2, "__builtin_ia32_cvttpd2dq256", IX86_BUILTIN_CVTTPD2DQ256, UNKNOWN, (int) V4SI_FTYPE_V4DF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtpd2dq256, "__builtin_ia32_cvtpd2dq256", IX86_BUILTIN_CVTPD2DQ256, UNKNOWN, (int) V4SI_FTYPE_V4DF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_fix_truncv8sfv8si2, "__builtin_ia32_cvttps2dq256", IX86_BUILTIN_CVTTPS2DQ256, UNKNOWN, (int) V8SI_FTYPE_V8SF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_vperm2f128v4df3, "__builtin_ia32_vperm2f128_pd256", IX86_BUILTIN_VPERM2F128PD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_INT },
@@ -26300,6 +26393,8 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_copysignv8sf3, "__builtin_ia32_copysignps256", IX86_BUILTIN_CPYSGNPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_copysignv4df3, "__builtin_ia32_copysignpd256", IX86_BUILTIN_CPYSGNPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_vec_pack_sfix_v4df, "__builtin_ia32_vec_pack_sfix256 ", IX86_BUILTIN_VEC_PACK_SFIX256, UNKNOWN, (int) V8SI_FTYPE_V4DF_V4DF },
+
/* AVX2 */
{ OPTION_MASK_ISA_AVX2, CODE_FOR_avx2_mpsadbw, "__builtin_ia32_mpsadbw256", IX86_BUILTIN_MPSADBW256, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_INT },
{ OPTION_MASK_ISA_AVX2, CODE_FOR_absv32qi2, "__builtin_ia32_pabsb256", IX86_BUILTIN_PABSB256, UNKNOWN, (int) V32QI_FTYPE_V32QI },
@@ -27065,6 +27160,22 @@ ix86_init_mmx_sse_builtins (void)
V4SI_FTYPE_V4SI_PCINT_V4DI_V4SI_INT,
IX86_BUILTIN_GATHERDIV8SI);
+ def_builtin (OPTION_MASK_ISA_AVX2, "__builtin_ia32_gatheraltsiv4df ",
+ V4DF_FTYPE_V4DF_PCDOUBLE_V8SI_V4DF_INT,
+ IX86_BUILTIN_GATHERALTSIV4DF);
+
+ def_builtin (OPTION_MASK_ISA_AVX2, "__builtin_ia32_gatheraltdiv4sf256 ",
+ V8SF_FTYPE_V8SF_PCFLOAT_V4DI_V8SF_INT,
+ IX86_BUILTIN_GATHERALTDIV8SF);
+
+ def_builtin (OPTION_MASK_ISA_AVX2, "__builtin_ia32_gatheraltsiv4di ",
+ V4DI_FTYPE_V4DI_PCINT64_V8SI_V4DI_INT,
+ IX86_BUILTIN_GATHERALTSIV4DI);
+
+ def_builtin (OPTION_MASK_ISA_AVX2, "__builtin_ia32_gatheraltdiv4si256 ",
+ V8SI_FTYPE_V8SI_PCINT_V4DI_V8SI_INT,
+ IX86_BUILTIN_GATHERALTDIV8SI);
+
/* MMX access to the vec_init patterns. */
def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v2si",
V2SI_FTYPE_INT_INT, IX86_BUILTIN_VEC_INIT_V2SI);
@@ -28123,6 +28234,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V32QI_FTYPE_V32QI_V32QI:
case V16HI_FTYPE_V32QI_V32QI:
case V16HI_FTYPE_V16HI_V16HI:
+ case V8SI_FTYPE_V4DF_V4DF:
case V8SI_FTYPE_V8SI_V8SI:
case V8SI_FTYPE_V16HI_V16HI:
case V4DI_FTYPE_V4DI_V4DI:
@@ -29052,7 +29164,7 @@ rdrand_step:
icode = CODE_FOR_avx2_gatherdiv4sf;
goto gather_gen;
case IX86_BUILTIN_GATHERDIV8SF:
- icode = CODE_FOR_avx2_gatherdiv4sf256;
+ icode = CODE_FOR_avx2_gatherdiv8sf;
goto gather_gen;
case IX86_BUILTIN_GATHERSIV2DI:
icode = CODE_FOR_avx2_gathersiv2di;
@@ -29076,7 +29188,20 @@ rdrand_step:
icode = CODE_FOR_avx2_gatherdiv4si;
goto gather_gen;
case IX86_BUILTIN_GATHERDIV8SI:
- icode = CODE_FOR_avx2_gatherdiv4si256;
+ icode = CODE_FOR_avx2_gatherdiv8si;
+ goto gather_gen;
+ case IX86_BUILTIN_GATHERALTSIV4DF:
+ icode = CODE_FOR_avx2_gathersiv4df;
+ goto gather_gen;
+ case IX86_BUILTIN_GATHERALTDIV8SF:
+ icode = CODE_FOR_avx2_gatherdiv8sf;
+ goto gather_gen;
+ case IX86_BUILTIN_GATHERALTSIV4DI:
+ icode = CODE_FOR_avx2_gathersiv4df;
+ goto gather_gen;
+ case IX86_BUILTIN_GATHERALTDIV8SI:
+ icode = CODE_FOR_avx2_gatherdiv8si;
+ goto gather_gen;
gather_gen:
arg0 = CALL_EXPR_ARG (exp, 0);
@@ -29095,8 +29220,39 @@ rdrand_step:
mode3 = insn_data[icode].operand[4].mode;
mode4 = insn_data[icode].operand[5].mode;
- if (target == NULL_RTX)
- target = gen_reg_rtx (insn_data[icode].operand[0].mode);
+ if (target == NULL_RTX
+ || GET_MODE (target) != insn_data[icode].operand[0].mode)
+ subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
+ else
+ subtarget = target;
+
+ if (fcode == IX86_BUILTIN_GATHERALTSIV4DF
+ || fcode == IX86_BUILTIN_GATHERALTSIV4DI)
+ {
+ rtx half = gen_reg_rtx (V4SImode);
+ if (!nonimmediate_operand (op2, V8SImode))
+ op2 = copy_to_mode_reg (V8SImode, op2);
+ emit_insn (gen_vec_extract_lo_v8si (half, op2));
+ op2 = half;
+ }
+ else if (fcode == IX86_BUILTIN_GATHERALTDIV8SF
+ || fcode == IX86_BUILTIN_GATHERALTDIV8SI)
+ {
+ rtx (*gen) (rtx, rtx);
+ rtx half = gen_reg_rtx (mode0);
+ if (mode0 == V4SFmode)
+ gen = gen_vec_extract_lo_v8sf;
+ else
+ gen = gen_vec_extract_lo_v8si;
+ if (!nonimmediate_operand (op0, GET_MODE (op0)))
+ op0 = copy_to_mode_reg (GET_MODE (op0), op0);
+ emit_insn (gen (half, op0));
+ op0 = half;
+ if (!nonimmediate_operand (op3, GET_MODE (op3)))
+ op3 = copy_to_mode_reg (GET_MODE (op3), op3);
+ emit_insn (gen (half, op3));
+ op3 = half;
+ }
/* Force memory operand only with base register here. But we
don't want to do it on memory operand for other builtin
@@ -29118,10 +29274,91 @@ rdrand_step:
error ("last argument must be scale 1, 2, 4, 8");
return const0_rtx;
}
- pat = GEN_FCN (icode) (target, op0, op1, op2, op3, op4);
+
+ /* Optimize. If mask is known to have all high bits set,
+ replace op0 with pc_rtx to signal that the instruction
+ overwrites the whole destination and doesn't use its
+ previous contents. */
+ if (optimize)
+ {
+ if (TREE_CODE (arg3) == VECTOR_CST)
+ {
+ tree elt;
+ unsigned int negative = 0;
+ for (elt = TREE_VECTOR_CST_ELTS (arg3);
+ elt; elt = TREE_CHAIN (elt))
+ {
+ tree cst = TREE_VALUE (elt);
+ if (TREE_CODE (cst) == INTEGER_CST
+ && tree_int_cst_sign_bit (cst))
+ negative++;
+ else if (TREE_CODE (cst) == REAL_CST
+ && REAL_VALUE_NEGATIVE (TREE_REAL_CST (cst)))
+ negative++;
+ }
+ if (negative == TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg3)))
+ op0 = pc_rtx;
+ }
+ else if (TREE_CODE (arg3) == SSA_NAME)
+ {
+ /* Recognize also when mask is like:
+ __v2df src = _mm_setzero_pd ();
+ __v2df mask = _mm_cmpeq_pd (src, src);
+ or
+ __v8sf src = _mm256_setzero_ps ();
+ __v8sf mask = _mm256_cmp_ps (src, src, _CMP_EQ_OQ);
+ as that is a cheaper way to load all ones into
+ a register than having to load a constant from
+ memory. */
+ gimple def_stmt = SSA_NAME_DEF_STMT (arg3);
+ if (is_gimple_call (def_stmt))
+ {
+ tree fndecl = gimple_call_fndecl (def_stmt);
+ if (fndecl
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ switch ((unsigned int) DECL_FUNCTION_CODE (fndecl))
+ {
+ case IX86_BUILTIN_CMPPD:
+ case IX86_BUILTIN_CMPPS:
+ case IX86_BUILTIN_CMPPD256:
+ case IX86_BUILTIN_CMPPS256:
+ if (!integer_zerop (gimple_call_arg (def_stmt, 2)))
+ break;
+ /* FALLTHRU */
+ case IX86_BUILTIN_CMPEQPD:
+ case IX86_BUILTIN_CMPEQPS:
+ if (initializer_zerop (gimple_call_arg (def_stmt, 0))
+ && initializer_zerop (gimple_call_arg (def_stmt,
+ 1)))
+ op0 = pc_rtx;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ pat = GEN_FCN (icode) (subtarget, op0, op1, op2, op3, op4);
if (! pat)
return const0_rtx;
emit_insn (pat);
+
+ if (fcode == IX86_BUILTIN_GATHERDIV8SF
+ || fcode == IX86_BUILTIN_GATHERDIV8SI)
+ {
+ enum machine_mode tmode = GET_MODE (subtarget) == V8SFmode
+ ? V4SFmode : V4SImode;
+ if (target == NULL_RTX)
+ target = gen_reg_rtx (tmode);
+ if (tmode == V4SFmode)
+ emit_insn (gen_vec_extract_lo_v8sf (target, subtarget));
+ else
+ emit_insn (gen_vec_extract_lo_v8si (target, subtarget));
+ }
+ else
+ target = subtarget;
+
return target;
default:
@@ -29218,13 +29455,21 @@ ix86_builtin_vectorized_function (tree fndecl, tree type_out,
}
break;
+ case BUILT_IN_IRINT:
case BUILT_IN_LRINT:
- if (out_mode == SImode && out_n == 4
- && in_mode == DFmode && in_n == 2)
- return ix86_builtins[IX86_BUILTIN_VEC_PACK_SFIX];
+ case BUILT_IN_LLRINT:
+ if (out_mode == SImode && in_mode == DFmode)
+ {
+ if (out_n == 4 && in_n == 2)
+ return ix86_builtins[IX86_BUILTIN_VEC_PACK_SFIX];
+ else if (out_n == 8 && in_n == 4)
+ return ix86_builtins[IX86_BUILTIN_VEC_PACK_SFIX256];
+ }
break;
+ case BUILT_IN_IRINTF:
case BUILT_IN_LRINTF:
+ case BUILT_IN_LLRINTF:
if (out_mode == SImode && in_mode == SFmode)
{
if (out_n == 4 && in_n == 4)
@@ -29626,6 +29871,73 @@ ix86_veclibabi_acml (enum built_in_function fn, tree type_out, tree type_in)
return new_fndecl;
}
+/* Returns a decl of a function that implements gather load with
+ memory type MEM_VECTYPE and index type INDEX_VECTYPE and SCALE.
+ Return NULL_TREE if it is not available. */
+
+static tree
+ix86_vectorize_builtin_gather (const_tree mem_vectype,
+ const_tree index_type, int scale)
+{
+ bool si;
+ enum ix86_builtins code;
+
+ if (! TARGET_AVX2)
+ return NULL_TREE;
+
+ if ((TREE_CODE (index_type) != INTEGER_TYPE
+ && !POINTER_TYPE_P (index_type))
+ || (TYPE_MODE (index_type) != SImode
+ && TYPE_MODE (index_type) != DImode))
+ return NULL_TREE;
+
+ if (TYPE_PRECISION (index_type) > POINTER_SIZE)
+ return NULL_TREE;
+
+ /* v*gather* insn sign extends index to pointer mode. */
+ if (TYPE_PRECISION (index_type) < POINTER_SIZE
+ && TYPE_UNSIGNED (index_type))
+ return NULL_TREE;
+
+ if (scale <= 0
+ || scale > 8
+ || (scale & (scale - 1)) != 0)
+ return NULL_TREE;
+
+ si = TYPE_MODE (index_type) == SImode;
+ switch (TYPE_MODE (mem_vectype))
+ {
+ case V2DFmode:
+ code = si ? IX86_BUILTIN_GATHERSIV2DF : IX86_BUILTIN_GATHERDIV2DF;
+ break;
+ case V4DFmode:
+ code = si ? IX86_BUILTIN_GATHERALTSIV4DF : IX86_BUILTIN_GATHERDIV4DF;
+ break;
+ case V2DImode:
+ code = si ? IX86_BUILTIN_GATHERSIV2DI : IX86_BUILTIN_GATHERDIV2DI;
+ break;
+ case V4DImode:
+ code = si ? IX86_BUILTIN_GATHERALTSIV4DI : IX86_BUILTIN_GATHERDIV4DI;
+ break;
+ case V4SFmode:
+ code = si ? IX86_BUILTIN_GATHERSIV4SF : IX86_BUILTIN_GATHERDIV4SF;
+ break;
+ case V8SFmode:
+ code = si ? IX86_BUILTIN_GATHERSIV8SF : IX86_BUILTIN_GATHERALTDIV8SF;
+ break;
+ case V4SImode:
+ code = si ? IX86_BUILTIN_GATHERSIV4SI : IX86_BUILTIN_GATHERDIV4SI;
+ break;
+ case V8SImode:
+ code = si ? IX86_BUILTIN_GATHERSIV8SI : IX86_BUILTIN_GATHERALTDIV8SI;
+ break;
+ default:
+ return NULL_TREE;
+ }
+
+ return ix86_builtins[code];
+}
+
/* Returns a code for a target-specific builtin that implements
reciprocal of the function, or NULL_TREE if not available. */
@@ -37835,6 +38147,9 @@ ix86_autovectorize_vector_sizes (void)
#undef TARGET_VECTORIZE_BUILTIN_TM_STORE
#define TARGET_VECTORIZE_BUILTIN_TM_STORE ix86_builtin_tm_store
+#undef TARGET_VECTORIZE_BUILTIN_GATHER
+#define TARGET_VECTORIZE_BUILTIN_GATHER ix86_vectorize_builtin_gather
+
#undef TARGET_BUILTIN_RECIPROCAL
#define TARGET_BUILTIN_RECIPROCAL ix86_builtin_reciprocal
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a8ebfa48000..35273d95683 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -248,6 +248,9 @@
;; For BMI2 support
UNSPEC_PDEP
UNSPEC_PEXT
+
+ ;; For __atomic support
+ UNSPEC_MOVA
])
(define_c_enum "unspecv" [
@@ -262,7 +265,10 @@
UNSPECV_ALIGN
UNSPECV_MONITOR
UNSPECV_MWAIT
- UNSPECV_CMPXCHG
+ UNSPECV_CMPXCHG_1
+ UNSPECV_CMPXCHG_2
+ UNSPECV_CMPXCHG_3
+ UNSPECV_CMPXCHG_4
UNSPECV_XCHG
UNSPECV_LOCK
UNSPECV_PROLOGUE_USE
@@ -2047,6 +2053,8 @@
return "mov{l}\t{%k1, %k0|%k0, %k1}";
else if (which_alternative == 2)
return "movabs{q}\t{%1, %0|%0, %1}";
+ else if (ix86_use_lea_for_mov (insn, operands))
+ return "lea{q}\t{%a1, %0|%0, %a1}";
else
return "mov{q}\t{%1, %0|%0, %1}";
}
@@ -2282,7 +2290,10 @@
default:
gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1]));
- return "mov{l}\t{%1, %0|%0, %1}";
+ if (ix86_use_lea_for_mov (insn, operands))
+ return "lea{l}\t{%a1, %0|%0, %a1}";
+ else
+ return "mov{l}\t{%1, %0|%0, %1}";
}
}
[(set (attr "type")
@@ -4922,7 +4933,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(set (match_dup 0) (float:MODEF (match_dup 1)))])
(define_split
@@ -4935,7 +4946,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (float:MODEF (match_dup 2)))])
@@ -5026,7 +5037,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(const_int 0)]
{
rtx op1 = operands[1];
@@ -5069,7 +5080,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(const_int 0)]
{
operands[3] = simplify_gen_subreg (<ssevecmode>mode, operands[0],
@@ -5093,7 +5104,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(const_int 0)]
{
rtx op1 = operands[1];
@@ -5139,7 +5150,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(const_int 0)]
{
operands[3] = simplify_gen_subreg (<ssevecmode>mode, operands[0],
@@ -5202,7 +5213,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(set (match_dup 0) (float:MODEF (match_dup 1)))])
(define_insn "*float<SWI48x:mode><MODEF:mode>2_sse_nointerunit"
@@ -5237,7 +5248,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (float:MODEF (match_dup 2)))])
@@ -5250,7 +5261,7 @@
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
- && SSE_REG_P (operands[0])))"
+ && SSE_REG_P (SUBREG_REG (operands[0]))))"
[(set (match_dup 0) (float:MODEF (match_dup 1)))])
(define_insn "*float<SWI48x:mode><X87MODEF:mode>2_i387_with_temp"
@@ -7702,8 +7713,10 @@
[(and:SI (zero_extract:SI (match_dup 2) (const_int 8) (const_int 8))
(match_dup 3))
(const_int 0)]))]
- "operands[2] = gen_lowpart (SImode, operands[2]);
- operands[3] = gen_int_mode (INTVAL (operands[3]) >> 8, SImode);")
+{
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ operands[3] = gen_int_mode (INTVAL (operands[3]) >> 8, SImode);
+})
(define_split
[(set (match_operand 0 "flags_reg_operand" "")
@@ -7721,8 +7734,10 @@
[(set (match_dup 0)
(match_op_dup 1 [(and:QI (match_dup 2) (match_dup 3))
(const_int 0)]))]
- "operands[2] = gen_lowpart (QImode, operands[2]);
- operands[3] = gen_lowpart (QImode, operands[3]);")
+{
+ operands[2] = gen_lowpart (QImode, operands[2]);
+ operands[3] = gen_lowpart (QImode, operands[3]);
+})
;; %%% This used to optimize known byte-wide and operations to memory,
;; and sometimes to QImode registers. If this is considered useful,
@@ -8147,9 +8162,11 @@
(const_int 8) (const_int 8))
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);
+})
;; Since AND can be encoded with sign extended immediate, this is only
;; profitable when 7th bit is not set.
@@ -8168,9 +8185,11 @@
(and:QI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (QImode, operands[0]);
- operands[1] = gen_lowpart (QImode, operands[1]);
- operands[2] = gen_lowpart (QImode, operands[2]);")
+{
+ operands[0] = gen_lowpart (QImode, operands[0]);
+ operands[1] = gen_lowpart (QImode, operands[1]);
+ operands[2] = gen_lowpart (QImode, operands[2]);
+})
;; Logical inclusive and exclusive OR instructions
@@ -8402,9 +8421,11 @@
(const_int 8) (const_int 8))
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);
+})
;; Since OR can be encoded with sign extended immediate, this is only
;; profitable when 7th bit is set.
@@ -8423,9 +8444,11 @@
(any_or:QI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (QImode, operands[0]);
- operands[1] = gen_lowpart (QImode, operands[1]);
- operands[2] = gen_lowpart (QImode, operands[2]);")
+{
+ operands[0] = gen_lowpart (QImode, operands[0]);
+ operands[1] = gen_lowpart (QImode, operands[1]);
+ operands[2] = gen_lowpart (QImode, operands[2]);
+})
(define_expand "xorqi_cc_ext_1"
[(parallel [
@@ -14651,7 +14674,7 @@
else if (optimize_insn_for_size_p ())
FAIL;
else
- ix86_expand_rint (operand0, operand1);
+ ix86_expand_rint (operands[0], operands[1]);
}
else
{
@@ -14851,7 +14874,7 @@
&& <SWI248x:MODE>mode != HImode
&& ((<SWI248x:MODE>mode != DImode) || TARGET_64BIT)
&& !flag_trapping_math && !flag_rounding_math)
- ix86_expand_lround (operand0, operand1);
+ ix86_expand_lround (operands[0], operands[1]);
else
ix86_emit_i387_round (operands[0], operands[1]);
DONE;
@@ -14927,9 +14950,9 @@
else if (optimize_insn_for_size_p ())
FAIL;
else if (TARGET_64BIT || (<MODE>mode != DFmode))
- ix86_expand_floorceil (operand0, operand1, true);
+ ix86_expand_floorceil (operands[0], operands[1], true);
else
- ix86_expand_floorceildf_32 (operand0, operand1, true);
+ ix86_expand_floorceildf_32 (operands[0], operands[1], true);
}
else
{
@@ -15111,7 +15134,7 @@
{
if (TARGET_64BIT && optimize_insn_for_size_p ())
FAIL;
- ix86_expand_lfloorceil (operand0, operand1, true);
+ ix86_expand_lfloorceil (operands[0], operands[1], true);
DONE;
})
@@ -15185,9 +15208,9 @@
else if (optimize_insn_for_size_p ())
FAIL;
else if (TARGET_64BIT || (<MODE>mode != DFmode))
- ix86_expand_floorceil (operand0, operand1, false);
+ ix86_expand_floorceil (operands[0], operands[1], false);
else
- ix86_expand_floorceildf_32 (operand0, operand1, false);
+ ix86_expand_floorceildf_32 (operands[0], operands[1], false);
}
else
{
@@ -15367,7 +15390,7 @@
"SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math"
{
- ix86_expand_lfloorceil (operand0, operand1, false);
+ ix86_expand_lfloorceil (operands[0], operands[1], false);
DONE;
})
@@ -15441,9 +15464,9 @@
else if (optimize_insn_for_size_p ())
FAIL;
else if (TARGET_64BIT || (<MODE>mode != DFmode))
- ix86_expand_trunc (operand0, operand1);
+ ix86_expand_trunc (operands[0], operands[1]);
else
- ix86_expand_truncdf_32 (operand0, operand1);
+ ix86_expand_truncdf_32 (operands[0], operands[1]);
}
else
{
@@ -16631,14 +16654,18 @@
;; The % modifier is not operational anymore in peephole2's, so we have to
;; swap the operands manually in the case of addition and multiplication.
- "if (COMMUTATIVE_ARITH_P (operands[2]))
- operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]),
- GET_MODE (operands[2]),
- operands[0], operands[1]);
- else
- operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]),
- GET_MODE (operands[2]),
- operands[1], operands[0]);")
+{
+ rtx op0, op1;
+
+ if (COMMUTATIVE_ARITH_P (operands[2]))
+ op0 = operands[0], op1 = operands[1];
+ else
+ op0 = operands[1], op1 = operands[0];
+
+ operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]),
+ GET_MODE (operands[2]),
+ op0, op1);
+})
;; Conditional addition patterns
(define_expand "add<mode>cc"
@@ -16837,11 +16864,13 @@
[(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- if (GET_CODE (operands[3]) != ASHIFT)
- operands[2] = gen_lowpart (SImode, operands[2]);
- PUT_MODE (operands[3], SImode);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ if (GET_CODE (operands[3]) != ASHIFT)
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ PUT_MODE (operands[3], SImode);
+})
; Promote the QImode tests, as i386 has encoding of the AND
; instruction with 32-bit sign-extended immediate and thus the
@@ -16911,8 +16940,10 @@
[(parallel [(set (match_dup 0)
(neg:SI (match_dup 1)))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (SImode, operands[1]);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+})
(define_split
[(set (match_operand 0 "register_operand" "")
@@ -16924,8 +16955,10 @@
|| optimize_insn_for_size_p ())))"
[(set (match_dup 0)
(not:SI (match_dup 1)))]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (SImode, operands[1]);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+})
(define_split
[(set (match_operand 0 "register_operand" "")
@@ -16940,9 +16973,11 @@
|| optimize_insn_for_size_p ())))"
[(set (match_dup 0)
(if_then_else:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
- "operands[0] = gen_lowpart (SImode, operands[0]);
- operands[2] = gen_lowpart (SImode, operands[2]);
- operands[3] = gen_lowpart (SImode, operands[3]);")
+{
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ operands[3] = gen_lowpart (SImode, operands[3]);
+})
;; RTL Peephole optimizations, run before sched2. These primarily look to
;; transform a complex memory operation into two memory to register operations.
@@ -17228,12 +17263,14 @@
[(parallel [(set (match_dup 4) (match_dup 5))
(set (match_dup 1) (match_op_dup 3 [(match_dup 1)
(match_dup 2)]))])]
- "operands[4] = SET_DEST (PATTERN (peep2_next_insn (3)));
- operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
- copy_rtx (operands[1]),
- copy_rtx (operands[2]));
- operands[5] = gen_rtx_COMPARE (GET_MODE (operands[4]),
- operands[5], const0_rtx);")
+{
+ operands[4] = SET_DEST (PATTERN (peep2_next_insn (3)));
+ operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
+ copy_rtx (operands[1]),
+ copy_rtx (operands[2]));
+ operands[5] = gen_rtx_COMPARE (GET_MODE (operands[4]),
+ operands[5], const0_rtx);
+})
(define_peephole2
[(parallel [(set (match_operand:SWI 0 "register_operand" "")
@@ -17253,12 +17290,14 @@
[(parallel [(set (match_dup 3) (match_dup 4))
(set (match_dup 1) (match_op_dup 2 [(match_dup 1)
(match_dup 0)]))])]
- "operands[3] = SET_DEST (PATTERN (peep2_next_insn (2)));
- operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]), <MODE>mode,
- copy_rtx (operands[1]),
- copy_rtx (operands[0]));
- operands[4] = gen_rtx_COMPARE (GET_MODE (operands[3]),
- operands[4], const0_rtx);")
+{
+ operands[3] = SET_DEST (PATTERN (peep2_next_insn (2)));
+ operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]), <MODE>mode,
+ copy_rtx (operands[1]),
+ copy_rtx (operands[0]));
+ operands[4] = gen_rtx_COMPARE (GET_MODE (operands[3]),
+ operands[4], const0_rtx);
+})
(define_peephole2
[(set (match_operand:SWI12 0 "register_operand" "")
@@ -17281,15 +17320,17 @@
? CCGOCmode : CCNOmode)"
[(parallel [(set (match_dup 4) (match_dup 5))
(set (match_dup 1) (match_dup 6))])]
- "operands[2] = gen_lowpart (<MODE>mode, operands[2]);
- operands[4] = SET_DEST (PATTERN (peep2_next_insn (3)));
- operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
- copy_rtx (operands[1]), operands[2]);
- operands[5] = gen_rtx_COMPARE (GET_MODE (operands[4]),
- operands[5], const0_rtx);
- operands[6] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
- copy_rtx (operands[1]),
- copy_rtx (operands[2]));")
+{
+ operands[2] = gen_lowpart (<MODE>mode, operands[2]);
+ operands[4] = SET_DEST (PATTERN (peep2_next_insn (3)));
+ operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
+ copy_rtx (operands[1]), operands[2]);
+ operands[5] = gen_rtx_COMPARE (GET_MODE (operands[4]),
+ operands[5], const0_rtx);
+ operands[6] = gen_rtx_fmt_ee (GET_CODE (operands[3]), <MODE>mode,
+ copy_rtx (operands[1]),
+ copy_rtx (operands[2]));
+})
;; Attempt to always use XOR for zeroing registers.
(define_peephole2
@@ -18075,8 +18116,8 @@
(match_operand:SI 3 "const_int_operand" "i")]
UNSPECV_LWPVAL_INTRINSIC)]
"TARGET_LWP"
- "/* Avoid unused variable warning. */
- (void) operand0;")
+ ;; Avoid unused variable warning.
+ "(void) operands[0];")
(define_insn "*lwp_lwpval<mode>3_1"
[(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")
diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
index 102814e2b90..986a573dbea 100644
--- a/gcc/config/i386/immintrin.h
+++ b/gcc/config/i386/immintrin.h
@@ -76,6 +76,10 @@
#include <fmaintrin.h>
#endif
+#ifdef __F16C__
+#include <f16cintrin.h>
+#endif
+
#ifdef __RDRND__
extern __inline int
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
@@ -161,63 +165,4 @@ _rdrand64_step (unsigned long long *__P)
#endif /* __RDRND__ */
#endif /* __x86_64__ */
-#ifdef __F16C__
-extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_cvtsh_ss (unsigned short __S)
-{
- __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
- __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
- return __builtin_ia32_vec_ext_v4sf (__A, 0);
-}
-
-extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_cvtph_ps (__m128i __A)
-{
- return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A);
-}
-
-extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_cvtph_ps (__m128i __A)
-{
- return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A);
-}
-
-#ifdef __OPTIMIZE__
-extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_cvtss_sh (float __F, const int __I)
-{
- __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 };
- __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I);
- return (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0);
-}
-
-extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_cvtps_ph (__m128 __A, const int __I)
-{
- return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
-}
-
-extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_cvtps_ph (__m256 __A, const int __I)
-{
- return (__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf) __A, __I);
-}
-#else
-#define _cvtss_sh(__F, __I) \
- (__extension__ \
- ({ \
- __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 }; \
- __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I); \
- (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0); \
- }))
-
-#define _mm_cvtps_ph(A, I) \
- ((__m128i) __builtin_ia32_vcvtps2ph ((__v4sf)(__m128) A, (int) (I)))
-
-#define _mm256_cvtps_ph(A, I) \
- ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) A, (int) (I)))
-#endif
-
-#endif /* __F16C__ */
-
#endif /* _IMMINTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index d9f10c834af..00dcca60bb0 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -230,4 +230,4 @@ do { \
#define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll"
/* We should find a way to not have to update this manually. */
-#define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-12.dll"
+#define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-13.dll"
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 48e110ad164..3745b497c19 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1162,7 +1162,7 @@
;; Return true if OP is a binary operator that can be promoted to wider mode.
(define_predicate "promotable_binary_operator"
- (ior (match_code "plus,and,ior,xor,ashift")
+ (ior (match_code "plus,minus,and,ior,xor,ashift")
(and (match_code "mult")
(match_test "TARGET_TUNE_PROMOTE_HIMODE_IMUL"))))
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 33c2e94b369..688b5be9648 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -316,14 +316,6 @@
;; Mix-n-match
(define_mode_iterator AVX256MODE2P [V8SI V8SF V4DF])
-(define_mode_iterator AVXMODE48P_DI
- [V2DI V2DF V4DI V4DF V4SF V4SI])
-(define_mode_attr AVXMODE48P_DI
- [(V2DI "V2DI") (V2DF "V2DI")
- (V4DI "V4DI") (V4DF "V4DI")
- (V4SI "V2DI") (V4SF "V2DI")
- (V8SI "V4DI") (V8SF "V4DI")])
-
(define_mode_iterator FMAMODE [SF DF V4SF V2DF V8SF V4DF])
;; Mapping of immediate bits for blend instructions
@@ -2242,30 +2234,12 @@
(set_attr "mode" "<sseinsnmode>")])
(define_expand "floatuns<sseintvecmodelower><mode>2"
- [(set (match_dup 5)
- (float:VF1
- (match_operand:<sseintvecmode> 1 "nonimmediate_operand" "")))
- (set (match_dup 6)
- (lt:VF1 (match_dup 5) (match_dup 3)))
- (set (match_dup 7)
- (and:VF1 (match_dup 6) (match_dup 4)))
- (set (match_operand:VF1 0 "register_operand" "")
- (plus:VF1 (match_dup 5) (match_dup 7)))]
- "TARGET_SSE2"
+ [(match_operand:VF1 0 "register_operand" "")
+ (match_operand:<sseintvecmode> 1 "register_operand" "")]
+ "TARGET_SSE2 && (<MODE>mode == V4SFmode || TARGET_AVX2)"
{
- REAL_VALUE_TYPE TWO32r;
- rtx x;
- int i;
-
- real_ldexp (&TWO32r, &dconst1, 32);
- x = const_double_from_real_value (TWO32r, SFmode);
-
- operands[3] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));
- operands[4] = force_reg (<MODE>mode,
- ix86_build_const_vector (<MODE>mode, 1, x));
-
- for (i = 5; i < 8; i++)
- operands[i] = gen_reg_rtx (<MODE>mode);
+ ix86_expand_vector_convert_uns_vsivsf (operands[0], operands[1]);
+ DONE;
})
(define_insn "avx_cvtps2dq256"
@@ -2325,10 +2299,13 @@
(define_expand "fixuns_trunc<mode><sseintvecmodelower>2"
[(match_operand:<sseintvecmode> 0 "register_operand" "")
(match_operand:VF1 1 "register_operand" "")]
- "TARGET_AVX"
+ "TARGET_SSE2"
{
- rtx tmp = ix86_expand_adjust_ufix_to_sfix_si (operands[1]);
- emit_insn (gen_fix_trunc<mode><sseintvecmodelower>2 (operands[0], tmp));
+ rtx tmp[3];
+ tmp[0] = ix86_expand_adjust_ufix_to_sfix_si (operands[1], &tmp[2]);
+ tmp[1] = gen_reg_rtx (<sseintvecmode>mode);
+ emit_insn (gen_fix_trunc<mode><sseintvecmodelower>2 (tmp[1], tmp[0]));
+ emit_insn (gen_xor<sseintvecmodelower>3 (operands[0], tmp[1], tmp[2]));
DONE;
})
@@ -3115,12 +3092,29 @@
[(match_operand:<ssepackfltmode> 0 "register_operand" "")
(match_operand:VF2 1 "register_operand" "")
(match_operand:VF2 2 "register_operand" "")]
- "TARGET_AVX"
+ "TARGET_SSE2"
{
- rtx tmp[2];
- tmp[0] = ix86_expand_adjust_ufix_to_sfix_si (operands[1]);
- tmp[1] = ix86_expand_adjust_ufix_to_sfix_si (operands[2]);
- emit_insn (gen_vec_pack_sfix_trunc_<mode> (operands[0], tmp[0], tmp[1]));
+ rtx tmp[7];
+ tmp[0] = ix86_expand_adjust_ufix_to_sfix_si (operands[1], &tmp[2]);
+ tmp[1] = ix86_expand_adjust_ufix_to_sfix_si (operands[2], &tmp[3]);
+ tmp[4] = gen_reg_rtx (<ssepackfltmode>mode);
+ emit_insn (gen_vec_pack_sfix_trunc_<mode> (tmp[4], tmp[0], tmp[1]));
+ if (<ssepackfltmode>mode == V4SImode || TARGET_AVX2)
+ {
+ tmp[5] = gen_reg_rtx (<ssepackfltmode>mode);
+ ix86_expand_vec_extract_even_odd (tmp[5], tmp[2], tmp[3], 0);
+ }
+ else
+ {
+ tmp[5] = gen_reg_rtx (V8SFmode);
+ ix86_expand_vec_extract_even_odd (tmp[5], gen_lowpart (V8SFmode, tmp[2]),
+ gen_lowpart (V8SFmode, tmp[3]), 0);
+ tmp[5] = gen_lowpart (V8SImode, tmp[5]);
+ }
+ tmp[6] = expand_simple_binop (<ssepackfltmode>mode, XOR, tmp[4], tmp[5],
+ operands[0], 0, OPTAB_DIRECT);
+ if (tmp[6] != operands[0])
+ emit_move_insn (operands[0], tmp[6]);
DONE;
})
@@ -12516,11 +12510,21 @@
;; For gather* insn patterns
(define_mode_iterator VEC_GATHER_MODE
[V2DI V2DF V4DI V4DF V4SI V4SF V8SI V8SF])
-(define_mode_attr VEC_GATHER_MODE
+(define_mode_attr VEC_GATHER_IDXSI
[(V2DI "V4SI") (V2DF "V4SI")
(V4DI "V4SI") (V4DF "V4SI")
(V4SI "V4SI") (V4SF "V4SI")
(V8SI "V8SI") (V8SF "V8SI")])
+(define_mode_attr VEC_GATHER_IDXDI
+ [(V2DI "V2DI") (V2DF "V2DI")
+ (V4DI "V4DI") (V4DF "V4DI")
+ (V4SI "V2DI") (V4SF "V2DI")
+ (V8SI "V4DI") (V8SF "V4DI")])
+(define_mode_attr VEC_GATHER_SRCDI
+ [(V2DI "V2DI") (V2DF "V2DF")
+ (V4DI "V4DI") (V4DF "V4DF")
+ (V4SI "V4SI") (V4SF "V4SF")
+ (V8SI "V4SI") (V8SF "V4SF")])
(define_expand "avx2_gathersi<mode>"
[(parallel [(set (match_operand:VEC_GATHER_MODE 0 "register_operand" "")
@@ -12529,7 +12533,8 @@
(mem:<ssescalarmode>
(match_par_dup 7
[(match_operand 2 "vsib_address_operand" "")
- (match_operand:<VEC_GATHER_MODE> 3 "register_operand" "")
+ (match_operand:<VEC_GATHER_IDXSI>
+ 3 "register_operand" "")
(match_operand:SI 5 "const1248_operand " "")]))
(mem:BLK (scratch))
(match_operand:VEC_GATHER_MODE 4 "register_operand" "")]
@@ -12549,7 +12554,7 @@
(match_operator:<ssescalarmode> 7 "vsib_mem_operator"
[(unspec:P
[(match_operand:P 3 "vsib_address_operand" "p")
- (match_operand:<VEC_GATHER_MODE> 4 "register_operand" "x")
+ (match_operand:<VEC_GATHER_IDXSI> 4 "register_operand" "x")
(match_operand:SI 6 "const1248_operand" "n")]
UNSPEC_VSIBADDR)])
(mem:BLK (scratch))
@@ -12562,17 +12567,39 @@
(set_attr "prefix" "vex")
(set_attr "mode" "<sseinsnmode>")])
+(define_insn "*avx2_gathersi<mode>_2"
+ [(set (match_operand:VEC_GATHER_MODE 0 "register_operand" "=&x")
+ (unspec:VEC_GATHER_MODE
+ [(pc)
+ (match_operator:<ssescalarmode> 6 "vsib_mem_operator"
+ [(unspec:P
+ [(match_operand:P 2 "vsib_address_operand" "p")
+ (match_operand:<VEC_GATHER_IDXSI> 3 "register_operand" "x")
+ (match_operand:SI 5 "const1248_operand" "n")]
+ UNSPEC_VSIBADDR)])
+ (mem:BLK (scratch))
+ (match_operand:VEC_GATHER_MODE 4 "register_operand" "1")]
+ UNSPEC_GATHER))
+ (clobber (match_scratch:VEC_GATHER_MODE 1 "=&x"))]
+ "TARGET_AVX2"
+ "v<sseintprefix>gatherd<ssemodesuffix>\t{%1, %6, %0|%0, %6, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<sseinsnmode>")])
+
(define_expand "avx2_gatherdi<mode>"
[(parallel [(set (match_operand:VEC_GATHER_MODE 0 "register_operand" "")
(unspec:VEC_GATHER_MODE
- [(match_operand:VEC_GATHER_MODE 1 "register_operand" "")
+ [(match_operand:<VEC_GATHER_SRCDI> 1 "register_operand" "")
(mem:<ssescalarmode>
(match_par_dup 7
[(match_operand 2 "vsib_address_operand" "")
- (match_operand:<AVXMODE48P_DI> 3 "register_operand" "")
+ (match_operand:<VEC_GATHER_IDXDI>
+ 3 "register_operand" "")
(match_operand:SI 5 "const1248_operand " "")]))
(mem:BLK (scratch))
- (match_operand:VEC_GATHER_MODE 4 "register_operand" "")]
+ (match_operand:<VEC_GATHER_SRCDI>
+ 4 "register_operand" "")]
UNSPEC_GATHER))
(clobber (match_scratch:VEC_GATHER_MODE 6 ""))])]
"TARGET_AVX2"
@@ -12583,63 +12610,45 @@
})
(define_insn "*avx2_gatherdi<mode>"
- [(set (match_operand:AVXMODE48P_DI 0 "register_operand" "=&x")
- (unspec:AVXMODE48P_DI
- [(match_operand:AVXMODE48P_DI 2 "register_operand" "0")
+ [(set (match_operand:VEC_GATHER_MODE 0 "register_operand" "=&x")
+ (unspec:VEC_GATHER_MODE
+ [(match_operand:<VEC_GATHER_SRCDI> 2 "register_operand" "0")
(match_operator:<ssescalarmode> 7 "vsib_mem_operator"
[(unspec:P
[(match_operand:P 3 "vsib_address_operand" "p")
- (match_operand:<AVXMODE48P_DI> 4 "register_operand" "x")
+ (match_operand:<VEC_GATHER_IDXDI> 4 "register_operand" "x")
(match_operand:SI 6 "const1248_operand" "n")]
UNSPEC_VSIBADDR)])
(mem:BLK (scratch))
- (match_operand:AVXMODE48P_DI 5 "register_operand" "1")]
+ (match_operand:<VEC_GATHER_SRCDI> 5 "register_operand" "1")]
UNSPEC_GATHER))
- (clobber (match_scratch:AVXMODE48P_DI 1 "=&x"))]
+ (clobber (match_scratch:VEC_GATHER_MODE 1 "=&x"))]
"TARGET_AVX2"
- "v<sseintprefix>gatherq<ssemodesuffix>\t{%1, %7, %0|%0, %7, %1}"
+ "v<sseintprefix>gatherq<ssemodesuffix>\t{%5, %7, %2|%2, %7, %5}"
[(set_attr "type" "ssemov")
(set_attr "prefix" "vex")
(set_attr "mode" "<sseinsnmode>")])
-;; Special handling for VEX.256 with float arguments
-;; since there're still xmms as operands
-(define_expand "avx2_gatherdi<mode>256"
- [(parallel [(set (match_operand:VI4F_128 0 "register_operand" "")
- (unspec:VI4F_128
- [(match_operand:VI4F_128 1 "register_operand" "")
- (mem:<ssescalarmode>
- (match_par_dup 7
- [(match_operand 2 "vsib_address_operand" "")
- (match_operand:V4DI 3 "register_operand" "")
- (match_operand:SI 5 "const1248_operand " "")]))
- (mem:BLK (scratch))
- (match_operand:VI4F_128 4 "register_operand" "")]
- UNSPEC_GATHER))
- (clobber (match_scratch:VI4F_128 6 ""))])]
- "TARGET_AVX2"
-{
- operands[7]
- = gen_rtx_UNSPEC (Pmode, gen_rtvec (3, operands[2], operands[3],
- operands[5]), UNSPEC_VSIBADDR);
-})
-
-(define_insn "*avx2_gatherdi<mode>256"
- [(set (match_operand:VI4F_128 0 "register_operand" "=x")
- (unspec:VI4F_128
- [(match_operand:VI4F_128 2 "register_operand" "0")
- (match_operator:<ssescalarmode> 7 "vsib_mem_operator"
+(define_insn "*avx2_gatherdi<mode>_2"
+ [(set (match_operand:VEC_GATHER_MODE 0 "register_operand" "=&x")
+ (unspec:VEC_GATHER_MODE
+ [(pc)
+ (match_operator:<ssescalarmode> 6 "vsib_mem_operator"
[(unspec:P
- [(match_operand:P 3 "vsib_address_operand" "p")
- (match_operand:V4DI 4 "register_operand" "x")
- (match_operand:SI 6 "const1248_operand" "n")]
+ [(match_operand:P 2 "vsib_address_operand" "p")
+ (match_operand:<VEC_GATHER_IDXDI> 3 "register_operand" "x")
+ (match_operand:SI 5 "const1248_operand" "n")]
UNSPEC_VSIBADDR)])
(mem:BLK (scratch))
- (match_operand:VI4F_128 5 "register_operand" "1")]
- UNSPEC_GATHER))
- (clobber (match_scratch:VI4F_128 1 "=&x"))]
+ (match_operand:<VEC_GATHER_SRCDI> 4 "register_operand" "1")]
+ UNSPEC_GATHER))
+ (clobber (match_scratch:VEC_GATHER_MODE 1 "=&x"))]
"TARGET_AVX2"
- "v<sseintprefix>gatherq<ssemodesuffix>\t{%1, %7, %0|%0, %7, %1}"
+{
+ if (<MODE>mode != <VEC_GATHER_SRCDI>mode)
+ return "v<sseintprefix>gatherq<ssemodesuffix>\t{%4, %6, %x0|%x0, %6, %4}";
+ return "v<sseintprefix>gatherq<ssemodesuffix>\t{%4, %6, %0|%0, %6, %4}";
+}
[(set_attr "type" "ssemov")
(set_attr "prefix" "vex")
(set_attr "mode" "<sseinsnmode>")])
diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md
index 20378d090bf..0ff17123f27 100644
--- a/gcc/config/i386/sync.md
+++ b/gcc/config/i386/sync.md
@@ -18,31 +18,27 @@
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
-(define_mode_iterator CASMODE
- [QI HI SI (DI "TARGET_64BIT || TARGET_CMPXCHG8B")
- (TI "TARGET_64BIT && TARGET_CMPXCHG16B")])
-(define_mode_iterator DCASMODE
- [(DI "!TARGET_64BIT && TARGET_CMPXCHG8B && !flag_pic")
- (TI "TARGET_64BIT && TARGET_CMPXCHG16B")])
-(define_mode_attr doublemodesuffix [(DI "8") (TI "16")])
-(define_mode_attr DCASHMODE [(DI "SI") (TI "DI")])
-
-(define_expand "memory_barrier"
- [(set (match_dup 0)
- (unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))]
+(define_expand "mem_thread_fence"
+ [(match_operand:SI 0 "const_int_operand" "")] ;; model
""
{
- operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
- MEM_VOLATILE_P (operands[0]) = 1;
+ /* Unless this is a SEQ_CST fence, the i386 memory model is strong
+ enough not to require barriers of any kind. */
+ if (INTVAL (operands[0]) != MEMMODEL_SEQ_CST)
+ DONE;
- if (!(TARGET_64BIT || TARGET_SSE2))
+ if (TARGET_64BIT || TARGET_SSE2)
+ emit_insn (gen_sse2_mfence ());
+ else
{
- emit_insn (gen_memory_barrier_nosse (operands[0]));
- DONE;
+ rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
+ MEM_VOLATILE_P (mem) = 1;
+ emit_insn (gen_mfence_nosse (mem));
}
+ DONE;
})
-(define_insn "memory_barrier_nosse"
+(define_insn "mfence_nosse"
[(set (match_operand:BLK 0 "" "")
(unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))
(clobber (reg:CC FLAGS_REG))]
@@ -50,127 +46,315 @@
"lock{%;} or{l}\t{$0, (%%esp)|DWORD PTR [esp], 0}"
[(set_attr "memory" "unknown")])
-;; ??? It would be possible to use cmpxchg8b on pentium for DImode
-;; changes. It's complicated because the insn uses ecx:ebx as the
-;; new value; note that the registers are reversed from the order
-;; that they'd be in with (reg:DI 2 ecx). Similarly for TImode
-;; data in 64-bit mode.
-
-(define_expand "sync_compare_and_swap<mode>"
- [(parallel
- [(set (match_operand:CASMODE 0 "register_operand" "")
- (match_operand:CASMODE 1 "memory_operand" ""))
- (set (match_dup 1)
- (unspec_volatile:CASMODE
- [(match_dup 1)
- (match_operand:CASMODE 2 "register_operand" "")
- (match_operand:CASMODE 3 "register_operand" "")]
- UNSPECV_CMPXCHG))
- (set (reg:CCZ FLAGS_REG)
- (compare:CCZ
- (unspec_volatile:CASMODE
- [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG)
- (match_dup 2)))])]
- "TARGET_CMPXCHG"
+;; ??? From volume 3 section 7.1.1 Guaranteed Atomic Operations,
+;; Only beginning at Pentium family processors do we get any guarantee of
+;; atomicity in aligned 64-bit quantities. Beginning at P6, we get a
+;; guarantee for 64-bit accesses that do not cross a cacheline boundary.
+;;
+;; Note that the TARGET_CMPXCHG8B test below is a stand-in for "Pentium".
+;;
+;; Importantly, *no* processor makes atomicity guarantees for larger
+;; accesses. In particular, there's no way to perform an atomic TImode
+;; move, despite the apparent applicability of MOVDQA et al.
+
+(define_mode_iterator ATOMIC
+ [QI HI SI
+ (DI "TARGET_64BIT || (TARGET_CMPXCHG8B && (TARGET_80387 || TARGET_SSE))")
+ ])
+
+(define_expand "atomic_load<mode>"
+ [(set (match_operand:ATOMIC 0 "register_operand" "")
+ (unspec:ATOMIC [(match_operand:ATOMIC 1 "memory_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPEC_MOVA))]
+ ""
+{
+ /* For DImode on 32-bit, we can use the FPU to perform the load. */
+ if (<MODE>mode == DImode && !TARGET_64BIT)
+ emit_insn (gen_atomic_loaddi_fpu
+ (operands[0], operands[1],
+ assign_386_stack_local (DImode,
+ (virtuals_instantiated
+ ? SLOT_TEMP : SLOT_VIRTUAL))));
+ else
+ emit_move_insn (operands[0], operands[1]);
+ DONE;
+})
+
+(define_insn_and_split "atomic_loaddi_fpu"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,?r")
+ (unspec:DI [(match_operand:DI 1 "memory_operand" "m,m,m")]
+ UNSPEC_MOVA))
+ (clobber (match_operand:DI 2 "memory_operand" "=X,X,m"))
+ (clobber (match_scratch:DF 3 "=X,xf,xf"))]
+ "!TARGET_64BIT && (TARGET_80387 || TARGET_SSE)"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx dst = operands[0], src = operands[1];
+ rtx mem = operands[2], tmp = operands[3];
+
+ if (SSE_REG_P (dst))
+ emit_move_insn (dst, src);
+ else
+ {
+ if (MEM_P (dst))
+ mem = dst;
+
+ if (FP_REG_P (tmp))
+ emit_insn (gen_movdi_via_fpu (mem, src, tmp));
+ else
+ {
+ adjust_reg_mode (tmp, DImode);
+ emit_move_insn (tmp, src);
+ emit_move_insn (mem, tmp);
+ }
+
+ if (mem != dst)
+ emit_move_insn (dst, mem);
+ }
+ DONE;
+})
+
+(define_expand "atomic_store<mode>"
+ [(set (match_operand:ATOMIC 0 "memory_operand" "")
+ (unspec:ATOMIC [(match_operand:ATOMIC 1 "register_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPEC_MOVA))]
+ ""
+{
+ enum memmodel model = (enum memmodel) INTVAL (operands[2]);
+
+ if (<MODE>mode == DImode && !TARGET_64BIT)
+ {
+ /* For DImode on 32-bit, we can use the FPU to perform the store. */
+ /* Note that while we could perform a cmpxchg8b loop, that turns
+ out to be significantly larger than this plus a barrier. */
+ emit_insn (gen_atomic_storedi_fpu
+ (operands[0], operands[1],
+ assign_386_stack_local (DImode,
+ (virtuals_instantiated
+ ? SLOT_TEMP : SLOT_VIRTUAL))));
+ }
+ else
+ {
+ /* For seq-cst stores, when we lack MFENCE, use XCHG. */
+ if (model == MEMMODEL_SEQ_CST && !(TARGET_64BIT || TARGET_SSE2))
+ {
+ emit_insn (gen_atomic_exchange<mode> (gen_reg_rtx (<MODE>mode),
+ operands[0], operands[1],
+ operands[2]));
+ DONE;
+ }
+
+ /* Otherwise use a normal store. */
+ emit_move_insn (operands[0], operands[1]);
+ }
+ /* ... followed by an MFENCE, if required. */
+ if (model == MEMMODEL_SEQ_CST)
+ emit_insn (gen_mem_thread_fence (operands[2]));
+ DONE;
+})
+
+(define_insn_and_split "atomic_storedi_fpu"
+ [(set (match_operand:DI 0 "memory_operand" "=m,m,m")
+ (unspec:DI [(match_operand:DI 1 "register_operand" "x,m,?r")]
+ UNSPEC_MOVA))
+ (clobber (match_operand:DI 2 "memory_operand" "=X,X,m"))
+ (clobber (match_scratch:DF 3 "=X,xf,xf"))]
+ "!TARGET_64BIT && (TARGET_80387 || TARGET_SSE)"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
{
- if ((<MODE>mode == DImode && !TARGET_64BIT) || <MODE>mode == TImode)
+ rtx dst = operands[0], src = operands[1];
+ rtx mem = operands[2], tmp = operands[3];
+
+ if (!SSE_REG_P (src))
{
- enum machine_mode hmode = <MODE>mode == DImode ? SImode : DImode;
- rtx low = simplify_gen_subreg (hmode, operands[3], <MODE>mode, 0);
- rtx high = simplify_gen_subreg (hmode, operands[3], <MODE>mode,
- GET_MODE_SIZE (hmode));
- low = force_reg (hmode, low);
- high = force_reg (hmode, high);
- if (<MODE>mode == DImode)
+ if (REG_P (src))
+ {
+ emit_move_insn (mem, src);
+ src = mem;
+ }
+
+ if (FP_REG_P (tmp))
{
- if (flag_pic && !cmpxchg8b_pic_memory_operand (operands[1], DImode))
- operands[1] = replace_equiv_address (operands[1],
- force_reg (Pmode,
- XEXP (operands[1],
- 0)));
- emit_insn (gen_sync_double_compare_and_swapdi
- (operands[0], operands[1], operands[2], low, high));
+ emit_insn (gen_movdi_via_fpu (dst, src, tmp));
+ DONE;
}
- else if (<MODE>mode == TImode)
- emit_insn (gen_sync_double_compare_and_swapti
- (operands[0], operands[1], operands[2], low, high));
else
- gcc_unreachable ();
- DONE;
+ {
+ adjust_reg_mode (tmp, DImode);
+ emit_move_insn (tmp, mem);
+ src = tmp;
+ }
}
+ emit_move_insn (dst, src);
+ DONE;
+})
+
+;; ??? You'd think that we'd be able to perform this via FLOAT + FIX_TRUNC
+;; operations. But the fix_trunc patterns want way more setup than we want
+;; to provide. Note that the scratch is DFmode instead of XFmode in order
+;; to make it easy to allocate a scratch in either SSE or FP_REGs above.
+(define_insn "movdi_via_fpu"
+ [(set (match_operand:DI 0 "memory_operand" "=m")
+ (unspec:DI [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_MOVA))
+ (clobber (match_operand:DF 2 "register_operand" "=f"))]
+ "TARGET_80387"
+ "fild\t%1\;fistp\t%0"
+ [(set_attr "type" "multi")
+ ;; Worst case based on full sib+offset32 addressing modes
+ (set_attr "length" "14")])
+
+(define_expand "atomic_compare_and_swap<mode>"
+ [(match_operand:QI 0 "register_operand" "") ;; bool success output
+ (match_operand:SWI124 1 "register_operand" "") ;; oldval output
+ (match_operand:SWI124 2 "memory_operand" "") ;; memory
+ (match_operand:SWI124 3 "register_operand" "") ;; expected input
+ (match_operand:SWI124 4 "register_operand" "") ;; newval input
+ (match_operand:SI 5 "const_int_operand" "") ;; is_weak
+ (match_operand:SI 6 "const_int_operand" "") ;; success model
+ (match_operand:SI 7 "const_int_operand" "")] ;; failure model
+ "TARGET_CMPXCHG"
+{
+ emit_insn (gen_atomic_compare_and_swap_single<mode>
+ (operands[1], operands[2], operands[3], operands[4]));
+ ix86_expand_setcc (operands[0], EQ, gen_rtx_REG (CCZmode, FLAGS_REG),
+ const0_rtx);
+ DONE;
})
-(define_insn "*sync_compare_and_swap<mode>"
+(define_mode_iterator CASMODE
+ [(DI "TARGET_64BIT || TARGET_CMPXCHG8B")
+ (TI "TARGET_64BIT && TARGET_CMPXCHG16B")])
+(define_mode_iterator DCASMODE
+ [(DI "!TARGET_64BIT && TARGET_CMPXCHG8B && !flag_pic")
+ (TI "TARGET_64BIT && TARGET_CMPXCHG16B")])
+(define_mode_attr doublemodesuffix [(DI "8") (TI "16")])
+(define_mode_attr DCASHMODE [(DI "SI") (TI "DI")])
+
+(define_expand "atomic_compare_and_swap<mode>"
+ [(match_operand:QI 0 "register_operand" "") ;; bool success output
+ (match_operand:CASMODE 1 "register_operand" "") ;; oldval output
+ (match_operand:CASMODE 2 "memory_operand" "") ;; memory
+ (match_operand:CASMODE 3 "register_operand" "") ;; expected input
+ (match_operand:CASMODE 4 "register_operand" "") ;; newval input
+ (match_operand:SI 5 "const_int_operand" "") ;; is_weak
+ (match_operand:SI 6 "const_int_operand" "") ;; success model
+ (match_operand:SI 7 "const_int_operand" "")] ;; failure model
+ "TARGET_CMPXCHG"
+{
+ if (<MODE>mode == DImode && TARGET_64BIT)
+ {
+ emit_insn (gen_atomic_compare_and_swap_singledi
+ (operands[1], operands[2], operands[3], operands[4]));
+ }
+ else
+ {
+ enum machine_mode hmode = <DCASHMODE>mode;
+ rtx lo_o, lo_e, lo_n, hi_o, hi_e, hi_n, mem;
+
+ lo_o = operands[1];
+ mem = operands[2];
+ lo_e = operands[3];
+ lo_n = operands[4];
+ hi_o = gen_highpart (hmode, lo_o);
+ hi_e = gen_highpart (hmode, lo_e);
+ hi_n = gen_highpart (hmode, lo_n);
+ lo_o = gen_lowpart (hmode, lo_o);
+ lo_e = gen_lowpart (hmode, lo_e);
+ lo_n = gen_lowpart (hmode, lo_n);
+
+ if (<MODE>mode == DImode
+ && !TARGET_64BIT
+ && flag_pic
+ && !cmpxchg8b_pic_memory_operand (mem, DImode))
+ mem = replace_equiv_address (mem, force_reg (Pmode, XEXP (mem, 0)));
+
+ emit_insn (gen_atomic_compare_and_swap_double<mode>
+ (lo_o, hi_o, mem, lo_e, hi_e, lo_n, hi_n));
+ }
+ ix86_expand_setcc (operands[0], EQ, gen_rtx_REG (CCZmode, FLAGS_REG),
+ const0_rtx);
+ DONE;
+})
+
+(define_insn "atomic_compare_and_swap_single<mode>"
[(set (match_operand:SWI 0 "register_operand" "=a")
- (match_operand:SWI 1 "memory_operand" "+m"))
- (set (match_dup 1)
(unspec_volatile:SWI
- [(match_dup 1)
- (match_operand:SWI 2 "register_operand" "a")
+ [(match_operand:SWI 1 "memory_operand" "+m")
+ (match_operand:SWI 2 "register_operand" "0")
(match_operand:SWI 3 "register_operand" "<r>")]
- UNSPECV_CMPXCHG))
+ UNSPECV_CMPXCHG_1))
+ (set (match_dup 1)
+ (unspec_volatile:SWI [(const_int 0)] UNSPECV_CMPXCHG_2))
(set (reg:CCZ FLAGS_REG)
- (compare:CCZ
- (unspec_volatile:SWI
- [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG)
- (match_dup 2)))]
+ (unspec_volatile:CCZ [(const_int 0)] UNSPECV_CMPXCHG_3))]
"TARGET_CMPXCHG"
"lock{%;} cmpxchg{<imodesuffix>}\t{%3, %1|%1, %3}")
-(define_insn "sync_double_compare_and_swap<mode>"
- [(set (match_operand:DCASMODE 0 "register_operand" "=A")
- (match_operand:DCASMODE 1 "memory_operand" "+m"))
- (set (match_dup 1)
- (unspec_volatile:DCASMODE
- [(match_dup 1)
- (match_operand:DCASMODE 2 "register_operand" "A")
- (match_operand:<DCASHMODE> 3 "register_operand" "b")
- (match_operand:<DCASHMODE> 4 "register_operand" "c")]
- UNSPECV_CMPXCHG))
+;; For double-word compare and swap, we are obliged to play tricks with
+;; the input newval (op5:op6) because the Intel register numbering does
+;; not match the gcc register numbering, so the pair must be CX:BX.
+;; That said, in order to take advantage of possible lower-subreg opts,
+;; treat all of the integral operands in the same way.
+(define_insn "atomic_compare_and_swap_double<mode>"
+ [(set (match_operand:<DCASHMODE> 0 "register_operand" "=a")
+ (unspec_volatile:<DCASHMODE>
+ [(match_operand:DCASMODE 2 "memory_operand" "+m")
+ (match_operand:<DCASHMODE> 3 "register_operand" "0")
+ (match_operand:<DCASHMODE> 4 "register_operand" "1")
+ (match_operand:<DCASHMODE> 5 "register_operand" "b")
+ (match_operand:<DCASHMODE> 6 "register_operand" "c")]
+ UNSPECV_CMPXCHG_1))
+ (set (match_operand:<DCASHMODE> 1 "register_operand" "=d")
+ (unspec_volatile:<DCASHMODE> [(const_int 0)] UNSPECV_CMPXCHG_2))
+ (set (match_dup 2)
+ (unspec_volatile:DCASMODE [(const_int 0)] UNSPECV_CMPXCHG_3))
(set (reg:CCZ FLAGS_REG)
- (compare:CCZ
- (unspec_volatile:DCASMODE
- [(match_dup 1) (match_dup 2) (match_dup 3) (match_dup 4)]
- UNSPECV_CMPXCHG)
- (match_dup 2)))]
+ (unspec_volatile:CCZ [(const_int 0)] UNSPECV_CMPXCHG_4))]
""
- "lock{%;} cmpxchg<doublemodesuffix>b\t%1")
-
-;; Theoretically we'd like to use constraint "r" (any reg) for operand
-;; 3, but that includes ecx. If operand 3 and 4 are the same (like when
-;; the input is -1LL) GCC might chose to allocate operand 3 to ecx, like
-;; operand 4. This breaks, as the xchg will move the PIC register contents
-;; to %ecx then --> boom. Operands 3 and 4 really need to be different
-;; registers, which in this case means operand 3 must not be ecx.
-;; Instead of playing tricks with fake early clobbers or the like we
-;; just enumerate all regs possible here, which (as this is !TARGET_64BIT)
+ "lock{%;} cmpxchg<doublemodesuffix>b\t%2")
+
+;; Theoretically we'd like to use constraint "r" (any reg) for op5,
+;; but that includes ecx. If op5 and op6 are the same (like when
+;; the input is -1LL) GCC might chose to allocate op5 to ecx, like
+;; op6. This breaks, as the xchg will move the PIC register contents
+;; to %ecx then --> boom. Operands 5 and 6 really need to be different
+;; registers, which in this case means op5 must not be ecx. Instead
+;; of playing tricks with fake early clobbers or the like we just
+;; enumerate all regs possible here, which (as this is !TARGET_64BIT)
;; are just esi and edi.
-(define_insn "*sync_double_compare_and_swapdi_pic"
- [(set (match_operand:DI 0 "register_operand" "=A")
- (match_operand:DI 1 "cmpxchg8b_pic_memory_operand" "+m"))
- (set (match_dup 1)
- (unspec_volatile:DI
- [(match_dup 1)
- (match_operand:DI 2 "register_operand" "A")
- (match_operand:SI 3 "register_operand" "SD")
- (match_operand:SI 4 "register_operand" "c")]
- UNSPECV_CMPXCHG))
+(define_insn "*atomic_compare_and_swap_doubledi_pic"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (unspec_volatile:SI
+ [(match_operand:DI 2 "cmpxchg8b_pic_memory_operand" "+m")
+ (match_operand:SI 3 "register_operand" "0")
+ (match_operand:SI 4 "register_operand" "1")
+ (match_operand:SI 5 "register_operand" "SD")
+ (match_operand:SI 6 "register_operand" "c")]
+ UNSPECV_CMPXCHG_1))
+ (set (match_operand:SI 1 "register_operand" "=d")
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_CMPXCHG_2))
+ (set (match_dup 2)
+ (unspec_volatile:DI [(const_int 0)] UNSPECV_CMPXCHG_3))
(set (reg:CCZ FLAGS_REG)
- (compare:CCZ
- (unspec_volatile:DI
- [(match_dup 1) (match_dup 2) (match_dup 3) (match_dup 4)]
- UNSPECV_CMPXCHG)
- (match_dup 2)))]
+ (unspec_volatile:CCZ [(const_int 0)] UNSPECV_CMPXCHG_4))]
"!TARGET_64BIT && TARGET_CMPXCHG8B && flag_pic"
- "xchg{l}\t%%ebx, %3\;lock{%;} cmpxchg8b\t%1\;xchg{l}\t%%ebx, %3")
+ "xchg{l}\t%%ebx, %5\;lock{%;} cmpxchg8b\t%2\;xchg{l}\t%%ebx, %5")
;; For operand 2 nonmemory_operand predicate is used instead of
;; register_operand to allow combiner to better optimize atomic
;; additions of constants.
-(define_insn "sync_old_add<mode>"
+(define_insn "atomic_fetch_add<mode>"
[(set (match_operand:SWI 0 "register_operand" "=<r>")
(unspec_volatile:SWI
- [(match_operand:SWI 1 "memory_operand" "+m")] UNSPECV_XCHG))
+ [(match_operand:SWI 1 "memory_operand" "+m")
+ (match_operand:SI 3 "const_int_operand" "")] ;; model
+ UNSPECV_XCHG))
(set (match_dup 1)
(plus:SWI (match_dup 1)
(match_operand:SWI 2 "nonmemory_operand" "0")))
@@ -186,7 +370,9 @@
(match_operand:SWI 2 "const_int_operand" ""))
(parallel [(set (match_dup 0)
(unspec_volatile:SWI
- [(match_operand:SWI 1 "memory_operand" "")] UNSPECV_XCHG))
+ [(match_operand:SWI 1 "memory_operand" "")
+ (match_operand:SI 4 "const_int_operand" "")]
+ UNSPECV_XCHG))
(set (match_dup 1)
(plus:SWI (match_dup 1)
(match_dup 0)))
@@ -199,17 +385,19 @@
== -(unsigned HOST_WIDE_INT) INTVAL (operands[3])
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
[(parallel [(set (reg:CCZ FLAGS_REG)
- (compare:CCZ (unspec_volatile:SWI [(match_dup 1)]
- UNSPECV_XCHG)
- (match_dup 3)))
+ (compare:CCZ
+ (unspec_volatile:SWI [(match_dup 1) (match_dup 4)]
+ UNSPECV_XCHG)
+ (match_dup 3)))
(set (match_dup 1)
(plus:SWI (match_dup 1)
(match_dup 2)))])])
-(define_insn "*sync_old_add_cmp<mode>"
+(define_insn "*atomic_fetch_add_cmp<mode>"
[(set (reg:CCZ FLAGS_REG)
(compare:CCZ (unspec_volatile:SWI
- [(match_operand:SWI 0 "memory_operand" "+m")]
+ [(match_operand:SWI 0 "memory_operand" "+m")
+ (match_operand:SI 3 "const_int_operand" "")]
UNSPECV_XCHG)
(match_operand:SWI 2 "const_int_operand" "i")))
(set (match_dup 0)
@@ -233,20 +421,24 @@
})
;; Recall that xchg implicitly sets LOCK#, so adding it again wastes space.
-(define_insn "sync_lock_test_and_set<mode>"
- [(set (match_operand:SWI 0 "register_operand" "=<r>")
+;; In addition, it is always a full barrier, so we can ignore the memory model.
+(define_insn "atomic_exchange<mode>"
+ [(set (match_operand:SWI 0 "register_operand" "=<r>") ;; output
(unspec_volatile:SWI
- [(match_operand:SWI 1 "memory_operand" "+m")] UNSPECV_XCHG))
+ [(match_operand:SWI 1 "memory_operand" "+m") ;; memory
+ (match_operand:SI 3 "const_int_operand" "")] ;; model
+ UNSPECV_XCHG))
(set (match_dup 1)
- (match_operand:SWI 2 "register_operand" "0"))]
+ (match_operand:SWI 2 "register_operand" "0"))] ;; input
""
"xchg{<imodesuffix>}\t{%1, %0|%0, %1}")
-(define_insn "sync_add<mode>"
+(define_insn "atomic_add<mode>"
[(set (match_operand:SWI 0 "memory_operand" "+m")
(unspec_volatile:SWI
[(plus:SWI (match_dup 0)
- (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))]
+ (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))
+ (match_operand:SI 2 "const_int_operand" "")] ;; model
UNSPECV_LOCK))
(clobber (reg:CC FLAGS_REG))]
""
@@ -265,11 +457,12 @@
return "lock{%;} add{<imodesuffix>}\t{%1, %0|%0, %1}";
})
-(define_insn "sync_sub<mode>"
+(define_insn "atomic_sub<mode>"
[(set (match_operand:SWI 0 "memory_operand" "+m")
(unspec_volatile:SWI
[(minus:SWI (match_dup 0)
- (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))]
+ (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))
+ (match_operand:SI 2 "const_int_operand" "")] ;; model
UNSPECV_LOCK))
(clobber (reg:CC FLAGS_REG))]
""
@@ -282,14 +475,18 @@
return "lock{%;} inc{<imodesuffix>}\t%0";
}
+ if (x86_maybe_negate_const_int (&operands[1], <MODE>mode))
+ return "lock{%;} add{<imodesuffix>}\t{%1, %0|%0, %1}";
+
return "lock{%;} sub{<imodesuffix>}\t{%1, %0|%0, %1}";
})
-(define_insn "sync_<code><mode>"
+(define_insn "atomic_<code><mode>"
[(set (match_operand:SWI 0 "memory_operand" "+m")
(unspec_volatile:SWI
[(any_logic:SWI (match_dup 0)
- (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))]
+ (match_operand:SWI 1 "nonmemory_operand" "<r><i>"))
+ (match_operand:SI 2 "const_int_operand" "")] ;; model
UNSPECV_LOCK))
(clobber (reg:CC FLAGS_REG))]
""
diff --git a/gcc/config/i386/t-crtstuff b/gcc/config/i386/t-crtstuff
deleted file mode 100644
index c14dd9411ae..00000000000
--- a/gcc/config/i386/t-crtstuff
+++ /dev/null
@@ -1,7 +0,0 @@
-# The pushl in CTOR initialization interferes with frame pointer elimination.
-# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
-# because then __FRAME_END__ might not be the last thing in .eh_frame
-# section. -fno-asynchronous-unwind-tables is off by default for i386
-# and is on by default for x86-64. We turn it off for both i386 and
-# x86-64.
-CRTSTUFF_T_CFLAGS += -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming
index af2c9e41c4d..18b57c4152a 100644
--- a/gcc/config/i386/t-cygming
+++ b/gcc/config/i386/t-cygming
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011
+# Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,18 +17,10 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = i386/cygwin.asm
-LIB1ASMFUNCS = _chkstk _chkstk_ms
-
# cygwin and mingw always have a limits.h, but, depending upon how we are
# doing the build, it may not be installed yet.
LIMITS_H_TEST = true
-# If we are building next to winsup, this will let us find the real
-# limits.h when building libgcc2. Otherwise, winsup must be installed
-# first.
-LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include
-
winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
$(TM_P_H) $(HASHTAB_H) $(GGC_H) $(LTO_STREAMER_H)
@@ -54,63 +47,3 @@ msformat-c.o: $(srcdir)/config/i386/msformat-c.c $(CONFIG_H) $(SYSTEM_H) coretyp
$(srcdir)/config/i386/msformat-c.c
STMP_FIXINC=stmp-fixinc
-
-# Build a shared libgcc library for PECOFF with a DEF file
-# with the GNU linker.
-#
-# mkmap-flat.awk is used with the pe_dll option to produce a DEF instead
-# of an ELF map file.
-#
-# Warning: If SHLIB_SOVERSION or SHLIB_SONAME are updated, LIBGCC_SONAME
-# in mingw32.h and SHLIB_MKMAP_OPTS below must be updated also.
-
-SHLIB_EXT = .dll
-SHLIB_IMPLIB = @shlib_base_name@.a
-SHLIB_SOVERSION = 1
-SHLIB_SONAME = @shlib_base_name@_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
-SHLIB_MAP = @shlib_map_file@
-SHLIB_OBJS = @shlib_objs@
-SHLIB_DIR = @multilib_dir@/shlib
-SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
-# SHLIB_DLLDIR is defined by including one of either t-dlldir or t-dlldir-x
-# (native/cross build respectively) in the tmake_file list in gcc/config.gcc.
-ifndef SHLIB_DLLDIR
-$(error SHLIB_DLLDIR must be defined)
-endif
-ifndef SHLIB_PTHREAD_CFLAG
-SHLIB_PTHREAD_CFLAG =
-endif
-ifndef SHLIB_PTHREAD_LDFLAG
-SHLIB_PTHREAD_LDFLAG =
-endif
-
-SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
- if [ ! -d $(SHLIB_DIR) ]; then \
- mkdir $(SHLIB_DIR); \
- else true; fi && \
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(SHLIB_PTHREAD_CFLAG) \
- -shared -nodefaultlibs \
- $(SHLIB_MAP).def \
- -Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \
- -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
- $(SHLIB_OBJS) ${SHLIB_PTHREAD_LDFLAG} $(SHLIB_LC) && \
- if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
- mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
- $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
- else true; fi && \
- mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
- mv $(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp $(SHLIB_DIR)/$(SHLIB_IMPLIB)
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(SHLIB_DLLDIR) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL) $(SHLIB_DIR)/$(SHLIB_SONAME) \
- $$(DESTDIR)$$(SHLIB_DLLDIR)/$(SHLIB_SONAME); \
- $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB)
-SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-# We'd like to use SHLIB_SONAME here too, but shlib_base_name
-# does not get substituted before mkmap-flat.awk is run.
-SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
diff --git a/gcc/config/i386/t-darwin b/gcc/config/i386/t-darwin
index 22323e4abee..bf44504d4fd 100644
--- a/gcc/config/i386/t-darwin
+++ b/gcc/config/i386/t-darwin
@@ -1,5 +1,2 @@
MULTILIB_OPTIONS = m64
MULTILIB_DIRNAMES = x86_64
-LIB2_SIDITI_CONV_FUNCS=yes
-LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c
-LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
diff --git a/gcc/config/i386/t-darwin64 b/gcc/config/i386/t-darwin64
index 81b4565ac72..6a6b22f1ee5 100644
--- a/gcc/config/i386/t-darwin64
+++ b/gcc/config/i386/t-darwin64
@@ -1,8 +1,2 @@
-LIB2_SIDITI_CONV_FUNCS=yes
-LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c
-
MULTILIB_OPTIONS = m32
MULTILIB_DIRNAMES = i386
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i386/t-dlldir b/gcc/config/i386/t-dlldir
deleted file mode 100644
index a3e03317a04..00000000000
--- a/gcc/config/i386/t-dlldir
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# In a native build, target DLLs go in bindir, where they can be executed.
-# Note double quoting to prevent variables from being evaluated until install
-# time; we don't want to expand them during libgcc.mvars generation.
-
-SHLIB_DLLDIR = $$(bindir)
diff --git a/gcc/config/i386/t-dlldir-x b/gcc/config/i386/t-dlldir-x
deleted file mode 100644
index 07dd845f0a6..00000000000
--- a/gcc/config/i386/t-dlldir-x
+++ /dev/null
@@ -1,9 +0,0 @@
-
-# In a cross build, bindir contains host not target binaries, so target DLLs
-# instead go in toolexeclibdir, alongside other target binaries and static libs.
-# Note double quoting to prevent variables from being evaluated until install
-# time; we don't want to expand them during libgcc.mvars generation, and in
-# any case, $toolexeclibdir is not defined in the gcc/ subdirectory, only in
-# target lib directories.
-
-SHLIB_DLLDIR = $$(toolexeclibdir)
diff --git a/gcc/config/i386/t-i386elf b/gcc/config/i386/t-i386elf
deleted file mode 100644
index 9560d905521..00000000000
--- a/gcc/config/i386/t-i386elf
+++ /dev/null
@@ -1,4 +0,0 @@
-# For svr4 we build crtbegin.o and crtend.o which serve to add begin and
-# end labels to the .ctors and .dtors section when we link using gcc.
-
-EXTRA_PARTS=crtbegin.o crtend.o
diff --git a/gcc/config/i386/t-interix b/gcc/config/i386/t-interix
index e7b016f1e7a..09c9127f6af 100644
--- a/gcc/config/i386/t-interix
+++ b/gcc/config/i386/t-interix
@@ -1,6 +1,3 @@
-LIB1ASMSRC = i386/cygwin.asm
-LIB1ASMFUNCS = _chkstk _chkstk_ms
-
winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
$(TM_P_H) $(HASHTAB_H) $(GGC_H)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index ea8f5e9d7ae..b5d39855a70 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -37,10 +37,3 @@ MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
MULTILIB_OSDIRNAMES = m64=../lib64
MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
MULTILIB_OSDIRNAMES+= mx32=../libx32
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \
- crtbeginT.o crtprec32.o crtprec64.o crtprec80.o \
- crtfastmath.o
diff --git a/gcc/config/i386/t-mingw-w32 b/gcc/config/i386/t-mingw-w32
index 83cee71f1c1..4fc8582cf5e 100644
--- a/gcc/config/i386/t-mingw-w32
+++ b/gcc/config/i386/t-mingw-w32
@@ -1,9 +1,3 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64 ../lib
-
-# MinGW-specific parts of LIB_SPEC
-SHLIB_LC = -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i386/t-mingw-w64 b/gcc/config/i386/t-mingw-w64
index 041a02f1018..c809ebd7d1d 100644
--- a/gcc/config/i386/t-mingw-w64
+++ b/gcc/config/i386/t-mingw-w64
@@ -1,9 +1,3 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib ../lib32
-
-# MinGW-specific parts of LIB_SPEC
-SHLIB_LC = -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i386/t-nto b/gcc/config/i386/t-nto
deleted file mode 100644
index b80ff802927..00000000000
--- a/gcc/config/i386/t-nto
+++ /dev/null
@@ -1,4 +0,0 @@
-CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
-TARGET_LIBGCC2_CFLAGS = -fPIC -fexceptions
-
-EXTRA_PARTS = crtbegin.o
diff --git a/gcc/config/i386/t-openbsd b/gcc/config/i386/t-openbsd
index 18304634000..4f8ff657a93 100644
--- a/gcc/config/i386/t-openbsd
+++ b/gcc/config/i386/t-openbsd
@@ -2,5 +2,3 @@
# We cope by building variants of libgcc.
MULTILIB_OPTIONS = fpic
MULTILIB_MATCHES=fpic=fPIC
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/ia64/t-glibc b/gcc/config/ia64/t-glibc
deleted file mode 100644
index ce18a92e275..00000000000
--- a/gcc/config/ia64/t-glibc
+++ /dev/null
@@ -1 +0,0 @@
-SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver
diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
index 4aa661441b2..a1b681a3a25 100644
--- a/gcc/config/ia64/t-hpux
+++ b/gcc/config/ia64/t-hpux
@@ -19,55 +19,11 @@
# We need multilib support for HPUX's ILP32 & LP64 modes.
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
MULTILIB_OPTIONS = milp32/mlp64
MULTILIB_DIRNAMES = hpux32 hpux64
MULTILIB_MATCHES =
-# On HP-UX we do not want _fixtfdi, _fixunstfdi, or _floatditf from
-# LIB1ASMSRC. These functions map the 128 bit conversion function names
-# to 80 bit conversions and were done for Linux backwards compatibility.
-
-LIB1ASMFUNCS := $(filter-out _fixtfdi _fixunstfdi _floatditf,$(LIB1ASMFUNCS))
-
-# Support routines for HP-UX 128 bit floats.
-
-LIB2FUNCS_EXTRA=quadlib.c $(srcdir)/config/floatunsitf.c
-
-quadlib.c: $(srcdir)/config/ia64/quadlib.c
- cat $(srcdir)/config/ia64/quadlib.c > quadlib.c
-
-# We get an undefined main when building a cross compiler because our
-# linkspec has "-u main" and we want that for linking but it makes
-# LIBGCC1_TEST fail because it uses -nostdlib -nostartup.
-
-LIBGCC1_TEST =
-
# We do not want to include the EH stuff that linux uses, we want to use
# the HP-UX libunwind library.
T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
-
-SHLIB_EXT = .so
-# Must include -lunwind in the link, so that libgcc_s.so has the necessary
-# DT_NEEDED entry for libunwind.
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,+h,@shlib_base_name@.so.0 \
- -o @multilib_dir@/@shlib_base_name@.so @multilib_flags@ \
- @shlib_objs@ -lunwind -lc && \
- rm -f @multilib_dir@/@shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @multilib_dir@/@shlib_base_name@.so.0
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
- $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so \
- $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so.0; \
- rm -f $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 \
- $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
- chmod +x $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so
-
-SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index f130f7c09d1..398aba1019f 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -18,31 +18,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = ia64/lib1funcs.asm
-
-# We use different names for the DImode div/mod files so that they won't
-# conflict with libgcc2.c files. We used to use __ia64 as a prefix, now
-# we use __ as the prefix. Note that L_divdi3 in libgcc2.c actually defines
-# a TImode divide function, so there is no actual overlap here between
-# libgcc2.c and lib1funcs.asm.
-LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
- __divdi3 __moddi3 __udivdi3 __umoddi3 \
- __divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
- __nonlocal_goto __restore_stack_nonlocal __trampoline \
- _fixtfdi _fixunstfdi _floatditf
-
-# ??? Hack to get -P option used when compiling lib1funcs.asm, because Intel
-# assembler does not accept # line number as a comment.
-# ??? This breaks C++ pragma interface/implementation, which is used in the
-# C++ part of libgcc2, hence it had to be disabled. Must find some other way
-# to support the Intel assembler.
-#LIBGCC2_DEBUG_CFLAGS = -g1 -P
-
-SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64.ver
-
-# Effectively disable the crtbegin/end rules using crtstuff.c
-T = disable
-
ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) $(C_PRAGMA_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
diff --git a/gcc/config/ia64/t-vms b/gcc/config/ia64/t-vms
deleted file mode 100644
index 094d53483ee..00000000000
--- a/gcc/config/ia64/t-vms
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) 2009, 2011
-# 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/>.
-
-# Enable the crtbegin/end rules disabled in t-ia64
-T =
-
-# VMS_EXTRA_PARTS is defined in x-vms and represent object files that
-# are only needed for VMS targets, but can only be compiled on a VMS host
-# (because they need DEC C).
-EXTRA_PARTS = $(VMS_EXTRA_PARTS) crtbegin.o crtbeginS.o crtend.o crtendS.o crtinitS.o
-
-CRTSTUFF_T_CFLAGS = -O0
-CRTSTUFF_T_CFLAGS_S = -O0
-
-$(T)crtinitS.o: $(srcdir)/config/ia64/vms-crtinit.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -I. -c -o $(T)crtinitS.o -x assembler-with-cpp \
- $(srcdir)/config/ia64/vms-crtinit.asm
-
-# Shared library macros
-shlib_version:=$(shell echo $(BASEVER_c) | sed -e 's/\./,/' -e 's/\.//g')
-SHLIB_EXT = .exe
-SHLIB_OBJS = @shlib_objs@
-SHLIB_NAME = @shlib_base_name@.exe
-SHLIB_MULTILIB =
-SHLIB_INSTALL = $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(libsubdir)/$(SHLIB_ NAME)
-SHLIB_LINK = \
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -nodefaultlibs \
- -shared --for-linker=/noinform -o $(SHLIB_NAME) $(SHLIB_OBJS) \
- --for-linker=$(srcdir)/config/ia64/VMS_SYMVEC_@shlib_base_name@.opt \
- --for-linker=gsmatch=equal,$(shlib_version)
-
diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h
index 853e0239d3b..75ea4ad430e 100644
--- a/gcc/config/ia64/vms.h
+++ b/gcc/config/ia64/vms.h
@@ -18,42 +18,24 @@ 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_OBJECT_SUFFIX ".obj"
-#define TARGET_EXECUTABLE_SUFFIX ".exe"
-
#define OBJECT_FORMAT_ELF
-#define TARGET_OS_CPP_BUILTINS() \
+#define SUBTARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define_std ("vms"); \
- builtin_define_std ("VMS"); \
builtin_define ("__IA64"); \
- builtin_assert ("system=vms"); \
builtin_define ("__IEEE_FLOAT"); \
} while (0)
-/* By default, allow $ to be part of an identifier. */
-#define DOLLARS_IN_IDENTIFIERS 2
-
-#undef TARGET_ABI_OPEN_VMS
-#define TARGET_ABI_OPEN_VMS 1
-
/* Need .debug_line info generated from gcc and gas. */
#undef TARGET_DEFAULT
+#if POINTER_SIZE == 64
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
+#else
#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
+#endif
#define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
-/* "long" is 32 bits, but 64 bits for Ada. */
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 32
-#define ADA_LONG_TYPE_SIZE 64
-
-/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
-#undef POINTER_SIZE
-#define POINTER_SIZE 32
-#define POINTERS_EXTEND_UNSIGNED 0
-
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
diff --git a/gcc/config/ia64/vms_symvec_libgcc_s.opt b/gcc/config/ia64/vms_symvec_libgcc_s.opt
deleted file mode 100644
index 88b46dfda6c..00000000000
--- a/gcc/config/ia64/vms_symvec_libgcc_s.opt
+++ /dev/null
@@ -1,89 +0,0 @@
-! Symbol vector listing all the universal symbols to be exported when
-! building libgcc_s.exe shareable image on IVMS for Gcc 3.4.5.
-! It would be better to auto-generate this file.
-
-case_sensitive=yes
-SYMBOL_VECTOR=(__divdf3=PROCEDURE)
-SYMBOL_VECTOR=(__divdi3=PROCEDURE)
-SYMBOL_VECTOR=(__divsf3=PROCEDURE)
-SYMBOL_VECTOR=(__divsi3=PROCEDURE)
-SYMBOL_VECTOR=(__divxf3=PROCEDURE)
-SYMBOL_VECTOR=(__moddi3=PROCEDURE)
-SYMBOL_VECTOR=(__modsi3=PROCEDURE)
-SYMBOL_VECTOR=(__ia64_nonlocal_goto=PROCEDURE)
-SYMBOL_VECTOR=(__ia64_restore_stack_nonlocal=PROCEDURE)
-SYMBOL_VECTOR=(__ia64_save_stack_nonlocal=PROCEDURE)
-SYMBOL_VECTOR=(__ia64_trampoline=PROCEDURE)
-SYMBOL_VECTOR=(__udivdi3=PROCEDURE)
-SYMBOL_VECTOR=(__udivsi3=PROCEDURE)
-SYMBOL_VECTOR=(__umoddi3=PROCEDURE)
-SYMBOL_VECTOR=(__umodsi3=PROCEDURE)
-SYMBOL_VECTOR=(__absvti2=PROCEDURE)
-SYMBOL_VECTOR=(__absvdi2=PROCEDURE)
-SYMBOL_VECTOR=(__absvsi2=PROCEDURE)
-SYMBOL_VECTOR=(__addvti3=PROCEDURE)
-SYMBOL_VECTOR=(__addvdi3=PROCEDURE)
-SYMBOL_VECTOR=(__addvsi3=PROCEDURE)
-SYMBOL_VECTOR=(__ashlti3=PROCEDURE)
-SYMBOL_VECTOR=(__ashrti3=PROCEDURE)
-SYMBOL_VECTOR=(__clear_cache=PROCEDURE)
-SYMBOL_VECTOR=(__clzti2=PROCEDURE)
-SYMBOL_VECTOR=(__clzdi2=PROCEDURE)
-SYMBOL_VECTOR=(__cmpti2=PROCEDURE)
-SYMBOL_VECTOR=(__ctzti2=PROCEDURE)
-SYMBOL_VECTOR=(__ctzdi2=PROCEDURE)
-SYMBOL_VECTOR=(__divti3=PROCEDURE)
-SYMBOL_VECTOR=(__enable_execute_stack=PROCEDURE)
-SYMBOL_VECTOR=(__ffsti2=PROCEDURE)
-SYMBOL_VECTOR=(__ffsdi2=PROCEDURE)
-SYMBOL_VECTOR=(__fixdfti=PROCEDURE)
-SYMBOL_VECTOR=(__fixsfti=PROCEDURE)
-SYMBOL_VECTOR=(__fixunsdfti=PROCEDURE)
-SYMBOL_VECTOR=(__fixunsdfdi=PROCEDURE)
-SYMBOL_VECTOR=(__fixunssfti=PROCEDURE)
-SYMBOL_VECTOR=(__fixunssfdi=PROCEDURE)
-SYMBOL_VECTOR=(__floattidf=PROCEDURE)
-SYMBOL_VECTOR=(__floattisf=PROCEDURE)
-SYMBOL_VECTOR=(__lshrti3=PROCEDURE)
-SYMBOL_VECTOR=(__modti3=PROCEDURE)
-SYMBOL_VECTOR=(__multi3=PROCEDURE)
-SYMBOL_VECTOR=(__mulvti3=PROCEDURE)
-SYMBOL_VECTOR=(__mulvdi3=PROCEDURE)
-SYMBOL_VECTOR=(__mulvsi3=PROCEDURE)
-SYMBOL_VECTOR=(__negti2=PROCEDURE)
-SYMBOL_VECTOR=(__negvti2=PROCEDURE)
-SYMBOL_VECTOR=(__negvdi2=PROCEDURE)
-SYMBOL_VECTOR=(__negvsi2=PROCEDURE)
-SYMBOL_VECTOR=(__parityti2=PROCEDURE)
-SYMBOL_VECTOR=(__paritydi2=PROCEDURE)
-SYMBOL_VECTOR=(__popcountti2=PROCEDURE)
-SYMBOL_VECTOR=(__popcountdi2=PROCEDURE)
-SYMBOL_VECTOR=(__subvti3=PROCEDURE)
-SYMBOL_VECTOR=(__subvdi3=PROCEDURE)
-SYMBOL_VECTOR=(__subvsi3=PROCEDURE)
-SYMBOL_VECTOR=(__ucmpti2=PROCEDURE)
-SYMBOL_VECTOR=(__udiv_w_sdiv=PROCEDURE)
-SYMBOL_VECTOR=(__udivti3=PROCEDURE)
-SYMBOL_VECTOR=(__udivmodti4=PROCEDURE)
-SYMBOL_VECTOR=(__umodti3=PROCEDURE)
-SYMBOL_VECTOR=(__gthread_active_p=PROCEDURE)
-SYMBOL_VECTOR=(__gthread_mutex_lock=PROCEDURE)
-SYMBOL_VECTOR=(__gthread_mutex_unlock=PROCEDURE)
-SYMBOL_VECTOR=(__gcc_personality_v0=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetGR=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_SetGR=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetIP=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetIPInfo=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_SetIP=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetLanguageSpecificData=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetRegionStart=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_FindEnclosingFunction=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetCFA=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_GetBSP=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_RaiseException=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_ForcedUnwind=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_Resume=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_Resume_or_Rethrow=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_DeleteException=PROCEDURE)
-SYMBOL_VECTOR=(_Unwind_Backtrace=PROCEDURE)
-case_sensitive=NO
diff --git a/gcc/config/iq2000/t-iq2000 b/gcc/config/iq2000/t-iq2000
deleted file mode 100644
index 03d8c703f86..00000000000
--- a/gcc/config/iq2000/t-iq2000
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2003, 2010, 2011 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/>.
-
-# Suppress building libgcc1.a, since the MIPS compiler port is complete
-# and does not need anything from libgcc1.a.
-LIBGCC1 =
-CROSS_LIBGCC1 =
-
-LIB2FUNCS_EXTRA = $(srcdir)/config/udivmod.c $(srcdir)/config/divmod.c $(srcdir)/config/udivmodsi4.c $(srcdir)/config/iq2000/lib2extra-funcs.c
-
-# Enable the following if multilibs are needed.
-# See gcc/genmultilib, gcc/gcc.texi and gcc/tm.texi for a
-# description of the options and their values.
-#
-# MULTILIB_OPTIONS =
-# MULTILIB_DIRNAMES =
-# MULTILIB_MATCHES =
-# MULTILIB_EXCEPTIONS =
-# MULTILIB_EXTRA_OPTS =
-#
-# LIBGCC = stmp-multilib
-# INSTALL_LIBGCC = install-multilib
-
diff --git a/gcc/config/lm32/t-rtems b/gcc/config/lm32/t-rtems
new file mode 100644
index 00000000000..e47245009df
--- /dev/null
+++ b/gcc/config/lm32/t-rtems
@@ -0,0 +1,21 @@
+# Custom RTEMS multilibs
+
+MULTILIB_OPTIONS = mmultiply-enabled mbarrel-shift-enabled
+MULTILIB_OPTIONS += mdivide-enabled msign-extend-enabled
+
+MULTILIB_EXCEPTIONS =
+# MULTILIB_EXCEPTIONS += mmultiply-enabled/mbarrel-shift-enabled/mdivide-enabled/msign-extend-enabled
+MULTILIB_EXCEPTIONS += mmultiply-enabled/mbarrel-shift-enabled/mdivide-enabled
+MULTILIB_EXCEPTIONS += mmultiply-enabled/mbarrel-shift-enabled/msign-extend-enabled
+# MULTILIB_EXCEPTIONS += mmultiply-enabled/mbarrel-shift-enabled
+MULTILIB_EXCEPTIONS += mmultiply-enabled/mdivide-enabled/msign-extend-enabled
+MULTILIB_EXCEPTIONS += mmultiply-enabled/mdivide-enabled
+MULTILIB_EXCEPTIONS += mmultiply-enabled/msign-extend-enabled
+# MULTILIB_EXCEPTIONS += mmultiply-enabled
+MULTILIB_EXCEPTIONS += mbarrel-shift-enabled/mdivide-enabled/msign-extend-enabled
+MULTILIB_EXCEPTIONS += mbarrel-shift-enabled/mdivide-enabled
+MULTILIB_EXCEPTIONS += mbarrel-shift-enabled/msign-extend-enabled
+# MULTILIB_EXCEPTIONS += mbarrel-shift-enabled
+MULTILIB_EXCEPTIONS += mdivide-enabled/msign-extend-enabled
+MULTILIB_EXCEPTIONS += mdivide-enabled
+MULTILIB_EXCEPTIONS += msign-extend-enabled
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 7040df69fcf..04f69050609 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -391,7 +391,7 @@ class_can_hold_mode (reg_class_t rclass, enum machine_mode mode)
we allow the user to limit the number of memregs available, in
order to try to persuade gcc to try harder to use real registers.
- Memregs are provided by m32c-lib1.S.
+ Memregs are provided by lib1funcs.S.
*/
int ok_to_change_target_memregs = TRUE;
diff --git a/gcc/config/m32c/t-m32c b/gcc/config/m32c/t-m32c
index e39fdf3a0aa..1e4ed6b7113 100644
--- a/gcc/config/m32c/t-m32c
+++ b/gcc/config/m32c/t-m32c
@@ -19,18 +19,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = m32c/m32c-lib1.S
-
-LIB1ASMFUNCS = \
- __m32c_memregs \
- __m32c_eh_return \
- __m32c_mulsi3 \
- __m32c_cmpsi2 \
- __m32c_ucmpsi2 \
- __m32c_jsri16
-
-LIB2FUNCS_EXTRA = $(srcdir)/config/m32c/m32c-lib2.c $(srcdir)/config/m32c/m32c-lib2-trapv.c
-
# target-specific files
md_file = md
@@ -53,5 +41,3 @@ m32c-pragma.o: $(srcdir)/config/m32c/m32c-pragma.c $(RTL_H) $(TREE_H) $(CONFIG_H
MULTILIB_OPTIONS = mcpu=m32cm
MULTILIB_DIRNAMES = m32cm
MULTILIB_MATCHES = mcpu?m32cm=mcpu?m32c mcpu?r8c=mcpu?m16c
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
diff --git a/gcc/config/m32r/t-linux b/gcc/config/m32r/t-linux
index 6de9c781a67..c4f7dcc0bd6 100644
--- a/gcc/config/m32r/t-linux
+++ b/gcc/config/m32r/t-linux
@@ -16,30 +16,5 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# lib1funcs.asm is currently empty.
-CROSS_LIBGCC1 =
-
-# Turn off the SDA while compiling libgcc2. There are no headers for it
-# and we want maximal upward compatibility here.
-
-TARGET_LIBGCC2_CFLAGS = -G 0 -fPIC
-
-# We need to use -fpic when we are using gcc to compile the routines in
-# initfini.c. This is only really needed when we are going to use gcc/g++
-# to produce a shared library, but since we don't know ahead of time when
-# we will be doing that, we just always use -fpic when compiling the
-# routines in initfini.c.
-# -fpic currently isn't supported for the m32r.
-
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
# Don't install "assert.h" in gcc. We use the one in glibc.
INSTALL_ASSERT_H =
-
-# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
-# C library can handle them.
-LIBGCC1 =
-CROSS_LIBGCC1 =
-LIBGCC1_TEST =
-
-SHLIB_MAPFILES += $(srcdir)/config/m32r/libgcc-glibc.ver
diff --git a/gcc/config/m32r/t-m32r b/gcc/config/m32r/t-m32r
index 44090658838..e048fbf04f2 100644
--- a/gcc/config/m32r/t-m32r
+++ b/gcc/config/m32r/t-m32r
@@ -17,40 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Turn off the SDA while compiling libgcc2. There are no headers for it
-# and we want maximal upward compatibility here.
-
-TARGET_LIBGCC2_CFLAGS = -G 0
-
-# We need to use -fpic when we are using gcc to compile the routines in
-# initfini.c. This is only really needed when we are going to use gcc/g++
-# to produce a shared library, but since we don't know ahead of time when
-# we will be doing that, we just always use -fpic when compiling the
-# routines in initfini.c.
-# -fpic currently isn't supported for the m32r.
-
-CRTSTUFF_T_CFLAGS =
-
-# .init/.fini section routines
-
-$(T)crtinit.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
- $(CRTSTUFF_T_CFLAGS) $(INCLUDES) -DCRT_INIT \
- -finhibit-size-directive -fno-inline-functions -g0 \
- -mmodel=medium -c $(srcdir)/config/m32r/initfini.c \
- -o $(T)crtinit.o
-
-$(T)crtfini.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
- $(CRTSTUFF_T_CFLAGS) $(INCLUDES) -DCRT_FINI \
- -finhibit-size-directive -fno-inline-functions -g0 \
- -mmodel=medium -c $(srcdir)/config/m32r/initfini.c \
- -o $(T)crtfini.o
-m32rx:
- mkdir $@
-m32r2:
- mkdir $@
-
# -mmodel={small,medium} requires separate libraries.
# We don't build libraries for the large model, instead we use the medium
# libraries. The only difference is that the large model can handle jumps
@@ -64,8 +30,3 @@ MULTILIB_MATCHES = mmodel?medium=mmodel?large
# SHN_M32R_SCOMMON.
# This is important for objects referenced in system header files.
MULTILIB_EXTRA_OPTS = msdata=sdata
-
-EXTRA_MULTILIB_PARTS = crtinit.o crtfini.o
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-crtstuff b/gcc/config/m68k/t-crtstuff
deleted file mode 100644
index a8bdb502d66..00000000000
--- a/gcc/config/m68k/t-crtstuff
+++ /dev/null
@@ -1,10 +0,0 @@
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crti.o crtn.o
-
-# Add flags here as required.
-CRTSTUFF_T_CFLAGS =
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/m68k/crti.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o $(srcdir)/config/m68k/crti.s
-$(T)crtn.o: $(srcdir)/config/m68k/crtn.s $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o $(srcdir)/config/m68k/crtn.s
diff --git a/gcc/config/m68k/t-floatlib b/gcc/config/m68k/t-floatlib
deleted file mode 100644
index 2039d1d0dc4..00000000000
--- a/gcc/config/m68k/t-floatlib
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2007 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/>.
-
-LIB1ASMSRC = m68k/lb1sf68.asm
-LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
- _double _float _floatex \
- _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
- _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
-
-LIB2FUNCS_EXTRA = fpgnulib.c xfgnulib.c
-
-fpgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
- cp $(srcdir)/config/m68k/fpgnulib.c fpgnulib.c
-xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
- echo '#define EXTFLOAT' > xfgnulib.c
- cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
diff --git a/gcc/config/m68k/t-linux b/gcc/config/m68k/t-linux
index a8cb563a2e2..3fa29474693 100644
--- a/gcc/config/m68k/t-linux
+++ b/gcc/config/m68k/t-linux
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,8 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
# Only include multilibs for 680x0 and ColdFire CPUs with an MMU.
M68K_MLIB_CPU += && ((CPU ~ "^m680") || (CPU ~ "^mcf")) && (FLAGS ~ "FL_MMU")
diff --git a/gcc/config/m68k/t-m68kelf b/gcc/config/m68k/t-m68kelf
deleted file mode 100644
index bea01dc4f49..00000000000
--- a/gcc/config/m68k/t-m68kelf
+++ /dev/null
@@ -1,4 +0,0 @@
-# from ../t-svr4
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
-# no pic for now
-#CRTSTUFF_T_CFLAGS=-fpic
diff --git a/gcc/config/m68k/t-mlibs b/gcc/config/m68k/t-mlibs
index 11df31f210e..7be0c9f4fd4 100644
--- a/gcc/config/m68k/t-mlibs
+++ b/gcc/config/m68k/t-mlibs
@@ -92,6 +92,3 @@ endif
# Remove the default CPU from the explicit exceptions.
MULTILIB_EXCEPTIONS := \
$(patsubst mcpu=$(M68K_MLIB_DEFAULT)/%,%,$(MULTILIB_EXCEPTIONS))
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-uclinux b/gcc/config/m68k/t-uclinux
index e1711a3443e..6994359dcce 100644
--- a/gcc/config/m68k/t-uclinux
+++ b/gcc/config/m68k/t-uclinux
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2007, 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,9 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# crti and crtn are provided by uClibc.
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
-
# Include multilibs for CPUs without an MMU or with FL_UCLINUX
M68K_MLIB_CPU += && (!match(FLAGS, "FL_MMU") || match(FLAGS, "FL_UCLINUX"))
diff --git a/gcc/config/mcore/t-mcore b/gcc/config/mcore/t-mcore
index 5533211a5d2..c848ceda3b3 100644
--- a/gcc/config/mcore/t-mcore
+++ b/gcc/config/mcore/t-mcore
@@ -16,42 +16,17 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = mcore/lib1.asm
-LIB1ASMFUNCS = _divsi3 _udivsi3 _modsi3 _umodsi3
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mcore/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mcore/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mcore/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mcore/crtn.asm
-
-# could use -msifilter to be safe from interrupt/jmp interactions and others.
-TARGET_LIBGCC2_CFLAGS=-O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
-
# We have values for float.h.
CROSS_FLOAT_H = $(srcdir)/config/mcore/gfloat.h
# If support for -m4align is ever re-enabled then comment out the
-# following line and uncomment the mutlilib lines below.
-
-EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
+# following line and uncomment the multilib lines below.
# MULTILIB_OPTIONS = m8align/m4align
# MULTILIB_DIRNAMES = align8 align4
# MULTILIB_MATCHES =
# MULTILIB_EXTRA_OPTS =
# MULTILIB_EXCEPTIONS =
-# EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-# LIBGCC = stmp-multilib
-# INSTALL_LIBGCC = install-multilib
MULTILIB_OPTIONS = mbig-endian/mlittle-endian m210/m340
MULTILIB_DIRNAMES = big little m210 m340
-
-EXTRA_PARTS =
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mep/t-mep b/gcc/config/mep/t-mep
index 29c75457241..96542c4782c 100644
--- a/gcc/config/mep/t-mep
+++ b/gcc/config/mep/t-mep
@@ -24,12 +24,6 @@
GTM_H = tm.h $(tm_file_list) $(srcdir)/config/mep/mep-intrin.h insn-constants.h
-# Use -O0 instead of -O2 so we don't get complex relocations
-
-CRTSTUFF_CFLAGS = -O0 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
- -finhibit-size-directive -fno-inline-functions -fno-exceptions \
- -fno-zero-initialized-in-bss -fno-unit-at-a-time
-
TCFLAGS = -mlibrary
mep-pragma.o: $(srcdir)/config/mep/mep-pragma.c $(CONFIG_H) $(SYSTEM_H) \
@@ -38,27 +32,9 @@ mep-pragma.o: $(srcdir)/config/mep/mep-pragma.c $(CONFIG_H) $(SYSTEM_H) \
function.h insn-config.h reload.h $(TARGET_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-# profiling support
-
-LIB1ASMSRC = mep/mep-lib1.asm
-
-LIB1ASMFUNCS = _mep_profile \
- _mep_bb_init_trace \
- _mep_bb_init \
- _mep_bb_trace \
- _mep_bb_increment
-
-# multiply and divide routines
-
-LIB2FUNCS_EXTRA = \
- $(srcdir)/config/mep/mep-lib2.c \
- $(srcdir)/config/mep/mep-tramp.c
-
MULTILIB_OPTIONS = mel mall-opts mfar
MULTILIB_DIRNAMES = el allopt far
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-
MD_INCLUDES = \
$(srcdir)/config/mep/intrinsics.md \
$(srcdir)/config/mep/predicates.md \
diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
index 8c8767f9baa..cb49636b9ac 100644
--- a/gcc/config/microblaze/t-microblaze
+++ b/gcc/config/microblaze/t-microblaze
@@ -1,8 +1,3 @@
-# For C++ crtstuff
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext)
-
-EXTRA_PARTS += crti$(objext) crtn$(objext)
-
MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high
MULTILIB_DIRNAMES = bs m mh
MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
@@ -13,10 +8,3 @@ microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \
$(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) $(TM_P_H) $(TREE_H) errors.h $(TM_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/microblaze/microblaze-c.c
-
-# Assemble startup files
-$(T)crti$(objext): $(srcdir)/config/microblaze/crti.s
- $(GCC_FOR_TARGET) -c $(srcdir)/config/microblaze/crti.s -o $(T)crti$(objext)
-
-$(T)crtn$(objext): $(srcdir)/config/microblaze/crtn.s
- $(GCC_FOR_TARGET) -c $(srcdir)/config/microblaze/crtn.s -o $(T)crtn$(objext)
diff --git a/gcc/config/mips/t-elf b/gcc/config/mips/t-elf
index 4ed36da659b..b4535d28fc4 100644
--- a/gcc/config/mips/t-elf
+++ b/gcc/config/mips/t-elf
@@ -1,5 +1,5 @@
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -17,28 +17,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
-# We must build libgcc2.a with -G 0, in case the user wants to link
-# without the $gp register.
-TARGET_LIBGCC2_CFLAGS = -G 0
-
# Build the libraries for both hard and soft floating point
MULTILIB_OPTIONS = msoft-float EL/EB
MULTILIB_DIRNAMES = soft-float el eb
MULTILIB_MATCHES = EL=mel EB=meb msingle-float=m4650
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-isa3264 b/gcc/config/mips/t-isa3264
index f6dce325562..7291193f8a6 100644
--- a/gcc/config/mips/t-isa3264
+++ b/gcc/config/mips/t-isa3264
@@ -1,5 +1,5 @@
# Copyright (C) 2001, 2002, 2003, 2004, 2007,
-# 2008 Free Software Foundation, Inc.
+# 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -17,22 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
-# We must build libgcc2.a with -G 0, in case the user wants to link
-# without the $gp register.
-TARGET_LIBGCC2_CFLAGS = -G 0
-
# Build the libraries for both hard and soft floating point
ifneq ($(filter MIPS_ABI_DEFAULT=ABI_EABI,$(tm_defines)),)
@@ -48,7 +32,3 @@ MULTILIB_EXCLUSIONS = !mips32r2/mfp64
endif
endif
MULTILIB_MATCHES = EL=mel EB=meb
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-libgcc-mips16 b/gcc/config/mips/t-libgcc-mips16
deleted file mode 100644
index 772b05ac45e..00000000000
--- a/gcc/config/mips/t-libgcc-mips16
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2007, 2008, 2011 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/>.
-
-LIB1ASMSRC = mips/mips16.S
-LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \
- _m16eqsf2 _m16nesf2 _m16gtsf2 _m16gesf2 _m16lesf2 _m16ltsf2 \
- _m16unordsf2 \
- _m16fltsisf _m16fix_truncsfsi _m16fltunsisf \
- _m16adddf3 _m16subdf3 _m16muldf3 _m16divdf3 \
- _m16extsfdf2 _m16trdfsf2 \
- _m16eqdf2 _m16nedf2 _m16gtdf2 _m16gedf2 _m16ledf2 _m16ltdf2 \
- _m16unorddf2 \
- _m16fltsidf _m16fix_truncdfsi _m16fltunsidf \
- _m16retsf _m16retdf \
- _m16retsc _m16retdc \
- _m16stub1 _m16stub2 _m16stub5 _m16stub6 _m16stub9 _m16stub10 \
- _m16stubsf0 _m16stubsf1 _m16stubsf2 _m16stubsf5 _m16stubsf6 \
- _m16stubsf9 _m16stubsf10 \
- _m16stubdf0 _m16stubdf1 _m16stubdf2 _m16stubdf5 _m16stubdf6 \
- _m16stubdf9 _m16stubdf10 \
- _m16stubsc0 _m16stubsc1 _m16stubsc2 _m16stubsc5 _m16stubsc6 \
- _m16stubsc9 _m16stubsc10 \
- _m16stubdc0 _m16stubdc1 _m16stubdc2 _m16stubdc5 _m16stubdc6 \
- _m16stubdc9 _m16stubdc10
-
-# Version these symbols if building libgcc.so.
-SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 0e695172f55..5197e5ee209 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -19,5 +19,3 @@
MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
MULTILIB_DIRNAMES = n32 32 64
MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/mips/t-mips b/gcc/config/mips/t-mips
index 53993e9d3c0..46c5ebcb1e4 100644
--- a/gcc/config/mips/t-mips
+++ b/gcc/config/mips/t-mips
@@ -16,8 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2_SIDITI_CONV_FUNCS=yes
-
$(srcdir)/config/mips/mips-tables.opt: $(srcdir)/config/mips/genopt.sh \
$(srcdir)/config/mips/mips-cpus.def
$(SHELL) $(srcdir)/config/mips/genopt.sh $(srcdir)/config/mips > \
diff --git a/gcc/config/mips/t-r3900 b/gcc/config/mips/t-r3900
index 2c4216399c5..d542df36ed6 100644
--- a/gcc/config/mips/t-r3900
+++ b/gcc/config/mips/t-r3900
@@ -1,5 +1,5 @@
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -17,19 +17,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# We must build libgcc2.a with -G 0, in case the user wants to link
-# without the $gp register.
-TARGET_LIBGCC2_CFLAGS = -G 0
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
# Build the libraries for both hard and soft floating point
MULTILIB_OPTIONS = msoft-float EL/EB
MULTILIB_DIRNAMES = soft-float el eb
MULTILIB_MATCHES = EL=mel EB=meb
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-sde b/gcc/config/mips/t-sde
index 0fa2277d573..d9c229ab4e0 100644
--- a/gcc/config/mips/t-sde
+++ b/gcc/config/mips/t-sde
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,18 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64/mips64r2 mips16 msoft-float/mfp64 mcode-readable=no
MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips64r2 mips16 sof f64 spram
MULTILIB_MATCHES = EL=mel EB=meb
@@ -45,9 +33,3 @@ MULTILIB_EXCLUSIONS += !mips32/!mips32r2/mips16
else
MULTILIB_EXCLUSIONS += mips64/mips16 mips64r2/mips16
endif
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# Build the multilibs.
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-sr71k b/gcc/config/mips/t-sr71k
index 44b69402e62..309eec6a650 100644
--- a/gcc/config/mips/t-sr71k
+++ b/gcc/config/mips/t-sr71k
@@ -16,32 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Suppress building libgcc1.a, since the MIPS compiler port is complete
-# and does not need anything from libgcc1.a.
-LIBGCC1 =
-CROSS_LIBGCC1 =
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
-# We must build libgcc2.a with -G 0, in case the user wants to link
-# without the $gp register.
-TARGET_LIBGCC2_CFLAGS = -G 0
-
# Build the libraries for both hard and soft floating point
-
MULTILIB_OPTIONS = EL/EB msoft-float mips2
MULTILIB_DIRNAMES = el eb soft-float mips2
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-st b/gcc/config/mips/t-st
index 83115f6fdd5..b0a8933c32b 100644
--- a/gcc/config/mips/t-st
+++ b/gcc/config/mips/t-st
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -28,5 +28,3 @@ MULTILIB_OSDIRNAMES += march.loongson2f/mabi.64=../lib64/2f
MULTILIB_OSDIRNAMES += mabi.n32=../lib32
MULTILIB_OSDIRNAMES += mabi.32=../lib
MULTILIB_OSDIRNAMES += mabi.64=../lib64
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/mips/t-vr b/gcc/config/mips/t-vr
index 81efef9b865..de5ca706faf 100644
--- a/gcc/config/mips/t-vr
+++ b/gcc/config/mips/t-vr
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2005, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,30 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# BEGIN boiler-plate MIPS stuff
-
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# We must build libgcc2.a with -G 0, in case the user wants to link
-# without the $gp register.
-TARGET_LIBGCC2_CFLAGS = -G 0
-
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/mips/mips16.S \
- $(srcdir)/config/mips/vr4120-div.S
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
-# END boiler-plate
-
# Main multilibs
# --------------
#
diff --git a/gcc/config/mmix/t-mmix b/gcc/config/mmix/t-mmix
index dc05c8e82f5..b25eebcd35a 100644
--- a/gcc/config/mmix/t-mmix
+++ b/gcc/config/mmix/t-mmix
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,16 +16,5 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# See "Target Fragment" in GCC info. That same order is used here.
-
-TARGET_LIBGCC2_CFLAGS = -mlibfuncs -O2
-
-# We need to turn off some assumptions on normality for code in crtstuff.c
-# and crt{i,n}.asm, specifically about execution not continuing past the
-# end of the section in the file being compiled. Thus we must stop the
-# assembler from generating stubbable PUSHJ relocs, because that will add
-# stubs at the end of the current section when necessary.
-CRTSTUFF_T_CFLAGS = -Wa,--no-stubs
-
MULTILIB_OPTIONS = mabi=gnu
MULTILIB_DIRNAMES = gnuabi
diff --git a/gcc/config/mn10300/t-mn10300 b/gcc/config/mn10300/t-mn10300
index c62c56f2013..af22d94cdc3 100644
--- a/gcc/config/mn10300/t-mn10300
+++ b/gcc/config/mn10300/t-mn10300
@@ -19,6 +19,3 @@
MULTILIB_OPTIONS = mam33/mam33-2/mam34
MULTILIB_DIRNAMES = am33 am33-2 am34
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/moxie/crti.asm b/gcc/config/moxie/crti.asm
deleted file mode 100644
index f44582799a3..00000000000
--- a/gcc/config/moxie/crti.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-# crti.asm for moxie
-#
-# Copyright (C) 2009 Free Software Foundation
-#
-# 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, 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/>.
-
-# This file just make a stack frame for the contents of the .fini and
-# .init sections. Users may put any desired instructions in those
-# sections.
-
- .file "crti.asm"
-
- .section ".init"
- .global _init
- .type _init, @function
- .p2align 1
-_init:
-
- .section ".fini"
- .global _fini
- .type _fini,@function
- .p2align 1
-_fini:
diff --git a/gcc/config/moxie/crtn.asm b/gcc/config/moxie/crtn.asm
deleted file mode 100644
index 3ac9d31eed8..00000000000
--- a/gcc/config/moxie/crtn.asm
+++ /dev/null
@@ -1,34 +0,0 @@
-# crtn.asm for moxie
-#
-# Copyright (C) 2009 Free Software Foundation
-#
-# 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, 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/>.
-
-# This file just makes sure that the .fini and .init sections do in
-# fact return. Users may put any desired instructions in those sections.
-# This file is the last thing linked into any executable.
-
- .file "crtn.asm"
-
- .section ".init"
- ret
-
- .section ".fini"
- ret
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 6d2f67d00c3..66574bad2fa 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -155,9 +155,7 @@ static void output_deferred_profile_counters (void) ATTRIBUTE_UNUSED;
#ifdef ASM_OUTPUT_EXTERNAL_REAL
static void pa_hpux_file_end (void);
#endif
-#if HPUX_LONG_DOUBLE_LIBRARY
-static void pa_hpux_init_libfuncs (void);
-#endif
+static void pa_init_libfuncs (void);
static rtx pa_struct_value_rtx (tree, int);
static bool pa_pass_by_reference (cumulative_args_t, enum machine_mode,
const_tree, bool);
@@ -316,10 +314,8 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG pa_reorg
-#if HPUX_LONG_DOUBLE_LIBRARY
#undef TARGET_INIT_LIBFUNCS
-#define TARGET_INIT_LIBFUNCS pa_hpux_init_libfuncs
-#endif
+#define TARGET_INIT_LIBFUNCS pa_init_libfuncs
#undef TARGET_PROMOTE_FUNCTION_MODE
#define TARGET_PROMOTE_FUNCTION_MODE pa_promote_function_mode
@@ -5542,47 +5538,56 @@ output_deferred_plabels (void)
}
}
-#if HPUX_LONG_DOUBLE_LIBRARY
-/* Initialize optabs to point to HPUX long double emulation routines. */
+/* Initialize optabs to point to emulation routines. */
+
static void
-pa_hpux_init_libfuncs (void)
-{
- set_optab_libfunc (add_optab, TFmode, "_U_Qfadd");
- set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub");
- set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy");
- set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv");
- set_optab_libfunc (smin_optab, TFmode, "_U_Qmin");
- set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax");
- set_optab_libfunc (sqrt_optab, TFmode, "_U_Qfsqrt");
- set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
- set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg");
-
- set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq");
- set_optab_libfunc (ne_optab, TFmode, "_U_Qfne");
- set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt");
- set_optab_libfunc (ge_optab, TFmode, "_U_Qfge");
- set_optab_libfunc (lt_optab, TFmode, "_U_Qflt");
- set_optab_libfunc (le_optab, TFmode, "_U_Qfle");
- set_optab_libfunc (unord_optab, TFmode, "_U_Qfunord");
-
- set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad");
- set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad");
- set_conv_libfunc (trunc_optab, SFmode, TFmode, "_U_Qfcnvff_quad_to_sgl");
- set_conv_libfunc (trunc_optab, DFmode, TFmode, "_U_Qfcnvff_quad_to_dbl");
-
- set_conv_libfunc (sfix_optab, SImode, TFmode, TARGET_64BIT
- ? "__U_Qfcnvfxt_quad_to_sgl"
- : "_U_Qfcnvfxt_quad_to_sgl");
- set_conv_libfunc (sfix_optab, DImode, TFmode, "_U_Qfcnvfxt_quad_to_dbl");
- set_conv_libfunc (ufix_optab, SImode, TFmode, "_U_Qfcnvfxt_quad_to_usgl");
- set_conv_libfunc (ufix_optab, DImode, TFmode, "_U_Qfcnvfxt_quad_to_udbl");
-
- set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
- set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
- set_conv_libfunc (ufloat_optab, TFmode, SImode, "_U_Qfcnvxf_usgl_to_quad");
- set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxf_udbl_to_quad");
+pa_init_libfuncs (void)
+{
+ if (HPUX_LONG_DOUBLE_LIBRARY)
+ {
+ set_optab_libfunc (add_optab, TFmode, "_U_Qfadd");
+ set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub");
+ set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy");
+ set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv");
+ set_optab_libfunc (smin_optab, TFmode, "_U_Qmin");
+ set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax");
+ set_optab_libfunc (sqrt_optab, TFmode, "_U_Qfsqrt");
+ set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
+ set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg");
+
+ set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq");
+ set_optab_libfunc (ne_optab, TFmode, "_U_Qfne");
+ set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt");
+ set_optab_libfunc (ge_optab, TFmode, "_U_Qfge");
+ set_optab_libfunc (lt_optab, TFmode, "_U_Qflt");
+ set_optab_libfunc (le_optab, TFmode, "_U_Qfle");
+ set_optab_libfunc (unord_optab, TFmode, "_U_Qfunord");
+
+ set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad");
+ set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad");
+ set_conv_libfunc (trunc_optab, SFmode, TFmode, "_U_Qfcnvff_quad_to_sgl");
+ set_conv_libfunc (trunc_optab, DFmode, TFmode, "_U_Qfcnvff_quad_to_dbl");
+
+ set_conv_libfunc (sfix_optab, SImode, TFmode,
+ TARGET_64BIT ? "__U_Qfcnvfxt_quad_to_sgl"
+ : "_U_Qfcnvfxt_quad_to_sgl");
+ set_conv_libfunc (sfix_optab, DImode, TFmode,
+ "_U_Qfcnvfxt_quad_to_dbl");
+ set_conv_libfunc (ufix_optab, SImode, TFmode,
+ "_U_Qfcnvfxt_quad_to_usgl");
+ set_conv_libfunc (ufix_optab, DImode, TFmode,
+ "_U_Qfcnvfxt_quad_to_udbl");
+
+ set_conv_libfunc (sfloat_optab, TFmode, SImode,
+ "_U_Qfcnvxf_sgl_to_quad");
+ set_conv_libfunc (sfloat_optab, TFmode, DImode,
+ "_U_Qfcnvxf_dbl_to_quad");
+ set_conv_libfunc (ufloat_optab, TFmode, SImode,
+ "_U_Qfcnvxf_usgl_to_quad");
+ set_conv_libfunc (ufloat_optab, TFmode, DImode,
+ "_U_Qfcnvxf_udbl_to_quad");
+ }
}
-#endif
/* HP's millicode routines mean something special to the assembler.
Keep track of which ones we have used. */
diff --git a/gcc/config/pa/t-dce-thr b/gcc/config/pa/t-dce-thr
index 8d86a418186..51b3abcf607 100644
--- a/gcc/config/pa/t-dce-thr
+++ b/gcc/config/pa/t-dce-thr
@@ -1,5 +1,2 @@
MULTILIB_OPTIONS = threads
MULTILIB_DIRNAMES = threads
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/pa/t-hpux-shlib b/gcc/config/pa/t-hpux-shlib
deleted file mode 100644
index d5a5b6c8609..00000000000
--- a/gcc/config/pa/t-hpux-shlib
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2001, 2003, 2004, 2005, 2006 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/>.
-
-# Build a shared libgcc library.
-SHLIB_EXT = .sl
-SHLIB_NAME = @shlib_base_name@$(SHLIB_EXT)
-SHLIB_SOVERSION = 1
-SHLIB_SONAME = @shlib_base_name@.$(SHLIB_SOVERSION)
-SHLIB_OBJS = @shlib_objs@
-SHLIB_DIR = @multilib_dir@
-SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
-
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,+h -Wl,$(SHLIB_SONAME) \
- -o $(SHLIB_DIR)/$(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) && \
- rm -f $(SHLIB_DIR)/$(SHLIB_SONAME) && \
- if [ -f $(SHLIB_DIR)/$(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_DIR)/$(SHLIB_NAME) $(SHLIB_DIR)/$(SHLIB_NAME).backup; \
- else true; fi && \
- mv $(SHLIB_DIR)/$(SHLIB_NAME).tmp $(SHLIB_DIR)/$(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_DIR)/$(SHLIB_SONAME)
-
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) -m 555 $(SHLIB_DIR)/$(SHLIB_NAME) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
- rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \
- $(LN_S) $(SHLIB_SONAME) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME)
diff --git a/gcc/config/pa/t-linux b/gcc/config/pa/t-linux
deleted file mode 100644
index fbbcfe29fd7..00000000000
--- a/gcc/config/pa/t-linux
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 1999, 2001, 2002, 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/>.
-
-#Plug millicode routines into libgcc.a We want these on both native and
-#cross compiles. We use the "64-bit" routines because the "32-bit" code
-#is broken for certain corner cases.
-
-LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall
-LIB1ASMSRC = pa/milli64.S
-
-# Compile libgcc2.a as PIC.
-TARGET_LIBGCC2_CFLAGS = -fPIC -DELF=1 -DLINUX=1
-
-LIB2FUNCS_EXTRA=fptr.c
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/pa/linux-atomic.c
-
-fptr.c: $(srcdir)/config/pa/fptr.c
- rm -f fptr.c
- cp $(srcdir)/config/pa/fptr.c .
-
-# Compile crtbeginS.o and crtendS.o as PIC.
-CRTSTUFF_T_CFLAGS_S = -fPIC
diff --git a/gcc/config/pa/t-linux64 b/gcc/config/pa/t-linux64
deleted file mode 100644
index 1658f6d8aae..00000000000
--- a/gcc/config/pa/t-linux64
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2001, 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/>.
-
-#Plug millicode routines into libgcc.a We want these on both native and
-#cross compiles.
-
-LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI
-LIB1ASMSRC = pa/milli64.S
-
-# Compile crtbeginS.o and crtendS.o as PIC.
-# Actually, hppa64 is always PIC but adding -fPIC does no harm.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/pa/linux-atomic.c
-
-# Compile libgcc2.a as PIC.
-TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1
diff --git a/gcc/config/pa/t-pa-hpux b/gcc/config/pa/t-pa-hpux
deleted file mode 100644
index 63eab636200..00000000000
--- a/gcc/config/pa/t-pa-hpux
+++ /dev/null
@@ -1,7 +0,0 @@
-lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm
- rm -f lib2funcs.asm
- cp $(srcdir)/config/pa/lib2funcs.asm .
-
-quadlib.c: $(srcdir)/config/pa/quadlib.c
- rm -f quadlib.c
- cp $(srcdir)/config/pa/quadlib.c .
diff --git a/gcc/config/pa/t-pa-hpux10 b/gcc/config/pa/t-pa-hpux10
deleted file mode 100644
index fd7ff484257..00000000000
--- a/gcc/config/pa/t-pa-hpux10
+++ /dev/null
@@ -1,2 +0,0 @@
-TARGET_LIBGCC2_CFLAGS = -fPIC -frandom-seed=fixed-seed -D_T_HPUX10
-LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c
diff --git a/gcc/config/pa/t-pa-hpux11 b/gcc/config/pa/t-pa-hpux11
deleted file mode 100644
index 4436b4ca640..00000000000
--- a/gcc/config/pa/t-pa-hpux11
+++ /dev/null
@@ -1,31 +0,0 @@
-TARGET_LIBGCC2_CFLAGS = -fPIC -frandom-seed=fixed-seed
-LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c
-LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
- pthread_mutex_lock-stub.o \
- pthread_mutex_unlock-stub.o \
- pthread_once-stub.o
-
-stublib.c: $(srcdir)/config/pa/stublib.c
- rm -f stublib.c
- cp $(srcdir)/config/pa/stublib.c .
-
-pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
- -o pthread_default_stacksize_np-stub.o
-
-pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
- -o pthread_mutex_lock-stub.o
-
-pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
- -o pthread_mutex_unlock-stub.o
-
-pthread_once-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
- -o pthread_once-stub.o
-
-$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
- -rm -rf $(T)libgcc_stub.a
- $(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
- $(RANLIB) $(T)libgcc_stub.a
diff --git a/gcc/config/pa/t-pa64 b/gcc/config/pa/t-pa64
deleted file mode 100644
index e6ac7a5bb7d..00000000000
--- a/gcc/config/pa/t-pa64
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (C) 2000, 2001, 2002, 2004, 2006,
-# 2007, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1 -mlong-calls
-LIB2FUNCS_EXTRA = quadlib.c
-LIBGCCSTUB_OBJS = rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o \
- pthread_default_stacksize_np-stub.o \
- pthread_mutex_lock-stub.o \
- pthread_mutex_unlock-stub.o \
- pthread_once-stub.o
-
-stublib.c: $(srcdir)/config/pa/stublib.c
- rm -f stublib.c
- cp $(srcdir)/config/pa/stublib.c .
-
-rfi-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_register_frame_info stublib.c \
- -o rfi-stub.o
-
-dfi-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_deregister_frame_info stublib.c \
- -o dfi-stub.o
-
-cxaf-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_cxa_finalize stublib.c \
- -o cxaf-stub.o
-
-jvrc-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_Jv_RegisterClasses stublib.c \
- -o jvrc-stub.o
-
-pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
- -o pthread_default_stacksize_np-stub.o
-
-pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
- -o pthread_mutex_lock-stub.o
-
-pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
- -o pthread_mutex_unlock-stub.o
-
-pthread_once-stub.o: stublib.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
- -o pthread_once-stub.o
-
-$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
- -rm -rf $(T)libgcc_stub.a
- $(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
- $(RANLIB) $(T)libgcc_stub.a
diff --git a/gcc/config/pdp11/t-pdp11 b/gcc/config/pdp11/t-pdp11
index 032084b381b..c0287d50da2 100644
--- a/gcc/config/pdp11/t-pdp11
+++ b/gcc/config/pdp11/t-pdp11
@@ -17,11 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-TARGET_LIBGCC2_CFLAGS = -O2 -mfloat32
-LIB2FUNCS_EXTRA = $(srcdir)/config/udivmod.c $(srcdir)/config/udivmodsi4.c \
- $(srcdir)/config/memcmp.c $(srcdir)/config/memcpy.c \
- $(srcdir)/config/memmove.c $(srcdir)/config/memset.c
-
MULTILIB_OPTIONS = msoft-float
# Because the pdp11 POINTER_SIZE is only 16, in dwarf2out.c,
diff --git a/gcc/config/picochip/libgccExtras/fake_libgcc.asm b/gcc/config/picochip/libgccExtras/fake_libgcc.asm
deleted file mode 100644
index e4b78f1e1f1..00000000000
--- a/gcc/config/picochip/libgccExtras/fake_libgcc.asm
+++ /dev/null
@@ -1,6 +0,0 @@
-// picoChip ASM file
-// Fake libgcc asm file. This contains nothing, but is used to prevent gcc
-// getting upset about the lack of a libgcc.S file when LIB1ASMFUNCS is defined
-// to switch off the compilation of parts of libgcc.
-
-
diff --git a/gcc/config/picochip/t-picochip b/gcc/config/picochip/t-picochip
index 222d7a646b9..269a0551407 100644
--- a/gcc/config/picochip/t-picochip
+++ b/gcc/config/picochip/t-picochip
@@ -16,45 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Compile the extra library functions.
-
-LIB2FUNCS_EXTRA = \
- $(srcdir)/config/picochip/libgccExtras/ashrsi3.asm \
- $(srcdir)/config/picochip/libgccExtras/ashlsi3.asm \
- $(srcdir)/config/picochip/libgccExtras/divmodhi4.asm \
- $(srcdir)/config/picochip/libgccExtras/udivmodhi4.asm \
- $(srcdir)/config/picochip/libgccExtras/divmodsi4.asm \
- $(srcdir)/config/picochip/libgccExtras/udivmodsi4.asm \
- $(srcdir)/config/picochip/libgccExtras/divmod15.asm \
- $(srcdir)/config/picochip/libgccExtras/ucmpsi2.asm \
- $(srcdir)/config/picochip/libgccExtras/cmpsi2.asm \
- $(srcdir)/config/picochip/libgccExtras/clzsi2.asm \
- $(srcdir)/config/picochip/libgccExtras/adddi3.asm \
- $(srcdir)/config/picochip/libgccExtras/subdi3.asm \
- $(srcdir)/config/picochip/libgccExtras/lshrsi3.asm \
- $(srcdir)/config/picochip/libgccExtras/parityhi2.asm \
- $(srcdir)/config/picochip/libgccExtras/popcounthi2.asm
-
-# Prevent some of the more complicated libgcc functions from being
-# compiled. This is because they are generally too big to fit into an
-# AE anyway, so there is no point in having them. Also, some don't
-# compile properly so we'll ignore them for the moment.
-
-LIB1ASMFUNCS = _mulsc3 _divsc3
-LIB1ASMSRC = picochip/libgccExtras/fake_libgcc.asm
-
-# Turn off ranlib on target libraries.
-RANLIB_FOR_TARGET = cat
-
-# Special libgcc setup. Make single/double floating point the same,
-# and use our own include files.
-TARGET_LIBGCC2_CFLAGS = -DDF=SF -I../../includes/
-
-# Switch off all debugging for the embedded libraries.
-# (embedded processors need small libraries by default).
-# NOTE: If the debug level is increased, turn off instruction scheduling.
-LIBGCC2_DEBUG_CFLAGS = -g0
-
# Build all combinations of library for different multiply units, and
# presence/absence of byte access.
MULTILIB_OPTIONS = mmul-type=none/mmul-type=mac/mmul-type=mul mno-byte-access/mbyte-access
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5b4607a5659..aa04fdd73bf 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1176,6 +1176,7 @@ static void rs6000_trampoline_init (rtx, tree, rtx);
static bool rs6000_cannot_force_const_mem (enum machine_mode, rtx);
static bool rs6000_legitimate_constant_p (enum machine_mode, rtx);
static bool rs6000_save_toc_in_prologue_p (void);
+static void rs6000_code_end (void) ATTRIBUTE_UNUSED;
/* Hash table stuff for keeping track of TOC entries. */
@@ -19660,7 +19661,7 @@ rs6000_emit_stack_reset (rs6000_stack_t *info,
{
/* This blockage is needed so that sched doesn't decide to move
the sp change before the register restores. */
- if (frame_reg_rtx != sp_reg_rtx
+ if (DEFAULT_ABI == ABI_V4
|| (TARGET_SPE_ABI
&& info->spe_64bit_regs_used != 0
&& info->first_gp_reg_save != 32))
@@ -21460,15 +21461,28 @@ rs6000_output_function_epilogue (FILE *file,
it looks like we might want one, insert a NOP. */
{
rtx insn = get_last_insn ();
+ rtx deleted_debug_label = NULL_RTX;
while (insn
&& NOTE_P (insn)
&& NOTE_KIND (insn) != NOTE_INSN_DELETED_LABEL)
- insn = PREV_INSN (insn);
+ {
+ /* Don't insert a nop for NOTE_INSN_DELETED_DEBUG_LABEL
+ notes only, instead set their CODE_LABEL_NUMBER to -1,
+ otherwise there would be code generation differences
+ in between -g and -g0. */
+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_DELETED_DEBUG_LABEL)
+ deleted_debug_label = insn;
+ insn = PREV_INSN (insn);
+ }
if (insn
&& (LABEL_P (insn)
|| (NOTE_P (insn)
&& NOTE_KIND (insn) == NOTE_INSN_DELETED_LABEL)))
fputs ("\tnop\n", file);
+ else if (deleted_debug_label)
+ for (insn = deleted_debug_label; insn; insn = NEXT_INSN (insn))
+ if (NOTE_KIND (insn) == NOTE_INSN_DELETED_DEBUG_LABEL)
+ CODE_LABEL_NUMBER (insn) = -1;
}
#endif
@@ -25070,7 +25084,7 @@ macho_branch_islands (void)
if (TARGET_LINK_STACK)
{
char name[32];
- get_ppc64_thunk_name (name);
+ get_ppc476_thunk_name (name);
strcat (tmp_buf, ":\n\tmflr r0\n\tbl ");
strcat (tmp_buf, name);
strcat (tmp_buf, "\n");
@@ -27948,6 +27962,12 @@ rs6000_save_toc_in_prologue_p (void)
return (cfun && cfun->machine && cfun->machine->save_toc_in_prologue);
}
+#ifdef HAVE_GAS_HIDDEN
+# define USE_HIDDEN_LINKONCE 1
+#else
+# define USE_HIDDEN_LINKONCE 0
+#endif
+
/* Fills in the label name that should be used for a 476 link stack thunk. */
void
@@ -27955,7 +27975,7 @@ get_ppc476_thunk_name (char name[32])
{
gcc_assert (TARGET_LINK_STACK);
- if (HAVE_GAS_HIDDEN)
+ if (USE_HIDDEN_LINKONCE)
sprintf (name, "__ppc476.get_thunk");
else
ASM_GENERATE_INTERNAL_LABEL (name, "LPPC476_", 0);
@@ -27982,7 +28002,7 @@ rs6000_code_end (void)
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
- if (HAVE_GAS_HIDDEN)
+ if (USE_HIDDEN_LINKONCE)
{
DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl);
targetm.asm_out.unique_section (decl, 0);
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index a8bd0e75fa2..7ffdd3e4831 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -49,8 +49,23 @@
%{mcpu=604: %{!Dppc*: %{!Dmpc*: -Dmpc604} } } \
%{mcpu=750: %{!Dppc*: %{!Dmpc*: -Dmpc750} } } \
%{mcpu=821: %{!Dppc*: %{!Dmpc*: -Dmpc821} } } \
-%{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } }"
+%{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } } \
+%{mcpu=8540: %{!Dppc*: %{!Dmpc*: -Dppc8540} } }"
#undef SUBSUBTARGET_EXTRA_SPECS
#define SUBSUBTARGET_EXTRA_SPECS \
{ "cpp_os_rtems", CPP_OS_RTEMS_SPEC }
+
+#undef SUBSUBTARGET_OVERRIDE_OPTIONS
+#define SUBSUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ if (TARGET_E500) \
+ { \
+ if (TARGET_HARD_FLOAT && !rs6000_explicit_options.float_gprs) \
+ rs6000_float_gprs = 1; \
+ if (rs6000_float_gprs != 0 && !rs6000_explicit_options.spe) \
+ rs6000_spe = 1; \
+ if (rs6000_spe && !rs6000_explicit_options.spe_abi) \
+ rs6000_spe_abi = 1; \
+ } \
+ } while(0)
diff --git a/gcc/config/rs6000/t-aix43 b/gcc/config/rs6000/t-aix43
index 374b98dfa93..97ce70ecca3 100644
--- a/gcc/config/rs6000/t-aix43
+++ b/gcc/config/rs6000/t-aix43
@@ -44,35 +44,3 @@ MULTILIB_MATCHES = mcpu?power=mcpu?power \
mcpu?powerpc=mcpu?604e \
mcpu?powerpc=mcpu?620 \
mcpu?powerpc=mcpu?630
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-# Build a shared libgcc library.
-SHLIB_EXT = .a
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
- @multilib_flags@ @shlib_objs@ -lc \
- `case @multilib_dir@ in \
- *pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \
- *) echo -lc ;; esac` ; \
- rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
- $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \
- @multilib_dir@/shr.o ; \
- mv @multilib_dir@/tmp-@shlib_base_name@.a \
- @multilib_dir@/@shlib_base_name@.a ; \
- rm -f @multilib_dir@/shr.o
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
- $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
- $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
-SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
-SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
-SHLIB_NM_FLAGS = -Bpg -X32_64
-
-# Either 32-bit and 64-bit objects in archives.
-AR_FLAGS_FOR_TARGET = -X32_64
-
diff --git a/gcc/config/rs6000/t-aix52 b/gcc/config/rs6000/t-aix52
index 79ef16fd84e..f3bf78d3630 100644
--- a/gcc/config/rs6000/t-aix52
+++ b/gcc/config/rs6000/t-aix52
@@ -25,34 +25,3 @@ MULTILIB_OPTIONS = pthread maix64
MULTILIB_DIRNAMES = pthread ppc64
MULTILIB_MATCHES =
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-# Build a shared libgcc library.
-SHLIB_EXT = .a
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
- @multilib_flags@ @shlib_objs@ -lc \
- `case @multilib_dir@ in \
- *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
- *) echo -lc ;; esac` ; \
- rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
- $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \
- @multilib_dir@/shr.o ; \
- mv @multilib_dir@/tmp-@shlib_base_name@.a \
- @multilib_dir@/@shlib_base_name@.a ; \
- rm -f @multilib_dir@/shr.o
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
- $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
- $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
-SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
-SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
-SHLIB_NM_FLAGS = -Bpg -X32_64
-
-# Either 32-bit and 64-bit objects in archives.
-AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
deleted file mode 100644
index bedd9e6ff9c..00000000000
--- a/gcc/config/rs6000/t-darwin
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2011 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/>.
-
-LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
- $(srcdir)/config/darwin-64.c \
- $(srcdir)/config/rs6000/darwin-fpsave.asm \
- $(srcdir)/config/rs6000/darwin-gpsave.asm \
- $(srcdir)/config/rs6000/darwin-world.asm
-
-LIB2FUNCS_STATIC_EXTRA = \
- $(srcdir)/config/rs6000/darwin-vecsave.asm
-
-# The .asm files above are designed to run on all processors, even though
-# they use AltiVec instructions.
-# -Wa is used because -force_cpusubtype_ALL doesn't work with -dynamiclib.
-# -mmacosx-version-min=10.4 is used to provide compatibility for code from
-# earlier OSX versions.
-
-TARGET_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4
-
-darwin-fpsave.o: $(srcdir)/config/rs6000/darwin-asm.h
-darwin-gpsave.o: $(srcdir)/config/rs6000/darwin-asm.h
-darwin-tramp.o: $(srcdir)/config/rs6000/darwin-asm.h
diff --git a/gcc/config/rs6000/t-darwin64 b/gcc/config/rs6000/t-darwin64
index 4c50b243873..b0a04c7d89d 100644
--- a/gcc/config/rs6000/t-darwin64
+++ b/gcc/config/rs6000/t-darwin64
@@ -1,11 +1,2 @@
-LIB2_SIDITI_CONV_FUNCS=yes
-
-LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
- $(srcdir)/config/darwin-64.c \
- $(srcdir)/config/rs6000/darwin-world.asm
-
MULTILIB_OPTIONS = m32
MULTILIB_DIRNAMES = ppc
-
-#LIBGCC = stmp-multilib
-#INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/rs6000/t-fprules b/gcc/config/rs6000/t-fprules
index 42d8fd77b5b..913bbbdae69 100644
--- a/gcc/config/rs6000/t-fprules
+++ b/gcc/config/rs6000/t-fprules
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2005, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -33,6 +33,3 @@ MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
MULTILIB_OPTIONS = msoft-float
MULTILIB_DIRNAMES = soft-float
MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index bd01d319212..6420431214d 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -19,8 +19,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-TARGET_LIBGCC2_CFLAGS += -mno-minimal-toc
-
# On Debian, Ubuntu and other derivative distributions, the 32bit libraries
# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to
# /lib and /usr/lib, while other distributions install libraries into /lib64
diff --git a/gcc/config/rs6000/t-lynx b/gcc/config/rs6000/t-lynx
index 768856e06eb..fdc5b56daed 100644
--- a/gcc/config/rs6000/t-lynx
+++ b/gcc/config/rs6000/t-lynx
@@ -16,14 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2FUNCS_EXTRA = tramp.S
-
-tramp.S: $(srcdir)/config/rs6000/tramp.asm
- cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
MULTILIB_OPTIONS += msoft-float
MULTILIB_DIRNAMES += soft-float
@@ -32,15 +24,6 @@ MULTILIB_DIRNAMES += altivec
MULTILIB_EXCEPTIONS = *msoft-float/*maltivec*
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-
-# If .sdata is enabled __CTOR_{LIST,END}__ go into .sdata instead of
-# .ctors.
-CRTSTUFF_T_CFLAGS = -mno-sdata
-
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC -mno-sdata
-
Local Variables:
mode: makefile
End:
diff --git a/gcc/config/rs6000/t-netbsd b/gcc/config/rs6000/t-netbsd
index bad21beaac6..462f0ce7536 100644
--- a/gcc/config/rs6000/t-netbsd
+++ b/gcc/config/rs6000/t-netbsd
@@ -1,6 +1,6 @@
# Support for NetBSD PowerPC ELF targets (SVR4 ABI).
#
-# Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -18,37 +18,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2FUNCS_EXTRA = tramp.S
-
-LIB2FUNCS_STATIC_EXTRA = crtsavfpr.S crtresfpr.S \
- crtsavgpr.S crtresgpr.S \
- crtresxfpr.S crtresxgpr.S
-
-tramp.S: $(srcdir)/config/rs6000/tramp.asm
- cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
-
-crtsavfpr.S: $(srcdir)/config/rs6000/crtsavfpr.asm
- cat $(srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
-
-crtresfpr.S: $(srcdir)/config/rs6000/crtresfpr.asm
- cat $(srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
-
-crtsavgpr.S: $(srcdir)/config/rs6000/crtsavgpr.asm
- cat $(srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
-
-crtresgpr.S: $(srcdir)/config/rs6000/crtresgpr.asm
- cat $(srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
-
-crtresxfpr.S: $(srcdir)/config/rs6000/crtresxfpr.asm
- cat $(srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
-
-crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
- cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
-
-# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
-CRTSTUFF_T_CFLAGS += -msdata=none
-CRTSTUFF_T_CFLAGS_S += -msdata=none
-
# Switch synonyms
MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
msoft-float=mcpu?403 \
@@ -65,26 +34,3 @@ MULTILIB_EXTRA_OPTS = fPIC mstrict-align
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
- crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext)
-
-$(T)crtsavfpr$(objext): crtsavfpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
-
-$(T)crtresfpr$(objext): crtresfpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresfpr.S -o $(T)crtresfpr$(objext)
-
-$(T)crtsavgpr$(objext): crtsavgpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavgpr.S -o $(T)crtsavgpr$(objext)
-
-$(T)crtresgpr$(objext): crtresgpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresgpr.S -o $(T)crtresgpr$(objext)
-
-$(T)crtresxfpr$(objext): crtresxfpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxfpr.S -o $(T)crtresxfpr$(objext)
-
-$(T)crtresxgpr$(objext): crtresxgpr.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxgpr.S -o $(T)crtresxgpr$(objext)
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
index b7e07a9b4c9..81ab7effa42 100644
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -19,57 +19,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB2FUNCS_EXTRA += tramp.S
-
-# These can't end up in shared libgcc
-LIB2FUNCS_STATIC_EXTRA = eabi.S
-
-eabi.S: $(srcdir)/config/rs6000/eabi.asm
- cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
-
-tramp.S: $(srcdir)/config/rs6000/tramp.asm
- cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
-
# Switch synonyms
MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
-
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
- crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
- ecrti$(objext) ecrtn$(objext) \
- ncrti$(objext) ncrtn$(objext)
-
-# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
-# end labels to all of the special sections used when we link using gcc.
-
-# Assemble startup files.
-ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
- cat $(srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
-
-ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
- cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
-
-ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
- cat $(srcdir)/config/rs6000/sol-ci.asm >ncrti.S
-
-ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
- cat $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
-
-# Build multiple copies of ?crt{i,n}.o, one for each target switch.
-$(T)ecrti$(objext): ecrti.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrti.S -o $(T)ecrti$(objext)
-
-$(T)ecrtn$(objext): ecrtn.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrtn.S -o $(T)ecrtn$(objext)
-
-$(T)ncrti$(objext): ncrti.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrti.S -o $(T)ncrti$(objext)
-
-$(T)ncrtn$(objext): ncrtn.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
-
-# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
-CRTSTUFF_T_CFLAGS = -msdata=none
-# Make sure crt*.o are built with -fPIC even if configured with
-# --enable-shared --disable-multilib
-CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems
index cad98c51cab..74465b74adb 100644
--- a/gcc/config/rs6000/t-rtems
+++ b/gcc/config/rs6000/t-rtems
@@ -19,14 +19,12 @@
# <http://www.gnu.org/licenses/>.
MULTILIB_OPTIONS = \
-mcpu=403/mcpu=505/mcpu=601/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400 \
-Dmpc8260 \
-msoft-float
+mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 \
+msoft-float/mfloat-gprs=double
MULTILIB_DIRNAMES = \
-m403 m505 m601 m603e m604 m860 m7400 \
-mpc8260 \
-nof
+m403 m505 m603e m604 m860 m7400 m8540 \
+nof gprsdouble
# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
MULTILIB_MATCHES =
@@ -47,6 +45,13 @@ MULTILIB_MATCHES += mcpu?7400=mcpu?7450
# Map 750 to .
MULTILIB_MATCHES += mcpu?750=
+# Map 8548 to 8540
+MULTILIB_MATCHES += mcpu?8540=mcpu?8548
+
+# Map -mcpu=8540 -mfloat-gprs=single to -mcpu=8540
+# (mfloat-gprs=single is implicit default)
+MULTILIB_MATCHES += mcpu?8540=mcpu?8540/mfloat-gprs?single
+
# Soft-float only, default implies msoft-float
# NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES
MULTILIB_SOFTFLOAT_ONLY = \
@@ -62,6 +67,16 @@ MULTILIB_SOFTFLOAT_ONLY = \
MULTILIB_HARDFLOAT_ONLY = \
*mcpu=505/*msoft-float*
+# Targets which do not support gprs
+MULTILIB_NOGPRS = \
+mfloat-gprs=* \
+*mcpu=403/*mfloat-gprs=* \
+*mcpu=505/*mfloat-gprs=* \
+*mcpu=603e/*mfloat-gprs=* \
+*mcpu=604/*mfloat-gprs=* \
+*mcpu=860/*mfloat-gprs=* \
+*mcpu=7400/*mfloat-gprs=*
+
MULTILIB_EXCEPTIONS =
# Disallow -Dppc and -Dmpc without other options
@@ -69,14 +84,5 @@ MULTILIB_EXCEPTIONS += Dppc* Dmpc*
MULTILIB_EXCEPTIONS += \
${MULTILIB_SOFTFLOAT_ONLY} \
-${MULTILIB_HARDFLOAT_ONLY}
-
-# Special rules
-# Take out all variants we don't want
-MULTILIB_EXCEPTIONS += *mcpu=403/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=505/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=601/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=604/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=750/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=860/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=7400/Dmpc*
+${MULTILIB_HARDFLOAT_ONLY} \
+${MULTILIB_NOGPRS}
diff --git a/gcc/config/rs6000/t-spe b/gcc/config/rs6000/t-spe
index cbbac79f661..1bed1e32b0e 100644
--- a/gcc/config/rs6000/t-spe
+++ b/gcc/config/rs6000/t-spe
@@ -18,9 +18,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
# What we really want are these variants:
# -mcpu=7400
# -mcpu=7400 -maltivec -mabi=altivec
diff --git a/gcc/config/rs6000/t-vxworks b/gcc/config/rs6000/t-vxworks
index 8a3d394ed77..c0128ed845f 100644
--- a/gcc/config/rs6000/t-vxworks
+++ b/gcc/config/rs6000/t-vxworks
@@ -1,6 +1,6 @@
# Multilibs for VxWorks.
#
-# Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005, 2006, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -23,12 +23,3 @@ MULTILIB_OPTIONS = mrtp fPIC msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = fPIC=fpic
MULTILIB_EXCEPTIONS = fPIC*
-
-# This is set from the common config/t-vxworks but clobbered by t-ppccomm
-# on this target.
-EXTRA_MULTILIB_PARTS =
-
-# Similarily, LIB2FUNCS_EXTRA is set from config/t-vxworks and
-# t-ppccomm *adds* to it, but the common contents are useful to us.
-# In particular the base trampoline_setup bits are expected to be
-# provided there.
diff --git a/gcc/config/rx/t-rx b/gcc/config/rx/t-rx
index ad667bcc5c9..9a5dca9056a 100644
--- a/gcc/config/rx/t-rx
+++ b/gcc/config/rx/t-rx
@@ -27,8 +27,3 @@ MULTILIB_MATCHES = nofpu=mnofpu nofpu=mcpu?rx200
MULTILIB_EXCEPTIONS =
MULTILIB_EXTRA_OPTS =
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
diff --git a/gcc/config/score/t-score-elf b/gcc/config/score/t-score-elf
deleted file mode 100644
index fd080c1b1fe..00000000000
--- a/gcc/config/score/t-score-elf
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/score/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/score/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/score/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/score/crtn.asm
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 1e654801334..cc26e05a764 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1983,7 +1983,7 @@ struct sh_args {
that the native compiler puts too large (> 32) immediate shift counts
into a register and shifts by the register, letting the SH decide what
to do instead of doing that itself. */
-/* ??? The library routines in lib1funcs.asm truncate the shift count.
+/* ??? The library routines in lib1funcs.S truncate the shift count.
However, the SH3 has hardware shifts that do not truncate exactly as gcc
expects - the sign bit is significant - so it appears that we need to
leave this zero for correct SH3 code. */
diff --git a/gcc/config/sh/t-elf b/gcc/config/sh/t-elf
deleted file mode 100644
index 333efb54e09..00000000000
--- a/gcc/config/sh/t-elf
+++ /dev/null
@@ -1,10 +0,0 @@
-EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o \
- crtbegin.o crtend.o crtbeginS.o crtendS.o $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
-# Don't compile libgcc with -fpic for now. It's unlikely that we'll
-# build shared libraries for embedded SH.
-# Linux / Netbsd will already have set TARGET_LIBGCC2_CFLAGS.
-# TARGET_LIBGCC2_CFLAGS = -fpic
diff --git a/gcc/config/sh/t-linux b/gcc/config/sh/t-linux
index 13ff848dd7c..d33c6383915 100644
--- a/gcc/config/sh/t-linux
+++ b/gcc/config/sh/t-linux
@@ -1,8 +1,2 @@
-LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
-
-LIB2FUNCS_EXTRA= $(srcdir)/config/sh/linux-atomic.asm
-
MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
-
-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/sh/t-linux64 b/gcc/config/sh/t-linux64
deleted file mode 100644
index 126b0163754..00000000000
--- a/gcc/config/sh/t-linux64
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
index e63131a5348..1d305ee5193 100644
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -22,15 +22,6 @@ sh-c.o: $(srcdir)/config/sh/sh-c.c \
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/sh/sh-c.c
-LIB1ASMSRC = sh/lib1funcs.asm
-LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \
- _movmem_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
- _div_table _udiv_qrnnd_16 \
- $(LIB1ASMFUNCS_CACHE)
-LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
-
-TARGET_LIBGCC2_CFLAGS = -mieee
-
DEFAULT_ENDIAN = $(word 1,$(TM_ENDIAN_CONFIG))
OTHER_ENDIAN = $(word 2,$(TM_ENDIAN_CONFIG))
@@ -91,58 +82,9 @@ MULTILIB_OSDIRNAMES = \
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-$(T)crt1.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-$(T)crti.o: $(srcdir)/config/sh/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sh/crti.asm
-$(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sh/crtn.asm
-
$(out_object_file): gt-sh.h
gt-sh.h : s-gtype ; @true
-# These are not suitable for COFF.
-# EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
-
-IC_EXTRA_PARTS= libic_invalidate_array_4-100.a libic_invalidate_array_4-200.a \
-libic_invalidate_array_4a.a
-OPT_EXTRA_PARTS= libgcc-Os-4-200.a libgcc-4-300.a
-EXTRA_MULTILIB_PARTS= $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-$(T)ic_invalidate_array_4-100.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-100.o -DL_ic_invalidate_array -DWAYS=1 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4-100.a: $(T)ic_invalidate_array_4-100.o $(GCC_PASSES)
- $(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-100.a $(T)ic_invalidate_array_4-100.o
-
-$(T)ic_invalidate_array_4-200.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-200.o -DL_ic_invalidate_array -DWAYS=2 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4-200.a: $(T)ic_invalidate_array_4-200.o $(GCC_PASSES)
- $(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-200.a $(T)ic_invalidate_array_4-200.o
-
-$(T)ic_invalidate_array_4a.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4a.o -DL_ic_invalidate_array -D__FORCE_SH4A__ -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4a.a: $(T)ic_invalidate_array_4a.o $(GCC_PASSES)
- $(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4a.a $(T)ic_invalidate_array_4a.o
-
-$(T)sdivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_sdivsi3_i4i -x assembler-with-cpp $<
-$(T)udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_udivsi3_i4i -x assembler-with-cpp $<
-$(T)unwind-dw2-Os-4-200.o: $(srcdir)/../libgcc/unwind-dw2.c $(srcdir)/../libgcc/unwind-generic.h $(srcdir)/../libgcc/unwind-pe.h $(srcdir)/../libgcc/unwind.inc $(srcdir)/../libgcc/unwind-dw2-fde.h $(srcdir)/../libgcc/unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) $(LIBGCC2_CFLAGS) $(INCLUDES) $(vis_hide) -fexceptions -Os -c -o $@ $<
-OBJS_Os_4_200=$(T)sdivsi3_i4i-Os-4-200.o $(T)udivsi3_i4i-Os-4-200.o $(T)unwind-dw2-Os-4-200.o
-$(T)libgcc-Os-4-200.a: $(OBJS_Os_4_200) $(GCC_PASSES)
- $(AR_CREATE_FOR_TARGET) $@ $(OBJS_Os_4_200)
-
-$(T)div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_div_table -x assembler-with-cpp $<
-
-$(T)libgcc-4-300.a: $(T)div_table-4-300.o $(GCC_PASSES)
- $(AR_CREATE_FOR_TARGET) $@ $(T)div_table-4-300.o
-
# Local Variables:
# mode: Makefile
# End:
diff --git a/gcc/config/sh/t-sh64 b/gcc/config/sh/t-sh64
index d88f929fd7a..3bd9205079b 100644
--- a/gcc/config/sh/t-sh64
+++ b/gcc/config/sh/t-sh64
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2005, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,13 +16,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMFUNCS = \
- _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
- _shcompact_call_trampoline _shcompact_return_trampoline \
- _shcompact_incoming_args _ic_invalidate _nested_trampoline \
- _push_pop_shmedia_regs \
- _udivdi3 _divdi3 _umoddi3 _moddi3 _div_table
-
MULTILIB_CPU_DIRS= $(ML_sh1) $(ML_sh2e) $(ML_sh2) $(ML_sh3e) $(ML_sh3) $(ML_sh4_nofpu) $(ML_sh4_single_only) $(ML_sh4_single) $(ML_sh4) $(ML_sh5_32media:m5-32media/=media32) $(ML_sh5_32media_nofpu:m5-32media-nofpu/=nofpu/media32) $(ML_sh5_compact:m5-compact/=compact) $(ML_sh5_compact_nofpu:m5-compact-nofpu/=nofpu/compact) $(ML_sh5_64media:m5-64media/=media64) $(ML_sh5_64media_nofpu:m5-64media-nofpu/=nofpu/media64)
MULTILIB_RAW_DIRNAMES= $(MULTILIB_ENDIAN:/mb= mb) $(MULTILIB_CPU_DIRS:/=)
diff --git a/gcc/config/sh/t-superh b/gcc/config/sh/t-superh
deleted file mode 100644
index 4e2d83dcba0..00000000000
--- a/gcc/config/sh/t-superh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2005, 2006 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/>.
-
-EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o \
- crtbegin.o crtend.o crtbeginS.o crtendS.o \
- crt1-mmu.o gcrt1-mmu.o gcrt1.o $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-# Compile crt1-mmu.o as crt1.o with -DMMU_SUPPORT
-$(T)crt1-mmu.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1-mmu.o -DMMU_SUPPORT -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-
-# Compile gcrt1-mmu.o as crt1-mmu.o with -DPROFILE
-$(T)gcrt1-mmu.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1-mmu.o -DPROFILE -DMMU_SUPPORT -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-
-# For sh4-400: Compile gcrt1.o as crt1.o with -DPROFILE
-$(T)gcrt1.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1.o -DPROFILE -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
diff --git a/gcc/config/sh/t-vxworks b/gcc/config/sh/t-vxworks
index 66aa7091ab1..d7ccc9b7f59 100644
--- a/gcc/config/sh/t-vxworks
+++ b/gcc/config/sh/t-vxworks
@@ -4,6 +4,3 @@ MULTILIB_OPTIONS = mrtp fPIC m2/m3/m4/m4a ml
# Don't build -fPIC without -mrtp, or -ml without -m3/-m4.
MULTILIB_EXCEPTIONS = fPIC* ml* mrtp/ml* mrtp/fPIC/ml* *m2/ml*
MULTILIB_MATCHES = m2=m4-nofpu fPIC=fpic
-
-# Restore a variable from t-vxworks clobbered by t-elf.
-EXTRA_MULTILIB_PARTS =
diff --git a/gcc/config/sparc/lb1spl.asm b/gcc/config/sparc/lb1spl.asm
deleted file mode 100644
index 973401f8018..00000000000
--- a/gcc/config/sparc/lb1spl.asm
+++ /dev/null
@@ -1,246 +0,0 @@
-/* This is an assembly language implementation of mulsi3, divsi3, and modsi3
- for the sparclite processor.
-
- These routines are all from the SPARClite User's Guide, slightly edited
- to match the desired calling convention, and also to optimize them. */
-
-#ifdef L_udivsi3
-.text
- .align 4
- .global .udiv
- .proc 04
-.udiv:
- wr %g0,%g0,%y ! Not a delayed write for sparclite
- tst %g0
- divscc %o0,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- retl
- divscc %g1,%o1,%o0
-#endif
-
-#ifdef L_umodsi3
-.text
- .align 4
- .global .urem
- .proc 04
-.urem:
- wr %g0,%g0,%y ! Not a delayed write for sparclite
- tst %g0
- divscc %o0,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- divscc %g1,%o1,%g1
- bl 1f
- rd %y,%o0
- retl
- nop
-1: retl
- add %o0,%o1,%o0
-#endif
-
-#ifdef L_divsi3
-.text
- .align 4
- .global .div
- .proc 04
-! ??? This routine could be made faster if was optimized, and if it was
-! rewritten to only calculate the quotient.
-.div:
- wr %g0,%g0,%y ! Not a delayed write for sparclite
- mov %o1,%o4
- tst %o1
- bl,a 1f
- sub %g0,%o4,%o4
-1: tst %o0
- bl,a 2f
- mov -1,%y
-2: divscc %o0,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- be 6f
- mov %y,%o3
- bg 4f
- addcc %o3,%o4,%g0
- be,a 6f
- mov %g0,%o3
- tst %o0
- bl 5f
- tst %g1
- ba 5f
- add %o3,%o4,%o3
-4: subcc %o3,%o4,%g0
- be,a 6f
- mov %g0,%o3
- tst %o0
- bge 5f
- tst %g1
- sub %o3,%o4,%o3
-5: bl,a 6f
- add %g1,1,%g1
-6: tst %o1
- bl,a 7f
- sub %g0,%g1,%g1
-7: retl
- mov %g1,%o0 ! Quotient is in %g1.
-#endif
-
-#ifdef L_modsi3
-.text
- .align 4
- .global .rem
- .proc 04
-! ??? This routine could be made faster if was optimized, and if it was
-! rewritten to only calculate the remainder.
-.rem:
- wr %g0,%g0,%y ! Not a delayed write for sparclite
- mov %o1,%o4
- tst %o1
- bl,a 1f
- sub %g0,%o4,%o4
-1: tst %o0
- bl,a 2f
- mov -1,%y
-2: divscc %o0,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- divscc %g1,%o4,%g1
- be 6f
- mov %y,%o3
- bg 4f
- addcc %o3,%o4,%g0
- be,a 6f
- mov %g0,%o3
- tst %o0
- bl 5f
- tst %g1
- ba 5f
- add %o3,%o4,%o3
-4: subcc %o3,%o4,%g0
- be,a 6f
- mov %g0,%o3
- tst %o0
- bge 5f
- tst %g1
- sub %o3,%o4,%o3
-5: bl,a 6f
- add %g1,1,%g1
-6: tst %o1
- bl,a 7f
- sub %g0,%g1,%g1
-7: retl
- mov %o3,%o0 ! Remainder is in %o3.
-#endif
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 6431405b87f..5d22fc0313e 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -3440,7 +3440,7 @@ sparc_legitimate_address_p (enum machine_mode mode, rtx addr, bool strict)
REG+REG address, then only one of them gets converted to an
offsettable address. */
if (mode == TFmode
- && ! (TARGET_FPU && TARGET_ARCH64 && TARGET_HARD_QUAD))
+ && ! (TARGET_ARCH64 && TARGET_HARD_QUAD))
return 0;
/* We prohibit REG + REG on ARCH32 if not optimizing for
@@ -11280,64 +11280,333 @@ output_v8plus_mult (rtx insn, rtx *operands, const char *name)
}
static void
-vector_init_bshuffle (rtx target, rtx elt, enum machine_mode mode,
+vector_init_bshuffle (rtx target, rtx *locs, int n_elts, enum machine_mode mode,
enum machine_mode inner_mode)
{
- rtx t1, final_insn;
- int bmask;
+ rtx mid_target, r0_high, r0_low, r1_high, r1_low;
+ enum machine_mode partial_mode;
+ int bmask, i, idxs[8];
- t1 = gen_reg_rtx (mode);
+ partial_mode = (mode == V4HImode
+ ? V2HImode
+ : (mode == V8QImode
+ ? V4QImode : mode));
- elt = convert_modes (SImode, inner_mode, elt, true);
- emit_move_insn (gen_lowpart(SImode, t1), elt);
+ r0_high = r0_low = NULL_RTX;
+ r1_high = r1_low = NULL_RTX;
- switch (mode)
+ /* Move the pieces into place, as needed, and calculate the nibble
+ indexes for the bmask calculation. After we execute this loop the
+ locs[] array is no longer needed. Therefore, to simplify things,
+ we set entries that have been processed already to NULL_RTX. */
+
+ for (i = 0; i < n_elts; i++)
+ {
+ int j;
+
+ if (locs[i] == NULL_RTX)
+ continue;
+
+ if (!r0_low)
{
- case V2SImode:
- final_insn = gen_bshufflev2si_vis (target, t1, t1);
- bmask = 0x45674567;
- break;
- case V4HImode:
- final_insn = gen_bshufflev4hi_vis (target, t1, t1);
- bmask = 0x67676767;
+ r0_low = locs[i];
+ idxs[i] = 0x7;
+ }
+ else if (!r1_low)
+ {
+ r1_low = locs[i];
+ idxs[i] = 0xf;
+ }
+ else if (!r0_high)
+ {
+ r0_high = gen_highpart (partial_mode, r0_low);
+ emit_move_insn (r0_high, gen_lowpart (partial_mode, locs[i]));
+ idxs[i] = 0x3;
+ }
+ else if (!r1_high)
+ {
+ r1_high = gen_highpart (partial_mode, r1_low);
+ emit_move_insn (r1_high, gen_lowpart (partial_mode, locs[i]));
+ idxs[i] = 0xb;
+ }
+ else
+ gcc_unreachable ();
+
+ for (j = i + 1; j < n_elts; j++)
+ {
+ if (locs[j] == locs[i])
+ {
+ locs[j] = NULL_RTX;
+ idxs[j] = idxs[i];
+ }
+ }
+ locs[i] = NULL_RTX;
+ }
+
+ bmask = 0;
+ for (i = 0; i < n_elts; i++)
+ {
+ int v = idxs[i];
+
+ switch (GET_MODE_SIZE (inner_mode))
+ {
+ case 2:
+ bmask <<= 8;
+ bmask |= (((v - 1) << 4) | v);
break;
- case V8QImode:
- final_insn = gen_bshufflev8qi_vis (target, t1, t1);
- bmask = 0x77777777;
+
+ case 1:
+ bmask <<= 4;
+ bmask |= v;
break;
+
default:
gcc_unreachable ();
}
+ }
+
+ emit_insn (gen_bmasksi_vis (gen_reg_rtx (SImode), CONST0_RTX (SImode),
+ force_reg (SImode, GEN_INT (bmask))));
+
+ mid_target = target;
+ if (GET_MODE_SIZE (mode) == 4)
+ {
+ mid_target = gen_reg_rtx (mode == V2HImode
+ ? V4HImode : V8QImode);
+ }
+
+ if (!r1_low)
+ r1_low = r0_low;
+
+ switch (GET_MODE (mid_target))
+ {
+ case V4HImode:
+ emit_insn (gen_bshufflev4hi_vis (mid_target, r0_low, r1_low));
+ break;
+ case V8QImode:
+ emit_insn (gen_bshufflev8qi_vis (mid_target, r0_low, r1_low));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (mid_target != target)
+ emit_move_insn (target, gen_lowpart (partial_mode, mid_target));
+}
+
+static bool
+vector_init_move_words (rtx target, rtx vals, enum machine_mode mode,
+ enum machine_mode inner_mode)
+{
+ switch (mode)
+ {
+ case V1SImode:
+ case V1DImode:
+ emit_move_insn (gen_lowpart (inner_mode, target),
+ gen_lowpart (inner_mode, XVECEXP (vals, 0, 0)));
+ return true;
+
+ case V2SImode:
+ emit_move_insn (gen_highpart (SImode, target), XVECEXP (vals, 0, 0));
+ emit_move_insn (gen_lowpart (SImode, target), XVECEXP (vals, 0, 1));
+ return true;
+
+ default:
+ break;
+ }
+ return false;
+}
+
+/* Move the elements in rtvec VALS into registers compatible with MODE.
+ Store the rtx for these regs into the corresponding array entry of
+ LOCS. */
+static void
+vector_init_prepare_elts (rtx vals, int n_elts, rtx *locs, enum machine_mode mode,
+ enum machine_mode inner_mode)
+{
+ enum machine_mode loc_mode;
+ int i;
+
+ switch (mode)
+ {
+ case V2HImode:
+ loc_mode = V4HImode;
+ break;
+
+ case V4QImode:
+ loc_mode = V8QImode;
+ break;
+
+ case V4HImode:
+ case V8QImode:
+ loc_mode = mode;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ gcc_assert (GET_MODE_SIZE (inner_mode) <= 4);
+ for (i = 0; i < n_elts; i++)
+ {
+ rtx dst, elt = XVECEXP (vals, 0, i);
+ int j;
+
+ /* Did we see this already? If so just record it's location. */
+ dst = NULL_RTX;
+ for (j = 0; j < i; j++)
+ {
+ if (XVECEXP (vals, 0, j) == elt)
+ {
+ dst = locs[j];
+ break;
+ }
+ }
+
+ if (! dst)
+ {
+ enum rtx_code code = GET_CODE (elt);
+
+ dst = gen_reg_rtx (loc_mode);
+
+ /* We use different strategies based upon whether the element
+ is in memory or in a register. When we start in a register
+ and we're VIS3 capable, it's always cheaper to use the VIS3
+ int-->fp register moves since we avoid having to use stack
+ memory. */
+ if ((TARGET_VIS3 && (code == REG || code == SUBREG))
+ || (CONSTANT_P (elt)
+ && (const_zero_operand (elt, inner_mode)
+ || const_all_ones_operand (elt, inner_mode))))
+ {
+ elt = convert_modes (SImode, inner_mode, elt, true);
+
+ emit_clobber (dst);
+ emit_move_insn (gen_lowpart (SImode, dst), elt);
+ }
+ else
+ {
+ rtx m = elt;
+
+ if (CONSTANT_P (elt))
+ {
+ m = force_const_mem (inner_mode, elt);
+ }
+ else if (code != MEM)
+ {
+ rtx stk = assign_stack_temp (inner_mode, GET_MODE_SIZE(inner_mode), 0);
+ emit_move_insn (stk, elt);
+ m = stk;
+ }
+
+ switch (loc_mode)
+ {
+ case V4HImode:
+ emit_insn (gen_zero_extend_v4hi_vis (dst, m));
+ break;
+ case V8QImode:
+ emit_insn (gen_zero_extend_v8qi_vis (dst, m));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ }
+ locs[i] = dst;
+ }
+}
+
+static void
+sparc_expand_vector_init_vis2 (rtx target, rtx *locs, int n_elts, int n_unique,
+ enum machine_mode mode,
+ enum machine_mode inner_mode)
+{
+ if (n_unique <= 4)
+ {
+ vector_init_bshuffle (target, locs, n_elts, mode, inner_mode);
+ }
+ else
+ {
+ int i;
- emit_insn (gen_bmasksi_vis (gen_reg_rtx (SImode), CONST0_RTX (SImode),
- force_reg (SImode, GEN_INT (bmask))));
- emit_insn (final_insn);
+ gcc_assert (mode == V8QImode);
+
+ emit_insn (gen_alignaddrsi_vis (gen_reg_rtx (SImode),
+ force_reg (SImode, GEN_INT (7)),
+ CONST0_RTX (SImode)));
+ i = n_elts - 1;
+ emit_insn (gen_faligndatav8qi_vis (target, locs[i], locs[i]));
+ while (--i >= 0)
+ emit_insn (gen_faligndatav8qi_vis (target, locs[i], target));
+ }
}
static void
-vector_init_fpmerge (rtx target, rtx elt, enum machine_mode inner_mode)
+sparc_expand_vector_init_vis1 (rtx target, rtx *locs, int n_elts, int n_unique,
+ enum machine_mode mode)
{
- rtx t1, t2, t3, t3_low;
+ enum machine_mode full_mode = mode;
+ rtx (*emitter)(rtx, rtx, rtx);
+ int alignaddr_val, i;
+ rtx tmp = target;
+
+ if (n_unique == 1 && mode == V8QImode)
+ {
+ rtx t2, t2_low, t1;
+
+ t1 = gen_reg_rtx (V4QImode);
+ emit_move_insn (t1, gen_lowpart (V4QImode, locs[0]));
- t1 = gen_reg_rtx (V4QImode);
- elt = convert_modes (SImode, inner_mode, elt, true);
- emit_move_insn (gen_lowpart (SImode, t1), elt);
+ t2 = gen_reg_rtx (V8QImode);
+ t2_low = gen_lowpart (V4QImode, t2);
+
+ /* xxxxxxAA --> xxxxxxxxxxxxAAAA
+ xxxxAAAA --> xxxxxxxxAAAAAAAA
+ AAAAAAAA --> AAAAAAAAAAAAAAAA */
+ emit_insn (gen_fpmerge_vis (t2, t1, t1));
+ emit_move_insn (t1, t2_low);
+ emit_insn (gen_fpmerge_vis (t2, t1, t1));
+ emit_move_insn (t1, t2_low);
+ emit_insn (gen_fpmerge_vis (target, t1, t1));
+ return;
+ }
+
+ switch (mode)
+ {
+ case V2HImode:
+ full_mode = V4HImode;
+ /* FALLTHRU */
+ case V4HImode:
+ emitter = gen_faligndatav4hi_vis;
+ alignaddr_val = 6;
+ break;
+
+ case V4QImode:
+ full_mode = V8QImode;
+ /* FALLTHRU */
+ case V8QImode:
+ emitter = gen_faligndatav8qi_vis;
+ alignaddr_val = 7;
+ break;
- t2 = gen_reg_rtx (V4QImode);
- emit_move_insn (t2, t1);
+ default:
+ gcc_unreachable ();
+ }
- t3 = gen_reg_rtx (V8QImode);
- t3_low = gen_lowpart (V4QImode, t3);
+ if (full_mode != mode)
+ tmp = gen_reg_rtx (full_mode);
- emit_insn (gen_fpmerge_vis (t3, t1, t2));
- emit_move_insn (t1, t3_low);
- emit_move_insn (t2, t3_low);
+ emit_insn (gen_alignaddrsi_vis (gen_reg_rtx (SImode),
+ force_reg (SImode, GEN_INT (alignaddr_val)),
+ CONST0_RTX (SImode)));
- emit_insn (gen_fpmerge_vis (t3, t1, t2));
- emit_move_insn (t1, t3_low);
- emit_move_insn (t2, t3_low);
+ i = n_elts - 1;
+ emit_insn (emitter (tmp, locs[i], locs[i]));
+ while (--i >= 0)
+ emit_insn (emitter (tmp, locs[i], tmp));
- emit_insn (gen_fpmerge_vis (gen_lowpart (V8QImode, target), t1, t2));
+ if (tmp != target)
+ emit_move_insn (target, gen_highpart (mode, tmp));
}
void
@@ -11346,19 +11615,30 @@ sparc_expand_vector_init (rtx target, rtx vals)
enum machine_mode mode = GET_MODE (target);
enum machine_mode inner_mode = GET_MODE_INNER (mode);
int n_elts = GET_MODE_NUNITS (mode);
- int i, n_var = 0;
- bool all_same;
- rtx mem;
+ int i, n_var = 0, n_unique = 0;
+ rtx locs[8];
+
+ gcc_assert (n_elts <= 8);
- all_same = true;
for (i = 0; i < n_elts; i++)
{
rtx x = XVECEXP (vals, 0, i);
+ bool found = false;
+ int j;
+
if (!CONSTANT_P (x))
n_var++;
- if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0)))
- all_same = false;
+ for (j = 0; j < i; j++)
+ {
+ if (rtx_equal_p (x, XVECEXP (vals, 0, j)))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ n_unique++;
}
if (n_var == 0)
@@ -11367,51 +11647,16 @@ sparc_expand_vector_init (rtx target, rtx vals)
return;
}
- if (GET_MODE_SIZE (inner_mode) == GET_MODE_SIZE (mode))
- {
- if (GET_MODE_SIZE (inner_mode) == 4)
- {
- emit_move_insn (gen_lowpart (SImode, target),
- gen_lowpart (SImode, XVECEXP (vals, 0, 0)));
- return;
- }
- else if (GET_MODE_SIZE (inner_mode) == 8)
- {
- emit_move_insn (gen_lowpart (DImode, target),
- gen_lowpart (DImode, XVECEXP (vals, 0, 0)));
- return;
- }
- }
- else if (GET_MODE_SIZE (inner_mode) == GET_MODE_SIZE (word_mode)
- && GET_MODE_SIZE (mode) == 2 * GET_MODE_SIZE (word_mode))
- {
- emit_move_insn (gen_highpart (word_mode, target),
- gen_lowpart (word_mode, XVECEXP (vals, 0, 0)));
- emit_move_insn (gen_lowpart (word_mode, target),
- gen_lowpart (word_mode, XVECEXP (vals, 0, 1)));
- return;
- }
+ if (vector_init_move_words (target, vals, mode, inner_mode))
+ return;
- if (all_same && GET_MODE_SIZE (mode) == 8)
- {
- if (TARGET_VIS2)
- {
- vector_init_bshuffle (target, XVECEXP (vals, 0, 0), mode, inner_mode);
- return;
- }
- if (mode == V8QImode)
- {
- vector_init_fpmerge (target, XVECEXP (vals, 0, 0), inner_mode);
- return;
- }
- }
+ vector_init_prepare_elts (vals, n_elts, locs, mode, inner_mode);
- mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
- for (i = 0; i < n_elts; i++)
- emit_move_insn (adjust_address_nv (mem, inner_mode,
- i * GET_MODE_SIZE (inner_mode)),
- XVECEXP (vals, 0, i));
- emit_move_insn (target, mem);
+ if (TARGET_VIS2)
+ sparc_expand_vector_init_vis2 (target, locs, n_elts, n_unique,
+ mode, inner_mode);
+ else
+ sparc_expand_vector_init_vis1 (target, locs, n_elts, n_unique, mode);
}
static reg_class_t
@@ -11485,12 +11730,16 @@ sparc_expand_conditional_move (enum machine_mode mode, rtx *operands)
rtx cc_reg, dst, cmp;
cmp = operands[1];
- cmp_mode = GET_MODE (XEXP (cmp, 0));
- if (cmp_mode == DImode && !TARGET_ARCH64)
+ if (GET_MODE (XEXP (cmp, 0)) == DImode && !TARGET_ARCH64)
return false;
- dst = operands[0];
+ if (GET_MODE (XEXP (cmp, 0)) == TFmode && !TARGET_HARD_QUAD)
+ cmp = sparc_emit_float_lib_cmp (XEXP (cmp, 0), XEXP (cmp, 1), rc);
+ cmp_mode = GET_MODE (XEXP (cmp, 0));
+ rc = GET_CODE (cmp);
+
+ dst = operands[0];
if (! rtx_equal_p (operands[2], dst)
&& ! rtx_equal_p (operands[3], dst))
{
@@ -11509,9 +11758,6 @@ sparc_expand_conditional_move (enum machine_mode mode, rtx *operands)
rc = reverse_condition (rc);
}
- if (cmp_mode == TFmode && !TARGET_HARD_QUAD)
- cmp = sparc_emit_float_lib_cmp (XEXP (cmp, 0), XEXP (cmp, 1), rc);
-
if (XEXP (cmp, 1) == const0_rtx
&& GET_CODE (XEXP (cmp, 0)) == REG
&& cmp_mode == DImode
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 65b45271890..e8707f50577 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -328,6 +328,7 @@ extern enum cmodel sparc_cmodel;
%{mcpu=sparclite:-Asparclite} \
%{mcpu=sparclite86x:-Asparclite} \
%{mcpu=f930:-Asparclite} %{mcpu=f934:-Asparclite} \
+%{mcpu=v8:-Av8} \
%{mv8plus:-Av8plus} \
%{mcpu=v9:-Av9} \
%{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 592440389e5..56f4dc06804 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -2041,8 +2041,8 @@
})
(define_insn "*movsf_insn"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,f, *r,*r,*r,*r, f, f,*r, m, m")
- (match_operand:SF 1 "input_operand" "G,C,f,*rR, Q, S, f,*r, m, m, f,*rG"))]
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,f, *r,*r,*r,*r, f,f,*r,m, m")
+ (match_operand:SF 1 "input_operand" "G,C,f,*rR, Q, S, f,*r,m, m,f,*rG"))]
"(register_operand (operands[0], SFmode)
|| register_or_zero_or_all_ones_operand (operands[1], SFmode))"
{
@@ -2138,8 +2138,8 @@
})
(define_insn "*movdf_insn_sp32"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,e,*r, f, e,T,W,U,T, f, *r, o,o")
- (match_operand:DF 1 "input_operand" "G,C,e,e, f,*r,W#F,G,e,T,U,o#F,*roGF,*rG,f"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,e,*r, f, e,T,W,U,T, f, *r, o,o")
+ (match_operand:DF 1 "input_operand" "G,C,e,e, f,*r,W#F,G,e,T,U,o#F,*roF,*rG,f"))]
"! TARGET_ARCH64
&& (register_operand (operands[0], DFmode)
|| register_or_zero_or_all_ones_operand (operands[1], DFmode))"
@@ -2166,7 +2166,7 @@
(define_insn "*movdf_insn_sp64"
[(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,*r, e, e,W, *r,*r, m,*r")
- (match_operand:DF 1 "input_operand" "G,C,e, e,*r,W#F,e,*rG, m,*rG, F"))]
+ (match_operand:DF 1 "input_operand" "G,C,e, e,*r,W#F,e,*rG, m,*rG, F"))]
"TARGET_ARCH64
&& (register_operand (operands[0], DFmode)
|| register_or_zero_or_all_ones_operand (operands[1], DFmode))"
@@ -2191,9 +2191,8 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(match_operand:DF 1 "const_double_operand" ""))]
- "TARGET_FPU
- && (GET_CODE (operands[0]) == REG
- && SPARC_INT_REG_P (REGNO (operands[0])))
+ "REG_P (operands[0])
+ && SPARC_INT_REG_P (REGNO (operands[0]))
&& ! const_zero_operand (operands[1], GET_MODE (operands[0]))
&& reload_completed"
[(clobber (const_int 0))]
@@ -2378,45 +2377,30 @@
})
(define_insn "*movtf_insn_sp32"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,U,r")
- (match_operand:TF 1 "input_operand" "G,oe,GeUr,o,roG"))]
- "TARGET_FPU
- && ! TARGET_ARCH64
- && (register_operand (operands[0], TFmode)
- || register_or_zero_operand (operands[1], TFmode))"
- "#"
- [(set_attr "length" "4")])
-
-;; Exactly the same as above, except that all `e' cases are deleted.
-;; This is necessary to prevent reload from ever trying to use a `e' reg
-;; when -mno-fpu.
-
-(define_insn "*movtf_insn_sp32_no_fpu"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=o,U,o,r,o")
- (match_operand:TF 1 "input_operand" "G,o,U,roG,r"))]
- "! TARGET_FPU
- && ! TARGET_ARCH64
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=b, e,o, o,U, r")
+ (match_operand:TF 1 "input_operand" " G,oe,e,rGU,o,roG"))]
+ "! TARGET_ARCH64
&& (register_operand (operands[0], TFmode)
|| register_or_zero_operand (operands[1], TFmode))"
"#"
- [(set_attr "length" "4")])
+ [(set_attr "length" "4,4,4,4,4,4")
+ (set_attr "cpu_feature" "fpu,fpu,fpu,*,*,*")])
(define_insn "*movtf_insn_sp64"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,r")
- (match_operand:TF 1 "input_operand" "G,oe,Ger,roG"))]
- "TARGET_FPU
- && TARGET_ARCH64
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=b, e,o, o, r")
+ (match_operand:TF 1 "input_operand" "G,oe,e,rG,roG"))]
+ "TARGET_ARCH64
&& ! TARGET_HARD_QUAD
&& (register_operand (operands[0], TFmode)
|| register_or_zero_operand (operands[1], TFmode))"
"#"
- [(set_attr "length" "2")])
+ [(set_attr "length" "2,2,2,2,2")
+ (set_attr "cpu_feature" "fpu,fpu,fpu,*,*")])
(define_insn "*movtf_insn_sp64_hq"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,e,m,o,r")
- (match_operand:TF 1 "input_operand" "G,e,m,e,rG,roG"))]
- "TARGET_FPU
- && TARGET_ARCH64
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,e,m, o, r")
+ (match_operand:TF 1 "input_operand" "G,e,m,e,rG,roG"))]
+ "TARGET_ARCH64
&& TARGET_HARD_QUAD
&& (register_operand (operands[0], TFmode)
|| register_or_zero_operand (operands[1], TFmode))"
@@ -2430,16 +2414,6 @@
[(set_attr "type" "*,fpmove,fpload,fpstore,*,*")
(set_attr "length" "2,*,*,*,2,2")])
-(define_insn "*movtf_insn_sp64_no_fpu"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o")
- (match_operand:TF 1 "input_operand" "orG,rG"))]
- "! TARGET_FPU
- && TARGET_ARCH64
- && (register_operand (operands[0], TFmode)
- || register_or_zero_operand (operands[1], TFmode))"
- "#"
- [(set_attr "length" "2")])
-
;; Now all the splits to handle multi-insn TF mode moves.
(define_split
[(set (match_operand:TF 0 "register_operand" "")
@@ -7856,6 +7830,60 @@
DONE;
})
+(define_expand "zero_extend_v8qi_vis"
+ [(set (match_operand:V8QI 0 "register_operand" "")
+ (vec_merge:V8QI
+ (vec_duplicate:V8QI
+ (match_operand:QI 1 "memory_operand" ""))
+ (match_dup 2)
+ (const_int 254)))]
+ "TARGET_VIS"
+{
+ if (! REG_P (XEXP (operands[1], 0)))
+ {
+ rtx addr = force_reg (Pmode, XEXP (operands[1], 0));
+ operands[1] = replace_equiv_address (operands[1], addr);
+ }
+ operands[2] = CONST0_RTX (V8QImode);
+})
+
+(define_expand "zero_extend_v4hi_vis"
+ [(set (match_operand:V4HI 0 "register_operand" "")
+ (vec_merge:V4HI
+ (vec_duplicate:V4HI
+ (match_operand:HI 1 "memory_operand" ""))
+ (match_dup 2)
+ (const_int 14)))]
+ "TARGET_VIS"
+{
+ if (! REG_P (XEXP (operands[1], 0)))
+ {
+ rtx addr = force_reg (Pmode, XEXP (operands[1], 0));
+ operands[1] = replace_equiv_address (operands[1], addr);
+ }
+ operands[2] = CONST0_RTX (V4HImode);
+})
+
+(define_insn "*zero_extend_v8qi_<P:mode>_insn"
+ [(set (match_operand:V8QI 0 "register_operand" "=e")
+ (vec_merge:V8QI
+ (vec_duplicate:V8QI
+ (mem:QI (match_operand:P 1 "register_operand" "r")))
+ (match_operand:V8QI 2 "const_zero_operand" "Y")
+ (const_int 254)))]
+ "TARGET_VIS"
+ "ldda\t[%1] 0xd0, %0")
+
+(define_insn "*zero_extend_v4hi_<P:mode>_insn"
+ [(set (match_operand:V4HI 0 "register_operand" "=e")
+ (vec_merge:V4HI
+ (vec_duplicate:V4HI
+ (mem:HI (match_operand:P 1 "register_operand" "r")))
+ (match_operand:V4HI 2 "const_zero_operand" "Y")
+ (const_int 14)))]
+ "TARGET_VIS"
+ "ldda\t[%1] 0xd2, %0")
+
(define_expand "vec_init<mode>"
[(match_operand:VMALL 0 "register_operand" "")
(match_operand:VMALL 1 "" "")]
diff --git a/gcc/config/sparc/t-elf b/gcc/config/sparc/t-elf
index 7073bcb7721..e9acfe3693e 100644
--- a/gcc/config/sparc/t-elf
+++ b/gcc/config/sparc/t-elf
@@ -17,12 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = sparc/lb1spc.asm
-LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
-
MULTILIB_OPTIONS = msoft-float mcpu=v8 mflat
MULTILIB_DIRNAMES = soft v8 flat
MULTILIB_MATCHES = msoft-float=mno-fpu
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/t-leon b/gcc/config/sparc/t-leon
index 4f9d0a9e797..25fc61136a9 100644
--- a/gcc/config/sparc/t-leon
+++ b/gcc/config/sparc/t-leon
@@ -16,15 +16,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = sparc/lb1spc.asm
-LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
-
# Multilibs for LEON
# LEON is a SPARC-V8, but the AT697 implementation has a bug in the
# V8-specific instructions.
MULTILIB_OPTIONS = mcpu=v7 msoft-float mflat
MULTILIB_DIRNAMES = v7 soft flat
MULTILIB_MATCHES = mcpu?v7=mv7 msoft-float=mno-fpu
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/t-leon3 b/gcc/config/sparc/t-leon3
index 0e7e45cc594..acdd1f2c67b 100644
--- a/gcc/config/sparc/t-leon3
+++ b/gcc/config/sparc/t-leon3
@@ -20,6 +20,3 @@
MULTILIB_OPTIONS = msoft-float
MULTILIB_DIRNAMES = soft
MULTILIB_MATCHES = msoft-float=mno-fpu
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/t-linux64 b/gcc/config/sparc/t-linux64
index 74d04898d9f..d9dfad66ce7 100644
--- a/gcc/config/sparc/t-linux64
+++ b/gcc/config/sparc/t-linux64
@@ -1,5 +1,5 @@
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004,
-# 2006, 2010 Free Software Foundation, Inc.
+# 2006, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -27,10 +27,3 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
- -print-multi-os-directory) \
- = x../lib64; then echo -mcmodel=medany; fi`
diff --git a/gcc/config/sparc/t-netbsd64 b/gcc/config/sparc/t-netbsd64
index 0fddb0ffe87..bc783c19366 100644
--- a/gcc/config/sparc/t-netbsd64
+++ b/gcc/config/sparc/t-netbsd64
@@ -1,8 +1,5 @@
-# Disable multilib fow now, as NetBSD/sparc64 does not ship with
+# Disable multilib for now, as NetBSD/sparc64 does not ship with
# a 32-bit environment.
#MULTILIB_OPTIONS = m32/m64
#MULTILIB_DIRNAMES = 32 64
#MULTILIB_MATCHES =
-
-#LIBGCC = stmp-multilib
-#INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
index b48106efed2..50c8d0353f5 100644
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -15,74 +15,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Suppress building libgcc1.a
-LIBGCC1 =
-CROSS_LIBGCC1 =
-
-TARGET_LIBGCC2_CFLAGS = -fPIC -mwarn-reloc -D__IN_LIBGCC2
-
-# We exclude those because the libgcc2.c default versions do not support
-# the SPU single-precision format (round towards zero). We provide our
-# own versions below and/or via direct expansion.
-LIB2FUNCS_EXCLUDE = _floatdisf _floatundisf _floattisf _floatunstisf
-
-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
- $(srcdir)/config/spu/float_unsdidf.c \
- $(srcdir)/config/spu/float_unsdisf.c \
- $(srcdir)/config/spu/float_disf.c \
- $(srcdir)/config/spu/mfc_tag_table.c \
- $(srcdir)/config/spu/mfc_tag_reserve.c \
- $(srcdir)/config/spu/mfc_tag_release.c \
- $(srcdir)/config/spu/mfc_multi_tag_reserve.c \
- $(srcdir)/config/spu/mfc_multi_tag_release.c \
- $(srcdir)/config/spu/multi3.c \
- $(srcdir)/config/spu/divmodti4.c \
- $(srcdir)/config/spu/divv2df3.c
-
-# Build TImode conversion routines to support Fortran 128-bit
-# integer data types.
-LIB2_SIDITI_CONV_FUNCS=yes
-
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS =
-
# 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 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
-
spu.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) \
diff --git a/gcc/config/stormy16/stormy16-lib2-ashlsi3.c b/gcc/config/stormy16/stormy16-lib2-ashlsi3.c
deleted file mode 100644
index d6cabc6691c..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-ashlsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_ASHLSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-ashrsi3.c b/gcc/config/stormy16/stormy16-lib2-ashrsi3.c
deleted file mode 100644
index 151e3d01cab..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-ashrsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_ASHRSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-clzhi2.c b/gcc/config/stormy16/stormy16-lib2-clzhi2.c
deleted file mode 100644
index 066fdf13112..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-clzhi2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_CLZHI2
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-cmpsi2.c b/gcc/config/stormy16/stormy16-lib2-cmpsi2.c
deleted file mode 100644
index 7563c36b569..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-cmpsi2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_CMPSI2
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-ctzhi2.c b/gcc/config/stormy16/stormy16-lib2-ctzhi2.c
deleted file mode 100644
index c1497db952f..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-ctzhi2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_CTZHI2
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-divsi3.c b/gcc/config/stormy16/stormy16-lib2-divsi3.c
deleted file mode 100644
index 33c370d1c1f..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-divsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_DIVSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-ffshi2.c b/gcc/config/stormy16/stormy16-lib2-ffshi2.c
deleted file mode 100644
index 4b629ddece8..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-ffshi2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_FFSHI2
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-lshrsi3.c b/gcc/config/stormy16/stormy16-lib2-lshrsi3.c
deleted file mode 100644
index cd769ee6647..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-lshrsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_LSHRSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-modsi3.c b/gcc/config/stormy16/stormy16-lib2-modsi3.c
deleted file mode 100644
index 587d0070d23..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-modsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_MODSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-ucmpsi2.c b/gcc/config/stormy16/stormy16-lib2-ucmpsi2.c
deleted file mode 100644
index da1a3e70753..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-ucmpsi2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_UCMPSI2
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-udivsi3.c b/gcc/config/stormy16/stormy16-lib2-udivsi3.c
deleted file mode 100644
index fdcd64a0ae0..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-udivsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_UDIVSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-umodsi3.c b/gcc/config/stormy16/stormy16-lib2-umodsi3.c
deleted file mode 100644
index 87921f2a196..00000000000
--- a/gcc/config/stormy16/stormy16-lib2-umodsi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XSTORMY16_UMODSI3
-#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/t-stormy16 b/gcc/config/stormy16/t-stormy16
deleted file mode 100644
index c2b6c2a5573..00000000000
--- a/gcc/config/stormy16/t-stormy16
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- makefile -*-
-#
-# Copyright (C) 2001, 2004, 2010, 2011 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/>.
-
-# SImode arithmetic and logical routines, HImode bit counting routines.
-LIB2FUNCS_EXTRA = \
- $(srcdir)/config/stormy16/stormy16-lib2-udivmodsi4.c \
- $(srcdir)/config/stormy16/stormy16-lib2-divsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-modsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-udivsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-umodsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-ashlsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-ashrsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-lshrsi3.c \
- $(srcdir)/config/stormy16/stormy16-lib2-popcounthi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-parityhi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-clzhi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-ctzhi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-ffshi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-cmpsi2.c \
- $(srcdir)/config/stormy16/stormy16-lib2-ucmpsi2.c
-
-TARGET_LIBGCC2_CFLAGS = -O2
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index d952bd39273..e2bd74d61b0 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -41,9 +41,3 @@ darwin-driver.o: $(srcdir)/config/darwin-driver.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) opts.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/darwin-driver.c
-
-# -pipe because there's an assembler bug, 4077127, which causes
-# it to not properly process the first # directive, causing temporary
-# file names to appear in stabs, causing the bootstrap to fail. Using -pipe
-# works around this by not having any temporary file names.
-TARGET_LIBGCC2_CFLAGS = -fPIC -pipe
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
deleted file mode 100644
index 0680618a6ec..00000000000
--- a/gcc/config/t-freebsd
+++ /dev/null
@@ -1,5 +0,0 @@
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-
-# Compile libgcc.a with pic.
-TARGET_LIBGCC2_CFLAGS += -fPIC
diff --git a/gcc/config/t-libc-ok b/gcc/config/t-libc-ok
deleted file mode 100644
index 561ee0b31d1..00000000000
--- a/gcc/config/t-libc-ok
+++ /dev/null
@@ -1 +0,0 @@
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff --git a/gcc/config/t-libgcc-pic b/gcc/config/t-libgcc-pic
deleted file mode 100644
index ff935fe1e05..00000000000
--- a/gcc/config/t-libgcc-pic
+++ /dev/null
@@ -1,2 +0,0 @@
-# Compile libgcc2.a with pic.
-TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind
index 6b8d2dd1292..6ebef7cc837 100644
--- a/gcc/config/t-libunwind
+++ b/gcc/config/t-libunwind
@@ -17,11 +17,5 @@
# <http://www.gnu.org/licenses/>.
# Use the system libunwind library.
-#
-# Override the default value from t-slibgcc-elf-ver and mention -lunwind
-# so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
-# libunwind.
-SHLIB_LC = -lunwind -lc
T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
-TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
deleted file mode 100644
index 64d19ca8dd7..00000000000
--- a/gcc/config/t-linux
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003,
-# 2004, 2011 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/>.
-
-# 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
-
-# Override t-slibgcc-elf-ver to export some libgcc symbols with
-# the symbol versions that glibc used.
-SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
diff --git a/gcc/config/t-lynx b/gcc/config/t-lynx
index ab6d2675c4f..860f61281d0 100644
--- a/gcc/config/t-lynx
+++ b/gcc/config/t-lynx
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,18 +16,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# 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
-
MULTILIB_OPTIONS = mthreads
MULTILIB_DIRNAMES = thread
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
Local Variables:
mode: makefile
End:
diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd
deleted file mode 100644
index 34949e12858..00000000000
--- a/gcc/config/t-netbsd
+++ /dev/null
@@ -1,2 +0,0 @@
-# Always build crtstuff with PIC.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff --git a/gcc/config/t-rtems b/gcc/config/t-rtems
index dfbd3afe9ee..baa00d83176 100644
--- a/gcc/config/t-rtems
+++ b/gcc/config/t-rtems
@@ -1,7 +1,2 @@
# RTEMS always has limits.h.
LIMITS_H_TEST = true
-
-# If we are building next to newlib, this will let us find the RTEMS
-# limits.h when building libgcc2. Otherwise, newlib must be installed
-# first.
-LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include
diff --git a/gcc/config/t-slibgcc b/gcc/config/t-slibgcc
new file mode 100644
index 00000000000..91f2d92e822
--- /dev/null
+++ b/gcc/config/t-slibgcc
@@ -0,0 +1,2 @@
+# Cause ENABLE_SHARED_LIBGCC to be defined in gcc/Makefile.in (DRIVER_DEFINES).
+SHLIB = true
diff --git a/gcc/config/t-slibgcc-dummy b/gcc/config/t-slibgcc-dummy
deleted file mode 100644
index e68ce5eb24a..00000000000
--- a/gcc/config/t-slibgcc-dummy
+++ /dev/null
@@ -1,3 +0,0 @@
-# SHLIB_LINK must be non-empty so ENABLE_SHARED_LIBGCC is defined correctly
-# in DRIVER_DEFINES if libgcc configuration has been moved to toplevel.
-SHLIB_LINK = dummy
diff --git a/gcc/config/t-slibgcc-elf-ver b/gcc/config/t-slibgcc-elf-ver
deleted file mode 100644
index b90f4fcf3a3..00000000000
--- a/gcc/config/t-slibgcc-elf-ver
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2001, 2002, 2003, 2004, 2005 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/>.
-
-# Build a shared libgcc library for ELF with symbol versioning
-# with the GNU linker.
-
-SHLIB_EXT = .so
-SHLIB_SOLINK = @shlib_base_name@.so
-SHLIB_SOVERSION = 1
-SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
-SHLIB_MAP = @shlib_map_file@
-SHLIB_OBJS = @shlib_objs@
-SHLIB_DIR = @multilib_dir@
-SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
-SHLIB_LC = -lc
-SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
-SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
-
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,--soname=$(SHLIB_SONAME) \
- -Wl,--version-script=$(SHLIB_MAP) \
- -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
- $(SHLIB_OBJS) $(SHLIB_LC) && \
- rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
- mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
- $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
- else true; fi && \
- mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
- $(SHLIB_MAKE_SOLINK)
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
- rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
- $(SHLIB_INSTALL_SOLINK)
-SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2
index f9156223593..8646e3625e8 100644
--- a/gcc/config/t-sol2
+++ b/gcc/config/t-sol2
@@ -36,6 +36,3 @@ sol2-stubs.o: $(srcdir)/config/sol2-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h
sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree.h output.h $(TM_H) $(TARGET_H) $(TM_P_H) $(GGC_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
-# This is required by gcc/ada/gcc-interface/Makefile.in.
-TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-svr4 b/gcc/config/t-svr4
deleted file mode 100644
index 6e75eea1f6e..00000000000
--- a/gcc/config/t-svr4
+++ /dev/null
@@ -1,8 +0,0 @@
-# We need to use -fPIC when we are using gcc to compile the routines in
-# crtstuff.c. This is only really needed when we are going to use gcc/g++
-# to produce a shared library, but since we don't know ahead of time when
-# we will be doing that, we just always use -fPIC when compiling the
-# routines in crtstuff.c. Likewise for libgcc2.c.
-
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks
index e200d932095..61d6e710aca 100644
--- a/gcc/config/t-vxworks
+++ b/gcc/config/t-vxworks
@@ -1,5 +1,5 @@
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008,
-# 2009, 2010 Free Software Foundation, Inc.
+# 2009, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -17,37 +17,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Build libgcc using the multilib mechanism
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-# No special flags needed for libgcc.a
-TARGET_LIBGCC2_CFLAGS =
-
-# Don't build libgcc.a with debug info
-LIBGCC2_DEBUG_CFLAGS =
-
-# Extra libgcc2 modules used by gthr-vxworks.h functions
-LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
-
-# Some runtime modules need these. Can't set extra_headers in config.gcc
-# because the paths are always made absolute to the cpu config dir.
-EXTRA_HEADERS += $(srcdir)/gthr-vxworks.h gthr-default.h
-
-# This ensures that the correct target headers are used; some
-# VxWorks system headers have names that collide with GCC's
-# internal (host) headers, e.g. regs.h.
-LIBGCC2_INCLUDES = -nostdinc -I \
- `case "/$$(MULTIDIR)" in \
- */mrtp*) echo $(WIND_USR)/h ;; \
- *) echo $(WIND_BASE)/target/h ;; \
- esac`
-
# Both the kernel and RTP headers provide limits.h.
LIMITS_H_TEST = true
-EXTRA_MULTILIB_PARTS =
-
vxworks.o: $(srcdir)/config/vxworks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TARGET_H) output.h $(TM_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff --git a/gcc/config/v850/t-v850 b/gcc/config/v850/t-v850
index fcd3b841e30..ca7f7ff73aa 100644
--- a/gcc/config/v850/t-v850
+++ b/gcc/config/v850/t-v850
@@ -17,71 +17,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = v850/lib1funcs.asm
-LIB1ASMFUNCS = _mulsi3 \
- _divsi3 \
- _udivsi3 \
- _modsi3 \
- _umodsi3 \
- _save_2 \
- _save_20 \
- _save_21 \
- _save_22 \
- _save_23 \
- _save_24 \
- _save_25 \
- _save_26 \
- _save_27 \
- _save_28 \
- _save_29 \
- _save_2c \
- _save_20c \
- _save_21c \
- _save_22c \
- _save_23c \
- _save_24c \
- _save_25c \
- _save_26c \
- _save_27c \
- _save_28c \
- _save_29c \
- _save_31c \
- _save_interrupt \
- _save_all_interrupt \
- _callt_save_20 \
- _callt_save_21 \
- _callt_save_22 \
- _callt_save_23 \
- _callt_save_24 \
- _callt_save_25 \
- _callt_save_26 \
- _callt_save_27 \
- _callt_save_28 \
- _callt_save_29 \
- _callt_save_20c \
- _callt_save_21c \
- _callt_save_22c \
- _callt_save_23c \
- _callt_save_24c \
- _callt_save_25c \
- _callt_save_26c \
- _callt_save_27c \
- _callt_save_28c \
- _callt_save_29c \
- _callt_save_31c \
- _callt_save_interrupt \
- _callt_save_all_interrupt \
- _callt_save_r2_r29 \
- _callt_save_r2_r31 \
- _negdi2 \
- _cmpdi2 \
- _ucmpdi2 \
- _muldi3
-
# Create target-specific versions of the libraries
MULTILIB_OPTIONS = mv850/mv850e/mv850e2/mv850e2v3
MULTILIB_DIRNAMES = v850 v850e v850e2 v850e2v3
-INSTALL_LIBGCC = install-multilib
MULTILIB_MATCHES = mv850e=mv850e1
TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow
diff --git a/gcc/config/vms/t-vms b/gcc/config/vms/t-vms
index 516435df1f9..61f9df55c31 100644
--- a/gcc/config/vms/t-vms
+++ b/gcc/config/vms/t-vms
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010
+# Copyright (C) 2009, 2010, 2011
# Free Software Foundation, Inc.
#
# This file is part of GCC.
@@ -24,17 +24,6 @@ LIMITS_H_TEST = false
# Under VMS, directory names cannot contain dots.
version:=$(shell echo $(BASEVER_c) | sed -e 's/\./_/g')
-VMS_EXTRA_PARTS=vcrt0.o pcrt0.o
-
-# Assemble startup files.
-$(T)vcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)vcrt0.o $(srcdir)/config/vms/vms-ucrt0.c
-
-$(T)pcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)pcrt0.o -DCRT0_POSIX_EXIT $(srcdir)/config/vms/vms-ucrt0.c
-
vms-crtlmap.h: $(srcdir)/config/vms/vms-crtlmap.map \
$(srcdir)/config/vms/make-crtlmap.awk
$(AWK) -f $(srcdir)/config/vms/make-crtlmap.awk \
@@ -43,3 +32,9 @@ vms-crtlmap.h: $(srcdir)/config/vms/vms-crtlmap.map \
vms.o: $(srcdir)/config/vms/vms.c $(TREE_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_P_H) vms-crtlmap.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+vms-c.o: $(srcdir)/config/vms/vms-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(CPPLIB_H) $(TREE_H) c-family/c-pragma.h toplev.h $(GGC_H) \
+ $(TM_P_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(PREPROCESSOR_DEFINES) \$<
diff --git a/gcc/config/vms/vms-c.c b/gcc/config/vms/vms-c.c
new file mode 100644
index 00000000000..eb4c63577a9
--- /dev/null
+++ b/gcc/config/vms/vms-c.c
@@ -0,0 +1,248 @@
+/* VMS specific, C compiler specific functions.
+ Copyright (C) 2011
+ Free Software Foundation, Inc.
+ Contributed by Tristan Gingold (gingold@adacore.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 "cpplib.h"
+#include "tree.h"
+#include "c-family/c-pragma.h"
+#include "c-family/c-common.h"
+#include "toplev.h"
+#include "ggc.h"
+#include "tm_p.h"
+#include "incpath.h"
+#include "diagnostic.h"
+
+/* '#pragma __nostandard' is simply ignored. */
+
+static void
+vms_pragma_nostandard (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+
+ if (pragma_lex (&x) != CPP_EOF)
+ warning (OPT_Wpragmas, "junk at end of #pragma __nostandard");
+}
+
+/* '#pragma __standard' is simply ignored. */
+
+static void
+vms_pragma_standard (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+
+ if (pragma_lex (&x) != CPP_EOF)
+ warning (OPT_Wpragmas, "junk at end of #pragma __standard");
+}
+
+/* Saved member alignment. */
+static int saved_member_alignment;
+
+/* Handle '#pragma member_alignment'. */
+
+static void
+vms_pragma_member_alignment (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+ int tok;
+ const char *arg;
+
+ tok = pragma_lex (&x);
+
+ if (tok == CPP_EOF)
+ {
+ /* Disable packing. */
+ maximum_field_alignment = initial_max_fld_align;
+ return;
+ }
+ if (tok != CPP_NAME)
+ {
+ warning (OPT_Wpragmas, "malformed '#pragma member_alignment', ignoring");
+ return;
+ }
+
+ arg = IDENTIFIER_POINTER (x);
+ /* Accept '__' prefix. */
+ if (arg[0] == '_' && arg[1] == '_')
+ arg += 2;
+
+ if (strcmp (arg, "save") == 0)
+ saved_member_alignment = maximum_field_alignment;
+ else if (strcmp (arg, "restore") == 0)
+ maximum_field_alignment = saved_member_alignment;
+ else
+ {
+ error ("unknown '#pragma member_alignment' name %s", arg);
+ return;
+ }
+ if (pragma_lex (&x) != CPP_EOF)
+ {
+ error ("malformed '#pragma member_alignment'");
+ return;
+ }
+}
+
+/* Handle '#pragma nomember_alignment'. */
+
+static void
+vms_pragma_nomember_alignment (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+ int tok;
+
+ tok = pragma_lex (&x);
+ if (tok == CPP_NAME)
+ {
+ const char *arg = IDENTIFIER_POINTER (x);
+
+ /* Accept '__' prefix. */
+ if (arg[0] == '_' && arg[1] == '_')
+ arg += 2;
+
+ if (strcmp (arg, "word") == 0)
+ maximum_field_alignment = 2 * BITS_PER_UNIT;
+ else if (strcmp (arg, "longword") == 0)
+ maximum_field_alignment = 4 * BITS_PER_UNIT;
+ else if (strcmp (arg, "quadword") == 0)
+ maximum_field_alignment = 8 * BITS_PER_UNIT;
+ else
+ {
+ error ("unhandled alignment for '#pragma nomember_alignment'");
+ }
+
+ tok = pragma_lex (&x);
+ }
+ else
+ {
+ /* Enable packing. */
+ maximum_field_alignment = BITS_PER_UNIT;
+ }
+
+ if (tok != CPP_EOF)
+ {
+ error ("garbage at end of '#pragma nomember_alignment'");
+ return;
+ }
+}
+
+/* The 'extern model' for public data. */
+
+enum extern_model_kind
+{
+ /* Create one overlaid section per variable. */
+ extern_model_common_block,
+
+ /* Like unix: multiple not-initialized declarations are allowed. */
+ extern_model_relaxed_refdef,
+
+ /* Like -fno-common. */
+ extern_model_strict_refdef,
+
+ /* Declarations creates symbols without storage. */
+ extern_model_globalvalue
+};
+
+/* Current and saved extern model. */
+static enum extern_model_kind current_extern_model;
+static enum extern_model_kind saved_extern_model;
+
+/* Partial handling of '#pragma extern_model'. */
+
+static void
+vms_pragma_extern_model (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+ int tok;
+ const char *arg;
+
+ tok = pragma_lex (&x);
+
+ if (tok != CPP_NAME)
+ {
+ warning (OPT_Wpragmas, "malformed '#pragma extern_model', ignoring");
+ return;
+ }
+
+ arg = IDENTIFIER_POINTER (x);
+ /* Accept "__" prefix. */
+ if (arg[0] == '_' && arg[1] == '_')
+ arg += 2;
+
+ if (strcmp (arg, "save") == 0)
+ saved_extern_model = current_extern_model;
+ else if (strcmp (arg, "restore") == 0)
+ current_extern_model = saved_extern_model;
+ else if (strcmp (arg, "strict_refdef") == 0)
+ current_extern_model = extern_model_strict_refdef;
+ else if (strcmp (arg, "common_block") == 0)
+ current_extern_model = extern_model_common_block;
+ else if (strcmp (arg, "globalvalue") == 0)
+ {
+ sorry ("extern model globalvalue");
+ return;
+ }
+ else
+ {
+ error ("unknown '#pragma extern_model' model '%s'", arg);
+ return;
+ }
+#if 0
+ if (pragma_lex (&x) != CPP_EOF)
+ {
+ permerror (input_location, "junk at end of '#pragma extern_model'");
+ return;
+ }
+#endif
+}
+
+/* Ignore '#pragma message'. */
+
+static void
+vms_pragma_message (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ /* Completly ignored. */
+#if 0
+ pedwarn (input_location, OPT_Wpragmas,
+ "vms '#pragma __message' is ignored");
+#endif
+}
+
+/* Add vms-specific pragma. */
+
+void
+vms_c_register_pragma (void)
+{
+ c_register_pragma (NULL, "__nostandard", vms_pragma_nostandard);
+ c_register_pragma (NULL, "nostandard", vms_pragma_nostandard);
+ c_register_pragma (NULL, "__standard", vms_pragma_standard);
+ c_register_pragma (NULL, "standard", vms_pragma_standard);
+ c_register_pragma (NULL, "__member_alignment", vms_pragma_member_alignment);
+ c_register_pragma (NULL, "member_alignment", vms_pragma_member_alignment);
+ c_register_pragma (NULL, "__nomember_alignment",
+ vms_pragma_nomember_alignment);
+ c_register_pragma (NULL, "nomember_alignment",
+ vms_pragma_nomember_alignment);
+ c_register_pragma (NULL, "__extern_model", vms_pragma_extern_model);
+ c_register_pragma (NULL, "extern_model", vms_pragma_extern_model);
+ c_register_pragma (NULL, "__message", vms_pragma_message);
+}
diff --git a/gcc/config/vms/vms-protos.h b/gcc/config/vms/vms-protos.h
index 04dcd606999..c313638eae2 100644
--- a/gcc/config/vms/vms-protos.h
+++ b/gcc/config/vms/vms-protos.h
@@ -17,5 +17,8 @@ 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/>. */
+/* vms-c.c */
+extern void vms_c_register_pragma (void);
+
/* vms.c */
void vms_patch_builtins (void);
diff --git a/gcc/config/vms/vms.c b/gcc/config/vms/vms.c
index 44940a3aa3b..ab37f827f83 100644
--- a/gcc/config/vms/vms.c
+++ b/gcc/config/vms/vms.c
@@ -99,11 +99,11 @@ vms_patch_builtins (void)
unsigned int i;
/* Fwrite on VMS is non-standard. */
- if (builtin_decl_implicit_p (BUILT_IN_WRITE))
- set_builtin_decl_implicit_p (BUILT_IN_WRITE, false);
+ if (builtin_decl_implicit_p (BUILT_IN_FWRITE))
+ set_builtin_decl_implicit_p (BUILT_IN_FWRITE, false);
- if (builtin_decl_implicit_p (BUILT_IN_WRITE_UNLOCKED))
- set_builtin_decl_implicit_p (BUILT_IN_WRITE_UNLOCKED, false);
+ if (builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED))
+ set_builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED, false);
/* Define aliases for names. */
for (i = 0; i < NBR_CRTL_NAMES; i++)
diff --git a/gcc/config/vms/vms.h b/gcc/config/vms/vms.h
new file mode 100644
index 00000000000..0da9d85a89c
--- /dev/null
+++ b/gcc/config/vms/vms.h
@@ -0,0 +1,60 @@
+/* Definitions of target machine GNU compiler. VMS common version.
+ Copyright (C) 2003-2009,2011 Free Software Foundation, Inc.
+ Contributed by Douglas B Rupp (rupp@gnat.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 TARGET_OBJECT_SUFFIX ".obj"
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define_std ("vms"); \
+ builtin_define_std ("VMS"); \
+ builtin_assert ("system=vms"); \
+ SUBTARGET_OS_CPP_BUILTINS(); \
+ if (POINTER_SIZE == 64) \
+ { \
+ builtin_define ("__LONG_POINTERS=1"); \
+ builtin_define ("__int64=long long"); \
+ } \
+ } while (0)
+
+/* Tell compiler we want to support VMS pragmas */
+#define REGISTER_TARGET_PRAGMAS() vms_c_register_pragma ()
+
+/* By default, allow $ to be part of an identifier. */
+#define DOLLARS_IN_IDENTIFIERS 2
+
+#undef TARGET_ABI_OPEN_VMS
+#define TARGET_ABI_OPEN_VMS 1
+
+/* "long" is 32 bits, but 64 bits for Ada. */
+#undef LONG_TYPE_SIZE
+#define LONG_TYPE_SIZE 32
+#define ADA_LONG_TYPE_SIZE 64
+
+/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
+#undef POINTER_SIZE
+#define POINTER_SIZE 32
+#define POINTERS_EXTEND_UNSIGNED 0
+
+/* Always 32 bits. */
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
diff --git a/gcc/config/ia64/vms64.h b/gcc/config/vms/vms64.h
index a92014337c5..24249ce9b3f 100644
--- a/gcc/config/ia64/vms64.h
+++ b/gcc/config/vms/vms64.h
@@ -1,6 +1,6 @@
-/* Definitions of target machine GNU compiler. 64bit IA64-VMS version.
- Copyright (C) 2004-2009 Free Software Foundation, Inc.
- Contributed by Douglas B Rupp (rupp@gnat.com).
+/* Output variables, constants and external declarations, for GNU compiler.
+ Copyright (C) 2001, 2007, 2009 Free Software Foundation, Inc.
+ Contributed by Douglas Rupp (rupp@gnat.com).
This file is part of GCC.
@@ -18,22 +18,12 @@ 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/>. */
-#undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("vms"); \
- builtin_define_std ("VMS"); \
- builtin_define ("__IA64"); \
- builtin_assert ("system=vms"); \
- builtin_define ("__IEEE_FLOAT"); \
- builtin_define ("__LONG_POINTERS=1"); \
- } while (0)
-
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 64
#undef POINTER_SIZE
#define POINTER_SIZE 64
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
+/* Defaults to "long int" */
+#undef SIZE_TYPE
+#undef PTRDIFF_TYPE
diff --git a/gcc/config/xtensa/t-linux b/gcc/config/xtensa/t-linux
deleted file mode 100644
index 7d535e155b4..00000000000
--- a/gcc/config/xtensa/t-linux
+++ /dev/null
@@ -1,3 +0,0 @@
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
-SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-xtensa.ver
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
index 641e6fe7620..6ec56969fe4 100644
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -17,25 +17,4 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-LIB1ASMSRC = xtensa/lib1funcs.asm
-LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \
- _umulsidi3 _clz _clzsi2 _ctzsi2 _ffssi2 \
- _ashldi3 _ashrdi3 _lshrdi3 \
- _negsf2 _addsubsf3 _mulsf3 _divsf3 _cmpsf2 _fixsfsi _fixsfdi \
- _fixunssfsi _fixunssfdi _floatsisf _floatunsisf \
- _floatdisf _floatundisf \
- _negdf2 _addsubdf3 _muldf3 _divdf3 _cmpdf2 _fixdfsi _fixdfdi \
- _fixunsdfsi _fixunsdfdi _floatsidf _floatunsidf \
- _floatdidf _floatundidf \
- _truncdfsf2 _extendsfdf2
-
-LIB2FUNCS_EXTRA = $(srcdir)/config/xtensa/lib2funcs.S
-
-$(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/xtensa/crti.asm
-$(T)crtn.o: $(srcdir)/config/xtensa/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm
-
$(out_object_file): gt-xtensa.h
diff --git a/gcc/configure b/gcc/configure
index 0540430dc20..99334ce44fd 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -618,12 +618,9 @@ xm_include_list
xm_file_list
tm_p_include_list
tm_p_file_list
-libgcc_tm_include_list
-libgcc_tm_file_list
tm_defines
tm_include_list
tm_file_list
-thread_file
common_out_object_file
common_out_file
out_object_file
@@ -645,7 +642,6 @@ gcc_config_arguments
float_h_file
extra_programs
extra_passes
-extra_parts
extra_objs
extra_headers_list
user_headers_inc_next_post
@@ -671,7 +667,6 @@ all_gtfiles
all_compilers
srcdir
subdirs
-slibdir
dollar
gcc_tooldir
enable_lto
@@ -728,7 +723,6 @@ LIBINTL
USE_NLS
extra_opt_files
extra_modes_file
-gthread_flags
NATIVE_SYSTEM_HEADER_DIR
objext
manext
@@ -777,6 +771,7 @@ valgrind_path_defines
valgrind_path
TREEBROWSER
nocommon_flag
+noexception_flags
warn_cxxflags
warn_cflags
c_strict_warn
@@ -918,7 +913,6 @@ with_gc
with_system_zlib
enable_maintainer_mode
enable_version_specific_runtime_libs
-with_slibdir
enable_plugin
enable_libquadmath_support
with_linker_hash_style
@@ -1674,7 +1668,6 @@ Optional Packages:
--with-gc={page,zone} choose the garbage collection mechanism to use with
the compiler
--with-system-zlib use installed libz
- --with-slibdir=DIR shared libraries in DIR [LIBDIR]
--with-linker-hash-style={sysv,gnu,both}
specify the linker hash style
@@ -6402,11 +6395,12 @@ fi
# * 'long long'
# * variadic macros
# * overlong strings
+# * C++11 narrowing conversions in { }
# So, we only use -pedantic if we can disable those warnings.
loose_warn=
save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wwrite-strings -Wcast-qual; do
+for option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6620,6 +6614,47 @@ fi
+# Disable exceptions and RTTI if building with g++
+noexception_flags=
+save_CFLAGS="$CFLAGS"
+for option in -fno-exceptions -fno-rtti; do
+ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
+$as_echo_n "checking whether $CC supports $option... " >&6; }
+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ CFLAGS="$option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_acx_Woption=yes"
+else
+ eval "$as_acx_Woption=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$$as_acx_Woption
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
+ noexception_flags="$noexception_flags${noexception_flags:+ }$option"
+fi
+ done
+CFLAGS="$save_CFLAGS"
+
+
# Enable expensive internal checks
is_release=
if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then
@@ -11359,19 +11394,6 @@ if test x${thread_file} = x; then
thread_file=${target_thread_file}
fi
-# Make gthr-default.h if we have a thread file.
-gthread_flags=
-if test $thread_file != single; then
- echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h-t
- if diff gthr-default.h-t gthr-default.h 2>/dev/null; then
- rm -f gthr-default.h-t
- else
- mv -f gthr-default.h-t gthr-default.h
- fi
- gthread_flags=-DHAVE_GTHR_DEFAULT
-fi
-
-
# --------
# UNSORTED
# --------
@@ -11793,13 +11815,6 @@ for f in $tm_file; do
esac
done
-libgcc_tm_file_list=
-libgcc_tm_include_list=
-for f in $libgcc_tm_file; do
- libgcc_tm_file_list="${libgcc_tm_file_list} \$(srcdir)/../libgcc/config/$f"
- libgcc_tm_include_list="${libgcc_tm_include_list} ../libgcc/config/$f"
-done
-
tm_p_file_list=
tm_p_include_list=
for f in $tm_p_file; do
@@ -18072,7 +18087,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18075 "configure"
+#line 18090 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18178,7 +18193,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18181 "configure"
+#line 18196 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -26957,22 +26972,6 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
-
-# Check whether --with-slibdir was given.
-if test "${with_slibdir+set}" = set; then :
- withval=$with_slibdir; slibdir="$with_slibdir"
-else
- if test "${enable_version_specific_runtime_libs+set}" = set; then
- slibdir='$(libsubdir)'
-elif test "$host" != "$target"; then
- slibdir='$(build_tooldir)/lib'
-else
- slibdir='$(libdir)'
-fi
-fi
-
-
-
# Substitute configuration variables
@@ -27036,10 +27035,6 @@ fi
-
-
-
-
# Echo link setup.
if test x${build} = x${host} ; then
if test x${host} = x${target} ; then
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d63acea68f5..c7654259c4a 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -329,10 +329,11 @@ GCC_STDINT_TYPES
# * 'long long'
# * variadic macros
# * overlong strings
+# * C++11 narrowing conversions in { }
# So, we only use -pedantic if we can disable those warnings.
ACX_PROG_CC_WARNING_OPTS(
- m4_quote(m4_do([-W -Wall -Wwrite-strings -Wcast-qual])), [loose_warn])
+ m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual])), [loose_warn])
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
[c_loose_warn])
@@ -357,6 +358,10 @@ fi
AC_SUBST(warn_cflags)
AC_SUBST(warn_cxxflags)
+# Disable exceptions and RTTI if building with g++
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
+
# Enable expensive internal checks
is_release=
if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then
@@ -1416,19 +1421,6 @@ if test x${thread_file} = x; then
thread_file=${target_thread_file}
fi
-# Make gthr-default.h if we have a thread file.
-gthread_flags=
-if test $thread_file != single; then
- echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h-t
- if diff gthr-default.h-t gthr-default.h 2>/dev/null; then
- rm -f gthr-default.h-t
- else
- mv -f gthr-default.h-t gthr-default.h
- fi
- gthread_flags=-DHAVE_GTHR_DEFAULT
-fi
-AC_SUBST(gthread_flags)
-
# --------
# UNSORTED
# --------
@@ -1715,13 +1707,6 @@ for f in $tm_file; do
esac
done
-libgcc_tm_file_list=
-libgcc_tm_include_list=
-for f in $libgcc_tm_file; do
- libgcc_tm_file_list="${libgcc_tm_file_list} \$(srcdir)/../libgcc/config/$f"
- libgcc_tm_include_list="${libgcc_tm_include_list} ../libgcc/config/$f"
-done
-
tm_p_file_list=
tm_p_include_list=
for f in $tm_p_file; do
@@ -4921,18 +4906,6 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
-AC_ARG_WITH(slibdir,
-[AS_HELP_STRING([--with-slibdir=DIR], [shared libraries in DIR @<:@LIBDIR@:>@])],
-slibdir="$with_slibdir",
-if test "${enable_version_specific_runtime_libs+set}" = set; then
- slibdir='$(libsubdir)'
-elif test "$host" != "$target"; then
- slibdir='$(build_tooldir)/lib'
-else
- slibdir='$(libdir)'
-fi)
-AC_SUBST(slibdir)
-
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
@@ -4959,7 +4932,6 @@ AC_SUBST(user_headers_inc_next_pre)
AC_SUBST(user_headers_inc_next_post)
AC_SUBST(extra_headers_list)
AC_SUBST(extra_objs)
-AC_SUBST(extra_parts)
AC_SUBST(extra_passes)
AC_SUBST(extra_programs)
AC_SUBST(float_h_file)
@@ -4981,12 +4953,9 @@ AC_SUBST(out_file)
AC_SUBST(out_object_file)
AC_SUBST(common_out_file)
AC_SUBST(common_out_object_file)
-AC_SUBST(thread_file)
AC_SUBST(tm_file_list)
AC_SUBST(tm_include_list)
AC_SUBST(tm_defines)
-AC_SUBST(libgcc_tm_file_list)
-AC_SUBST(libgcc_tm_include_list)
AC_SUBST(tm_p_file_list)
AC_SUBST(tm_p_include_list)
AC_SUBST(xm_file_list)
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 45cdbbd6fd6..1374a98a810 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -181,5 +181,18 @@ union _dont_use_tree_here_;
#endif
+/* Memory model types for the __atomic* builtins.
+ This must match the order in libstdc++-v3/include/bits/atomic_base.h. */
+enum memmodel
+{
+ MEMMODEL_RELAXED = 0,
+ MEMMODEL_CONSUME = 1,
+ MEMMODEL_ACQUIRE = 2,
+ MEMMODEL_RELEASE = 3,
+ MEMMODEL_ACQ_REL = 4,
+ MEMMODEL_SEQ_CST = 5,
+ MEMMODEL_LAST = 6
+};
+
#endif /* coretypes.h */
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 24e0e3d87f2..520652b1e71 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -1,6 +1,6 @@
/* Read and write coverage files, and associated functionality.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
- 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
@@ -54,13 +54,14 @@ along with GCC; see the file COPYING3. If not see
#include "gcov-io.h"
#include "gcov-io.c"
-struct function_list
+struct GTY((chain_next ("%h.next"))) function_list
{
struct function_list *next; /* next function */
unsigned ident; /* function ident */
unsigned lineno_checksum; /* function lineno checksum */
unsigned cfg_checksum; /* function cfg checksum */
- unsigned n_ctrs[GCOV_COUNTERS];/* number of counters. */
+ tree fn_decl; /* the function decl */
+ tree ctr_vars[GCOV_COUNTERS]; /* counter variables. */
};
/* Counts information for a function. */
@@ -75,22 +76,18 @@ typedef struct counts_entry
unsigned cfg_checksum;
gcov_type *counts;
struct gcov_ctr_summary summary;
-
- /* Workspace */
- struct counts_entry *chain;
-
} counts_entry_t;
-static struct function_list *functions_head = 0;
+static GTY(()) struct function_list *functions_head = 0;
static struct function_list **functions_tail = &functions_head;
static unsigned no_coverage = 0;
/* Cumulative counter information for whole program. */
static unsigned prg_ctr_mask; /* Mask of counter types generated. */
-static unsigned prg_n_ctrs[GCOV_COUNTERS]; /* Total counters allocated. */
/* Counter information for current function. */
static unsigned fn_ctr_mask; /* Mask of counters used. */
+static GTY(()) tree fn_v_ctrs[GCOV_COUNTERS]; /* counter variables. */
static unsigned fn_n_ctrs[GCOV_COUNTERS]; /* Counters allocated. */
static unsigned fn_b_ctrs[GCOV_COUNTERS]; /* Allocation base. */
@@ -105,9 +102,6 @@ static char *da_file_name;
/* Hash table of count data. */
static htab_t counts_hash = NULL;
-/* Trees representing the counter table arrays. */
-static GTY(()) tree tree_ctr_tables[GCOV_COUNTERS];
-
/* The names of merge functions for counters. */
static const char *const ctr_merge_functions[GCOV_COUNTERS] = GCOV_MERGE_FUNCTIONS;
static const char *const ctr_names[GCOV_COUNTERS] = GCOV_COUNTER_NAMES;
@@ -117,11 +111,11 @@ static hashval_t htab_counts_entry_hash (const void *);
static int htab_counts_entry_eq (const void *, const void *);
static void htab_counts_entry_del (void *);
static void read_counts_file (void);
-static tree build_fn_info_type (unsigned);
-static tree build_fn_info_value (const struct function_list *, tree);
-static tree build_ctr_info_type (void);
-static tree build_ctr_info_value (unsigned, tree);
-static tree build_gcov_info (void);
+static tree build_var (tree, tree, int);
+static void build_fn_info_type (tree, unsigned, tree);
+static tree build_fn_info (const struct function_list *, tree, tree);
+static void build_info_type (tree, unsigned, tree);
+static tree build_info (tree, tree, tree, unsigned);
static void create_coverage (void);
/* Return the type node for gcov_type. */
@@ -172,8 +166,8 @@ static void
read_counts_file (void)
{
gcov_unsigned_t fn_ident = 0;
- counts_entry_t *summaried = NULL;
- unsigned seen_summary = 0;
+ struct gcov_summary summary;
+ unsigned new_summary = 1;
gcov_unsigned_t tag;
int is_error = 0;
unsigned lineno_checksum = 0;
@@ -216,42 +210,34 @@ read_counts_file (void)
offset = gcov_position ();
if (tag == GCOV_TAG_FUNCTION)
{
- fn_ident = gcov_read_unsigned ();
- lineno_checksum = gcov_read_unsigned ();
- cfg_checksum = gcov_read_unsigned ();
- if (seen_summary)
+ if (length)
{
- /* We have already seen a summary, this means that this
- new function begins a new set of program runs. We
- must unlink the summaried chain. */
- counts_entry_t *entry, *chain;
-
- for (entry = summaried; entry; entry = chain)
- {
- chain = entry->chain;
- entry->chain = NULL;
- }
- summaried = NULL;
- seen_summary = 0;
+ fn_ident = gcov_read_unsigned ();
+ lineno_checksum = gcov_read_unsigned ();
+ cfg_checksum = gcov_read_unsigned ();
}
+ else
+ fn_ident = lineno_checksum = cfg_checksum = 0;
+ new_summary = 1;
}
else if (tag == GCOV_TAG_PROGRAM_SUMMARY)
{
- counts_entry_t *entry;
- struct gcov_summary summary;
+ struct gcov_summary sum;
+ unsigned ix;
- gcov_read_summary (&summary);
- seen_summary = 1;
- for (entry = summaried; entry; entry = entry->chain)
- {
- struct gcov_ctr_summary *csum = &summary.ctrs[entry->ctr];
+ if (new_summary)
+ memset (&summary, 0, sizeof (summary));
- entry->summary.runs += csum->runs;
- entry->summary.sum_all += csum->sum_all;
- if (entry->summary.run_max < csum->run_max)
- entry->summary.run_max = csum->run_max;
- entry->summary.sum_max += csum->sum_max;
+ gcov_read_summary (&sum);
+ for (ix = 0; ix != GCOV_COUNTERS_SUMMABLE; ix++)
+ {
+ summary.ctrs[ix].runs += sum.ctrs[ix].runs;
+ summary.ctrs[ix].sum_all += sum.ctrs[ix].sum_all;
+ if (summary.ctrs[ix].run_max < sum.ctrs[ix].run_max)
+ summary.ctrs[ix].run_max = sum.ctrs[ix].run_max;
+ summary.ctrs[ix].sum_max += sum.ctrs[ix].sum_max;
}
+ new_summary = 0;
}
else if (GCOV_TAG_IS_COUNTER (tag) && fn_ident)
{
@@ -272,6 +258,7 @@ read_counts_file (void)
entry->ctr = elt.ctr;
entry->lineno_checksum = lineno_checksum;
entry->cfg_checksum = cfg_checksum;
+ entry->summary = summary.ctrs[elt.ctr];
entry->summary.num = n_counts;
entry->counts = XCNEWVEC (gcov_type, n_counts);
}
@@ -298,15 +285,13 @@ read_counts_file (void)
ctr_names[elt.ctr], fn_ident);
goto skip_merge;
}
-
- if (elt.ctr < GCOV_COUNTERS_SUMMABLE
- /* This should always be true for a just allocated entry,
- and always false for an existing one. Check this way, in
- case the gcov file is corrupt. */
- && (!entry->chain || summaried != entry))
+ else
{
- entry->chain = summaried;
- summaried = entry;
+ entry->summary.runs += summary.ctrs[elt.ctr].runs;
+ entry->summary.sum_all += summary.ctrs[elt.ctr].sum_all;
+ if (entry->summary.run_max < summary.ctrs[elt.ctr].run_max)
+ entry->summary.run_max = summary.ctrs[elt.ctr].run_max;
+ entry->summary.sum_max += summary.ctrs[elt.ctr].sum_max;
}
for (ix = 0; ix != n_counts; ix++)
entry->counts[ix] += gcov_read_counter ();
@@ -350,13 +335,12 @@ get_coverage_counts (unsigned counter, unsigned expected,
elt.ident = current_function_funcdef_no + 1;
elt.ctr = counter;
entry = (counts_entry_t *) htab_find (counts_hash, &elt);
- if (!entry)
- {
- warning (0, "no coverage for function %qE found",
- DECL_ASSEMBLER_NAME (current_function_decl));
- return NULL;
- }
-
+ if (!entry || !entry->summary.num)
+ /* The function was not emitted, or is weak and not chosen in the
+ final executable. Silently fail, because there's nothing we
+ can do about it. */
+ return NULL;
+
if (entry->cfg_checksum != cfg_checksum
|| entry->summary.num != expected)
{
@@ -366,11 +350,11 @@ get_coverage_counts (unsigned counter, unsigned expected,
warning_printed =
warning_at (input_location, OPT_Wcoverage_mismatch,
- "The control flow of function %qE does not match "
+ "the control flow of function %qE does not match "
"its profile data (counter %qs)", id, ctr_names[counter]);
if (warning_printed)
{
- inform (input_location, "Use -Wno-error=coverage-mismatch to tolerate "
+ inform (input_location, "use -Wno-error=coverage-mismatch to tolerate "
"the mismatch but performance may drop if the function is hot");
if (!seen_error ()
@@ -388,12 +372,12 @@ get_coverage_counts (unsigned counter, unsigned expected,
return NULL;
}
- else if (entry->lineno_checksum != lineno_checksum)
- {
- warning (0, "Source location for function %qE have changed,"
- " the profile data may be out of date",
- DECL_ASSEMBLER_NAME (current_function_decl));
- }
+ else if (entry->lineno_checksum != lineno_checksum)
+ {
+ warning (0, "source location for function %qE have changed,"
+ " the profile data may be out of date",
+ DECL_ASSEMBLER_NAME (current_function_decl));
+ }
if (summary)
*summary = &entry->summary;
@@ -413,28 +397,17 @@ coverage_counter_alloc (unsigned counter, unsigned num)
if (!num)
return 1;
- if (!tree_ctr_tables[counter])
+ if (!fn_v_ctrs[counter])
{
- /* Generate and save a copy of this so it can be shared. Leave
- the index type unspecified for now; it will be set after all
- functions have been compiled. */
- char buf[20];
- tree gcov_type_node = get_gcov_type ();
- tree gcov_type_array_type
- = build_array_type (gcov_type_node, NULL_TREE);
- tree_ctr_tables[counter]
- = build_decl (BUILTINS_LOCATION,
- VAR_DECL, NULL_TREE, gcov_type_array_type);
- TREE_STATIC (tree_ctr_tables[counter]) = 1;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1);
- DECL_NAME (tree_ctr_tables[counter]) = get_identifier (buf);
- DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (gcov_type_node);
-
- if (dump_file)
- fprintf (dump_file, "Using data file %s\n", da_file_name);
+ tree array_type = build_array_type (get_gcov_type (), NULL_TREE);
+
+ fn_v_ctrs[counter]
+ = build_var (current_function_decl, array_type, counter);
}
+
fn_b_ctrs[counter] = fn_n_ctrs[counter];
fn_n_ctrs[counter] += num;
+
fn_ctr_mask |= 1 << counter;
return 1;
}
@@ -447,10 +420,11 @@ tree_coverage_counter_ref (unsigned counter, unsigned no)
tree gcov_type_node = get_gcov_type ();
gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]);
- no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
+ no += fn_b_ctrs[counter];
+
/* "no" here is an array index, scaled to bytes later. */
- return build4 (ARRAY_REF, gcov_type_node, tree_ctr_tables[counter],
+ return build4 (ARRAY_REF, gcov_type_node, fn_v_ctrs[counter],
build_int_cst (integer_type_node, no), NULL, NULL);
}
@@ -462,13 +436,11 @@ tree_coverage_counter_addr (unsigned counter, unsigned no)
tree gcov_type_node = get_gcov_type ();
gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]);
- no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
-
- TREE_ADDRESSABLE (tree_ctr_tables[counter]) = 1;
+ no += fn_b_ctrs[counter];
/* "no" here is an array index, scaled to bytes later. */
return build_fold_addr_expr (build4 (ARRAY_REF, gcov_type_node,
- tree_ctr_tables[counter],
+ fn_v_ctrs[counter],
build_int_cst (integer_type_node, no),
NULL, NULL));
}
@@ -647,78 +619,159 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
{
struct function_list *item;
- item = XCNEW (struct function_list);
-
- *functions_tail = item;
- functions_tail = &item->next;
-
+ item = ggc_alloc_function_list ();
item->next = 0;
item->ident = current_function_funcdef_no + 1;
item->lineno_checksum = lineno_checksum;
item->cfg_checksum = cfg_checksum;
+ item->fn_decl = current_function_decl;
for (i = 0; i != GCOV_COUNTERS; i++)
{
- item->n_ctrs[i] = fn_n_ctrs[i];
- prg_n_ctrs[i] += fn_n_ctrs[i];
- fn_n_ctrs[i] = fn_b_ctrs[i] = 0;
+ tree var = fn_v_ctrs[i];
+
+ item->ctr_vars[i] = var;
+ if (var)
+ {
+ tree array_type = build_index_type (size_int (fn_n_ctrs[i] - 1));
+ array_type = build_array_type (get_gcov_type (), array_type);
+ TREE_TYPE (var) = array_type;
+ DECL_SIZE (var) = TYPE_SIZE (array_type);
+ DECL_SIZE_UNIT (var) = TYPE_SIZE_UNIT (array_type);
+ varpool_finalize_decl (var);
+ }
+ fn_b_ctrs[i] = fn_n_ctrs[i] = 0;
+ fn_v_ctrs[i] = NULL_TREE;
}
prg_ctr_mask |= fn_ctr_mask;
fn_ctr_mask = 0;
+ /* If the function is extern (i.e. extern inline), then we won't
+ be outputting it, so don't chain it onto the function list. */
+ if (!DECL_EXTERNAL (item->fn_decl))
+ {
+ *functions_tail = item;
+ functions_tail = &item->next;
+ }
}
bbg_function_announced = 0;
}
-/* Creates the gcov_fn_info RECORD_TYPE. */
+/* Build a coverage variable of TYPE for function FN_DECL. If COUNTER
+ >= 0 it is a counter array, and thus local. Otherwise it is the
+ function structure and needs to be globalized. All cases must be
+ in the same comdat group as FN_DECL. */
static tree
-build_fn_info_type (unsigned int counters)
+build_var (tree fn_decl, tree type, int counter)
+{
+ tree var = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, type);
+ tree fn_name = DECL_ASSEMBLER_NAME (fn_decl);
+ char *buf = (char *)alloca (IDENTIFIER_LENGTH (fn_name) + 10);
+
+ if (counter >= 0)
+ TREE_STATIC (var) = 1;
+ else
+ {
+ TREE_PUBLIC (var) = TREE_PUBLIC (fn_decl);
+ TREE_STATIC (var) = TREE_STATIC (fn_decl);
+ }
+ TREE_ADDRESSABLE (var) = 1;
+ DECL_ALIGN (var) = TYPE_ALIGN (type);
+
+ if (counter < 0)
+ sprintf (buf, "__gcov__%s", IDENTIFIER_POINTER (fn_name));
+ else
+ sprintf (buf, "__gcov%u_%s", counter, IDENTIFIER_POINTER (fn_name));
+ DECL_NAME (var) = get_identifier (buf);
+
+ /* Initialize assembler name so we can stream out. */
+ if (TREE_PUBLIC (var))
+ DECL_ASSEMBLER_NAME (var);
+
+ DECL_WEAK (var) = TREE_PUBLIC (var) && DECL_WEAK (fn_decl);
+ DECL_COMDAT (var) = DECL_COMDAT (fn_decl);
+ DECL_COMDAT_GROUP (var) = DECL_COMDAT_GROUP (fn_decl);
+
+ return var;
+}
+
+/* Creates the gcov_fn_info RECORD_TYPE. */
+
+static void
+build_fn_info_type (tree type, unsigned counters, tree gcov_info_type)
{
- tree type = lang_hooks.types.make_type (RECORD_TYPE);
+ tree ctr_info = lang_hooks.types.make_type (RECORD_TYPE);
tree field, fields;
tree array_type;
+ gcc_assert (counters);
+
+ /* ctr_info::num */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
+ fields = field;
+
+ /* ctr_info::values */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ build_pointer_type (get_gcov_type ()));
+ DECL_CHAIN (field) = fields;
+ fields = field;
+
+ finish_builtin_struct (ctr_info, "__gcov_ctr_info", fields, NULL_TREE);
+
+ /* key */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ build_pointer_type (build_qualified_type
+ (gcov_info_type, TYPE_QUAL_CONST)));
+ fields = field;
+
/* ident */
- fields = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
+ DECL_CHAIN (field) = fields;
+ fields = field;
+
/* lineno_checksum */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
DECL_CHAIN (field) = fields;
fields = field;
/* cfg checksum */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
DECL_CHAIN (field) = fields;
fields = field;
array_type = build_index_type (size_int (counters - 1));
- array_type = build_array_type (get_gcov_unsigned_t (), array_type);
+ array_type = build_array_type (ctr_info, array_type);
/* counters */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, array_type);
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, array_type);
DECL_CHAIN (field) = fields;
fields = field;
finish_builtin_struct (type, "__gcov_fn_info", fields, NULL_TREE);
-
- return type;
}
/* Creates a CONSTRUCTOR for a gcov_fn_info. FUNCTION is
the function being processed and TYPE is the gcov_fn_info
- RECORD_TYPE. */
+ RECORD_TYPE. KEY is the object file key. */
static tree
-build_fn_info_value (const struct function_list *function, tree type)
+build_fn_info (const struct function_list *function, tree type, tree key)
{
tree fields = TYPE_FIELDS (type);
+ tree ctr_type;
unsigned ix;
VEC(constructor_elt,gc) *v1 = NULL;
VEC(constructor_elt,gc) *v2 = NULL;
+ /* key */
+ CONSTRUCTOR_APPEND_ELT (v1, fields,
+ build1 (ADDR_EXPR, TREE_TYPE (fields), key));
+ fields = DECL_CHAIN (fields);
+
/* ident */
CONSTRUCTOR_APPEND_ELT (v1, fields,
build_int_cstu (get_gcov_unsigned_t (),
@@ -738,240 +791,194 @@ build_fn_info_value (const struct function_list *function, tree type)
fields = DECL_CHAIN (fields);
/* counters */
+ ctr_type = TREE_TYPE (TREE_TYPE (fields));
for (ix = 0; ix != GCOV_COUNTERS; ix++)
if (prg_ctr_mask & (1 << ix))
- CONSTRUCTOR_APPEND_ELT (v2, NULL,
- build_int_cstu (get_gcov_unsigned_t (),
- function->n_ctrs[ix]));
-
+ {
+ VEC(constructor_elt,gc) *ctr = NULL;
+ tree var = function->ctr_vars[ix];
+ unsigned count = 0;
+
+ if (var)
+ count
+ = tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (var))), 0)
+ + 1;
+
+ CONSTRUCTOR_APPEND_ELT (ctr, TYPE_FIELDS (ctr_type),
+ build_int_cstu (get_gcov_unsigned_t (),
+ count));
+
+ if (var)
+ CONSTRUCTOR_APPEND_ELT (ctr, DECL_CHAIN (TYPE_FIELDS (ctr_type)),
+ build_fold_addr_expr (var));
+
+ CONSTRUCTOR_APPEND_ELT (v2, NULL, build_constructor (ctr_type, ctr));
+ }
+
CONSTRUCTOR_APPEND_ELT (v1, fields,
build_constructor (TREE_TYPE (fields), v2));
return build_constructor (type, v1);
}
-/* Creates the gcov_ctr_info RECORD_TYPE. */
+/* Creaste gcov_info_struct. N_FUNCS is the number of functions in
+ the trailing array. */
-static tree
-build_ctr_info_type (void)
+static void
+build_info_type (tree type, unsigned n_funcs, tree fn_info_type)
{
- tree type = lang_hooks.types.make_type (RECORD_TYPE);
tree field, fields = NULL_TREE;
- tree gcov_ptr_type = build_pointer_type (get_gcov_type ());
- tree gcov_merge_fn_type;
+ tree merge_fn_type, fn_info_array;
- /* counters */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
+ gcc_assert (n_funcs);
+
+ /* Version ident */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
DECL_CHAIN (field) = fields;
fields = field;
- /* values */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, gcov_ptr_type);
+ /* next pointer */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ build_pointer_type (build_qualified_type
+ (type, TYPE_QUAL_CONST)));
DECL_CHAIN (field) = fields;
fields = field;
- /* merge */
- gcov_merge_fn_type =
- build_function_type_list (void_type_node,
- gcov_ptr_type, get_gcov_unsigned_t (),
- NULL_TREE);
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE,
- build_pointer_type (gcov_merge_fn_type));
+ /* stamp */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
DECL_CHAIN (field) = fields;
fields = field;
- finish_builtin_struct (type, "__gcov_ctr_info", fields, NULL_TREE);
-
- return type;
-}
-
-/* Creates a CONSTRUCTOR for a gcov_ctr_info. COUNTER is
- the counter being processed and TYPE is the gcov_ctr_info
- RECORD_TYPE. */
-
-static tree
-build_ctr_info_value (unsigned int counter, tree type)
-{
- tree fields = TYPE_FIELDS (type);
- tree fn;
- VEC(constructor_elt,gc) *v = NULL;
-
- /* counters */
- CONSTRUCTOR_APPEND_ELT (v, fields,
- build_int_cstu (get_gcov_unsigned_t (),
- prg_n_ctrs[counter]));
- fields = DECL_CHAIN (fields);
+ /* Filename */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ build_pointer_type (build_qualified_type
+ (char_type_node, TYPE_QUAL_CONST)));
+ DECL_CHAIN (field) = fields;
+ fields = field;
- if (prg_n_ctrs[counter])
- {
- tree array_type;
-
- array_type = build_int_cstu (get_gcov_unsigned_t (),
- prg_n_ctrs[counter] - 1);
- array_type = build_index_type (array_type);
- array_type = build_array_type (TREE_TYPE (TREE_TYPE (fields)),
- array_type);
-
- TREE_TYPE (tree_ctr_tables[counter]) = array_type;
- DECL_SIZE (tree_ctr_tables[counter]) = TYPE_SIZE (array_type);
- DECL_SIZE_UNIT (tree_ctr_tables[counter]) = TYPE_SIZE_UNIT (array_type);
- varpool_finalize_decl (tree_ctr_tables[counter]);
-
- CONSTRUCTOR_APPEND_ELT (v, fields,
- build1 (ADDR_EXPR, TREE_TYPE (fields),
- tree_ctr_tables[counter]));
- }
- else
- CONSTRUCTOR_APPEND_ELT (v, fields, null_pointer_node);
- fields = DECL_CHAIN (fields);
+ /* merge fn array */
+ merge_fn_type
+ = build_function_type_list (void_type_node,
+ build_pointer_type (get_gcov_type ()),
+ get_gcov_unsigned_t (), NULL_TREE);
+ merge_fn_type
+ = build_array_type (build_pointer_type (merge_fn_type),
+ build_index_type (size_int (GCOV_COUNTERS - 1)));
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ merge_fn_type);
+ DECL_CHAIN (field) = fields;
+ fields = field;
+
+ /* n_functions */
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ get_gcov_unsigned_t ());
+ DECL_CHAIN (field) = fields;
+ fields = field;
+
+ /* function_info pointer array */
+ fn_info_type = build_pointer_type
+ (build_qualified_type (fn_info_type, TYPE_QUAL_CONST));
+ fn_info_array = build_index_type (size_int (n_funcs));
+ fn_info_array = build_array_type (fn_info_type, fn_info_array);
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
+ fn_info_array);
+ DECL_CHAIN (field) = fields;
+ fields = field;
- fn = build_decl (BUILTINS_LOCATION,
- FUNCTION_DECL,
- get_identifier (ctr_merge_functions[counter]),
- TREE_TYPE (TREE_TYPE (fields)));
- DECL_EXTERNAL (fn) = 1;
- TREE_PUBLIC (fn) = 1;
- DECL_ARTIFICIAL (fn) = 1;
- TREE_NOTHROW (fn) = 1;
- DECL_ASSEMBLER_NAME (fn); /* Initialize assembler name so we can stream out. */
- CONSTRUCTOR_APPEND_ELT (v, fields, build1 (ADDR_EXPR, TREE_TYPE (fields), fn));
-
- return build_constructor (type, v);
+ finish_builtin_struct (type, "__gcov_info", fields, NULL_TREE);
}
-/* Creates the gcov_info RECORD_TYPE and initializer for it. Returns a
- CONSTRUCTOR. */
+/* Creates the gcov_info initializer. Returns a CONSTRUCTOR. */
static tree
-build_gcov_info (void)
+build_info (tree info_type, tree fn_type, tree key_var, unsigned n_funcs)
{
- unsigned n_ctr_types, ix;
- tree type, const_type;
- tree fn_info_type, fn_info_value = NULL_TREE;
- tree fn_info_ptr_type;
- tree ctr_info_type, ctr_info_ary_type, ctr_info_value = NULL_TREE;
- tree field, fields = NULL_TREE;
+ tree info_fields = TYPE_FIELDS (info_type);
+ tree merge_fn_type, fn_info_ptr_type;
+ unsigned ix;
tree filename_string;
int da_file_name_len;
- unsigned n_fns;
const struct function_list *fn;
- tree string_type;
VEC(constructor_elt,gc) *v1 = NULL;
VEC(constructor_elt,gc) *v2 = NULL;
-
- /* Count the number of active counters. */
- for (n_ctr_types = 0, ix = 0; ix != GCOV_COUNTERS; ix++)
- if (prg_ctr_mask & (1 << ix))
- n_ctr_types++;
-
- type = lang_hooks.types.make_type (RECORD_TYPE);
- const_type = build_qualified_type (type, TYPE_QUAL_CONST);
+ VEC(constructor_elt,gc) *v3 = NULL;
/* Version ident */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field,
- build_int_cstu (TREE_TYPE (field), GCOV_VERSION));
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build_int_cstu (TREE_TYPE (info_fields),
+ GCOV_VERSION));
+ info_fields = DECL_CHAIN (info_fields);
/* next -- NULL */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, build_pointer_type (const_type));
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field, null_pointer_node);
-
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields, null_pointer_node);
+ info_fields = DECL_CHAIN (info_fields);
+
/* stamp */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field,
- build_int_cstu (TREE_TYPE (field), local_tick));
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build_int_cstu (TREE_TYPE (info_fields),
+ local_tick));
+ info_fields = DECL_CHAIN (info_fields);
/* Filename */
- string_type = build_pointer_type (build_qualified_type (char_type_node,
- TYPE_QUAL_CONST));
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, string_type);
- DECL_CHAIN (field) = fields;
- fields = field;
da_file_name_len = strlen (da_file_name);
filename_string = build_string (da_file_name_len + 1, da_file_name);
TREE_TYPE (filename_string) = build_array_type
(char_type_node, build_index_type (size_int (da_file_name_len)));
- CONSTRUCTOR_APPEND_ELT (v1, field,
- build1 (ADDR_EXPR, string_type, filename_string));
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build1 (ADDR_EXPR, TREE_TYPE (info_fields),
+ filename_string));
+ info_fields = DECL_CHAIN (info_fields);
- /* Build the fn_info type and initializer. */
- fn_info_type = build_fn_info_type (n_ctr_types);
- fn_info_ptr_type = build_pointer_type (build_qualified_type
- (fn_info_type, TYPE_QUAL_CONST));
- for (fn = functions_head, n_fns = 0; fn; fn = fn->next, n_fns++)
- CONSTRUCTOR_APPEND_ELT (v2, NULL_TREE,
- build_fn_info_value (fn, fn_info_type));
-
- if (n_fns)
+ /* merge fn array -- NULL slots indicate unmeasured counters */
+ merge_fn_type = TREE_TYPE (TREE_TYPE (info_fields));
+ for (ix = 0; ix != GCOV_COUNTERS; ix++)
{
- tree array_type;
-
- array_type = build_index_type (size_int (n_fns - 1));
- array_type = build_array_type (fn_info_type, array_type);
+ tree ptr = null_pointer_node;
- fn_info_value = build_constructor (array_type, v2);
- fn_info_value = build1 (ADDR_EXPR, fn_info_ptr_type, fn_info_value);
+ if ((1u << ix) & prg_ctr_mask)
+ {
+ tree merge_fn = build_decl (BUILTINS_LOCATION,
+ FUNCTION_DECL,
+ get_identifier (ctr_merge_functions[ix]),
+ TREE_TYPE (merge_fn_type));
+ DECL_EXTERNAL (merge_fn) = 1;
+ TREE_PUBLIC (merge_fn) = 1;
+ DECL_ARTIFICIAL (merge_fn) = 1;
+ TREE_NOTHROW (merge_fn) = 1;
+ /* Initialize assembler name so we can stream out. */
+ DECL_ASSEMBLER_NAME (merge_fn);
+ ptr = build1 (ADDR_EXPR, merge_fn_type, merge_fn);
+ }
+ CONSTRUCTOR_APPEND_ELT (v2, NULL, ptr);
}
- else
- fn_info_value = null_pointer_node;
-
- /* number of functions */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field,
- build_int_cstu (get_gcov_unsigned_t (), n_fns));
-
- /* fn_info table */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, fn_info_ptr_type);
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field, fn_info_value);
-
- /* counter_mask */
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field,
- build_int_cstu (get_gcov_unsigned_t (),
- prg_ctr_mask));
-
- /* counters */
- ctr_info_type = build_ctr_info_type ();
- ctr_info_ary_type = build_index_type (size_int (n_ctr_types));
- ctr_info_ary_type = build_array_type (ctr_info_type, ctr_info_ary_type);
- v2 = NULL;
- for (ix = 0; ix != GCOV_COUNTERS; ix++)
- if (prg_ctr_mask & (1 << ix))
- CONSTRUCTOR_APPEND_ELT (v2, NULL_TREE,
- build_ctr_info_value (ix, ctr_info_type));
- ctr_info_value = build_constructor (ctr_info_ary_type, v2);
-
- field = build_decl (BUILTINS_LOCATION,
- FIELD_DECL, NULL_TREE, ctr_info_ary_type);
- DECL_CHAIN (field) = fields;
- fields = field;
- CONSTRUCTOR_APPEND_ELT (v1, field, ctr_info_value);
-
- finish_builtin_struct (type, "__gcov_info", fields, NULL_TREE);
-
- return build_constructor (type, v1);
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build_constructor (TREE_TYPE (info_fields), v2));
+ info_fields = DECL_CHAIN (info_fields);
+
+ /* n_functions */
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build_int_cstu (TREE_TYPE (info_fields), n_funcs));
+ info_fields = DECL_CHAIN (info_fields);
+
+ /* Build the fn_info type and initializer. */
+ fn_info_ptr_type = TREE_TYPE (TREE_TYPE (info_fields));
+
+ for (fn = functions_head; fn; fn = fn->next)
+ {
+ tree init = build_fn_info (fn, fn_type, key_var);
+ tree var = build_var (fn->fn_decl, fn_type, -1);
+
+ DECL_INITIAL (var) = init;
+ varpool_finalize_decl (var);
+
+ CONSTRUCTOR_APPEND_ELT (v3, NULL,
+ build1 (ADDR_EXPR, fn_info_ptr_type, var));
+ }
+ CONSTRUCTOR_APPEND_ELT (v1, info_fields,
+ build_constructor (TREE_TYPE (info_fields), v3));
+ return build_constructor (info_type, v1);
}
/* Write out the structure which libgcov uses to locate all the
@@ -982,6 +989,11 @@ static void
create_coverage (void)
{
tree gcov_info, gcov_init, body, t;
+ tree gcov_info_type, gcov_fn_type;
+ unsigned n_counters = 0, n_functions = 0;
+ struct function_list *fn;
+ struct function_list **fn_prev;
+ unsigned ix;
char name_buf[32];
no_coverage = 1; /* Disable any further coverage. */
@@ -989,14 +1001,37 @@ create_coverage (void)
if (!prg_ctr_mask)
return;
- t = build_gcov_info ();
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Using data file %s\n", da_file_name);
+ for (ix = 0; ix != GCOV_COUNTERS; ix++)
+ if ((1u << ix) & prg_ctr_mask)
+ n_counters++;
+ for (fn_prev = &functions_head; (fn = *fn_prev);)
+ if (DECL_STRUCT_FUNCTION (fn->fn_decl))
+ {
+ n_functions++;
+ fn_prev = &fn->next;
+ }
+ else
+ /* The function is not being emitted, remove from list. */
+ *fn_prev = fn->next;
+
+ /* Build the info and fn_info types. These are mutually recursive. */
+ gcov_info_type = lang_hooks.types.make_type (RECORD_TYPE);
+ gcov_fn_type = lang_hooks.types.make_type (RECORD_TYPE);
+ build_fn_info_type (gcov_fn_type, n_counters, gcov_info_type);
+ build_info_type (gcov_info_type, n_functions, gcov_fn_type);
+
+ /* Build the gcov info var, this is referred to in its own
+ initializer. */
gcov_info = build_decl (BUILTINS_LOCATION,
- VAR_DECL, NULL_TREE, TREE_TYPE (t));
+ VAR_DECL, NULL_TREE, gcov_info_type);
TREE_STATIC (gcov_info) = 1;
ASM_GENERATE_INTERNAL_LABEL (name_buf, "LPBX", 0);
DECL_NAME (gcov_info) = get_identifier (name_buf);
- DECL_INITIAL (gcov_info) = t;
+ DECL_INITIAL (gcov_info) = build_info (gcov_info_type, gcov_fn_type,
+ gcov_info, n_functions);
/* Build structure. */
varpool_finalize_decl (gcov_info);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1b40250b421..72aa0513d96 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,222 @@
+2011-11-07 Jason Merrill <jason@redhat.com>
+ Dodji Seketeli <dodji@redhat.com>
+
+ Support C++11 alias-declaration
+ PR c++/45114
+ * cp-tree.h (TYPE_DECL_ALIAS_P, TYPE_ALIAS_P)
+ (DECL_TYPE_TEMPLATE_P, DECL_ALIAS_TEMPLATE_P): New accessor
+ macros.
+ (TYPE_TEMPLATE_INFO): Get template info of an alias template
+ specializations from its TYPE_DECL.
+ (SET_TYPE_TEMPLATE_INFO): Set template info of alias template
+ specializations into its TYPE_DECL.
+ (DECL_CLASS_TEMPLATE_P): Re-write using the new
+ DECL_TYPE_TEMPLATE_P.
+ (enum cp_decl_spec): Add new ds_alias enumerator.
+ (alias_type_or_template_p, alias_template_specialization_p):
+ Declare new functions.
+ * parser.c (cp_parser_alias_declaration): New static function.
+ (cp_parser_check_decl_spec): Add "using" name for the `alias'
+ declspec.
+ (cp_parser_type_name): Update comment. Support simple-template-id
+ representing alias template specializations in c++0x mode.
+ (cp_parser_qualifying_entity): Update comment. Use
+ cp_parser_type_name.
+ (cp_parser_block_declaration): Handle alias-declaration in c++11.
+ Update comment.
+ (cp_parser_template_id): Handle specializations of alias
+ templates.
+ (cp_parser_member_declaration): Add alias-declaration production
+ to comment. Support alias-declarations.
+ (cp_parser_template_declaration_after_export): Handle alias
+ templates in c++11.
+ * decl.c (make_typename_type, make_unbound_class_template): Accept
+ alias templates.
+ (grokdeclarator): Set TYPE_DECL_ALIAS_P on alias
+ declarations.
+ * decl2.c (grokfield): Move template creation after setting up the
+ TYPE_DECL of the alias, so that the TEMPLATE_DECL of the alias
+ template actually carries the right type-id of the alias
+ declaration.
+ * pt.c (alias_type_or_template_p)
+ (alias_template_specialization_p): Define new public functions.
+ (maybe_process_partial_specialization): Reject partial
+ specializations of alias templates.
+ (primary_template_instantiation_p): Consider alias template
+ instantiations.
+ (push_template_decl_real): Assert that TYPE_DECLs of alias
+ templates are different from those of class template. Store
+ template info onto the TYPE_DECL of the alias template.
+ (convert_template_argument): Strip aliases from template
+ arguments.
+ (lookup_template_class_1): Handle the creation of the
+ specialization of an alias template.
+ (tsubst_decl): Create a substituted copy of the TYPE_DECL of an
+ member alias template.
+ (tsubst): Handle substituting into the type of an alias template.
+ Handle substituting UNBOUND_CLASS_TEMPLATE into
+ BOUND_TEMPLATE_TEMPLATE_PARM.
+ (do_type_instantiation): Better diagnostics when trying to
+ explicitely instantiate a non-class template.
+ * search.c (lookup_field_1, lookup_field_r): Support looking up
+ alias templates.
+ * semantics.c (finish_template_type): For instantiations of alias
+ templates, return the TYPE_DECL of the actual alias and not the
+ one of the aliased type.
+ * error.c (dump_alias_template_specialization): New static
+ function.
+ (dump_type): Handle printing of alias templates and their
+ specializations. templates.
+ (dump_aggr_type): For specialization of alias templates, fetch
+ arguments from the right place.
+ (dump_decl): Print an alias-declaration like `using decl = type;'
+ (dump_template_decl): Support printing of alias templates.
+
+2011-11-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * decl2.c (constrain_visibility): Return void. Add tmpl parm
+ which gives the constraint priority over an attribute.
+ (constrain_visibility_for_template, determine_visibility): Adjust.
+ * pt.c (instantiate_class_template_1): Call determine_visibility.
+
+ PR c++/33255
+ * decl.c (save_function_data): Clear local_typedefs.
+
+ * decl.c (cp_finish_decl): Only make_tree_vector if we're calling
+ check_initializer.
+
+2011-11-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * decl2.c (constrain_visibility): Check decl_has_visibility_attr
+ rather than DECL_VISIBILITY_SPECIFIED.
+
+2011-11-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47695
+ * decl2.c (mark_used): Early return false after error or sorry.
+ * cp-tree.h (mark_used): Adjust declaration.
+ * semantics.c (finish_id_expression): Check mark_used return value.
+
+2011-11-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * decl.c (cp_finish_decl): Mostly revert previous change.
+
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/26714
+ * init.c (perform_member_init): Strip TARGET_EXPR around NSDMI.
+ Do temporary lifetime extension.
+
+ PR c++/48370
+ * decl.c (cp_finish_decl): Run cleanups in the right order.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR c++/50608
+ * semantics.c (finish_offsetof): Adjust call to fold_offsetof.
+ * typeck.c (cp_build_addr_expr_1): Call fold_offsetof_1.
+
+2011-11-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * typeck.c (build_indirect_ref): Use ATTRIBUTE_UNUSED.
+ * mangle.c (write_unnamed_type_name): Likewise.
+
+2011-11-04 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * parser.c (cp_parser_enumerator_list): Do not warn about
+ trailing commas in C++0x mode.
+
+2011-11-04 Olivier Goffart <olivier@woboq.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/50965
+ * class.c (check_field_decls): NSDMI makes a class non-aggregate.
+
+2011-11-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/48420
+ * call.c (conversion_null_warnings): For 'false' to NULL pointer,
+ just check that TREE_TYPE (expr) is a BOOLEAN_TYPE.
+
+2011-11-04 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ PR c++/50941
+ * parser.c (cp_parser_userdef_string_literal): Fix string length.
+
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * call.c (extend_ref_init_temps, extend_ref_init_temps_1): New.
+ (set_up_extended_ref_temp): Use it. Change cleanup parm to VEC.
+ (initialize_reference): Just call convert_like.
+ * decl.c (grok_reference_init): Just call initialize_reference.
+ (build_init_list_var_init): Remove.
+ (check_initializer): Change cleanup parm to VEC. Handle references
+ like other types. Call perform_implicit_conversion instead
+ of build_init_list_var_init. Don't use build_aggr_init for
+ aggregate initialization of arrays.
+ (cp_finish_decl): Change cleanup to VEC.
+ * typeck2.c (store_init_value): Call extend_ref_init_temps.
+ Use build_vec_init for non-constant arrays.
+ * init.c (expand_aggr_init_1): Adjust.
+ (build_vec_init): Avoid re-converting an initializer
+ that's already digested.
+ * mangle.c (mangle_ref_init_variable): Add a discriminator.
+ * cp-tree.h: Adjust.
+ * typeck.c (convert_for_initialization): Adjust.
+ * decl2.c (maybe_emit_vtables): Adjust.
+
+2011-11-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/50930
+ * init.c (build_aggr_init): Don't set LOOKUP_ONLYCONVERTING
+ if the initializer has TARGET_EXPR_DIRECT_INIT_P.
+ (expand_default_init): An initializer with TARGET_EXPR_DIRECT_INIT_P
+ or TARGET_EXPR_LIST_INIT_P doesn't need more processing.
+ * tree.c (bot_manip): Propagate TARGET_EXPR_IMPLICIT_P,
+ TARGET_EXPR_LIST_INIT_P, TARGET_EXPR_DIRECT_INIT_P.
+ * call.c (convert_like_real): Set TARGET_EXPR_DIRECT_INIT_P
+ as appropriate on list-value-initialization.
+
+ * parser.c (cp_parser_decl_specifier_seq): Change "C++0x" to
+ "C++11" in warnings.
+ (cp_lexer_get_preprocessor_token): Likewise.
+ (cp_parser_binary_expression): Likewise.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50810
+ * typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics.
+ (digest_init_r): Call check_narrowing irrespective of the C++ dialect.
+ * decl.c (check_initializer): Likewise.
+ * semantics.c (finish_compound_literal): Likewise.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50956
+ * typeck.c (build_const_cast_1): Fix -Wcast-qual for false
+ comp_ptr_ttypes_const.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (g++spec.o): Pass SHLIB instead of SHLIB_LINK.
+
+2011-11-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44277
+ * cvt.c (cp_convert_to_pointer): Warn for zero as null pointer
+ constant.
+ * typeck.c (cp_truthvalue_conversion): Handle pointers and member
+ function pointers under c_inhibit_evaluation_warnings; use
+ nullptr_node for data member pointers.
+ (cp_build_binary_op): Tweak, just forward to cp_convert op1,
+ either a nullptr_node or an integer_zero_node.
+ (build_ptrmemfunc): Use nullptr_node.
+ * init.c (build_zero_init_1): Likewise.
+
2011-11-01 Jason Merrill <jason@redhat.com>
PR c++/50500
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 6944ce972a8..650fc385096 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -55,7 +55,7 @@ c++: cc1plus$(exeext)
g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
$(CONFIG_H) $(OPTS_H)
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
$(INCLUDES) $(srcdir)/cp/g++spec.c)
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index c1b9018788c..578905e41e6 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5547,7 +5547,8 @@ conversion_null_warnings (tree totype, tree expr, tree fn, int argnum)
}
/* Issue warnings if "false" is converted to a NULL pointer */
- else if (expr == boolean_false_node && TYPE_PTR_P (totype))
+ else if (TREE_CODE (TREE_TYPE (expr)) == BOOLEAN_TYPE
+ && TYPE_PTR_P (totype))
{
if (fn)
warning_at (input_location, OPT_Wconversion_null,
@@ -5658,10 +5659,14 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
&& CONSTRUCTOR_NELTS (expr) == 0
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (totype))
{
+ bool direct = CONSTRUCTOR_IS_DIRECT_INIT (expr);
expr = build_value_init (totype, complain);
expr = get_target_expr_sfinae (expr, complain);
if (expr != error_mark_node)
- TARGET_EXPR_LIST_INIT_P (expr) = true;
+ {
+ TARGET_EXPR_LIST_INIT_P (expr) = true;
+ TARGET_EXPR_DIRECT_INIT_P (expr) = direct;
+ }
return expr;
}
@@ -8501,6 +8506,44 @@ perform_direct_initialization_if_possible (tree type,
return expr;
}
+/* When initializing a reference that lasts longer than a full-expression,
+ this special rule applies:
+
+ [class.temporary]
+
+ The temporary to which the reference is bound or the temporary
+ that is the complete object to which the reference is bound
+ persists for the lifetime of the reference.
+
+ The temporaries created during the evaluation of the expression
+ initializing the reference, except the temporary to which the
+ reference is bound, are destroyed at the end of the
+ full-expression in which they are created.
+
+ In that case, we store the converted expression into a new
+ VAR_DECL in a new scope.
+
+ However, we want to be careful not to create temporaries when
+ they are not required. For example, given:
+
+ struct B {};
+ struct D : public B {};
+ D f();
+ const B& b = f();
+
+ there is no need to copy the return value from "f"; we can just
+ extend its lifetime. Similarly, given:
+
+ struct S {};
+ struct T { operator S(); };
+ T t;
+ const S& s = t;
+
+ we can extend the lifetime of the return value of the conversion
+ operator.
+
+ The next several functions are involved in this lifetime extension. */
+
/* DECL is a VAR_DECL whose type is a REFERENCE_TYPE. The reference
is being bound to a temporary. Create and return a new VAR_DECL
with the indicated TYPE; this variable will store the value to
@@ -8518,6 +8561,7 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
if (TREE_STATIC (decl))
{
/* Namespace-scope or local static; give it a mangled name. */
+ /* FIXME share comdat with decl? */
tree name;
TREE_STATIC (var) = 1;
@@ -8539,8 +8583,9 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
cleanup for the new variable is returned through CLEANUP, and the
code to initialize the new variable is returned through INITP. */
-tree
-set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
+static tree
+set_up_extended_ref_temp (tree decl, tree expr, VEC(tree,gc) **cleanups,
+ tree *initp)
{
tree init;
tree type;
@@ -8561,6 +8606,10 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
if (TREE_CODE (expr) != TARGET_EXPR)
expr = get_target_expr (expr);
+ /* Recursively extend temps in this initializer. */
+ TARGET_EXPR_INITIAL (expr)
+ = extend_ref_init_temps (decl, TARGET_EXPR_INITIAL (expr), cleanups);
+
/* If the initializer is constant, put it in DECL_INITIAL so we get
static initialization and use in constant expressions. */
init = maybe_constant_init (expr);
@@ -8594,7 +8643,11 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
if (TREE_STATIC (var))
init = add_stmt_to_compound (init, register_dtor_fn (var));
else
- *cleanup = cxx_maybe_build_cleanup (var, tf_warning_or_error);
+ {
+ tree cleanup = cxx_maybe_build_cleanup (var, tf_warning_or_error);
+ if (cleanup)
+ VEC_safe_push (tree, gc, *cleanups, cleanup);
+ }
/* We must be careful to destroy the temporary only
after its initialization has taken place. If the
@@ -8628,18 +8681,10 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
}
/* Convert EXPR to the indicated reference TYPE, in a way suitable for
- initializing a variable of that TYPE. If DECL is non-NULL, it is
- the VAR_DECL being initialized with the EXPR. (In that case, the
- type of DECL will be TYPE.) If DECL is non-NULL, then CLEANUP must
- also be non-NULL, and with *CLEANUP initialized to NULL. Upon
- return, if *CLEANUP is no longer NULL, it will be an expression
- that should be pushed as a cleanup after the returned expression
- is used to initialize DECL.
-
- Return the converted expression. */
+ initializing a variable of that TYPE. */
tree
-initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
+initialize_reference (tree type, tree expr,
int flags, tsubst_flags_t complain)
{
conversion *conv;
@@ -8673,103 +8718,77 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
return error_mark_node;
}
- /* If DECL is non-NULL, then this special rule applies:
-
- [class.temporary]
-
- The temporary to which the reference is bound or the temporary
- that is the complete object to which the reference is bound
- persists for the lifetime of the reference.
+ gcc_assert (conv->kind == ck_ref_bind);
- The temporaries created during the evaluation of the expression
- initializing the reference, except the temporary to which the
- reference is bound, are destroyed at the end of the
- full-expression in which they are created.
+ /* Perform the conversion. */
+ expr = convert_like (conv, expr, complain);
- In that case, we store the converted expression into a new
- VAR_DECL in a new scope.
+ /* Free all the conversions we allocated. */
+ obstack_free (&conversion_obstack, p);
- However, we want to be careful not to create temporaries when
- they are not required. For example, given:
+ return expr;
+}
- struct B {};
- struct D : public B {};
- D f();
- const B& b = f();
+/* Subroutine of extend_ref_init_temps. Possibly extend one initializer,
+ which is bound either to a reference or a std::initializer_list. */
- there is no need to copy the return value from "f"; we can just
- extend its lifetime. Similarly, given:
+static tree
+extend_ref_init_temps_1 (tree decl, tree init, VEC(tree,gc) **cleanups)
+{
+ tree sub = init;
+ tree *p;
+ STRIP_NOPS (sub);
+ if (TREE_CODE (sub) != ADDR_EXPR)
+ return init;
+ /* Deal with binding to a subobject. */
+ for (p = &TREE_OPERAND (sub, 0); TREE_CODE (*p) == COMPONENT_REF; )
+ p = &TREE_OPERAND (*p, 0);
+ if (TREE_CODE (*p) == TARGET_EXPR)
+ {
+ tree subinit = NULL_TREE;
+ *p = set_up_extended_ref_temp (decl, *p, cleanups, &subinit);
+ if (subinit)
+ init = build2 (COMPOUND_EXPR, TREE_TYPE (init), subinit, init);
+ }
+ return init;
+}
- struct S {};
- struct T { operator S(); };
- T t;
- const S& s = t;
+/* INIT is part of the initializer for DECL. If there are any
+ reference or initializer lists being initialized, extend their
+ lifetime to match that of DECL. */
- we can extend the lifetime of the return value of the conversion
- operator. */
- gcc_assert (conv->kind == ck_ref_bind);
- if (decl)
+tree
+extend_ref_init_temps (tree decl, tree init, VEC(tree,gc) **cleanups)
+{
+ tree type = TREE_TYPE (init);
+ if (processing_template_decl)
+ return init;
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ init = extend_ref_init_temps_1 (decl, init, cleanups);
+ else if (is_std_init_list (type))
{
- tree var;
- tree base_conv_type;
-
- gcc_assert (complain == tf_warning_or_error);
-
- /* Skip over the REF_BIND. */
- conv = conv->u.next;
- /* If the next conversion is a BASE_CONV, skip that too -- but
- remember that the conversion was required. */
- if (conv->kind == ck_base)
+ /* The temporary array underlying a std::initializer_list
+ is handled like a reference temporary. */
+ tree ctor = init;
+ if (TREE_CODE (ctor) == TARGET_EXPR)
+ ctor = TARGET_EXPR_INITIAL (ctor);
+ if (TREE_CODE (ctor) == CONSTRUCTOR)
{
- base_conv_type = conv->type;
- conv = conv->u.next;
- }
- else
- base_conv_type = NULL_TREE;
- /* Perform the remainder of the conversion. */
- expr = convert_like_real (conv, expr,
- /*fn=*/NULL_TREE, /*argnum=*/0,
- /*inner=*/-1,
- /*issue_conversion_warnings=*/true,
- /*c_cast_p=*/false,
- complain);
- if (error_operand_p (expr))
- expr = error_mark_node;
- else
- {
- if (!lvalue_or_rvalue_with_address_p (expr))
- {
- tree init;
- var = set_up_extended_ref_temp (decl, expr, cleanup, &init);
- /* Use its address to initialize the reference variable. */
- expr = build_address (var);
- if (base_conv_type)
- expr = convert_to_base (expr,
- build_pointer_type (base_conv_type),
- /*check_access=*/true,
- /*nonnull=*/true, complain);
- if (init)
- expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
- }
- else
- /* Take the address of EXPR. */
- expr = cp_build_addr_expr (expr, complain);
- /* If a BASE_CONV was required, perform it now. */
- if (base_conv_type)
- expr = (perform_implicit_conversion
- (build_pointer_type (base_conv_type), expr,
- complain));
- expr = build_nop (type, expr);
+ tree array = CONSTRUCTOR_ELT (ctor, 0)->value;
+ array = extend_ref_init_temps_1 (decl, array, cleanups);
+ CONSTRUCTOR_ELT (ctor, 0)->value = array;
}
}
- else
- /* Perform the conversion. */
- expr = convert_like (conv, expr, complain);
-
- /* Free all the conversions we allocated. */
- obstack_free (&conversion_obstack, p);
+ else if (TREE_CODE (init) == CONSTRUCTOR)
+ {
+ unsigned i;
+ constructor_elt *p;
+ VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (init);
+ FOR_EACH_VEC_ELT (constructor_elt, elts, i, p)
+ p->value = extend_ref_init_temps (decl, p->value, cleanups);
+ }
- return expr;
+ return init;
}
/* Returns true iff TYPE is some variant of std::initializer_list. */
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f3d87fca819..be632be64c8 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3205,6 +3205,12 @@ check_field_decls (tree t, tree *access_decls,
no_const_asn_ref_p,
&any_default_members);
+ /* Now that we've removed bit-field widths from DECL_INITIAL,
+ anything left in DECL_INITIAL is an NSDMI that makes the class
+ non-aggregate. */
+ if (DECL_INITIAL (x))
+ CLASSTYPE_NON_AGGREGATE (t) = true;
+
/* If any field is const, the structure type is pseudo-const. */
if (CP_TYPE_CONST_P (type))
{
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 1bb6d98d072..32d08caf9cc 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -140,6 +140,7 @@ c-common.h, not after.
5: DECL_INTERFACE_KNOWN.
6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
DECL_FIELD_IS_BASE (in FIELD_DECL)
+ TYPE_DECL_ALIAS_P (in TYPE_DECL)
7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
DECL_THUNK_P (in a member FUNCTION_DECL)
DECL_NORMAL_CAPTURE_P (in FIELD_DECL)
@@ -2542,6 +2543,17 @@ extern void decl_shadowed_for_var_insert (tree, tree);
#define DECL_PENDING_INLINE_INFO(NODE) \
(LANG_DECL_FN_CHECK (NODE)->u.pending_inline_info)
+/* Nonzero for TYPE_DECL means that it was written 'using name = type'. */
+#define TYPE_DECL_ALIAS_P(NODE) \
+ DECL_LANG_FLAG_6 (TYPE_DECL_CHECK (NODE))
+
+/* Nonzero for a type which is an alias for another type; i.e, a type
+ which declaration was written 'using name-of-type =
+ another-type'. */
+#define TYPE_ALIAS_P(NODE) \
+ (TYPE_P (NODE) \
+ && TYPE_DECL_ALIAS_P (TYPE_NAME (NODE)))
+
/* For a class type: if this structure has many fields, we'll sort them
and put them into a TREE_VEC. */
#define CLASSTYPE_SORTED_FIELDS(NODE) \
@@ -2598,16 +2610,20 @@ extern void decl_shadowed_for_var_insert (tree, tree);
? ENUM_TEMPLATE_INFO (NODE) : \
(TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \
? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) : \
- (TYPE_LANG_SPECIFIC (NODE) \
+ ((CLASS_TYPE_P (NODE) && !TYPE_ALIAS_P (NODE)) \
? CLASSTYPE_TEMPLATE_INFO (NODE) \
- : NULL_TREE)))
+ : (DECL_LANG_SPECIFIC (TYPE_NAME (NODE)) \
+ ? (DECL_TEMPLATE_INFO (TYPE_NAME (NODE))) \
+ : NULL_TREE))))
/* Set the template information for an ENUMERAL_, RECORD_, or
UNION_TYPE to VAL. */
-#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
- (TREE_CODE (NODE) == ENUMERAL_TYPE \
- ? (ENUM_TEMPLATE_INFO (NODE) = (VAL)) \
- : (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL)))
+#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
+ (TREE_CODE (NODE) == ENUMERAL_TYPE \
+ ? (ENUM_TEMPLATE_INFO (NODE) = (VAL)) \
+ : ((CLASS_TYPE_P (NODE) && !TYPE_ALIAS_P (NODE)) \
+ ? (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL)) \
+ : (DECL_TEMPLATE_INFO (TYPE_NAME (NODE)) = (VAL))))
#define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE))
#define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE))
@@ -3206,8 +3222,9 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
/* [dcl.init.aggr]
- An aggregate is an array or a class with no user-declared
- constructors, no private or protected non-static data members, no
+ An aggregate is an array or a class with no user-provided
+ constructors, no brace-or-equal-initializers for non-static data
+ members, no private or protected non-static data members, no
base classes, and no virtual functions.
As an extension, we also treat vectors as aggregates. Keep these
@@ -3620,12 +3637,23 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
&& !DECL_UNBOUND_CLASS_TEMPLATE_P (NODE) \
&& TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
-/* Nonzero for a DECL that represents a template class. */
-#define DECL_CLASS_TEMPLATE_P(NODE) \
+/* Nonzero for a DECL that represents a class template or alias
+ template. */
+#define DECL_TYPE_TEMPLATE_P(NODE) \
(TREE_CODE (NODE) == TEMPLATE_DECL \
&& DECL_TEMPLATE_RESULT (NODE) != NULL_TREE \
+ && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL)
+
+/* Nonzero for a DECL that represents a class template. */
+#define DECL_CLASS_TEMPLATE_P(NODE) \
+ (DECL_TYPE_TEMPLATE_P (NODE) \
&& DECL_IMPLICIT_TYPEDEF_P (DECL_TEMPLATE_RESULT (NODE)))
+/* Nonzero for a TEMPLATE_DECL that represents an alias template. */
+#define DECL_ALIAS_TEMPLATE_P(NODE) \
+ (DECL_TYPE_TEMPLATE_P (NODE) \
+ && !DECL_ARTIFICIAL (DECL_TEMPLATE_RESULT (NODE)))
+
/* Nonzero for a NODE which declares a type. */
#define DECL_DECLARES_TYPE_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
@@ -4584,6 +4612,7 @@ typedef enum cp_decl_spec {
ds_explicit,
ds_friend,
ds_typedef,
+ ds_alias,
ds_constexpr,
ds_complex,
ds_thread,
@@ -4815,9 +4844,9 @@ extern tree cxx_type_promotes_to (tree);
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 *, int,
+extern tree initialize_reference (tree, tree, int,
tsubst_flags_t);
+extern tree extend_ref_init_temps (tree, tree, VEC(tree,gc)**);
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
extern tree strip_top_quals (tree);
extern bool reference_related_p (tree, tree);
@@ -5053,7 +5082,7 @@ extern tree build_offset_ref_call_from_tree (tree, VEC(tree,gc) **);
extern bool decl_constant_var_p (tree);
extern bool decl_maybe_constant_var_p (tree);
extern void check_default_args (tree);
-extern void mark_used (tree);
+extern bool mark_used (tree);
extern void finish_static_data_member_decl (tree, tree, bool, tree, int);
extern tree cp_build_parm_decl (tree, tree);
extern tree get_guard (tree);
@@ -5287,6 +5316,8 @@ extern tree build_non_dependent_expr (tree);
extern void make_args_non_dependent (VEC(tree,gc) *);
extern bool reregister_specialization (tree, tree, tree);
extern tree fold_non_dependent_expr (tree);
+extern bool alias_type_or_template_p (tree);
+extern bool alias_template_specialization_p (tree);
extern bool explicit_class_specialization_p (tree);
extern int push_tinst_level (tree);
extern void pop_tinst_level (void);
@@ -5801,7 +5832,7 @@ extern void complete_type_check_abstract (tree);
extern int abstract_virtuals_error (tree, tree);
extern int abstract_virtuals_error_sfinae (tree, tree, tsubst_flags_t);
-extern tree store_init_value (tree, tree, int);
+extern tree store_init_value (tree, tree, VEC(tree,gc)**, int);
extern void check_narrowing (tree, tree);
extern tree digest_init (tree, tree, tsubst_flags_t);
extern tree digest_init_flags (tree, tree, int);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 3e618d320ad..8570e3d4502 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -198,6 +198,11 @@ cp_convert_to_pointer (tree type, tree expr)
if (null_ptr_cst_p (expr))
{
+ if (c_inhibit_evaluation_warnings == 0
+ && !NULLPTR_TYPE_P (TREE_TYPE (expr)))
+ warning (OPT_Wzero_as_null_pointer_constant,
+ "zero as null pointer constant");
+
if (TYPE_PTRMEMFUNC_P (type))
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0,
/*c_cast_p=*/false, tf_warning_or_error);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cf0429e3f18..de0cf25d640 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -71,7 +71,7 @@ static void require_complete_types_for_parms (tree);
static int ambi_op_p (enum tree_code);
static int unary_op_p (enum tree_code);
static void push_local_name (tree);
-static tree grok_reference_init (tree, tree, tree, tree *, int);
+static tree grok_reference_init (tree, tree, tree, int);
static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *,
int, int, tree);
static int check_static_variable_definition (tree, tree);
@@ -91,7 +91,7 @@ static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool);
static int walk_namespaces_r (tree, walk_namespaces_fn, void *);
static void maybe_deduce_size_from_array_init (tree, tree);
static void layout_var_decl (tree);
-static tree check_initializer (tree, tree, int, tree *);
+static tree check_initializer (tree, tree, int, VEC(tree,gc) **);
static void make_rtl_for_nonlocal_decl (tree, tree, const char *);
static void save_function_data (tree);
static void copy_type_enum (tree , tree);
@@ -3270,7 +3270,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
return error_mark_node;
}
- if (want_template && !DECL_CLASS_TEMPLATE_P (t))
+ if (want_template && !DECL_TYPE_TEMPLATE_P (t))
{
if (complain & tf_error)
error ("%<typename %T::%D%> names %q#T, which is not a class template",
@@ -3338,7 +3338,7 @@ make_unbound_class_template (tree context, tree name, tree parm_list,
if (tmpl && TREE_CODE (tmpl) == TYPE_DECL)
tmpl = maybe_get_template_decl_from_type_decl (tmpl);
- if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
+ if (!tmpl || !DECL_TYPE_TEMPLATE_P (tmpl))
{
if (complain & tf_error)
error ("no class template named %q#T in %q#T", name, context);
@@ -4613,11 +4613,8 @@ start_decl_1 (tree decl, bool initialized)
Quotes on semantics can be found in ARM 8.4.3. */
static tree
-grok_reference_init (tree decl, tree type, tree init, tree *cleanup,
- int flags)
+grok_reference_init (tree decl, tree type, tree init, int flags)
{
- tree tmp;
-
if (init == NULL_TREE)
{
if ((DECL_LANG_SPECIFIC (decl) == 0
@@ -4643,62 +4640,8 @@ 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, flags,
- tf_warning_or_error);
- if (DECL_DECLARED_CONSTEXPR_P (decl))
- {
- tmp = cxx_constant_value (tmp);
- DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)
- = reduced_constant_expression_p (tmp);
- }
-
- if (tmp == error_mark_node)
- return NULL_TREE;
- else if (tmp == NULL_TREE)
- {
- error ("cannot initialize %qT from %qT", type, TREE_TYPE (init));
- return NULL_TREE;
- }
-
- if (TREE_STATIC (decl) && !TREE_CONSTANT (tmp))
- return tmp;
-
- DECL_INITIAL (decl) = tmp;
-
- return NULL_TREE;
-}
-
-/* Subroutine of check_initializer. We're initializing a DECL of
- std::initializer_list<T> TYPE from a braced-init-list INIT, and need to
- extend the lifetime of the underlying array to match that of the decl,
- just like for reference initialization. CLEANUP is as for
- grok_reference_init. */
-
-static tree
-build_init_list_var_init (tree decl, tree type, tree init, tree *array_init,
- tree *cleanup)
-{
- tree aggr_init, array, arrtype;
- init = perform_implicit_conversion (type, init, tf_warning_or_error);
- if (error_operand_p (init))
- return error_mark_node;
-
- aggr_init = TARGET_EXPR_INITIAL (init);
- array = CONSTRUCTOR_ELT (aggr_init, 0)->value;
- arrtype = TREE_TYPE (array);
- STRIP_NOPS (array);
- gcc_assert (TREE_CODE (array) == ADDR_EXPR);
- array = TREE_OPERAND (array, 0);
- /* If the array is constant, finish_compound_literal already made it a
- static variable and we don't need to do anything here. */
- if (decl && TREE_CODE (array) == TARGET_EXPR)
- {
- tree var = set_up_extended_ref_temp (decl, array, cleanup, array_init);
- var = build_address (var);
- var = convert (arrtype, var);
- CONSTRUCTOR_ELT (aggr_init, 0)->value = var;
- }
- return init;
+ return initialize_reference (type, init, flags,
+ tf_warning_or_error);
}
/* Designated initializers in arrays are not supported in GNU C++.
@@ -5442,7 +5385,7 @@ build_aggr_init_full_exprs (tree decl, tree init, int flags)
evaluated dynamically to initialize DECL. */
static tree
-check_initializer (tree decl, tree init, int flags, tree *cleanup)
+check_initializer (tree decl, tree init, int flags, VEC(tree,gc) **cleanups)
{
tree type = TREE_TYPE (decl);
tree init_code = NULL;
@@ -5511,19 +5454,26 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
}
else if (!init && DECL_REALLY_EXTERN (decl))
;
- else if (TREE_CODE (type) == REFERENCE_TYPE)
- init = grok_reference_init (decl, type, init, cleanup, flags);
- else if (init || type_build_ctor_call (type))
+ else if (init || type_build_ctor_call (type)
+ || TREE_CODE (type) == REFERENCE_TYPE)
{
- if (!init)
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ init = grok_reference_init (decl, type, init, flags);
+ flags |= LOOKUP_ALREADY_DIGESTED;
+ }
+ else if (!init)
check_for_uninitialized_const_var (decl);
/* Do not reshape constructors of vectors (they don't need to be
reshaped. */
else if (BRACE_ENCLOSED_INITIALIZER_P (init))
{
if (is_std_init_list (type))
- init = build_init_list_var_init (decl, type, init,
- &extra_init, cleanup);
+ {
+ init = perform_implicit_conversion (type, init,
+ tf_warning_or_error);
+ flags |= LOOKUP_ALREADY_DIGESTED;
+ }
else if (TYPE_NON_AGGREGATE_CLASS (type))
{
/* Don't reshape if the class has constructors. */
@@ -5540,7 +5490,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
else
{
init = reshape_init (type, init, tf_warning_or_error);
- if (cxx_dialect >= cxx0x && SCALAR_TYPE_P (type))
+ if (SCALAR_TYPE_P (type))
check_narrowing (type, init);
}
}
@@ -5552,9 +5502,10 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
if (type == error_mark_node)
return NULL_TREE;
- if (type_build_ctor_call (type)
- || (CLASS_TYPE_P (type)
- && !(init && BRACE_ENCLOSED_INITIALIZER_P (init))))
+ if ((type_build_ctor_call (type) || CLASS_TYPE_P (type))
+ && !(flags & LOOKUP_ALREADY_DIGESTED)
+ && !(init && BRACE_ENCLOSED_INITIALIZER_P (init)
+ && CP_AGGREGATE_TYPE_P (type)))
{
init_code = build_aggr_init_full_exprs (decl, init, flags);
@@ -5596,7 +5547,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
if (init && TREE_CODE (init) != TREE_VEC)
{
- init_code = store_init_value (decl, init, flags);
+ init_code = store_init_value (decl, init, cleanups, flags);
if (pedantic && TREE_CODE (type) == ARRAY_TYPE
&& DECL_INITIAL (decl)
&& TREE_CODE (DECL_INITIAL (decl)) == STRING_CST
@@ -5958,7 +5909,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
tree asmspec_tree, int flags)
{
tree type;
- tree cleanup;
+ VEC(tree,gc) *cleanups = NULL;
const char *asmspec = NULL;
int was_readonly = 0;
bool var_definition_p = false;
@@ -5981,9 +5932,6 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
if (type == error_mark_node)
return;
- /* Assume no cleanup is required. */
- cleanup = NULL_TREE;
-
/* If a name was specified, get the string. */
if (at_namespace_scope_p ())
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
@@ -6103,9 +6051,12 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
/* This variable seems to be a non-dependent constant, so process
its initializer. If check_initializer returns non-null the
initialization wasn't constant after all. */
- tree init_code = check_initializer (decl, init, flags, &cleanup);
+ tree init_code;
+ cleanups = make_tree_vector ();
+ init_code = check_initializer (decl, init, flags, &cleanups);
if (init_code == NULL_TREE)
init = NULL_TREE;
+ release_tree_vector (cleanups);
}
else if (!DECL_PRETTY_FUNCTION_P (decl))
/* Deduce array size even if the initializer is dependent. */
@@ -6204,7 +6155,8 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
error ("Java object %qD not allocated with %<new%>", decl);
init = NULL_TREE;
}
- init = check_initializer (decl, init, flags, &cleanup);
+ cleanups = make_tree_vector ();
+ init = check_initializer (decl, init, flags, &cleanups);
/* Thread-local storage cannot be dynamically initialized. */
if (DECL_THREAD_LOCAL_P (decl) && init)
{
@@ -6369,8 +6321,13 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
/* If a CLEANUP_STMT was created to destroy a temporary bound to a
reference, insert it in the statement-tree now. */
- if (cleanup)
- push_cleanup (decl, cleanup, false);
+ if (cleanups)
+ {
+ unsigned i; tree t;
+ FOR_EACH_VEC_ELT (tree, cleanups, i, t)
+ push_cleanup (decl, t, false);
+ release_tree_vector (cleanups);
+ }
if (was_readonly)
TREE_READONLY (decl) = 1;
@@ -9792,6 +9749,11 @@ grokdeclarator (const cp_declarator *declarator,
memfn_quals != TYPE_UNQUALIFIED,
inlinep, friendp, raises != NULL_TREE);
+ if (declspecs->specs[(int)ds_alias])
+ /* Acknowledge that this was written:
+ `using analias = atype;'. */
+ TYPE_DECL_ALIAS_P (decl) = 1;
+
return decl;
}
@@ -13066,6 +13028,7 @@ save_function_data (tree decl)
f->base.x_stmt_tree.x_cur_stmt_list = NULL;
f->bindings = NULL;
f->x_local_names = NULL;
+ f->base.local_typedefs = NULL;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index be9044b9e67..3dc5a69df54 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -848,9 +848,6 @@ grokfield (const cp_declarator *declarator,
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
- if (processing_template_decl)
- value = push_template_decl (value);
-
if (attrlist)
{
int attrflags = 0;
@@ -869,6 +866,12 @@ grokfield (const cp_declarator *declarator,
&& TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))) != value)
set_underlying_type (value);
+ /* It's important that push_template_decl below follows
+ set_underlying_type above so that the created template
+ carries the properly set type of VALUE. */
+ if (processing_template_decl)
+ value = push_template_decl (value);
+
record_locally_defined_typedef (value);
return value;
}
@@ -1877,10 +1880,12 @@ maybe_emit_vtables (tree ctype)
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
{
- tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl), LOOKUP_NORMAL);
+ VEC(tree,gc)* cleanups = NULL;
+ tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl), &cleanups,
+ LOOKUP_NORMAL);
/* It had better be all done at compile-time. */
- gcc_assert (!expr);
+ gcc_assert (!expr && !cleanups);
}
/* Write it out. */
@@ -1952,10 +1957,12 @@ type_visibility (tree type)
}
/* Limit the visibility of DECL to VISIBILITY, if not explicitly
- specified (or if VISIBILITY is static). */
+ specified (or if VISIBILITY is static). If TMPL is true, this
+ constraint is for a template argument, and takes precedence
+ over explicitly-specified visibility on the template. */
-static bool
-constrain_visibility (tree decl, int visibility)
+static void
+constrain_visibility (tree decl, int visibility, bool tmpl)
{
if (visibility == VISIBILITY_ANON)
{
@@ -1973,12 +1980,10 @@ constrain_visibility (tree decl, int visibility)
}
}
else if (visibility > DECL_VISIBILITY (decl)
- && !DECL_VISIBILITY_SPECIFIED (decl))
+ && (tmpl || !DECL_VISIBILITY_SPECIFIED (decl)))
{
DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility;
- return true;
}
- return false;
}
/* Constrain the visibility of DECL based on the visibility of its template
@@ -2014,7 +2019,7 @@ constrain_visibility_for_template (tree decl, tree targs)
}
}
if (vis)
- constrain_visibility (decl, vis);
+ constrain_visibility (decl, vis, true);
}
}
@@ -2127,7 +2132,7 @@ determine_visibility (tree decl)
if (underlying_vis == VISIBILITY_ANON
|| (CLASS_TYPE_P (underlying_type)
&& CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type)))
- constrain_visibility (decl, underlying_vis);
+ constrain_visibility (decl, underlying_vis, false);
else
DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
}
@@ -2135,7 +2140,7 @@ determine_visibility (tree decl)
{
/* tinfo visibility is based on the type it's for. */
constrain_visibility
- (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))));
+ (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))), false);
/* Give the target a chance to override the visibility associated
with DECL. */
@@ -2202,14 +2207,14 @@ determine_visibility (tree decl)
if (decl_anon_ns_mem_p (decl))
/* Names in an anonymous namespace get internal linkage.
This might change once we implement export. */
- constrain_visibility (decl, VISIBILITY_ANON);
+ constrain_visibility (decl, VISIBILITY_ANON, false);
else if (TREE_CODE (decl) != TYPE_DECL)
{
/* Propagate anonymity from type to decl. */
int tvis = type_visibility (TREE_TYPE (decl));
if (tvis == VISIBILITY_ANON
|| ! DECL_VISIBILITY_SPECIFIED (decl))
- constrain_visibility (decl, tvis);
+ constrain_visibility (decl, tvis, false);
}
else if (no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/true))
/* DR 757: A type without linkage shall not be used as the type of a
@@ -2220,7 +2225,7 @@ determine_visibility (tree decl)
Since non-extern "C" decls need to be defined in the same
translation unit, we can make the type internal. */
- constrain_visibility (decl, VISIBILITY_ANON);
+ constrain_visibility (decl, VISIBILITY_ANON, false);
/* If visibility changed and DECL already has DECL_RTL, ensure
symbol flags are updated. */
@@ -4201,9 +4206,10 @@ possibly_inlined_p (tree decl)
/* Mark DECL (either a _DECL or a BASELINK) as "used" in the program.
If DECL is a specialization or implicitly declared class member,
- generate the actual definition. */
+ generate the actual definition. Return false if something goes
+ wrong, true otherwise. */
-void
+bool
mark_used (tree decl)
{
/* If DECL is a BASELINK for a single function, then treat it just
@@ -4214,7 +4220,7 @@ mark_used (tree decl)
{
decl = BASELINK_FUNCTIONS (decl);
if (really_overloaded_fn (decl))
- return;
+ return true;
decl = OVL_CURRENT (decl);
}
@@ -4235,13 +4241,13 @@ mark_used (tree decl)
generate it properly; see maybe_add_lambda_conv_op. */
sorry ("converting lambda which uses %<...%> to "
"function pointer");
- return;
+ return false;
}
}
error ("use of deleted function %qD", decl);
if (!maybe_explain_implicit_delete (decl))
error_at (DECL_SOURCE_LOCATION (decl), "declared here");
- return;
+ return false;
}
/* We can only check DECL_ODR_USED on variables or functions with
@@ -4250,20 +4256,20 @@ mark_used (tree decl)
if ((TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
|| DECL_LANG_SPECIFIC (decl) == NULL
|| DECL_THUNK_P (decl))
- return;
+ return true;
/* We only want to do this processing once. We don't need to keep trying
to instantiate inline templates, because unit-at-a-time will make sure
we get them compiled before functions that want to inline them. */
if (DECL_ODR_USED (decl))
- return;
+ return true;
/* If within finish_function, defer the rest until that function
finishes, otherwise it might recurse. */
if (defer_mark_used_calls)
{
VEC_safe_push (tree, gc, deferred_mark_used_calls, decl);
- return;
+ return true;
}
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -4292,15 +4298,15 @@ mark_used (tree decl)
/* If we don't need a value, then we don't need to synthesize DECL. */
if (cp_unevaluated_operand != 0)
- return;
+ return true;
if (processing_template_decl)
- return;
+ return true;
/* Check this too in case we're within fold_non_dependent_expr. */
if (DECL_TEMPLATE_INFO (decl)
&& uses_template_parms (DECL_TI_ARGS (decl)))
- return;
+ return true;
DECL_ODR_USED (decl) = 1;
if (DECL_CLONED_FUNCTION_P (decl))
@@ -4378,6 +4384,8 @@ mark_used (tree decl)
/*expl_inst_class_mem_p=*/false);
--function_depth;
}
+
+ return true;
}
#include "gt-cp-decl2.h"
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 0bee6b4105c..841366f58fa 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -61,6 +61,7 @@ static const char *op_to_string (enum tree_code);
static const char *parm_to_string (int);
static const char *type_to_string (tree, int);
+static void dump_alias_template_specialization (tree, int);
static void dump_type (tree, int);
static void dump_typename (tree, int);
static void dump_simple_decl (tree, tree, int);
@@ -330,6 +331,23 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
}
}
+/* Dump a human-readable equivalent of the alias template
+ specialization of T. */
+
+static void
+dump_alias_template_specialization (tree t, int flags)
+{
+ tree name;
+
+ gcc_assert (alias_template_specialization_p (t));
+
+ name = TYPE_IDENTIFIER (t);
+ pp_cxx_tree_identifier (cxx_pp, name);
+ dump_template_parms (TYPE_TEMPLATE_INFO (t),
+ /*primary=*/false,
+ flags & ~TFF_TEMPLATE_HEADER);
+}
+
/* Dump a human-readable equivalent of TYPE. FLAGS controls the
format. */
@@ -344,10 +362,15 @@ dump_type (tree t, int flags)
{
tree decl = TYPE_NAME (t);
if ((flags & TFF_CHASE_TYPEDEF)
- || DECL_SELF_REFERENCE_P (decl)
- || (!flag_pretty_templates
- && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)))
+ || DECL_SELF_REFERENCE_P (decl)
+ || (!flag_pretty_templates
+ && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)))
t = strip_typedefs (t);
+ else if (alias_template_specialization_p (t))
+ {
+ dump_alias_template_specialization (t, flags);
+ return;
+ }
else if (same_type_p (t, TREE_TYPE (decl)))
t = decl;
else
@@ -588,7 +611,10 @@ dump_aggr_type (tree t, int flags)
if (name)
{
- typdef = !DECL_ARTIFICIAL (name);
+ typdef = (!DECL_ARTIFICIAL (name)
+ /* An alias specialization is not considered to be a
+ typedef. */
+ && !alias_template_specialization_p (t));
if ((typdef
&& ((flags & TFF_CHASE_TYPEDEF)
@@ -613,7 +639,7 @@ dump_aggr_type (tree t, int flags)
{
/* Because the template names are mangled, we have to locate
the most general template, and use that name. */
- tree tpl = CLASSTYPE_TI_TEMPLATE (t);
+ tree tpl = TYPE_TI_TEMPLATE (t);
while (DECL_TEMPLATE_INFO (tpl))
tpl = DECL_TI_TEMPLATE (tpl);
@@ -952,6 +978,18 @@ dump_decl (tree t, int flags)
dump_type (TREE_TYPE (t), flags);
break;
}
+ if (TYPE_DECL_ALIAS_P (t)
+ && (flags & TFF_DECL_SPECIFIERS
+ || flags & TFF_CLASS_KEY_OR_ENUM))
+ {
+ pp_cxx_ws_string (cxx_pp, "using");
+ dump_decl (DECL_NAME (t), flags);
+ pp_cxx_whitespace (cxx_pp);
+ pp_cxx_ws_string (cxx_pp, "=");
+ pp_cxx_whitespace (cxx_pp);
+ dump_type (DECL_ORIGINAL_TYPE (t), flags);
+ break;
+ }
if ((flags & TFF_DECL_SPECIFIERS)
&& !DECL_SELF_REFERENCE_P (t))
pp_cxx_ws_string (cxx_pp, "typedef");
@@ -1196,13 +1234,14 @@ dump_template_decl (tree t, int flags)
}
}
- if (DECL_TEMPLATE_RESULT (t)
- && TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL)
+ if (DECL_CLASS_TEMPLATE_P (t))
dump_type (TREE_TYPE (t),
((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME
| (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0)));
else if (DECL_TEMPLATE_RESULT (t)
- && TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL)
+ && (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL
+ /* Alias template. */
+ || DECL_TYPE_TEMPLATE_P (t)))
dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME);
else
{
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 9115df3dba6..ca4f590cc06 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -176,6 +176,8 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
items with static storage duration that are not otherwise
initialized are initialized to zero. */
;
+ else if (TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type))
+ init = convert (type, nullptr_node);
else if (SCALAR_TYPE_P (type))
init = convert (type, integer_zero_node);
else if (CLASS_TYPE_P (type))
@@ -505,7 +507,15 @@ perform_member_init (tree member, tree init)
tf_warning_or_error, member, /*function_p=*/false,
/*integral_constant_expression_p=*/false));
else
- init = break_out_target_exprs (DECL_INITIAL (member));
+ {
+ init = DECL_INITIAL (member);
+ /* Strip redundant TARGET_EXPR so we don't need to remap it, and
+ so the aggregate init code below will see a CONSTRUCTOR. */
+ if (init && TREE_CODE (init) == TARGET_EXPR
+ && !VOID_TYPE_P (TREE_TYPE (TARGET_EXPR_INITIAL (init))))
+ init = TARGET_EXPR_INITIAL (init);
+ init = break_out_target_exprs (init);
+ }
}
/* Effective C++ rule 12 requires that all data members be
@@ -563,6 +573,42 @@ perform_member_init (tree member, tree init)
finish_expr_stmt (init);
}
}
+ else if (init
+ && (TREE_CODE (type) == REFERENCE_TYPE
+ /* Pre-digested NSDMI. */
+ || (((TREE_CODE (init) == CONSTRUCTOR
+ && TREE_TYPE (init) == type)
+ /* { } mem-initializer. */
+ || (TREE_CODE (init) == TREE_LIST
+ && TREE_CODE (TREE_VALUE (init)) == CONSTRUCTOR
+ && CONSTRUCTOR_IS_DIRECT_INIT (TREE_VALUE (init))))
+ && (CP_AGGREGATE_TYPE_P (type)
+ || is_std_init_list (type)))))
+ {
+ /* With references and list-initialization, we need to deal with
+ extending temporary lifetimes. 12.2p5: "A temporary bound to a
+ reference member in a constructor’s ctor-initializer (12.6.2)
+ persists until the constructor exits." */
+ unsigned i; tree t;
+ VEC(tree,gc) *cleanups = make_tree_vector ();
+ if (TREE_CODE (init) == TREE_LIST)
+ init = build_x_compound_expr_from_list (init, ELK_MEM_INIT,
+ tf_warning_or_error);
+ if (TREE_TYPE (init) != type)
+ init = digest_init (type, init, tf_warning_or_error);
+ if (init == error_mark_node)
+ return;
+ /* Use 'this' as the decl, as it has the lifetime we want. */
+ init = extend_ref_init_temps (current_class_ptr, init, &cleanups);
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (type)))
+ init = build_vec_init_expr (type, init, tf_warning_or_error);
+ init = build2 (INIT_EXPR, type, decl, init);
+ finish_expr_stmt (init);
+ FOR_EACH_VEC_ELT (tree, cleanups, i, t)
+ push_cleanup (decl, t, false);
+ release_tree_vector (cleanups);
+ }
else if (type_build_ctor_call (type)
|| (init && CLASS_TYPE_P (strip_array_types (type))))
{
@@ -1375,6 +1421,8 @@ build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain)
TREE_THIS_VOLATILE (exp) = 0;
if (init && TREE_CODE (init) != TREE_LIST
+ && !(TREE_CODE (init) == TARGET_EXPR
+ && TARGET_EXPR_DIRECT_INIT_P (init))
&& !(BRACE_ENCLOSED_INITIALIZER_P (init)
&& CONSTRUCTOR_IS_DIRECT_INIT (init)))
flags |= LOOKUP_ONLYCONVERTING;
@@ -1457,10 +1505,28 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
if (init && BRACE_ENCLOSED_INITIALIZER_P (init)
&& CP_AGGREGATE_TYPE_P (type))
+ /* A brace-enclosed initializer for an aggregate. In C++0x this can
+ happen for direct-initialization, too. */
+ init = digest_init (type, init, complain);
+
+ /* A CONSTRUCTOR of the target's type is a previously digested
+ initializer, whether that happened just above or in
+ cp_parser_late_parsing_nsdmi.
+
+ A TARGET_EXPR with TARGET_EXPR_DIRECT_INIT_P or TARGET_EXPR_LIST_INIT_P
+ set represents the whole initialization, so we shouldn't build up
+ another ctor call. */
+ if (init
+ && (TREE_CODE (init) == CONSTRUCTOR
+ || (TREE_CODE (init) == TARGET_EXPR
+ && (TARGET_EXPR_DIRECT_INIT_P (init)
+ || TARGET_EXPR_LIST_INIT_P (init))))
+ && same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), type))
{
- /* A brace-enclosed initializer for an aggregate. In C++0x this can
- happen for direct-initialization, too. */
- init = digest_init (type, init, complain);
+ /* Early initialization via a TARGET_EXPR only works for
+ complete objects. */
+ gcc_assert (TREE_CODE (init) == CONSTRUCTOR || true_exp == exp);
+
init = build2 (INIT_EXPR, TREE_TYPE (exp), exp, init);
TREE_SIDE_EFFECTS (init) = 1;
finish_expr_stmt (init);
@@ -1575,12 +1641,14 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags,
if (init && TREE_CODE (exp) == VAR_DECL
&& COMPOUND_LITERAL_P (init))
{
+ VEC(tree,gc)* cleanups = NULL;
/* If store_init_value returns NULL_TREE, the INIT has been
recorded as the DECL_INITIAL for EXP. That means there's
nothing more we have to do. */
- init = store_init_value (exp, init, flags);
+ init = store_init_value (exp, init, &cleanups, flags);
if (init)
finish_expr_stmt (init);
+ gcc_assert (!cleanups);
return;
}
@@ -3128,6 +3196,9 @@ build_vec_init (tree base, tree maxindex, tree init,
bool try_const = (TREE_CODE (atype) == ARRAY_TYPE
&& (literal_type_p (inner_elt_type)
|| TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type)));
+ /* If the constructor already has the array type, it's been through
+ digest_init, so we shouldn't try to do anything more. */
+ bool digested = same_type_p (atype, TREE_TYPE (init));
bool saw_non_const = false;
bool saw_const = false;
/* If we're initializing a static array, we want to do static
@@ -3150,7 +3221,9 @@ build_vec_init (tree base, tree maxindex, tree init,
num_initialized_elts++;
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
- if (MAYBE_CLASS_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
+ if (digested)
+ one_init = build2 (INIT_EXPR, type, baseref, elt);
+ else if (MAYBE_CLASS_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
one_init = build_aggr_init (baseref, elt, 0, complain);
else
one_init = cp_build_modify_expr (baseref, NOP_EXPR,
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 69fe147f480..548998a086f 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1339,7 +1339,7 @@ nested_anon_class_index (tree type)
/* <unnamed-type-name> ::= Ut [ <nonnegative number> ] _ */
static void
-write_unnamed_type_name (const tree type __attribute__ ((__unused__)))
+write_unnamed_type_name (const tree type ATTRIBUTE_UNUSED)
{
int discriminator;
MANGLE_TRACE_TREE ("unnamed-type-name", type);
@@ -3503,12 +3503,17 @@ mangle_guard_variable (const tree variable)
initialize a static reference. This isn't part of the ABI, but we might
as well call them something readable. */
+static GTY(()) int temp_count;
+
tree
mangle_ref_init_variable (const tree variable)
{
start_mangling (variable);
write_string ("_ZGR");
write_name (variable, /*ignore_local_scope=*/0);
+ /* Avoid name clashes with aggregate initialization of multiple
+ references at once. */
+ write_unsigned_number (temp_count++);
return finish_mangling_get_identifier (/*warn=*/false);
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index b7d99c803ab..7c86b1b41b6 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -749,7 +749,7 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
/* Warn about the C++0x keyword (but still treat it as
an identifier). */
warning (OPT_Wc__0x_compat,
- "identifier %qE will become a keyword in C++0x",
+ "identifier %qE is a keyword in C++11",
token->u.value);
/* Clear out the C_RID_CODE so we don't warn about this
@@ -1940,6 +1940,8 @@ static bool cp_parser_using_declaration
(cp_parser *, bool);
static void cp_parser_using_directive
(cp_parser *);
+static tree cp_parser_alias_declaration
+ (cp_parser *);
static void cp_parser_asm_definition
(cp_parser *);
static void cp_parser_linkage_specification
@@ -2525,6 +2527,7 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs,
"explicit",
"friend",
"typedef",
+ "using",
"constexpr",
"__complex",
"__thread"
@@ -3701,8 +3704,8 @@ cp_parser_userdef_string_literal (cp_token *token)
suffix_id = USERDEF_LITERAL_SUFFIX_ID (literal);
name = cp_literal_operator_id (IDENTIFIER_POINTER (suffix_id));
value = USERDEF_LITERAL_VALUE (literal);
- len = TREE_STRING_LENGTH (value) - 1;
-
+ len = TREE_STRING_LENGTH (value)
+ / TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (value)))) - 1;
/* Build up a call to the user-defined operator */
/* Lookup the name we got back from the id-expression. */
vec = make_tree_vector ();
@@ -5155,7 +5158,7 @@ cp_parser_nested_name_specifier (cp_parser *parser,
this is either a class-name or a namespace-name (which corresponds
to the class-or-namespace-name production in the grammar). For
C++0x, it can also be a type-name that refers to an enumeration
- type.
+ type or a simple-template-id.
TYPENAME_KEYWORD_P is TRUE iff the `typename' keyword is in effect.
TEMPLATE_KEYWORD_P is TRUE iff the `template' keyword is in effect.
@@ -5231,8 +5234,8 @@ cp_parser_qualifying_entity (cp_parser *parser,
/* Parse tentatively. */
cp_parser_parse_tentatively (parser);
- /* Parse a typedef-name or enum-name. */
- scope = cp_parser_nonclass_name (parser);
+ /* Parse a type-name */
+ scope = cp_parser_type_name (parser);
/* "If the name found does not designate a namespace or a class,
enumeration, or dependent type, the program is ill-formed."
@@ -7222,8 +7225,8 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
&& !parser->greater_than_is_operator_p)
{
if (warning_at (token->location, OPT_Wc__0x_compat,
- "%<>>%> operator will be treated as"
- " two right angle brackets in C++0x"))
+ "%<>>%> operator is treated as"
+ " two right angle brackets in C++11"))
inform (token->location,
"suggest parentheses around %<>>%> expression");
}
@@ -10187,8 +10190,8 @@ cp_parser_block_declaration (cp_parser *parser,
namespace-alias-definition. */
else if (token1->keyword == RID_NAMESPACE)
cp_parser_namespace_alias_definition (parser);
- /* If the next keyword is `using', we have either a
- using-declaration or a using-directive. */
+ /* If the next keyword is `using', we have a
+ using-declaration, a using-directive, or an alias-declaration. */
else if (token1->keyword == RID_USING)
{
cp_token *token2;
@@ -10200,6 +10203,14 @@ cp_parser_block_declaration (cp_parser *parser,
token2 = cp_lexer_peek_nth_token (parser->lexer, 2);
if (token2->keyword == RID_NAMESPACE)
cp_parser_using_directive (parser);
+ /* If the second token after 'using' is '=', then we have an
+ alias-declaration. */
+ else if (cxx_dialect >= cxx0x
+ && token2->type == CPP_NAME
+ && ((cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_EQ)
+ || (cp_lexer_peek_nth_token (parser->lexer, 3)->keyword
+ == RID_ATTRIBUTE)))
+ cp_parser_alias_declaration (parser);
/* Otherwise, it's a using-declaration. */
else
cp_parser_using_declaration (parser,
@@ -10565,7 +10576,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
/* Complain about `auto' as a storage specifier, if
we're complaining about C++0x compatibility. */
warning_at (token->location, OPT_Wc__0x_compat, "%<auto%>"
- " will change meaning in C++0x; please remove it");
+ " changes meaning in C++11; please remove it");
/* Set the storage class anyway. */
cp_parser_set_storage_class (parser, decl_specs, RID_AUTO,
@@ -12380,7 +12391,7 @@ cp_parser_template_id (cp_parser *parser,
/* Build a representation of the specialization. */
if (TREE_CODE (templ) == IDENTIFIER_NODE)
template_id = build_min_nt (TEMPLATE_ID_EXPR, templ, arguments);
- else if (DECL_CLASS_TEMPLATE_P (templ)
+ else if (DECL_TYPE_TEMPLATE_P (templ)
|| DECL_TEMPLATE_TEMPLATE_PARM_P (templ))
{
bool entering_scope;
@@ -13648,6 +13659,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
class-name
enum-name
typedef-name
+ simple-template-id [in c++0x]
enum-name:
identifier
@@ -13675,8 +13687,37 @@ cp_parser_type_name (cp_parser* parser)
/* If it's not a class-name, keep looking. */
if (!cp_parser_parse_definitely (parser))
{
- /* It must be a typedef-name or an enum-name. */
- return cp_parser_nonclass_name (parser);
+ if (cxx_dialect < cxx0x)
+ /* It must be a typedef-name or an enum-name. */
+ return cp_parser_nonclass_name (parser);
+
+ cp_parser_parse_tentatively (parser);
+ /* It is either a simple-template-id representing an
+ instantiation of an alias template... */
+ type_decl = cp_parser_template_id (parser,
+ /*template_keyword_p=*/false,
+ /*check_dependency_p=*/false,
+ /*is_declaration=*/false);
+ /* Note that this must be an instantiation of an alias template
+ because [temp.names]/6 says:
+
+ A template-id that names an alias template specialization
+ is a type-name.
+
+ Whereas [temp.names]/7 says:
+
+ A simple-template-id that names a class template
+ specialization is a class-name. */
+ if (type_decl != NULL_TREE
+ && TREE_CODE (type_decl) == TYPE_DECL
+ && TYPE_DECL_ALIAS_P (type_decl))
+ gcc_assert (DECL_TEMPLATE_INSTANTIATION (type_decl));
+ else
+ cp_parser_simulate_error (parser);
+
+ if (!cp_parser_parse_definitely (parser))
+ /* ... Or a typedef-name or an enum-name. */
+ return cp_parser_nonclass_name (parser);
}
return type_decl;
@@ -14095,6 +14136,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
enum-specifier:
enum-head { enumerator-list [opt] }
+ enum-head { enumerator-list , } [C++0x]
enum-head:
enum-key identifier [opt] enum-base [opt]
@@ -14114,6 +14156,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
GNU Extensions:
enum-key attributes[opt] identifier [opt] enum-base [opt]
{ enumerator-list [opt] }attributes[opt]
+ enum-key attributes[opt] identifier [opt] enum-base [opt]
+ { enumerator-list, }attributes[opt] [C++0x]
Returns an ENUM_TYPE representing the enumeration, or NULL_TREE
if the token stream isn't an enum-specifier after all. */
@@ -14453,8 +14497,9 @@ cp_parser_enumerator_list (cp_parser* parser, tree type)
/* If the next token is a `}', there is a trailing comma. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
- if (!in_system_header)
- pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list");
+ if (cxx_dialect < cxx0x && !in_system_header)
+ pedwarn (input_location, OPT_pedantic,
+ "comma at end of enumerator list");
break;
}
}
@@ -14868,6 +14913,63 @@ cp_parser_using_declaration (cp_parser* parser,
return true;
}
+/* Parse an alias-declaration.
+
+ alias-declaration:
+ using identifier attribute-specifier-seq [opt] = type-id */
+
+static tree
+cp_parser_alias_declaration (cp_parser* parser)
+{
+ tree id, type, decl, dummy, attributes;
+ location_t id_location;
+ cp_declarator *declarator;
+ cp_decl_specifier_seq decl_specs;
+
+ /* Look for the `using' keyword. */
+ cp_parser_require_keyword (parser, RID_USING, RT_USING);
+ id_location = cp_lexer_peek_token (parser->lexer)->location;
+ id = cp_parser_identifier (parser);
+ attributes = cp_parser_attributes_opt (parser);
+ cp_parser_require (parser, CPP_EQ, RT_EQ);
+
+ type = cp_parser_type_id (parser);
+
+ /* A typedef-name can also be introduced by an alias-declaration. The
+ identifier following the using keyword becomes a typedef-name. It has
+ the same semantics as if it were introduced by the typedef
+ specifier. In particular, it does not define a new type and it shall
+ not appear in the type-id. */
+
+ clear_decl_specs (&decl_specs);
+ decl_specs.type = type;
+ decl_specs.attributes = attributes;
+ ++decl_specs.specs[(int) ds_typedef];
+ ++decl_specs.specs[(int) ds_alias];
+
+ declarator = make_id_declarator (NULL_TREE, id, sfk_none);
+ declarator->id_loc = id_location;
+
+ if (at_class_scope_p ())
+ decl = grokfield (declarator, &decl_specs, NULL_TREE, false,
+ NULL_TREE, attributes);
+ else
+ decl = start_decl (declarator, &decl_specs, 0,
+ attributes, NULL_TREE, &dummy);
+ if (decl == error_mark_node)
+ return decl;
+
+ cp_finish_decl (decl, NULL_TREE, 0, NULL_TREE, 0);
+
+ /* If decl is a template, return its TEMPLATE_DECL so that it gets
+ added into the symbol table; otherwise, return the TYPE_DECL. */
+ if (DECL_LANG_SPECIFIC (decl)
+ && DECL_TEMPLATE_INFO (decl)
+ && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl)))
+ decl = DECL_TI_TEMPLATE (decl);
+ return decl;
+}
+
/* Parse a using-directive.
using-directive:
@@ -18570,6 +18672,7 @@ cp_parser_member_specification_opt (cp_parser* parser)
:: [opt] nested-name-specifier template [opt] unqualified-id ;
using-declaration
template-declaration
+ alias-declaration
member-declarator-list:
member-declarator
@@ -18637,10 +18740,25 @@ cp_parser_member_declaration (cp_parser* parser)
/* Check for a using-declaration. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_USING))
{
- /* Parse the using-declaration. */
- cp_parser_using_declaration (parser,
- /*access_declaration_p=*/false);
- return;
+ if (cxx_dialect < cxx0x)
+ {
+ /* Parse the using-declaration. */
+ cp_parser_using_declaration (parser,
+ /*access_declaration_p=*/false);
+ return;
+ }
+ else
+ {
+ tree decl;
+ cp_parser_parse_tentatively (parser);
+ decl = cp_parser_alias_declaration (parser);
+ if (cp_parser_parse_definitely (parser))
+ finish_member_declaration (decl);
+ else
+ cp_parser_using_declaration (parser,
+ /*access_declaration_p=*/false);
+ return;
+ }
}
/* Check for @defs. */
@@ -20938,6 +21056,9 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
if (cp_lexer_next_token_is_keyword (parser->lexer,
RID_TEMPLATE))
cp_parser_template_declaration_after_export (parser, member_p);
+ else if (cxx_dialect >= cxx0x
+ && cp_lexer_next_token_is_keyword (parser->lexer, RID_USING))
+ decl = cp_parser_alias_declaration (parser);
else
{
/* There are no access checks when parsing a template, as we do not
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3196d123ce3..d08a792e2e0 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -814,7 +814,13 @@ maybe_process_partial_specialization (tree type)
context = TYPE_CONTEXT (type);
- if (CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type))
+ if ((CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type))
+ /* Consider non-class instantiations of alias templates as
+ well. */
+ || (TYPE_P (type)
+ && TYPE_TEMPLATE_INFO (type)
+ && DECL_LANG_SPECIFIC (TYPE_NAME (type))
+ && DECL_USE_TEMPLATE (TYPE_NAME (type))))
{
/* This is for ordinary explicit specialization and partial
specialization of a template class such as:
@@ -827,7 +833,8 @@ maybe_process_partial_specialization (tree type)
Make sure that `C<int>' and `C<T*>' are implicit instantiations. */
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)
+ if (CLASS_TYPE_P (type)
+ && CLASSTYPE_IMPLICIT_INSTANTIATION (type)
&& !COMPLETE_TYPE_P (type))
{
check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
@@ -839,8 +846,16 @@ maybe_process_partial_specialization (tree type)
return error_mark_node;
}
}
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
+ else if (CLASS_TYPE_P (type)
+ && CLASSTYPE_TEMPLATE_INSTANTIATION (type))
error ("specialization of %qT after instantiation", type);
+
+ if (DECL_ALIAS_TEMPLATE_P (TYPE_TI_TEMPLATE (type)))
+ {
+ error ("partial specialization of alias template %qD",
+ TYPE_TI_TEMPLATE (type));
+ return error_mark_node;
+ }
}
else if (CLASS_TYPE_P (type)
&& !CLASSTYPE_USE_TEMPLATE (type)
@@ -2842,8 +2857,8 @@ make_ith_pack_parameter_name (tree name, int i)
return get_identifier (newname);
}
-/* Return true if T is a primary function
- or class template instantiation. */
+/* Return true if T is a primary function, class or alias template
+ instantiation. */
bool
primary_template_instantiation_p (const_tree t)
@@ -2858,6 +2873,11 @@ primary_template_instantiation_p (const_tree t)
else if (CLASS_TYPE_P (t))
return CLASSTYPE_TEMPLATE_INSTANTIATION (t)
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t));
+ else if (TYPE_P (t)
+ && TYPE_TEMPLATE_INFO (t)
+ && PRIMARY_TEMPLATE_P (TYPE_TI_TEMPLATE (t))
+ && DECL_TEMPLATE_INSTANTIATION (TYPE_NAME (t)))
+ return true;
return false;
}
@@ -4831,6 +4851,10 @@ push_template_decl_real (tree decl, bool is_friend)
else if (DECL_IMPLICIT_TYPEDEF_P (decl)
&& CLASS_TYPE_P (TREE_TYPE (decl)))
/* OK */;
+ else if (TREE_CODE (decl) == TYPE_DECL
+ && TYPE_DECL_ALIAS_P (decl))
+ /* alias-declaration */
+ gcc_assert (!DECL_ARTIFICIAL (decl));
else
{
error ("template declaration of %q#D", decl);
@@ -5095,8 +5119,13 @@ template arguments to %qD do not match original template %qD",
if (DECL_IMPLICIT_TYPEDEF_P (decl))
SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
- else if (DECL_LANG_SPECIFIC (decl))
- DECL_TEMPLATE_INFO (decl) = info;
+ else
+ {
+ if (primary && !DECL_LANG_SPECIFIC (decl))
+ retrofit_lang_decl (decl);
+ if (DECL_LANG_SPECIFIC (decl))
+ DECL_TEMPLATE_INFO (decl) = info;
+ }
return DECL_TEMPLATE_RESULT (tmpl);
}
@@ -5259,6 +5288,32 @@ fold_non_dependent_expr (tree expr)
return fold_non_dependent_expr_sfinae (expr, tf_error);
}
+/* Return TRUE iff T is a type alias, a TEMPLATE_DECL for an alias
+ template declaration, or a TYPE_DECL for an alias declaration. */
+
+bool
+alias_type_or_template_p (tree t)
+{
+ if (t == NULL_TREE)
+ return false;
+ return ((TREE_CODE (t) == TYPE_DECL && TYPE_DECL_ALIAS_P (t))
+ || (TYPE_P (t)
+ && TYPE_NAME (t)
+ && TYPE_DECL_ALIAS_P (TYPE_NAME (t)))
+ || DECL_ALIAS_TEMPLATE_P (t));
+}
+
+/* Return TRUE iff is a specialization of an alias template. */
+
+bool
+alias_template_specialization_p (tree t)
+{
+ if (t == NULL_TREE)
+ return false;
+ return (primary_template_instantiation_p (t)
+ && DECL_ALIAS_TEMPLATE_P (TYPE_TI_TEMPLATE (t)));
+}
+
/* Subroutine of convert_nontype_argument. Converts EXPR to TYPE, which
must be a function or a pointer-to-function type, as specified
in [temp.arg.nontype]: disambiguate EXPR if it is an overload set,
@@ -7355,7 +7410,31 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
ENUM_FIXED_UNDERLYING_TYPE_P (t)
= ENUM_FIXED_UNDERLYING_TYPE_P (template_type);
}
- else
+ else if (DECL_ALIAS_TEMPLATE_P (gen_tmpl))
+ {
+ /* The user referred to a specialization of an alias
+ template represented by GEN_TMPL.
+
+ [temp.alias]/2 says:
+
+ When a template-id refers to the specialization of an
+ alias template, it is equivalent to the associated
+ type obtained by substitution of its
+ template-arguments for the template-parameters in the
+ type-id of the alias template. */
+
+ t = tsubst (TREE_TYPE (gen_tmpl), arglist, complain, in_decl);
+ /* Note that the call above (by indirectly calling
+ register_specialization in tsubst_decl) registers the
+ TYPE_DECL representing the specialization of the alias
+ template. So next time someone substitutes ARGLIST for
+ the template parms into the alias template (GEN_TMPL),
+ she'll get that TYPE_DECL back. */
+
+ if (t == error_mark_node)
+ return t;
+ }
+ else if (CLASS_TYPE_P (template_type))
{
t = make_class_type (TREE_CODE (template_type));
CLASSTYPE_DECLARED_CLASS (t)
@@ -7378,6 +7457,8 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
structural equality testing. */
SET_TYPE_STRUCTURAL_EQUALITY (t);
}
+ else
+ gcc_unreachable ();
/* If we called start_enum or pushtag above, this information
will already be set up. */
@@ -7393,14 +7474,17 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
else
type_decl = TYPE_NAME (t);
- TREE_PRIVATE (type_decl)
- = TREE_PRIVATE (TYPE_STUB_DECL (template_type));
- TREE_PROTECTED (type_decl)
- = TREE_PROTECTED (TYPE_STUB_DECL (template_type));
- if (CLASSTYPE_VISIBILITY_SPECIFIED (template_type))
+ if (CLASS_TYPE_P (template_type))
{
- DECL_VISIBILITY_SPECIFIED (type_decl) = 1;
- DECL_VISIBILITY (type_decl) = CLASSTYPE_VISIBILITY (template_type);
+ TREE_PRIVATE (type_decl)
+ = TREE_PRIVATE (TYPE_STUB_DECL (template_type));
+ TREE_PROTECTED (type_decl)
+ = TREE_PROTECTED (TYPE_STUB_DECL (template_type));
+ if (CLASSTYPE_VISIBILITY_SPECIFIED (template_type))
+ {
+ DECL_VISIBILITY_SPECIFIED (type_decl) = 1;
+ DECL_VISIBILITY (type_decl) = CLASSTYPE_VISIBILITY (template_type);
+ }
}
/* Let's consider the explicit specialization of a member
@@ -7456,7 +7540,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
++processing_template_decl;
partial_inst_args =
tsubst (INNERMOST_TEMPLATE_ARGS
- (CLASSTYPE_TI_ARGS (TREE_TYPE (gen_tmpl))),
+ (TYPE_TI_ARGS (TREE_TYPE (gen_tmpl))),
arglist, complain, NULL_TREE);
--processing_template_decl;
TREE_VEC_LENGTH (arglist)++;
@@ -7480,7 +7564,15 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
TREE_VEC_LENGTH (arglist)--;
found = tsubst (gen_tmpl, arglist, complain, NULL_TREE);
TREE_VEC_LENGTH (arglist)++;
- found = CLASSTYPE_TI_TEMPLATE (found);
+ /* FOUND is either a proper class type, or an alias
+ template specialization. In the later case, it's a
+ TYPE_DECL, resulting from the substituting of arguments
+ for parameters in the TYPE_DECL of the alias template
+ done earlier. So be careful while getting the template
+ of FOUND. */
+ found = TREE_CODE (found) == TYPE_DECL
+ ? TYPE_TI_TEMPLATE (TREE_TYPE (found))
+ : CLASSTYPE_TI_TEMPLATE (found);
}
SET_TYPE_TEMPLATE_INFO (t, build_template_info (found, arglist));
@@ -7508,7 +7600,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
the instantiation and exit above. */
tsubst_enum (template_type, t, arglist);
- if (is_dependent_type)
+ if (CLASS_TYPE_P (template_type) && is_dependent_type)
/* If the type makes use of template parameters, the
code that generates debugging information will crash. */
DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
@@ -8600,6 +8692,8 @@ instantiate_class_template_1 (tree type)
{
CLASSTYPE_VISIBILITY_SPECIFIED (type) = 1;
CLASSTYPE_VISIBILITY (type) = CLASSTYPE_VISIBILITY (pattern);
+ /* Adjust visibility for template arguments. */
+ determine_visibility (TYPE_MAIN_DECL (type));
}
CLASSTYPE_FINAL (type) = CLASSTYPE_FINAL (pattern);
@@ -9843,7 +9937,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
DECL_TEMPLATE_INFO (r) = build_template_info (t, args);
- if (TREE_CODE (decl) == TYPE_DECL)
+ if (TREE_CODE (decl) == TYPE_DECL
+ && !TYPE_DECL_ALIAS_P (decl))
{
tree new_type;
++processing_template_decl;
@@ -10376,8 +10471,15 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
referencing a static data member within in its own
class. We can use pointer equality, rather than
same_type_p, because DECL_CONTEXT is always
- canonical. */
- if (ctx == DECL_CONTEXT (t))
+ canonical... */
+ if (ctx == DECL_CONTEXT (t)
+ && (TREE_CODE (t) != TYPE_DECL
+ /* ... unless T is a member template; in which
+ case our caller can be willing to create a
+ specialization of that template represented
+ by T. */
+ || !(DECL_TI_TEMPLATE (t)
+ && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (t)))))
spec = t;
}
@@ -10858,7 +10960,7 @@ tree
tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
enum tree_code code;
- tree type, r;
+ tree type, r = NULL_TREE;
if (t == NULL_TREE || t == error_mark_node
|| t == integer_type_node
@@ -10890,10 +10992,21 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
&& typedef_variant_p (t))
{
tree decl = TYPE_NAME (t);
-
- if (DECL_CLASS_SCOPE_P (decl)
- && CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))
- && uses_template_parms (DECL_CONTEXT (decl)))
+
+ if (TYPE_DECL_ALIAS_P (decl)
+ && DECL_LANG_SPECIFIC (decl)
+ && DECL_TEMPLATE_INFO (decl)
+ && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl)))
+ {
+ /* DECL represents an alias template and we want to
+ instantiate it. Let's substitute our arguments for the
+ template parameters into the declaration and get the
+ resulting type. */
+ r = tsubst (decl, args, complain, decl);
+ }
+ else if (DECL_CLASS_SCOPE_P (decl)
+ && CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))
+ && uses_template_parms (DECL_CONTEXT (decl)))
{
tree tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
tree gen_args = tsubst (DECL_TI_ARGS (decl), args, complain, in_decl);
@@ -11043,6 +11156,46 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (argvec == error_mark_node)
return error_mark_node;
+ gcc_assert (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
+ || TREE_CODE (arg) == TEMPLATE_DECL
+ || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE);
+
+ if (TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE)
+ /* Consider this code:
+
+ template <template <class> class Template>
+ struct Internal {
+ template <class Arg> using Bind = Template<Arg>;
+ };
+
+ template <template <class> class Template, class Arg>
+ using Instantiate = Template<Arg>; //#0
+
+ template <template <class> class Template,
+ class Argument>
+ using Bind =
+ Instantiate<Internal<Template>::template Bind,
+ Argument>; //#1
+
+ When #1 is parsed, the
+ BOUND_TEMPLATE_TEMPLATE_PARM representing the
+ parameter `Template' in #0 matches the
+ UNBOUND_CLASS_TEMPLATE representing the argument
+ `Internal<Template>::template Bind'; We then want
+ to assemble the type `Bind<Argument>' that can't
+ be fully created right now, because
+ `Internal<Template>' not being complete, the Bind
+ template cannot be looked up in that context. So
+ we need to "store" `Bind<Argument>' for later
+ when the context of Bind becomes complete. Let's
+ store that in a TYPENAME_TYPE. */
+ return make_typename_type (TYPE_CONTEXT (arg),
+ build_nt (TEMPLATE_ID_EXPR,
+ TYPE_IDENTIFIER (arg),
+ argvec),
+ typename_type,
+ complain);
+
/* We can get a TEMPLATE_TEMPLATE_PARM here when we
are resolving nested-types in the signature of a
member function templates. Otherwise ARG is a
@@ -17630,7 +17783,12 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (! CLASS_TYPE_P (t) || ! CLASSTYPE_TEMPLATE_INFO (t))
{
- error ("explicit instantiation of non-template type %qT", t);
+ tree tmpl =
+ (TYPE_TEMPLATE_INFO (t)) ? TYPE_TI_TEMPLATE (t) : NULL;
+ if (tmpl)
+ error ("explicit instantiation of non-class template %qD", tmpl);
+ else
+ error ("explicit instantiation of non-template type %qT", t);
return;
}
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 5f60eeedf4e..40af661e953 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -427,7 +427,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
field = fields[i--];
while (i >= lo && DECL_NAME (fields[i]) == name);
if (TREE_CODE (field) != TYPE_DECL
- && !DECL_CLASS_TEMPLATE_P (field))
+ && !DECL_TYPE_TEMPLATE_P (field))
field = NULL_TREE;
}
else
@@ -478,7 +478,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
if (DECL_NAME (field) == name
&& (!want_type
|| TREE_CODE (field) == TYPE_DECL
- || DECL_CLASS_TEMPLATE_P (field)))
+ || DECL_TYPE_TEMPLATE_P (field)))
return field;
}
/* Not found. */
@@ -1046,7 +1046,7 @@ lookup_field_r (tree binfo, void *data)
/* If we're looking up a type (as with an elaborated type specifier)
we ignore all non-types we find. */
if (lfi->want_type && TREE_CODE (nval) != TYPE_DECL
- && !DECL_CLASS_TEMPLATE_P (nval))
+ && !DECL_TYPE_TEMPLATE_P (nval))
{
if (lfi->name == TYPE_IDENTIFIER (type))
{
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 068754a6a53..508e2529fbe 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2369,7 +2369,7 @@ finish_compound_literal (tree type, tree compound_literal,
&& check_array_initializer (NULL_TREE, type, compound_literal))
return error_mark_node;
compound_literal = reshape_init (type, compound_literal, complain);
- if (cxx_dialect >= cxx0x && SCALAR_TYPE_P (type)
+ if (SCALAR_TYPE_P (type)
&& !BRACE_ENCLOSED_INITIALIZER_P (compound_literal))
check_narrowing (type, compound_literal);
if (TREE_CODE (type) == ARRAY_TYPE
@@ -2733,15 +2733,17 @@ finish_template_decl (tree parms)
tree
finish_template_type (tree name, tree args, int entering_scope)
{
- tree decl;
+ tree type;
- decl = lookup_template_class (name, args,
+ type = lookup_template_class (name, args,
NULL_TREE, NULL_TREE, entering_scope,
tf_warning_or_error | tf_user);
- if (decl != error_mark_node)
- decl = TYPE_STUB_DECL (decl);
-
- return decl;
+ if (type == error_mark_node)
+ return type;
+ else if (CLASS_TYPE_P (type) && !alias_type_or_template_p (type))
+ return TYPE_STUB_DECL (type);
+ else
+ return TYPE_NAME (type);
}
/* Finish processing a BASE_CLASS with the indicated ACCESS_SPECIFIER.
@@ -3286,8 +3288,9 @@ finish_id_expression (tree id_expression,
if (TREE_CODE (first_fn) == TEMPLATE_DECL)
first_fn = DECL_TEMPLATE_RESULT (first_fn);
- if (!really_overloaded_fn (decl))
- mark_used (first_fn);
+ if (!really_overloaded_fn (decl)
+ && !mark_used (first_fn))
+ return error_mark_node;
if (!template_arg_p
&& TREE_CODE (first_fn) == FUNCTION_DECL
@@ -3568,7 +3571,7 @@ finish_offsetof (tree expr)
if (!complete_type_or_else (TREE_TYPE (object), object))
return error_mark_node;
}
- return fold_offsetof (expr, NULL_TREE);
+ return fold_offsetof (expr);
}
/* Replace the AGGR_INIT_EXPR at *TP with an equivalent CALL_EXPR. This
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 707f2c8aeba..dc9fc954e41 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1889,6 +1889,10 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
u = build_target_expr_with_type (TREE_OPERAND (t, 1), TREE_TYPE (t),
tf_warning_or_error);
+ TARGET_EXPR_IMPLICIT_P (u) = TARGET_EXPR_IMPLICIT_P (t);
+ TARGET_EXPR_LIST_INIT_P (u) = TARGET_EXPR_LIST_INIT_P (t);
+ TARGET_EXPR_DIRECT_INIT_P (u) = TARGET_EXPR_DIRECT_INIT_P (t);
+
/* Map the old variable to the new one. */
splay_tree_insert (target_remap,
(splay_tree_key) TREE_OPERAND (t, 0),
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ec14934a823..386f3b89d48 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -2726,7 +2726,7 @@ build_x_indirect_ref (tree expr, ref_operator errorstring,
/* Helper function called from c-common. */
tree
-build_indirect_ref (location_t loc __attribute__ ((__unused__)),
+build_indirect_ref (location_t loc ATTRIBUTE_UNUSED,
tree ptr, ref_operator errorstring)
{
return cp_build_indirect_ref (ptr, errorstring, tf_warning_or_error);
@@ -4058,7 +4058,7 @@ cp_build_binary_op (location_t location,
else
{
op0 = build_ptrmemfunc_access_expr (op0, pfn_identifier);
- op1 = cp_convert (TREE_TYPE (op0), integer_zero_node);
+ op1 = cp_convert (TREE_TYPE (op0), op1);
}
result_type = TREE_TYPE (op0);
}
@@ -4668,7 +4668,17 @@ cp_truthvalue_conversion (tree expr)
tree type = TREE_TYPE (expr);
if (TYPE_PTRMEM_P (type))
return build_binary_op (EXPR_LOCATION (expr),
- NE_EXPR, expr, integer_zero_node, 1);
+ NE_EXPR, expr, nullptr_node, 1);
+ else if (TYPE_PTR_P (type) || TYPE_PTRMEMFUNC_P (type))
+ {
+ /* With -Wzero-as-null-pointer-constant do not warn for an
+ 'if (p)' or a 'while (!p)', where p is a pointer. */
+ tree ret;
+ ++c_inhibit_evaluation_warnings;
+ ret = c_common_truthvalue_conversion (input_location, expr);
+ --c_inhibit_evaluation_warnings;
+ return ret;
+ }
else
return c_common_truthvalue_conversion (input_location, expr);
}
@@ -4871,9 +4881,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
&& TREE_CONSTANT (TREE_OPERAND (val, 0)))
{
tree type = build_pointer_type (argtype);
- tree op0 = fold_convert (type, TREE_OPERAND (val, 0));
- tree op1 = fold_offsetof (arg, val);
- return fold_build_pointer_plus (op0, op1);
+ return fold_convert (type, fold_offsetof_1 (arg));
}
/* Handle complex lvalues (when permitted)
@@ -6335,34 +6343,41 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
return error_mark_node;
}
- if ((TYPE_PTR_P (src_type) || TYPE_PTRMEM_P (src_type))
- && comp_ptr_ttypes_const (dst_type, src_type))
+ if (TYPE_PTR_P (src_type) || TYPE_PTRMEM_P (src_type))
{
- if (valid_p)
- {
- *valid_p = true;
- /* This cast is actually a C-style cast. Issue a warning if
- the user is making a potentially unsafe cast. */
- check_for_casting_away_constness (src_type, dst_type, CAST_EXPR,
- complain);
- }
- if (reference_type)
- {
- expr = cp_build_addr_expr (expr, complain);
- expr = build_nop (reference_type, expr);
- return convert_from_reference (expr);
- }
- else
+ if (comp_ptr_ttypes_const (dst_type, src_type))
{
- expr = decay_conversion (expr);
- /* build_c_cast puts on a NOP_EXPR to make the result not an
- lvalue. Strip such NOP_EXPRs if VALUE is being used in
- non-lvalue context. */
- if (TREE_CODE (expr) == NOP_EXPR
- && TREE_TYPE (expr) == TREE_TYPE (TREE_OPERAND (expr, 0)))
- expr = TREE_OPERAND (expr, 0);
- return build_nop (dst_type, expr);
+ if (valid_p)
+ {
+ *valid_p = true;
+ /* This cast is actually a C-style cast. Issue a warning if
+ the user is making a potentially unsafe cast. */
+ check_for_casting_away_constness (src_type, dst_type,
+ CAST_EXPR, complain);
+ }
+ if (reference_type)
+ {
+ expr = cp_build_addr_expr (expr, complain);
+ expr = build_nop (reference_type, expr);
+ return convert_from_reference (expr);
+ }
+ else
+ {
+ expr = decay_conversion (expr);
+ /* build_c_cast puts on a NOP_EXPR to make the result not an
+ lvalue. Strip such NOP_EXPRs if VALUE is being used in
+ non-lvalue context. */
+ if (TREE_CODE (expr) == NOP_EXPR
+ && TREE_TYPE (expr) == TREE_TYPE (TREE_OPERAND (expr, 0)))
+ expr = TREE_OPERAND (expr, 0);
+ return build_nop (dst_type, expr);
+ }
}
+ else if (valid_p
+ && !at_least_as_qualified_p (TREE_TYPE (dst_type),
+ TREE_TYPE (src_type)))
+ check_for_casting_away_constness (src_type, dst_type, CAST_EXPR,
+ complain);
}
if (complain & tf_error)
@@ -7148,7 +7163,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p,
/* Handle null pointer to member function conversions. */
if (null_ptr_cst_p (pfn))
{
- pfn = build_c_cast (input_location, type, integer_zero_node);
+ pfn = build_c_cast (input_location, type, nullptr_node);
return build_ptrmemfunc1 (to_type,
integer_zero_node,
pfn);
@@ -7544,8 +7559,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, flags, complain);
+ rhs = initialize_reference (type, rhs, flags, complain);
if (fndecl)
{
if (warningcount > savew)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 57cd5e01d8c..70edc2f5a4d 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -655,7 +655,7 @@ split_nonconstant_init (tree dest, tree init)
for static variable. In that case, caller must emit the code. */
tree
-store_init_value (tree decl, tree init, int flags)
+store_init_value (tree decl, tree init, VEC(tree,gc)** cleanups, int flags)
{
tree value, type;
@@ -699,6 +699,8 @@ store_init_value (tree decl, tree init, int flags)
/* Digest the specified initializer into an expression. */
value = digest_init_flags (type, init, flags);
+ value = extend_ref_init_temps (decl, value, cleanups);
+
/* In C++0x constant expression is a semantic, not syntactic, property.
In C++98, make sure that what we thought was a constant expression at
template definition time is still constant. */
@@ -725,7 +727,16 @@ store_init_value (tree decl, tree init, int flags)
if (value != error_mark_node
&& (TREE_SIDE_EFFECTS (value)
|| ! initializer_constant_valid_p (value, TREE_TYPE (value))))
- return split_nonconstant_init (decl, value);
+ {
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (type)))
+ /* For an array, we only need/want a single cleanup region rather
+ than one per element. */
+ return build_vec_init (decl, NULL_TREE, value, false, 1,
+ tf_warning_or_error);
+ else
+ return split_nonconstant_init (decl, value);
+ }
/* If the value is a constant, just put it in DECL_INITIAL. If DECL
is an automatic variable, the middle end will turn this into a
dynamic initialization later. */
@@ -804,8 +815,16 @@ check_narrowing (tree type, tree init)
}
if (!ok)
- pedwarn (input_location, OPT_Wnarrowing, "narrowing conversion of %qE "
- "from %qT to %qT inside { }", init, ftype, type);
+ {
+ if (cxx_dialect >= cxx0x)
+ pedwarn (EXPR_LOC_OR_HERE (init), OPT_Wnarrowing,
+ "narrowing conversion of %qE from %qT to %qT inside { }",
+ init, ftype, type);
+ else
+ warning_at (EXPR_LOC_OR_HERE (init), OPT_Wnarrowing,
+ "narrowing conversion of %qE from %qT to %qT inside { } "
+ "is ill-formed in C++11", init, ftype, type);
+ }
}
/* Process the initializer INIT for a variable of type TYPE, emitting
@@ -902,7 +921,7 @@ digest_init_r (tree type, tree init, bool nested, int flags,
{
tree *exp;
- if (cxx_dialect != cxx98 && nested)
+ if (nested)
check_narrowing (type, init);
init = convert_for_initialization (0, type, init, flags,
ICR_INIT, NULL_TREE, 0,
diff --git a/gcc/cppbuiltin.c b/gcc/cppbuiltin.c
index cf7d2ff12fd..05d82f5df49 100644
--- a/gcc/cppbuiltin.c
+++ b/gcc/cppbuiltin.c
@@ -66,6 +66,12 @@ define__GNUC__ (cpp_reader *pfile)
cpp_define_formatted (pfile, "__GNUC_MINOR__=%d", minor);
cpp_define_formatted (pfile, "__GNUC_PATCHLEVEL__=%d", patchlevel);
cpp_define_formatted (pfile, "__VERSION__=\"%s\"", version_string);
+ cpp_define_formatted (pfile, "__ATOMIC_RELAXED=%d", MEMMODEL_RELAXED);
+ cpp_define_formatted (pfile, "__ATOMIC_SEQ_CST=%d", MEMMODEL_SEQ_CST);
+ cpp_define_formatted (pfile, "__ATOMIC_ACQUIRE=%d", MEMMODEL_ACQUIRE);
+ cpp_define_formatted (pfile, "__ATOMIC_RELEASE=%d", MEMMODEL_RELEASE);
+ cpp_define_formatted (pfile, "__ATOMIC_ACQ_REL=%d", MEMMODEL_ACQ_REL);
+ cpp_define_formatted (pfile, "__ATOMIC_CONSUME=%d", MEMMODEL_CONSUME);
}
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 584ffd202ba..d90f769e546 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -712,8 +712,8 @@ find_used_regs (rtx *xptr, void *data ATTRIBUTE_UNUSED)
}
}
-/* Try to replace all non-SET_DEST occurrences of FROM in INSN with TO.
- Returns nonzero is successful. */
+/* Try to replace all uses of FROM in INSN with TO.
+ Return nonzero if successful. */
static int
try_replace_reg (rtx from, rtx to, rtx insn)
@@ -764,6 +764,18 @@ try_replace_reg (rtx from, rtx to, rtx insn)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
+ if (set && MEM_P (SET_DEST (set)) && reg_mentioned_p (from, SET_DEST (set)))
+ {
+ /* Registers can also appear as uses in SET_DEST if it is a MEM.
+ We could perhaps try this for multiple SETs, but it probably
+ won't buy us anything. */
+ rtx dest = simplify_replace_rtx (SET_DEST (set), from, to);
+
+ if (!rtx_equal_p (dest, SET_DEST (set))
+ && validate_change (insn, &SET_DEST (set), dest, 0))
+ success = 1;
+ }
+
/* REG_EQUAL may get simplified into register.
We don't allow that. Remove that note. This code ought
not to happen, because previous code ought to synthesize
diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi
index 939f6dea1dd..f76cce8d234 100644
--- a/gcc/doc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -746,7 +746,7 @@ Volker Reichelt for keeping up with the problem reports.
@item
Joern Rennecke for maintaining the sh port, loop, regmove & reload
-hacking.
+hacking and developing and maintaining the Epiphany port.
@item
Loren J. Rittle for improvements to libstdc++-v3 including the FreeBSD
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7c773882423..c7e8ede9cb0 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -79,7 +79,8 @@ extensions, accepted by GCC in C90 mode and in C++.
* Return Address:: Getting the return or frame address of a function.
* Vector Extensions:: Using vector instructions through built-in functions.
* Offsetof:: Special syntax for implementing @code{offsetof}.
-* Atomic Builtins:: Built-in functions for atomic memory access.
+* __sync Builtins:: Legacy built-in functions for atomic memory access.
+* __atomic Builtins:: Atomic built-in functions with memory model.
* Object Size Checking:: Built-in functions for limited buffer overflow
checking.
* Other Builtins:: Other built-in functions.
@@ -2192,7 +2193,7 @@ types (@pxref{Variable Attributes}, @pxref{Type Attributes}.)
@item disinterrupt
@cindex @code{disinterrupt} attribute
-On MeP targets, this attribute causes the compiler to emit
+On Epiphany and MeP targets, this attribute causes the compiler to emit
instructions to disable interrupts for the duration of the given
function.
@@ -2551,7 +2552,7 @@ This attribute is ignored for R8C target.
@item interrupt
@cindex interrupt handler functions
-Use this attribute on the ARM, AVR, M32C, M32R/D, m68k, MeP, MIPS,
+Use this attribute on the ARM, AVR, Epiphany, 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
@@ -2723,7 +2724,8 @@ attribute is not allowed on types to annotate indirect calls.
@item long_call/short_call
@cindex indirect calls on ARM
This attribute specifies how a particular function is called on
-ARM@. Both attributes override the @option{-mlong-calls} (@pxref{ARM Options})
+ARM and Epiphany. Both attributes override the
+@option{-mlong-calls} (@pxref{ARM Options})
command-line switch and @code{#pragma long_calls} settings. The
@code{long_call} attribute indicates that the function might be far
away from the call site and require a different (more expensive)
@@ -6682,8 +6684,8 @@ is a suitable definition of the @code{offsetof} macro. In C++, @var{type}
may be dependent. In either case, @var{member} may consist of a single
identifier, or a sequence of member accesses and array references.
-@node Atomic Builtins
-@section Built-in functions for atomic memory access
+@node __sync Builtins
+@section Legacy __sync built-in functions for atomic memory access
The following builtins are intended to be compatible with those described
in the @cite{Intel Itanium Processor-specific Application Binary Interface},
@@ -6815,6 +6817,232 @@ previous memory loads have been satisfied, but following memory reads
are not prevented from being speculated to before the barrier.
@end table
+@node __atomic Builtins
+@section Built-in functions for memory model aware atomic operations
+
+The following built-in functions approximately match the requirements for
+C++11 memory model. Many are similar to the @samp{__sync} prefixed built-in
+functions, but all also have a memory model parameter. These are all
+identified by being prefixed with @samp{__atomic}, and most are overloaded
+such that they work with multiple types.
+
+GCC will allow any integral scalar or pointer type that is 1, 2, 4, or 8
+bytes in length. 16-byte integral types are also allowed if
+@samp{__int128} (@pxref{__int128}) is supported by the architecture.
+
+Target architectures are encouraged to provide their own patterns for
+each of these built-in functions. If no target is provided, the original
+non-memory model set of @samp{__sync} atomic built-in functions will be
+utilized, along with any required synchronization fences surrounding it in
+order to achieve the proper behaviour. Execution in this case is subject
+to the same restrictions as those built-in functions.
+
+If there is no pattern or mechanism to provide a lock free instruction
+sequence, a call is made to an external routine with the same parameters
+to be resolved at runtime.
+
+The four non-arithmetic functions (load, store, exchange, and
+compare_exchange) all have a generic version as well. This generic
+version will work on any data type. If the data type size maps to one
+of the integral sizes which may have lock free support, the generic
+version will utilize the lock free built-in function. Otherwise an
+external call is left to be resolved at runtime. This external call will
+be the same format with the addition of a @samp{size_t} parameter inserted
+as the first parameter indicating the size of the object being pointed to.
+All objects must be the same size.
+
+There are 6 different memory models which can be specified. These map
+to the same names in the C++11 standard. Refer there or to the
+@uref{http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync,GCC wiki on
+atomic synchronization} for more detailed definitions. These memory
+models integrate both barriers to code motion as well as synchronization
+requirements with other threads. These are listed in approximately
+ascending order of strength.
+
+@table @code
+@item __ATOMIC_RELAXED
+No barriers or synchronization.
+@item __ATOMIC_CONSUME
+Data dependency only for both barrier and synchronization with another
+thread.
+@item __ATOMIC_ACQUIRE
+Barrier to hoisting of code and synchronizes with release (or stronger)
+semantic stores from another thread.
+@item __ATOMIC_RELEASE
+Barrier to sinking of code and synchronizes with acquire (or stronger)
+semantic loads from another thread.
+@item __ATOMIC_ACQ_REL
+Full barrier in both directions and synchronizes with acquire loads and
+release stores in another thread.
+@item __ATOMIC_SEQ_CST
+Full barrier in both directions and synchronizes with acquire loads and
+release stores in all threads.
+@end table
+
+When implementing patterns for these built-in functions , the memory model
+parameter can be ignored as long as the pattern implements the most
+restrictive @code{__ATOMIC_SEQ_CST} model. Any of the other memory models
+will execute correctly with this memory model but they may not execute as
+efficiently as they could with a more appropriate implemention of the
+relaxed requirements.
+
+Note that the C++11 standard allows for the memory model parameter to be
+determined at runtime rather than at compile time. These built-in
+functions will map any runtime value to @code{__ATOMIC_SEQ_CST} rather
+than invoke a runtime library call or inline a switch statement. This is
+standard compliant, safe, and the simplest approach for now.
+
+@deftypefn {Built-in Function} @var{type} __atomic_load_n (@var{type} *ptr, int memmodel)
+This built-in function implements an atomic load operation. It returns the
+contents of @code{*@var{ptr}}.
+
+The valid memory model variants are
+@code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, @code{__ATOMIC_ACQUIRE},
+and @code{__ATOMIC_CONSUME}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_load (@var{type} *ptr, @var{type} *ret, int memmodel)
+This is the generic version of an atomic load. It will return the
+contents of @code{*@var{ptr}} in @code{*@var{ret}}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_store_n (@var{type} *ptr, @var{type} val, int memmodel)
+This built-in function implements an atomic store operation. It writes
+@code{@var{val}} into @code{*@var{ptr}}.
+
+The valid memory model variants are
+@code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, and @code{__ATOMIC_RELEASE}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_store (@var{type} *ptr, @var{type} *val, int memmodel)
+This is the generic version of an atomic store. It will store the value
+of @code{*@var{val}} into @code{*@var{ptr}}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} @var{type} __atomic_exchange_n (@var{type} *ptr, @var{type} val, int memmodel)
+This built-in function implements an atomic exchange operation. It writes
+@var{val} into @code{*@var{ptr}}, and returns the previous contents of
+@code{*@var{ptr}}.
+
+The valid memory model variants are
+@code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, @code{__ATOMIC_ACQUIRE},
+@code{__ATOMIC_RELEASE}, and @code{__ATOMIC_ACQ_REL}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_exchange (@var{type} *ptr, @var{type} *val, @var{type} *ret, int memmodel)
+This is the generic version of an atomic exchange. It will store the
+contents of @code{*@var{val}} into @code{*@var{ptr}}. The original value
+of @code{*@var{ptr}} will be copied into @code{*@var{ret}}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} bool __atomic_compare_exchange_n (@var{type} *ptr, @var{type} *expected, @var{type} desired, bool weak, int success_memmodel, int failure_memmodel)
+This built-in function implements an atomic compare and exchange operation.
+This compares the contents of @code{*@var{ptr}} with the contents of
+@code{*@var{expected}} and if equal, writes @var{desired} into
+@code{*@var{ptr}}. If they are not equal, the current contents of
+@code{*@var{ptr}} is written into @code{*@var{expected}}.
+
+True is returned if @code{*@var{desired}} is written into
+@code{*@var{ptr}} and the execution is considered to conform to the
+memory model specified by @var{success_memmodel}. There are no
+restrictions on what memory model can be used here.
+
+False is returned otherwise, and the execution is considered to conform
+to @var{failure_memmodel}. This memory model cannot be
+@code{__ATOMIC_RELEASE} nor @code{__ATOMIC_ACQ_REL}. It also cannot be a
+stronger model than that specified by @var{success_memmodel}.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} bool __atomic_compare_exchange (@var{type} *ptr, @var{type} *expected, @var{type} *desired, bool weak, int success_memmodel, int failure_memmodel)
+This built-in function implements the generic version of
+@code{__atomic_compare_exchange}. The function is virtually identical to
+@code{__atomic_compare_exchange_n}, except the desired value is also a
+pointer.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} @var{type} __atomic_add_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_sub_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_and_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_xor_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_or_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_nand_fetch (@var{type} *ptr, @var{type} val, int memmodel)
+These built-in functions perform the operation suggested by the name, and
+return the result of the operation. That is,
+
+@smallexample
+@{ *ptr @var{op}= val; return *ptr; @}
+@end smallexample
+
+All memory models are valid.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} @var{type} __atomic_fetch_add (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_fetch_sub (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_fetch_and (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_fetch_xor (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_fetch_or (@var{type} *ptr, @var{type} val, int memmodel)
+@deftypefnx {Built-in Function} @var{type} __atomic_fetch_nand (@var{type} *ptr, @var{type} val, int memmodel)
+These built-in functions perform the operation suggested by the name, and
+return the value that had previously been in @code{*@var{ptr}}. That is,
+
+@smallexample
+@{ tmp = *ptr; *ptr @var{op}= val; return tmp; @}
+@end smallexample
+
+All memory models are valid.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_thread_fence (int memmodel)
+
+This built-in function acts as a synchronization fence between threads
+based on the specified memory model.
+
+All memory orders are valid.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} void __atomic_signal_fence (int memmodel)
+
+This built-in function acts as a synchronization fence between a thread
+and signal handlers based in the same thread.
+
+All memory orders are valid.
+
+@end deftypefn
+
+@deftypefn {Built-in Function} bool __atomic_always_lock_free (size_t size)
+
+This built-in function returns true if objects of size bytes will always
+generate lock free atomic instructions for the target architecture.
+Otherwise false is returned.
+
+size must resolve to a compile time constant.
+
+@smallexample
+if (_atomic_always_lock_free (sizeof (long long)))
+@end smallexample
+
+@end deftypefn
+
+@deftypefn {Built-in Function} bool __atomic_is_lock_free (size_t size)
+
+This built-in function returns true if objects of size bytes will always
+generate lock free atomic instructions for the target architecture. If
+it is not known to be lock free a call is made to a runtime routine named
+@code{__atomic_is_lock_free}.
+
+@end deftypefn
+
@node Object Size Checking
@section Object Size Checking Builtins
@findex __builtin_object_size
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 730f82baff8..643ba7208e6 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1208,6 +1208,11 @@ of the arguments depend on the target.
Specify if the compiler should default to @option{-marm} or @option{-mthumb}.
This option is only supported on ARM targets.
+@item --with-stack-offset=@var{num}
+This option sets the default for the -mstack-offset=@var{num} option,
+and will thus generally also control the setting of this option for
+libraries. This option is only supported on Epiphany targets.
+
@item --with-fpmath=@var{isa}
This options sets @option{-mfpmath=sse} by default and specifies the default
ISA for floating-point arithmetics. You can select either @samp{sse} which
@@ -3315,6 +3320,13 @@ and includes all the necessary compilation tools and libraries.
@html
<hr />
@end html
+@heading @anchor{epiphany-x-elf}epiphany-*-elf
+Adapteva Epiphany.
+This configuration is intended for embedded systems.
+
+@html
+<hr />
+@end html
@heading @anchor{x-x-freebsd}*-*-freebsd*
Support for FreeBSD 1 was discontinued in GCC 3.2. Support for
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 47b49bf5c6b..3a5a3414cd9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -458,6 +458,14 @@ Objective-C and Objective-C++ Dialects}.
@c Try and put the significant identifier (CPU or system) first,
@c so users have a clue at guessing where the ones they want will be.
+@emph{Adapteva Epiphany Options}
+@gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
+-mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
+-msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
+-mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
+-mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
+-msplit-vecmove-early -m1reg-@var{reg}}
+
@emph{ARM Options}
@gccoptlist{-mapcs-frame -mno-apcs-frame @gol
-mabi=@var{name} @gol
@@ -2376,17 +2384,22 @@ an instance of a derived class through a pointer to a base class if the
base class does not have a virtual destructor. This warning is enabled
by @option{-Wall}.
-@item -Wno-narrowing @r{(C++ and Objective-C++ only)}
+@item -Wnarrowing @r{(C++ and Objective-C++ only)}
@opindex Wnarrowing
@opindex Wno-narrowing
-With -std=c++11, suppress the diagnostic required by the standard for
-narrowing conversions within @samp{@{ @}}, e.g.
+Warn when a narrowing conversion prohibited by C++11 occurs within
+@samp{@{ @}}, e.g.
@smallexample
int i = @{ 2.2 @}; // error: narrowing from double to int
@end smallexample
-This flag can be useful for compiling valid C++98 code in C++11 mode.
+This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
+
+With -std=c++11, @option{-Wno-narrowing} suppresses the diagnostic
+required by the standard. Note that this does not affect the meaning
+of well-formed code; narrowing conversions are still considered
+ill-formed in SFINAE context.
@item -Wnoexcept @r{(C++ and Objective-C++ only)}
@opindex Wnoexcept
@@ -4075,9 +4088,10 @@ ISO C and ISO C++, e.g.@: request for implicit conversion from
@code{void *} to a pointer to non-@code{void} type.
@item -Wc++11-compat @r{(C++ and Objective-C++ only)}
-Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
-ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that will become keywords
-in ISO C++ 2011. This warning is enabled by @option{-Wall}.
+Warn about C++ constructs whose meaning differs between ISO C++ 1998
+and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
+in ISO C++ 2011. This warning turns on @option{-Wnarrowing} and is
+enabled by @option{-Wall}.
@item -Wcast-qual
@opindex Wcast-qual
@@ -4155,6 +4169,12 @@ unsigned integers are disabled by default in C++ unless
Do not warn for conversions between @code{NULL} and non-pointer
types. @option{-Wconversion-null} is enabled by default.
+@item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
+@opindex Wzero-as-null-pointer-constant
+@opindex Wno-zero-as-null-pointer-constant
+Warn when a literal '0' is used as null pointer constant. This can
+be useful to facilitate the conversion to @code{nullptr} in C++11.
+
@item -Wempty-body
@opindex Wempty-body
@opindex Wno-empty-body
@@ -9163,11 +9183,26 @@ The maximum number of conditional stores paires that can be sunk. Set to 0
if either vectorization (@option{-ftree-vectorize}) or if-conversion
(@option{-ftree-loop-if-convert}) is disabled. The default is 2.
+@item allow-load-data-races
+Allow optimizers to introduce new data races on loads.
+Set to 1 to allow, otherwise to 0. This option is enabled by default
+unless implicitly set by the @option{-fmemory-model=} option.
+
@item allow-store-data-races
Allow optimizers to introduce new data races on stores.
Set to 1 to allow, otherwise to 0. This option is enabled by default
unless implicitly set by the @option{-fmemory-model=} option.
+@item allow-packed-load-data-races
+Allow optimizers to introduce new data races on packed data loads.
+Set to 1 to allow, otherwise to 0. This option is enabled by default
+unless implicitly set by the @option{-fmemory-model=} option.
+
+@item allow-packed-store-data-races
+Allow optimizers to introduce new data races on packed data stores.
+Set to 1 to allow, otherwise to 0. This option is enabled by default
+unless implicitly set by the @option{-fmemory-model=} option.
+
@item case-values-threshold
The smallest number of different values for which it is best to use a
jump-table instead of a tree of conditional branches. If the value is
@@ -10234,6 +10269,7 @@ platform.
@c in Machine Dependent Options
@menu
+* Adapteva Epiphany Options::
* ARM Options::
* AVR Options::
* Blackfin Options::
@@ -10282,6 +10318,161 @@ platform.
* zSeries Options::
@end menu
+@node Adapteva Epiphany Options
+@subsection Adapteva Epiphany Options
+
+These @samp{-m} options are defined for Adapteva Epiphany:
+
+@table @gcctabopt
+@item -mhalf-reg-file
+@opindex mhalf-reg-file
+Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
+That allows code to run on hardware variants that lack these registers.
+
+@item -mprefer-short-insn-regs
+@opindex mprefer-short-insn-regs
+Preferrentially allocate registers that allow short instruction generation.
+This can result in increasesd instruction count, so if this reduces or
+increases code size might vary from case to case.
+
+@item -mbranch-cost=@var{num}
+@opindex mbranch-cost
+Set the cost of branches to roughly @var{num} ``simple'' instructions.
+This cost is only a heuristic and is not guaranteed to produce
+consistent results across releases.
+
+@item -mcmove
+@opindex mcmove
+Enable the generation of conditional moves.
+
+@item -mnops=@var{num}
+@opindex mnops
+Emit @var{num} nops before every other generated instruction.
+
+@item -mno-soft-cmpsf
+@opindex mno-soft-cmpsf
+For single-precision floating point comparisons, emit an fsub instruction
+and test the flags. This is faster than a software comparison, but can
+get incorrect results in the presence of NaNs, or when two different small
+numbers are compared such that their difference is calculated as zero.
+The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
+software comparisons.
+
+@item -mstack-offset=@var{num}
+@opindex mstack-offset
+Set the offset between the top of the stack and the stack pointer.
+E.g., a value of 8 means that the eight bytes in the range sp+0@dots{}sp+7
+can be used by leaf functions without stack allocation.
+Values other than @samp{8} or @samp{16} are untested and unlikely to work.
+Note also that this option changes the ABI, compiling a program with a
+different stack offset than the libraries have been compiled with
+will generally not work.
+This option can be useful if you want to evaluate if a different stack
+offset would give you better code, but to actually use a different stack
+offset to build working programs, it is recommended to configure the
+toolchain with the appropriate @samp{--with-stack-offset=@var{num}} option.
+
+@item -mno-round-nearest
+@opindex mno-round-nearest
+Make the scheduler assume that the rounding mode has been set to
+truncating. The default is @option{-mround-nearest}.
+
+@item -mlong-calls
+@opindex mlong-calls
+If not otherwise specified by an attribute, assume all calls might be beyond
+the offset range of the b / bl instructions, and therefore load the
+function address into a register before performing a (otherwise direct) call.
+This is the default.
+
+@item -mshort-calls
+@opindex short-calls
+If not otherwise specified by an attribute, assume all direct calls are
+in the range of the b / bl instructions, so use these instructions
+for direct calls. The default is @option{-mlong-calls}.
+
+@item -msmall16
+@opindex msmall16
+Assume addresses can be loaded as 16 bit unsigned values. This does not
+apply to function addresses for which @option{-mlong-calls} semantics
+are in effect.
+
+@item -mfp-mode=@var{mode}
+@opindex mfp-mode
+Set the prevailing mode of the floating point unit.
+This determines the floating point mode that is provided and expected
+at function call and return time. Making this mode match the mode you
+predominantly need at function start can make your programs smaller and
+faster by avoiding unnecessary mode switches.
+
+@var{mode} can be set to one the following values:
+
+@table @samp
+@item caller
+Any mode at function entry is valid, and retained or restored when
+the function returns, and when it calls other functions.
+This mode is useful for compiling libraries or other compilation units
+you might want to incorporate into different programs with different
+prevailing FPU modes, and the convenience of being able to use a single
+object file outweighs the size and speed overhead for any extra
+mode switching that might be needed, compared with what would be needed
+with a more specific choice of prevailing FPU mode.
+
+@item truncate
+This is the mode used for floating point calculations with
+truncating (i.e.@: round towards zero) rounding mode. That includes
+conversion from floating point to integer.
+
+@item round-nearest
+This is the mode used for floating point calculations with
+round-to-nearest-or-even rounding mode.
+
+@item int
+This is the mode used to perform integer calculations in the FPU, e.g.@:
+integer multiply, or integer multiply-and-accumulate.
+@end table
+
+The default is @option{-mfp-mode=caller}
+
+@item -mnosplit-lohi
+@opindex mnosplit-lohi
+@item -mno-postinc
+@opindex mno-postinc
+@item -mno-postmodify
+@opindex mno-postmodify
+Code generation tweaks that disable, respectively, splitting of 32
+bit loads, generation of post-increment addresses, and generation of
+post-modify addresses. The defaults are @option{msplit-lohi},
+@option{-mpost-inc}, and @option{-mpost-modify}.
+
+@item -mnovect-double
+@opindex mno-vect-double
+Change the preferred SIMD mode to SImode. The default is
+@option{-mvect-double}, which uses DImode as preferred SIMD mode.
+
+@item -max-vect-align=@var{num}
+@opindex max-vect-align
+The maximum alignment for SIMD vector mode types.
+@var{num} may be 4 or 8. The default is 8.
+Note that this is an ABI change, even though many library function
+interfaces will be unaffected, if they don't use SIMD vector modes
+in places where they affect size and/or alignment of relevant types.
+
+@item -msplit-vecmove-early
+@opindex msplit-vecmove-early
+Split vector moves into single word moves before reload. In theory this
+could give better register allocation, but so far the reverse seems to be
+generally the case.
+
+@item -m1reg-@var{reg}
+@opindex m1reg-
+Specify a register to hold the constant @minus{}1, which makes loading small negative
+constants and certain bitmasks faster.
+Allowable values for reg are r43 and r63, which specify to use that register
+as a fixed register, and none, which means that no register is used for this
+purpose. The default is @option{-m1reg-none}.
+
+@end table
+
@node ARM Options
@subsection ARM Options
@cindex ARM options
@@ -13024,7 +13215,8 @@ This option will enable GCC to use CMPXCHG16B instruction in generated code.
CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
data types. This is useful for high resolution counters that could be updated
by multiple processors (or cores). This instruction is generated as part of
-atomic built-in functions: see @ref{Atomic Builtins} for details.
+atomic built-in functions: see @ref{__sync Builtins} or
+@ref{__atomic Builtins} for details.
@item -msahf
@opindex msahf
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 4a0bcfa1bf1..6b75f2bce28 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
-@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -1778,6 +1778,77 @@ A memory address based on Y or Z pointer with displacement.
Constant integer 4
@end table
+@item Epiphany---@file{config/epiphany/constraints.md}
+@table @code
+@item U16
+An unsigned 16-bit constant.
+
+@item K
+An unsigned 5-bit constant.
+
+@item L
+A signed 11-bit constant.
+
+@item Cm1
+A signed 11-bit constant added to @minus{}1.
+Can only match when the @option{-m1reg-@var{reg}} option is active.
+
+@item Cl1
+Left-shift of @minus{}1, i.e., a bit mask with a block of leading ones, the rest
+being a block of trailing zeroes.
+Can only match when the @option{-m1reg-@var{reg}} option is active.
+
+@item Cr1
+Right-shift of @minus{}1, i.e., a bit mask with a trailing block of ones, the
+rest being zeroes. Or to put it another way, one less than a power of two.
+Can only match when the @option{-m1reg-@var{reg}} option is active.
+
+@item Cal
+Constant for arithmetic/logical operations.
+This is like @code{i}, except that for position independent code,
+no symbols / expressions needing relocations are allowed.
+
+@item Csy
+Symbolic constant for call/jump instruction.
+
+@item Rcs
+The register class usable in short insns. This is a register class
+constraint, and can thus drive register allocation.
+This constraint won't match unless @option{-mprefer-short-insn-regs} is
+in effect.
+
+@item Rsc
+The the register class of registers that can be used to hold a
+sibcall call address. I.e., a caller-saved register.
+
+@item Rct
+Core control register class.
+
+@item Rgs
+The register group usable in short insns.
+This constraint does not use a register class, so that it only
+passively matches suitable registers, and doesn't drive register allocation.
+
+@ifset INTERNALS
+@item Car
+Constant suitable for the addsi3_r pattern. This is a valid offset
+For byte, halfword, or word addressing.
+@end ifset
+
+@item Rra
+Matches the return address if it can be replaced with the link register.
+
+@item Rcc
+Matches the integer condition code register.
+
+@item Sra
+Matches the return address if it is in a stack slot.
+
+@item Cfm
+Matches control register values to switch fp mode, which are encapsulated in
+@code{UNSPEC_FP_MODE}.
+@end table
+
@item Hewlett-Packard PA-RISC---@file{config/pa/pa.h}
@table @code
@item a
@@ -5628,6 +5699,155 @@ released only after all previous memory operations have completed.
If this pattern is not defined, then a @code{memory_barrier} pattern
will be emitted, followed by a store of the value to the memory operand.
+@cindex @code{atomic_compare_and_swap@var{mode}} instruction pattern
+@item @samp{atomic_compare_and_swap@var{mode}}
+This pattern, if defined, emits code for an atomic compare-and-swap
+operation with memory model semantics. Operand 2 is the memory on which
+the atomic operation is performed. Operand 0 is an output operand which
+is set to true or false based on whether the operation succeeded. Operand
+1 is an output operand which is set to the contents of the memory before
+the operation was attempted. Operand 3 is the value that is expected to
+be in memory. Operand 4 is the value to put in memory if the expected
+value is found there. Operand 5 is set to 1 if this compare and swap is to
+be treated as a weak operation. Operand 6 is the memory model to be used
+if the operation is a success. Operand 7 is the memory model to be used
+if the operation fails.
+
+If memory referred to in operand 2 contains the value in operand 3, then
+operand 4 is stored in memory pointed to by operand 2 and fencing based on
+the memory model in operand 6 is issued.
+
+If memory referred to in operand 2 does not contain the value in operand 3,
+then fencing based on the memory model in operand 7 is issued.
+
+If a target does not support weak compare-and-swap operations, or the port
+elects not to implement weak operations, the argument in operand 5 can be
+ignored. Note a strong implementation must be provided.
+
+If this pattern is not provided, the @code{__atomic_compare_exchange}
+built-in functions will utilize the legacy @code{sync_compare_and_swap}
+pattern with an @code{__ATOMIC_SEQ_CST} memory model.
+
+@cindex @code{atomic_load@var{mode}} instruction pattern
+@item @samp{atomic_load@var{mode}}
+This pattern implements an atomic load operation with memory model
+semantics. Operand 1 is the memory address being loaded from. Operand 0
+is the result of the load. Operand 2 is the memory model to be used for
+the load operation.
+
+If not present, the @code{__atomic_load} built-in function will either
+resort to a normal load with memory barriers, or a compare-and-swap
+operation if a normal load would not be atomic.
+
+@cindex @code{atomic_store@var{mode}} instruction pattern
+@item @samp{atomic_store@var{mode}}
+This pattern implements an atomic store operation with memory model
+semantics. Operand 0 is the memory address being stored to. Operand 1
+is the value to be written. Operand 2 is the memory model to be used for
+the operation.
+
+If not present, the @code{__atomic_store} built-in function will attempt to
+perform a normal store and surround it with any required memory fences. If
+the store would not be atomic, then an @code{__atomic_exchange} is
+attempted with the result being ignored.
+
+@cindex @code{atomic_exchange@var{mode}} instruction pattern
+@item @samp{atomic_exchange@var{mode}}
+This pattern implements an atomic exchange operation with memory model
+semantics. Operand 1 is the memory location the operation is performed on.
+Operand 0 is an output operand which is set to the original value contained
+in the memory pointed to by operand 1. Operand 2 is the value to be
+stored. Operand 3 is the memory model to be used.
+
+If this pattern is not present, the built-in function
+@code{__atomic_exchange} will attempt to preform the operation with a
+compare and swap loop.
+
+@cindex @code{atomic_add@var{mode}} instruction pattern
+@cindex @code{atomic_sub@var{mode}} instruction pattern
+@cindex @code{atomic_or@var{mode}} instruction pattern
+@cindex @code{atomic_and@var{mode}} instruction pattern
+@cindex @code{atomic_xor@var{mode}} instruction pattern
+@cindex @code{atomic_nand@var{mode}} instruction pattern
+@item @samp{atomic_add@var{mode}}, @samp{atomic_sub@var{mode}}
+@itemx @samp{atomic_or@var{mode}}, @samp{atomic_and@var{mode}}
+@itemx @samp{atomic_xor@var{mode}}, @samp{atomic_nand@var{mode}}
+
+These patterns emit code for an atomic operation on memory with memory
+model semantics. Operand 0 is the memory on which the atomic operation is
+performed. Operand 1 is the second operand to the binary operator.
+Operand 2 is the memory model to be used by the operation.
+
+If these patterns are not defined, attempts will be made to use legacy
+@code{sync} patterns, or equivilent patterns which return a result. If
+none of these are available a compare-and-swap loop will be used.
+
+@cindex @code{atomic_fetch_add@var{mode}} instruction pattern
+@cindex @code{atomic_fetch_sub@var{mode}} instruction pattern
+@cindex @code{atomic_fetch_or@var{mode}} instruction pattern
+@cindex @code{atomic_fetch_and@var{mode}} instruction pattern
+@cindex @code{atomic_fetch_xor@var{mode}} instruction pattern
+@cindex @code{atomic_fetch_nand@var{mode}} instruction pattern
+@item @samp{atomic_fetch_add@var{mode}}, @samp{atomic_fetch_sub@var{mode}}
+@itemx @samp{atomic_fetch_or@var{mode}}, @samp{atomic_fetch_and@var{mode}}
+@itemx @samp{atomic_fetch_xor@var{mode}}, @samp{atomic_fetch_nand@var{mode}}
+
+These patterns emit code for an atomic operation on memory with memory
+model semantics, and return the original value. Operand 0 is an output
+operand which contains the value of the memory location before the
+operation was performed. Operand 1 is the memory on which the atomic
+operation is performed. Operand 2 is the second operand to the binary
+operator. Operand 3 is the memory model to be used by the operation.
+
+If these patterns are not defined, attempts will be made to use legacy
+@code{sync} patterns. If none of these are available a compare-and-swap
+loop will be used.
+
+@cindex @code{atomic_add_fetch@var{mode}} instruction pattern
+@cindex @code{atomic_sub_fetch@var{mode}} instruction pattern
+@cindex @code{atomic_or_fetch@var{mode}} instruction pattern
+@cindex @code{atomic_and_fetch@var{mode}} instruction pattern
+@cindex @code{atomic_xor_fetch@var{mode}} instruction pattern
+@cindex @code{atomic_nand_fetch@var{mode}} instruction pattern
+@item @samp{atomic_add_fetch@var{mode}}, @samp{atomic_sub_fetch@var{mode}}
+@itemx @samp{atomic_or_fetch@var{mode}}, @samp{atomic_and_fetch@var{mode}}
+@itemx @samp{atomic_xor_fetch@var{mode}}, @samp{atomic_nand_fetch@var{mode}}
+
+These patterns emit code for an atomic operation on memory with memory
+model semantics and return the result after the operation is performed.
+Operand 0 is an output operand which contains the value after the
+operation. Operand 1 is the memory on which the atomic operation is
+performed. Operand 2 is the second operand to the binary operator.
+Operand 3 is the memory model to be used by the operation.
+
+If these patterns are not defined, attempts will be made to use legacy
+@code{sync} patterns, or equivilent patterns which return the result before
+the operation followed by the arithmetic operation required to produce the
+result. If none of these are available a compare-and-swap loop will be
+used.
+
+@cindex @code{mem_thread_fence@var{mode}} instruction pattern
+@item @samp{mem_thread_fence@var{mode}}
+This pattern emits code required to implement a thread fence with
+memory model semantics. Operand 0 is the memory model to be used.
+
+If this pattern is not specified, all memory models except
+@code{__ATOMIC_RELAXED} will result in issuing a @code{sync_synchronize}
+barrier pattern.
+
+@cindex @code{mem_signal_fence@var{mode}} instruction pattern
+@item @samp{mem_signal_fence@var{mode}}
+This pattern emits code required to implement a signal fence with
+memory model semantics. Operand 0 is the memory model to be used.
+
+This pattern should impact the compiler optimizers the same way that
+mem_signal_fence does, but it does not need to issue any barrier
+instructions.
+
+If this pattern is not specified, all memory models except
+@code{__ATOMIC_RELAXED} will result in issuing a @code{sync_synchronize}
+barrier pattern.
+
@cindex @code{stack_protect_set} instruction pattern
@item @samp{stack_protect_set}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 737b48e0de8..d96932b4e48 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -5766,6 +5766,14 @@ This hook should return the built-in decl needed to load a vector of the given t
This hook should return the built-in decl needed to store a vector of the given type within a transaction.
@end deftypefn
+@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_GATHER (const_tree @var{mem_vectype}, const_tree @var{index_type}, int @var{scale})
+Target builtin that implements vector gather operation. @var{mem_vectype}
+is the vector type of the load and @var{index_type} is scalar type of
+the index, scaled by @var{scale}.
+The default is @code{NULL_TREE} which means to not vectorize gather
+loads.
+@end deftypefn
+
@node Anchored Addresses
@section Anchored Addresses
@cindex anchored addresses
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 348b7e6dee5..146e38a35e1 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -5700,6 +5700,14 @@ The default is zero which means to not iterate over other vector sizes.
@hook TARGET_VECTORIZE_BUILTIN_TM_STORE
+@hook TARGET_VECTORIZE_BUILTIN_GATHER
+Target builtin that implements vector gather operation. @var{mem_vectype}
+is the vector type of the load and @var{index_type} is scalar type of
+the index, scaled by @var{scale}.
+The default is @code{NULL_TREE} which means to not vectorize gather
+loads.
+@end deftypefn
+
@node Anchored Addresses
@section Anchored Addresses
@cindex anchored addresses
diff --git a/gcc/dse.c b/gcc/dse.c
index ef1b50c5315..ddabd3de0c6 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
+#include "regset.h"
#include "flags.h"
#include "df.h"
#include "cselib.h"
@@ -377,6 +378,13 @@ struct insn_info
created. */
read_info_t read_rec;
+ /* The live fixed registers. We assume only fixed registers can
+ cause trouble by being clobbered from an expanded pattern;
+ storing only the live fixed registers (rather than all registers)
+ means less memory needs to be allocated / copied for the individual
+ stores. */
+ regset fixed_regs_live;
+
/* The prev insn in the basic block. */
struct insn_info * prev_insn;
@@ -448,9 +456,9 @@ struct bb_info
/* The following bitvector is indexed by the reg number. It
contains the set of regs that are live at the current instruction
being processed. While it contains info for all of the
- registers, only the pseudos are actually examined. It is used to
- assure that shift sequences that are inserted do not accidently
- clobber live hard regs. */
+ registers, only the hard registers are actually examined. It is used
+ to assure that shift and/or add sequences that are inserted do not
+ accidently clobber live hard regs. */
bitmap regs_live;
};
@@ -827,6 +835,51 @@ free_store_info (insn_info_t insn_info)
insn_info->store_rec = NULL;
}
+typedef struct
+{
+ rtx first, current;
+ regset fixed_regs_live;
+ bool failure;
+} note_add_store_info;
+
+/* Callback for emit_inc_dec_insn_before via note_stores.
+ Check if a register is clobbered which is live afterwards. */
+
+static void
+note_add_store (rtx loc, const_rtx expr ATTRIBUTE_UNUSED, void *data)
+{
+ rtx insn;
+ note_add_store_info *info = (note_add_store_info *) data;
+ int r, n;
+
+ if (!REG_P (loc))
+ return;
+
+ /* If this register is referenced by the current or an earlier insn,
+ that's OK. E.g. this applies to the register that is being incremented
+ with this addition. */
+ for (insn = info->first;
+ insn != NEXT_INSN (info->current);
+ insn = NEXT_INSN (insn))
+ if (reg_referenced_p (loc, PATTERN (insn)))
+ return;
+
+ /* If we come here, we have a clobber of a register that's only OK
+ if that register is not live. If we don't have liveness information
+ available, fail now. */
+ if (!info->fixed_regs_live)
+ {
+ info->failure = true;
+ return;
+ }
+ /* Now check if this is a live fixed register. */
+ r = REGNO (loc);
+ n = hard_regno_nregs[r][GET_MODE (loc)];
+ while (--n >= 0)
+ if (REGNO_REG_SET_P (info->fixed_regs_live, r+n))
+ info->failure = true;
+}
+
/* Callback for for_each_inc_dec that emits an INSN that sets DEST to
SRC + SRCOFF before insn ARG. */
@@ -835,31 +888,68 @@ emit_inc_dec_insn_before (rtx mem ATTRIBUTE_UNUSED,
rtx op ATTRIBUTE_UNUSED,
rtx dest, rtx src, rtx srcoff, void *arg)
{
- rtx insn = (rtx)arg;
-
- if (srcoff)
- src = gen_rtx_PLUS (GET_MODE (src), src, srcoff);
+ insn_info_t insn_info = (insn_info_t) arg;
+ rtx insn = insn_info->insn, new_insn, cur;
+ note_add_store_info info;
/* We can reuse all operands without copying, because we are about
to delete the insn that contained it. */
+ if (srcoff)
+ new_insn = gen_add3_insn (dest, src, srcoff);
+ else
+ new_insn = gen_move_insn (dest, src);
+ info.first = new_insn;
+ info.fixed_regs_live = insn_info->fixed_regs_live;
+ info.failure = false;
+ for (cur = new_insn; cur; cur = NEXT_INSN (cur))
+ {
+ info.current = cur;
+ note_stores (PATTERN (cur), note_add_store, &info);
+ }
- emit_insn_before (gen_rtx_SET (VOIDmode, dest, src), insn);
+ /* If a failure was flagged above, return 1 so that for_each_inc_dec will
+ return it immediately, communicating the failure to its caller. */
+ if (info.failure)
+ return 1;
+
+ emit_insn_before (new_insn, insn);
return -1;
}
-/* Before we delete INSN, make sure that the auto inc/dec, if it is
- there, is split into a separate insn. */
+/* Before we delete INSN_INFO->INSN, make sure that the auto inc/dec, if it
+ is there, is split into a separate insn.
+ Return true on success (or if there was nothing to do), false on failure. */
-void
-check_for_inc_dec (rtx insn)
+static bool
+check_for_inc_dec_1 (insn_info_t insn_info)
{
+ rtx insn = insn_info->insn;
rtx note = find_reg_note (insn, REG_INC, NULL_RTX);
if (note)
- for_each_inc_dec (&insn, emit_inc_dec_insn_before, insn);
+ return for_each_inc_dec (&insn, emit_inc_dec_insn_before, insn_info) == 0;
+ return true;
}
+/* Entry point for postreload. If you work on reload_cse, or you need this
+ anywhere else, consider if you can provide register liveness information
+ and add a parameter to this function so that it can be passed down in
+ insn_info.fixed_regs_live. */
+bool
+check_for_inc_dec (rtx insn)
+{
+ struct insn_info insn_info;
+ rtx note;
+
+ insn_info.insn = insn;
+ insn_info.fixed_regs_live = NULL;
+ note = find_reg_note (insn, REG_INC, NULL_RTX);
+ if (note)
+ return for_each_inc_dec (&insn, emit_inc_dec_insn_before, &insn_info) == 0;
+ return true;
+}
+
/* Delete the insn and free all of the fields inside INSN_INFO. */
static void
@@ -870,7 +960,8 @@ delete_dead_store_insn (insn_info_t insn_info)
if (!dbg_cnt (dse))
return;
- check_for_inc_dec (insn_info->insn);
+ if (!check_for_inc_dec_1 (insn_info))
+ return;
if (dump_file)
{
fprintf (dump_file, "Locally deleting insn %d ",
@@ -2375,6 +2466,17 @@ get_call_args (rtx call_insn, tree fn, rtx *args, int nargs)
return true;
}
+/* Return a bitmap of the fixed registers contained in IN. */
+
+static bitmap
+copy_fixed_regs (const_bitmap in)
+{
+ bitmap ret;
+
+ ret = ALLOC_REG_SET (NULL);
+ bitmap_and (ret, in, fixed_reg_set_regset);
+ return ret;
+}
/* Apply record_store to all candidate stores in INSN. Mark INSN
if some part of it is not a candidate store and assigns to a
@@ -2529,6 +2631,8 @@ scan_insn (bb_info_t bb_info, rtx insn)
active_local_stores_len = 1;
active_local_stores = NULL;
}
+ insn_info->fixed_regs_live
+ = copy_fixed_regs (bb_info->regs_live);
insn_info->next_local_store = active_local_stores;
active_local_stores = insn_info;
}
@@ -2579,6 +2683,7 @@ scan_insn (bb_info_t bb_info, rtx insn)
active_local_stores_len = 1;
active_local_stores = NULL;
}
+ insn_info->fixed_regs_live = copy_fixed_regs (bb_info->regs_live);
insn_info->next_local_store = active_local_stores;
active_local_stores = insn_info;
}
@@ -3622,9 +3727,9 @@ dse_step5_nospill (void)
}
if (deleted)
{
- if (dbg_cnt (dse))
+ if (dbg_cnt (dse)
+ && check_for_inc_dec_1 (insn_info))
{
- check_for_inc_dec (insn_info->insn);
delete_insn (insn_info->insn);
insn_info->insn = NULL;
globally_deleted++;
@@ -3702,12 +3807,12 @@ dse_step5_spill (void)
deleted = false;
store_info = store_info->next;
}
- if (deleted && dbg_cnt (dse))
+ if (deleted && dbg_cnt (dse)
+ && check_for_inc_dec_1 (insn_info))
{
if (dump_file)
fprintf (dump_file, "Spill deleting insn %d\n",
INSN_UID (insn_info->insn));
- check_for_inc_dec (insn_info->insn);
delete_insn (insn_info->insn);
spill_deleted++;
insn_info->insn = NULL;
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 4f44c7744b3..69e6f21719b 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -1757,7 +1757,8 @@ dwarf2out_frame_debug_expr (rtx expr)
regiser. */
if (fde
&& fde->stack_realign
- && src == hard_frame_pointer_rtx)
+ && REG_P (src)
+ && REGNO (src) == HARD_FRAME_POINTER_REGNUM)
{
gcc_assert (cur_cfa->reg != dw_frame_pointer_regnum);
cur_trace->cfa_store.offset = 0;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index e6f86a49854..39be9a16e9c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18020,6 +18020,14 @@ gen_label_die (tree decl, dw_die_ref context_die)
ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (insn));
add_AT_lbl_id (lbl_die, DW_AT_low_pc, label);
}
+ else if (insn
+ && NOTE_P (insn)
+ && NOTE_KIND (insn) == NOTE_INSN_DELETED_DEBUG_LABEL
+ && CODE_LABEL_NUMBER (insn) != -1)
+ {
+ ASM_GENERATE_INTERNAL_LABEL (label, "LDL", CODE_LABEL_NUMBER (insn));
+ add_AT_lbl_id (lbl_die, DW_AT_low_pc, label);
+ }
}
}
diff --git a/gcc/expr.h b/gcc/expr.h
index 1bf1369ac96..2cc8152c740 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -212,11 +212,17 @@ int can_conditionally_move_p (enum machine_mode mode);
rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, enum machine_mode,
rtx, rtx, enum machine_mode, int);
-rtx expand_val_compare_and_swap (rtx, rtx, rtx, rtx);
-rtx expand_bool_compare_and_swap (rtx, rtx, rtx, rtx);
rtx expand_sync_operation (rtx, rtx, enum rtx_code);
rtx expand_sync_fetch_operation (rtx, rtx, enum rtx_code, bool, rtx);
-rtx expand_sync_lock_test_and_set (rtx, rtx, rtx);
+
+rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel, bool);
+rtx expand_atomic_load (rtx, rtx, enum memmodel);
+rtx expand_atomic_store (rtx, rtx, enum memmodel, bool);
+rtx expand_atomic_fetch_op (rtx, rtx, rtx, enum rtx_code, enum memmodel,
+ bool);
+void expand_atomic_thread_fence (enum memmodel);
+void expand_atomic_signal_fence (enum memmodel);
+
/* Functions from expmed.c: */
@@ -248,6 +254,7 @@ extern void expand_builtin_setjmp_receiver (rtx);
extern rtx expand_builtin_saveregs (void);
extern void expand_builtin_trap (void);
extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
+extern void expand_builtin_mem_thread_fence (enum memmodel);
/* Functions from expr.c: */
diff --git a/gcc/final.c b/gcc/final.c
index e6d288639b7..bd4e7a762a7 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2080,6 +2080,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
ASM_OUTPUT_DEBUG_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
break;
+ case NOTE_INSN_DELETED_DEBUG_LABEL:
+ /* Similarly, but need to use different namespace for it. */
+ if (CODE_LABEL_NUMBER (insn) != -1)
+ ASM_OUTPUT_DEBUG_LABEL (file, "LDL", CODE_LABEL_NUMBER (insn));
+ break;
+
case NOTE_INSN_VAR_LOCATION:
case NOTE_INSN_CALL_ARG_LOCATION:
if (!DECL_IGNORED_P (current_function_decl))
@@ -4369,7 +4375,8 @@ rest_of_clean_state (void)
(NOTE_KIND (insn) != NOTE_INSN_VAR_LOCATION
&& NOTE_KIND (insn) != NOTE_INSN_CALL_ARG_LOCATION
&& NOTE_KIND (insn) != NOTE_INSN_BLOCK_BEG
- && NOTE_KIND (insn) != NOTE_INSN_BLOCK_END)))
+ && NOTE_KIND (insn) != NOTE_INSN_BLOCK_END
+ && NOTE_KIND (insn) != NOTE_INSN_DELETED_DEBUG_LABEL)))
print_rtl_single (final_output, insn);
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 40d2a304bd5..1dae389d361 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,564 @@
+2011-11-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50919
+ * class.c (add_proc_comp): Don't add non-overridable procedures to the
+ vtable.
+ * resolve.c (resolve_typebound_function,resolve_typebound_subroutine):
+ Don't generate a dynamic _vptr call for non-overridable procedures.
+
+2011-11-07 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * intrinsic.texi (MCLOCK, MCLOCK8, TIME, TIME8): Functions clock
+ and time are part of the C standard library.
+
+2011-11-06 Janus Weil <janus@gcc.gnu.org>
+
+ * gfortran.h (gfc_extend_expr): Modified prototype.
+ * interface.c (gfc_extend_expr): Return 'match' instead of 'gfc_try'.
+ Remove argument 'real_error'.
+ * resolve.c (resolve_operator): Modified call to 'gfc_extend_expr'.
+
+2011-11-06 Andrew MacLeod <amacleod@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ Merged from cxx-mem-model.
+
+ * types.def: (BT_SIZE, BT_CONST_VOLATILE_PTR, BT_FN_VOID_INT,
+ BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
+ BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
+ BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
+ BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
+ BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT,
+ BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT): New types.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/43829
+ * trans-array.c (gfc_conv_expr_descriptor): Accept the inline intrinsic
+ case in the assertion.
+ * trans-intrinsic (enter_nested_loop): New function.
+ (gfc_conv_intrinsic_arith): Support non-scalar cases.
+ (nest_loop_dimension, walk_inline_intrinsic_arith): New functions.
+ (walk_inline_intrinsic_function): Handle sum and product.
+ (gfc_inline_intrinsic_function_p): Ditto.
+ * trans.h (gfc_get_loopinfo): New macro.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_arith): Introduce parent
+ expression variable. Use it.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic.c): Introduce current loop
+ pointer. Use it.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_arith): Small argument handling
+ cleanup.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_arith): Update conditions.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * frontend-passes.c (cfe_register_funcs): Return early in the case
+ of an inline intrinsic function.
+ (optimize_binop_array_assignment): Skip optimization in the case of
+ an inline intrinsic function.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * array.c (match_subscript): Skip whitespaces before setting locus.
+ * matchexp.c (match_level_1): Ditto.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Set loop's
+ temporary rank to the loop rank. Mark ss chains for multiple loop
+ if necessary. Use gfc_trans_scalarized_loop_boundary to end one loop
+ and start another.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set loop's
+ temporary rank to the loop rank. Mark ss chains for multiple loop
+ if necessary. Use gfc_trans_scalarized_loop_boundary to end one loop
+ and start another.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Don't calculate
+ offset twice in generated code.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-expr.c (gfc_conv_procedure_call): Handle temporaries for
+ arguments to elemental calls.
+ * trans-stmt.c (replace_ss): New function.
+ (gfc_conv_elemental_dependencies): Remove temporary loop handling.
+ Create a new ss for the temporary and replace the original one with it.
+ Remove fake array references. Recalculate all offsets.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.h (gfc_free_ss, gfc_set_delta): New prototypes.
+ * trans-array.c (gfc_free_ss): Remove forward declaration.
+ Make non-static.
+ (set_delta, gfc_set_delta): Remove forward declaration.
+ Make non-static and rename the former to the later. Update uses.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (gfc_inline_intrinsic_function_p): Move prototype...
+ * gfortran.h (gfc_inline_intrinsic_function_p): ... here.
+ * dependency.c (gfc_check_argument_var_dependency): Check dependencies
+ of inline intrinsics' arguments.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): New pointers to outer
+ dimension's ss and loop. Use them.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (outermost_loop): New function.
+ (gfc_trans_array_constructor, gfc_set_vector_loop_bounds,
+ gfc_add_loop_ss_code): Put generated code out of the outermost loop.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (constant_array_constructor_loop_size):
+ Handle multiple loops.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (get_rank, get_loop_upper_bound_for_array):
+ New functions.
+ (gfc_trans_array_constructor): Handle multiple loops.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_loopinfo): New field parent.
+ * trans-array.c (gfc_cleanup_loop): Free nested loops.
+ (gfc_add_ss_to_loop): Set nested_loop's parent loop.
+ (gfc_trans_array_constructor): Update assertion.
+ (gfc_conv_loop_setup): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_add_loop_ss_code): Skip non-nestedmost ss.
+ Call recursively gfc_add_loop_ss_code for all the nested loops.
+ (gfc_conv_ss_startstride): Only get the descriptor for the outermost
+ ss. Call recursively gfc_conv_ss_startstride for all the nested loops.
+ (set_loop_bounds): Call recursively for all the nested loops.
+ (set_delta): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_loopinfo): New fields nested and next.
+ * trans-array.c (gfc_add_ss_to_loop): Update list of nested list if
+ ss has non-null nested_ss field.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_create_temp_array): Loop over the parents.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (get_array_ref_dim, get_scalarizer_dim_for_array_dim):
+ Rename the former to the latter and loop over the parents.
+ (innermost_ss): New function.
+ (get_array_ref_dim_for_loop_dim): New function.
+ (gfc_trans_create_temp_array): Use get_scalarizer_dim_for_array_dim.
+ (set_loop_bounds): Use get_array_dim_for_loop_dim).
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss): New field nested_ss.
+ * trans-expr.c (gfc_advance_se_ss_chain): Update assertion.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (set_vector_loop_bounds): Loop over the parents.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_array_constructor): Loop over the parents.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_set_loop_bounds_from_array_spec): Loop over the
+ parents.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss): New field parent.
+ * trans-array.c (gfc_trans_scalarizing_loops): Skip clearing if a
+ parent exists.
+ * trans-expr.c (gfc_advance_se_ss_chain): Move to parent ss at the
+ end of the chain.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.h (gfc_trans_create_temp_array): Remove loop argument.
+ * trans-array.c (gfc_trans_create_temp_array): Ditto. Get loop from ss.
+ Update reference to loop. Remove loop argument.
+ (gfc_trans_array_constructor, gfc_conv_loop_setup): Update calls to
+ gfc_trans_create_temp_array.
+ * trans-expr.c (gfc_conv_procedure_call): Ditto.
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
+ Set loop before calling gfc_trans_create_temp_array.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_create_temp_array): New variable total_dim.
+ Set total_dim to loop's rank. Replace usages of loop's rank.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_array_constructor, trans_array_constructor):
+ Rename the former to the later. Get loop from ss.
+ Remove loop argument.
+ (gfc_add_loop_ss_code): Update call.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_set_vector_loop_bounds): Get loop from ss.
+ Remove loop argument.
+ (gfc_add_loop_ss_code): Update call.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss): New field loop.
+ * trans-array.c (set_ss_loop): New function.
+ (gfc_add_ss_to_loop): Call set_ss_loop.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss_info): New field refcount.
+ * trans-array.c (free_ss_info): Decrement refcount. Return early if
+ still non-zero.
+ (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Increment
+ refcount.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_create_temp_array): Move invariant condition
+ out of the containing loop.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_conv_loop_setup, gfc_trans_create_temp_array):
+ Move specloop arrays clearing from the former to the latter.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (set_loop_bounds): Separate the beginning of
+ gfc_conv_loop_setup into a function of its own.
+ (set_delta): Separate the end of gfc_conv_loop_setup into a function
+ of its own.
+ (gfc_conv_loop_setup): Call set_loop_bounds and set delta.
+ (set_loop_bounds, set_delta, gfc_conv_loop_setup): Make loopspec a
+ pointer to the specloop field from the loop struct.
+
+2011-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50933
+ * interface.c (gfc_compare_derived_types): Fix check for BIND(C).
+
+2011-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50960
+ * trans-decl.c (gfc_finish_var_decl): Mark PARAMETER as TREE_READONLY.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+ gfc_ss::where into gfc_ss_info.
+ * trans-array.c (gfc_add_loop_ss_code):
+ Update reference chains.
+ * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+ gfc_ss::useflags into gfc_ss_info.
+ * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup,
+ gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary):
+ Update reference chains.
+ * trans-expr.c (gfc_conv_procedure_call): Ditto.
+ * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+ gfc_ss::data::info into gfc_ss_info::data and remove empty union
+ gfc_ss::data.
+ * trans-array.c (gfc_free_ss, gfc_trans_create_temp_array,
+ gfc_trans_constant_array_constructor, gfc_trans_array_constructor,
+ gfc_set_vector_loop_bounds, gfc_add_loop_ss_code,
+ gfc_conv_ss_descriptor, gfc_trans_array_bound_check,
+ gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
+ add_array_offset, gfc_trans_preloop_setup,
+ gfc_trans_scalarized_boundary, gfc_conv_section_startstride,
+ gfc_conv_ss_startstride, gfc_could_be_alias,
+ gfc_conv_loop_setup, gfc_conv_expr_descriptor,
+ gfc_alloc_allocatable_for_assignment, gfc_walk_array_ref):
+ Update reference chains and factor them where possible.
+ * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg,
+ gfc_conv_procedure_call, gfc_trans_subarray_assign): Updata reference
+ chains.
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
+ * trans-io.c (transfer_array_component): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies,
+ gfc_trans_pointer_assign_need_temp): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
+ gfc_ss::data::temp into gfc_ss_info::data.
+ * trans-array.c (gfc_get_temp_ss, gfc_conv_loop_setup): Update reference
+ chains.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
+ gfc_ss::data::scalar into newly created union gfc_ss_info::data,
+ and rename subfield expr to value.
+ * trans-array.c (gfc_add_loop_ss_code, gfc_conv_array_index_offset,
+ gfc_conv_expr_descriptor): Update reference chains.
+ * trans-const.c (gfc_conv_constant): Ditto.
+ * trans-expr.c (gfc_conv_expr): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+ string_length from the former struct to the latter.
+ * trans-array.c
+ (gfc_get_temp_ss, gfc_trans_array_constructor, gfc_add_loop_ss_code,
+ gfc_conv_ss_descriptor, gfc_conv_scalarized_array_ref,
+ gfc_conv_resolve_dependencies, gfc_conv_loop_setup,
+ gfc_conv_expr_descriptor): Update references to string_length and
+ factor common reference chains where possible.
+ * trans-const.c (gfc_conv_constant): Ditto.
+ * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg,
+ gfc_conv_expr): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_ss_info): Move field expr from
+ the former struct to the latter.
+ * trans-array.c
+ (gfc_get_array_ss, gfc_get_scalar_ss,
+ gfc_trans_constant_array_constructor, gfc_trans_array_constructor,
+ gfc_add_loop_ss_code, gfc_conv_ss_descriptor,
+ gfc_trans_array_bound_check, gfc_conv_array_index_offset,
+ gfc_conv_scalarized_array_ref, gfc_conv_ss_startstride,
+ gfc_could_be_alias, gfc_conv_resolve_dependencies,
+ gfc_conv_loop_setup, gfc_conv_expr_descriptor,
+ gfc_alloc_allocatable_for_assignment): Update references to expr and
+ factor common reference chains where possible.
+ * trans-const.c (gfc_conv_constant): Ditto.
+ * trans-expr.c (gfc_conv_variable, gfc_conv_procedure_call,
+ gfc_conv_array_constructor_expr, gfc_conv_expr,
+ gfc_conv_expr_reference): Ditto.
+ * trans-intrinsic.c (trans_this_image, gfc_conv_intrinsic_bound,
+ gfc_conv_intrinsic_cobound, gfc_conv_intrinsic_funcall,
+ gfc_add_intrinsic_ss_code): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss_info): New struct.
+ (gfc_get_ss_info): New macro.
+ (struct gfc_ss): Move type field to struct gfc_ss_info.
+ Add an info field of type gfc_ss_info.
+ * trans-array.c (free_ss_info): New function.
+ (gfc_free_ss): Call free_ss_info.
+ (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss):
+ Allocate gfc_ss_info field.
+ (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss,
+ gfc_set_vector_loop_bounds, gfc_add_loop_ss_code,
+ gfc_conv_array_index_offset, gfc_trans_preloop_setup,
+ gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride,
+ gfc_conv_ss_startstride, gfc_conv_resolve_dependencies,
+ gfc_conv_loop_setup, transposed_dims, gfc_conv_expr_descriptor,
+ gfc_walk_elemental_function_args): Update references to type.
+ * trans-const.c (gfc_conv_constant): Factor common reference chains
+ and update reference to type.
+ * trans-expr.c (gfc_conv_procedure_call, gfc_trans_assignment_1):
+ Update reference to type.
+ (gfc_conv_array_constructor_expr, gfc_conv_expr,
+ gfc_conv_expr_reference): Ditto. Factor common reference chains.
+ * trans-intrinsic.c (walk_inline_intrinsic_transpose): Update references
+ to type
+ * trans-stmt.c (gfc_trans_where_assign): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss, struct gfc_array_info): Move shape field
+ from the former struct to the latter.
+ * trans-array.c (gfc_conv_ss_startstride, gfc_conv_loop_setup):
+ Update field references.
+ * trans-expr.c (gfc_trans_subarray_assign): Update field references
+ and factor common reference chains.
+ * trans-io.c (transfer_array_component): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_array_info): Move dim and dimen fields...
+ (struct gfc_ss): ... here. Remove gfc_ss::data::temp::dimen field.
+ * trans-array.c (gfc_conv_loop_setup): Remove temp_ss dim array
+ initialization.
+ (gfc_get_temp_ss): Initialize dim and dimen.
+ (gfc_free_ss, gfc_get_array_ss, gfc_get_temp_ss,
+ gfc_set_loop_bounds_from_array_spec, get_array_ref_dim,
+ gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
+ gfc_set_vector_loop_bounds, gfc_conv_scalarized_array_ref,
+ gfc_trans_preloop_setup, gfc_conv_ss_startstride,
+ gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims,
+ gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment,
+ gfc_walk_array_ref): Update field references.
+ * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
+ Ditto.
+ * trans-intrinsic.c (walk_inline_intrinsic_transpose): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (struct gfc_ss_info, struct gfc_array_info):
+ Rename the former to the latter.
+ * trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage,
+ get_array_ref_dim, gfc_trans_create_temp_array,
+ gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds,
+ gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
+ add_array_offset, gfc_trans_preloop_setup, gfc_conv_section_startstride,
+ gfc_conv_ss_startstride, gfc_conv_loop_setup, transposed_dims,
+ gfc_conv_expr_descriptor): Update all uses.
+ * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
+ Ditto.
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer,
+ walk_inline_intrinsic_transpose): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies,
+ gfc_trans_pointer_assign_need_temp): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (dim_ok, transposed_dims): Rename the former to the
+ latter. Change argument type. Invert return value.
+ (gfc_conv_expr_descriptor): Update calls.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (get_array_ref_dim): Change argument type and name.
+ Obtain previous argument from the new argument in the body.
+ (gfc_trans_create_temp_arry, gfc_conv_loop_setup): Update calls.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_set_vector_loop_bounds, set_vector_loop_bounds):
+ Rename the former to the latter. Change type and name of argument.
+ Get previous argument from the new one.
+ (gfc_add_loop_ss_code): Update call.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.h (gfc_trans_create_temp_array): Replace info argument
+ with ss argument.
+ * trans-array.c (gfc_trans_create_temp_array): Ditto. Get info from ss.
+ (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
+ gfc_trans_create_temp_array.
+ * trans-expr.c (gfc_conv_procedure_call): Ditto.
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_array_bound_check): Use ss argument
+ to get name.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_array_bound_check,
+ trans_array_bound_check): Rename the former to the latter.
+ Replace descriptor argument with ss argument. Get descriptor from ss.
+ (gfc_conv_array_index_offset, conv_array_index_offset): Rename the
+ former to the latter. Update call to trans_array_bound_check.
+ Replace info argument with ss argument. Get info from ss.
+ (gfc_conv_scalarized_array_ref): Update call to conv_array_index_offset.
+ (add_array_offset): Ditto
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_constant_array_constructor,
+ trans_constant_array_constructor): Rename the former to the latter.
+ Don't set the rank of the temporary for the loop. Remove then unused
+ loop argument.
+ (gfc_trans_array_constructor): Update call.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_scalarizing_loops): Stop loop before end
+ marker, not after it.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_conv_loop_setup): Also skip temporary arrays.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_conv_ss_startstride): Access array bounds along
+ array dimensions instead of loop dimensions.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Assertify one condition.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_walk_array_ref): Skip coarray dimensions.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (get_array_ref_dim): Remove redundant condition.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Move common code...
+ (add_array_offset): ...into that new function.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead
+ of array's dimention. Check that it is indeed the same.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion.
+ Special case outermost loop.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Factor loop index
+ initialization.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Move code earlier.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_trans_preloop_setup): Move array reference
+ initialisation earlier. Factor subsequent array references.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makef-lang.in (gfortranspec.o): Pass SHLIB instead of SHLIB_LINK.
+
2011-10-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/50573
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index b766da651a2..2602b157ab8 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -79,7 +79,7 @@ fortran: f951$(exeext)
gfortranspec.o: $(srcdir)/fortran/gfortranspec.c $(SYSTEM_H) $(TM_H) $(GCC_H) \
$(CONFIG_H) coretypes.h intl.h $(OPTS_H)
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
$(INCLUDES) $(srcdir)/fortran/gfortranspec.c)
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 3e6b9d2591c..a1449fd8c9e 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -70,6 +70,7 @@ match_subscript (gfc_array_ref *ar, int init, bool match_star)
i = ar->dimen + ar->codimen;
+ gfc_gobble_whitespace ();
ar->c_where[i] = gfc_current_locus;
ar->start[i] = ar->end[i] = ar->stride[i] = NULL;
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index f64cc1b2a81..574d22b0b12 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -288,6 +288,10 @@ static void
add_proc_comp (gfc_symbol *vtype, const char *name, gfc_typebound_proc *tb)
{
gfc_component *c;
+
+ if (tb->non_overridable)
+ return;
+
c = gfc_find_component (vtype, name, true, true);
if (c == NULL)
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index c43af00c727..fd7fa734426 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -713,6 +713,17 @@ gfc_check_argument_var_dependency (gfc_expr *var, sym_intent intent,
return gfc_check_fncall_dependency (var, intent, NULL,
expr->value.function.actual,
ELEM_CHECK_VARIABLE);
+
+ if (gfc_inline_intrinsic_function_p (expr))
+ {
+ /* The TRANSPOSE case should have been caught in the
+ noncopying intrinsic case above. */
+ gcc_assert (expr->value.function.isym->id != GFC_ISYM_TRANSPOSE);
+
+ return gfc_check_fncall_dependency (var, intent, NULL,
+ expr->value.function.actual,
+ ELEM_CHECK_VARIABLE);
+ }
}
return 0;
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 5b1a644e247..a19f22deac5 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -203,8 +203,8 @@ cfe_register_funcs (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED,
/* Conversions are handled on the fly by the middle end,
transpose during trans-* stages and TRANSFER by the middle end. */
if ((*e)->value.function.isym->id == GFC_ISYM_CONVERSION
- || (*e)->value.function.isym->id == GFC_ISYM_TRANSPOSE
- || (*e)->value.function.isym->id == GFC_ISYM_TRANSFER)
+ || (*e)->value.function.isym->id == GFC_ISYM_TRANSFER
+ || gfc_inline_intrinsic_function_p (*e))
return 0;
/* Don't create an array temporary for elemental functions,
@@ -567,7 +567,8 @@ optimize_binop_array_assignment (gfc_code *c, gfc_expr **rhs, bool seen_op)
&& ! (e->value.function.isym
&& (e->value.function.isym->elemental
|| e->ts.type != c->expr1->ts.type
- || e->ts.kind != c->expr1->ts.kind)))
+ || e->ts.kind != c->expr1->ts.kind))
+ && ! gfc_inline_intrinsic_function_p (e))
{
gfc_code *n;
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index da3477d7a0b..17ebd58e50f 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2831,7 +2831,7 @@ void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *);
gfc_symbol *gfc_search_interface (gfc_interface *, int,
gfc_actual_arglist **);
-gfc_try gfc_extend_expr (gfc_expr *, bool *);
+match gfc_extend_expr (gfc_expr *);
void gfc_free_formal_arglist (gfc_formal_arglist *);
gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *);
gfc_try gfc_add_interface (gfc_symbol *);
@@ -2880,6 +2880,9 @@ void gfc_generate_code (gfc_namespace *);
void gfc_generate_module_code (gfc_namespace *);
void gfc_init_coarray_decl (bool);
+/* trans-intrinsic.c */
+bool gfc_inline_intrinsic_function_p (gfc_expr *);
+
/* bbt.c */
typedef int (*compare_fn) (void *, void *);
void gfc_insert_bbt (void *, void *, compare_fn);
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 5308513b774..90d98c759dd 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -405,7 +405,7 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
return 1;
/* Compare type via the rules of the standard. Both types must have
- the SEQUENCE attribute to be equal. */
+ the SEQUENCE or BIND(C) attribute to be equal. */
if (strcmp (derived1->name, derived2->name))
return 0;
@@ -414,7 +414,8 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
|| derived2->component_access == ACCESS_PRIVATE)
return 0;
- if (derived1->attr.sequence == 0 || derived2->attr.sequence == 0)
+ if (!(derived1->attr.sequence && derived2->attr.sequence)
+ && !(derived1->attr.is_bind_c && derived2->attr.is_bind_c))
return 0;
dt1 = derived1->components;
@@ -3220,12 +3221,11 @@ build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual,
with the operator. This subroutine builds an actual argument list
corresponding to the operands, then searches for a compatible
interface. If one is found, the expression node is replaced with
- the appropriate function call.
- real_error is an additional output argument that specifies if FAILURE
- is because of some real error and not because no match was found. */
+ the appropriate function call. We use the 'match' enum to specify
+ whether a replacement has been made or not, or if an error occurred. */
-gfc_try
-gfc_extend_expr (gfc_expr *e, bool *real_error)
+match
+gfc_extend_expr (gfc_expr *e)
{
gfc_actual_arglist *actual;
gfc_symbol *sym;
@@ -3239,7 +3239,6 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
actual = gfc_get_actual_arglist ();
actual->expr = e->value.op.op1;
- *real_error = false;
gname = NULL;
if (e->value.op.op2 != NULL)
@@ -3343,16 +3342,16 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
result = gfc_resolve_expr (e);
if (result == FAILURE)
- *real_error = true;
+ return MATCH_ERROR;
- return result;
+ return MATCH_YES;
}
/* Don't use gfc_free_actual_arglist(). */
free (actual->next);
free (actual);
- return FAILURE;
+ return MATCH_NO;
}
/* Change the expression node to a function call. */
@@ -3365,12 +3364,9 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
e->user_operator = 1;
if (gfc_resolve_expr (e) == FAILURE)
- {
- *real_error = true;
- return FAILURE;
- }
+ return MATCH_ERROR;
- return SUCCESS;
+ return MATCH_YES;
}
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 24af4d5ac7d..f7d5a193e56 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -8639,7 +8639,7 @@ cases, the result is of the same type and kind as @var{ARRAY}.
@table @asis
@item @emph{Description}:
Returns the number of clock ticks since the start of the process, based
-on the UNIX function @code{clock(3)}.
+on the function @code{clock(3)} in the C standard library.
This intrinsic is not fully portable, such as to systems with 32-bit
@code{INTEGER} types but supporting times wider than 32 bits. Therefore,
@@ -8677,7 +8677,7 @@ the system does not support @code{clock(3)}.
@table @asis
@item @emph{Description}:
Returns the number of clock ticks since the start of the process, based
-on the UNIX function @code{clock(3)}.
+on the function @code{clock(3)} in the C standard library.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{clock(3)}. On a system with a 32-bit
@@ -12222,8 +12222,8 @@ END IF
@table @asis
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
-UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
+function @code{time(3)} in the C standard library). This value is
+suitable for passing to @code{CTIME}, @code{GMTIME}, and @code{LTIME}.
This intrinsic is not fully portable, such as to systems with 32-bit
@code{INTEGER} types but supporting times wider than 32 bits. Therefore,
@@ -12263,8 +12263,8 @@ The return value is a scalar of type @code{INTEGER(4)}.
@table @asis
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
-UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
+function @code{time(3)} in the C standard library). This value is
+suitable for passing to @code{CTIME}, @code{GMTIME}, and @code{LTIME}.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{time(3)}. On a system with a 32-bit
diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c
index 8b99ce98692..cd70dc0f758 100644
--- a/gcc/fortran/matchexp.c
+++ b/gcc/fortran/matchexp.c
@@ -201,6 +201,7 @@ match_level_1 (gfc_expr **result)
locus where;
match m;
+ gfc_gobble_whitespace ();
where = gfc_current_locus;
uop = NULL;
m = match_defined_operator (&uop);
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 30f5f55e214..0e882399902 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -4034,11 +4034,10 @@ resolve_operator (gfc_expr *e)
bad_op:
{
- bool real_error;
- if (gfc_extend_expr (e, &real_error) == SUCCESS)
+ match m = gfc_extend_expr (e);
+ if (m == MATCH_YES)
return SUCCESS;
-
- if (real_error)
+ if (m == MATCH_ERROR)
return FAILURE;
}
@@ -5869,11 +5868,13 @@ resolve_typebound_function (gfc_expr* e)
const char *name;
gfc_typespec ts;
gfc_expr *expr;
+ bool overridable;
st = e->symtree;
/* Deal with typebound operators for CLASS objects. */
expr = e->value.compcall.base_object;
+ overridable = !e->value.compcall.tbp->non_overridable;
if (expr && expr->ts.type == BT_CLASS && e->value.compcall.name)
{
/* Since the typebound operators are generic, we have to ensure
@@ -5924,22 +5925,26 @@ resolve_typebound_function (gfc_expr* e)
return FAILURE;
ts = e->ts;
- /* Then convert the expression to a procedure pointer component call. */
- e->value.function.esym = NULL;
- e->symtree = st;
+ if (overridable)
+ {
+ /* Convert the expression to a procedure pointer component call. */
+ e->value.function.esym = NULL;
+ e->symtree = st;
+
+ if (new_ref)
+ e->ref = new_ref;
- if (new_ref)
- e->ref = new_ref;
+ /* '_vptr' points to the vtab, which contains the procedure pointers. */
+ gfc_add_vptr_component (e);
+ gfc_add_component_ref (e, name);
- /* '_vptr' points to the vtab, which contains the procedure pointers. */
- gfc_add_vptr_component (e);
- gfc_add_component_ref (e, name);
+ /* Recover the typespec for the expression. This is really only
+ necessary for generic procedures, where the additional call
+ to gfc_add_component_ref seems to throw the collection of the
+ correct typespec. */
+ e->ts = ts;
+ }
- /* Recover the typespec for the expression. This is really only
- necessary for generic procedures, where the additional call
- to gfc_add_component_ref seems to throw the collection of the
- correct typespec. */
- e->ts = ts;
return SUCCESS;
}
@@ -5958,11 +5963,13 @@ resolve_typebound_subroutine (gfc_code *code)
const char *name;
gfc_typespec ts;
gfc_expr *expr;
+ bool overridable;
st = code->expr1->symtree;
/* Deal with typebound operators for CLASS objects. */
expr = code->expr1->value.compcall.base_object;
+ overridable = !code->expr1->value.compcall.tbp->non_overridable;
if (expr && expr->ts.type == BT_CLASS && code->expr1->value.compcall.name)
{
/* Since the typebound operators are generic, we have to ensure
@@ -6007,22 +6014,26 @@ resolve_typebound_subroutine (gfc_code *code)
return FAILURE;
ts = code->expr1->ts;
- /* Then convert the expression to a procedure pointer component call. */
- code->expr1->value.function.esym = NULL;
- code->expr1->symtree = st;
+ if (overridable)
+ {
+ /* Convert the expression to a procedure pointer component call. */
+ code->expr1->value.function.esym = NULL;
+ code->expr1->symtree = st;
- if (new_ref)
- code->expr1->ref = new_ref;
+ if (new_ref)
+ code->expr1->ref = new_ref;
- /* '_vptr' points to the vtab, which contains the procedure pointers. */
- gfc_add_vptr_component (code->expr1);
- gfc_add_component_ref (code->expr1, name);
+ /* '_vptr' points to the vtab, which contains the procedure pointers. */
+ gfc_add_vptr_component (code->expr1);
+ gfc_add_component_ref (code->expr1, name);
+
+ /* Recover the typespec for the expression. This is really only
+ necessary for generic procedures, where the additional call
+ to gfc_add_component_ref seems to throw the collection of the
+ correct typespec. */
+ code->expr1->ts = ts;
+ }
- /* Recover the typespec for the expression. This is really only
- necessary for generic procedures, where the additional call
- to gfc_add_component_ref seems to throw the collection of the
- correct typespec. */
- code->expr1->ts = ts;
return SUCCESS;
}
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 3472804e4c6..262743d0d37 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -463,11 +463,9 @@ void
gfc_mark_ss_chain_used (gfc_ss * ss, unsigned flags)
{
for (; ss != gfc_ss_terminator; ss = ss->next)
- ss->useflags = flags;
+ ss->info->useflags = flags;
}
-static void gfc_free_ss (gfc_ss *);
-
/* Free a gfc_ss chain. */
@@ -486,20 +484,35 @@ gfc_free_ss_chain (gfc_ss * ss)
}
+static void
+free_ss_info (gfc_ss_info *ss_info)
+{
+ ss_info->refcount--;
+ if (ss_info->refcount > 0)
+ return;
+
+ gcc_assert (ss_info->refcount == 0);
+ free (ss_info);
+}
+
+
/* Free a SS. */
-static void
+void
gfc_free_ss (gfc_ss * ss)
{
+ gfc_ss_info *ss_info;
int n;
- switch (ss->type)
+ ss_info = ss->info;
+
+ switch (ss_info->type)
{
case GFC_SS_SECTION:
- for (n = 0; n < ss->data.info.dimen; n++)
+ for (n = 0; n < ss->dimen; n++)
{
- if (ss->data.info.subscript[ss->data.info.dim[n]])
- gfc_free_ss_chain (ss->data.info.subscript[ss->data.info.dim[n]]);
+ if (ss_info->data.array.subscript[ss->dim[n]])
+ gfc_free_ss_chain (ss_info->data.array.subscript[ss->dim[n]]);
}
break;
@@ -507,6 +520,7 @@ gfc_free_ss (gfc_ss * ss)
break;
}
+ free_ss_info (ss_info);
free (ss);
}
@@ -517,17 +531,20 @@ gfc_ss *
gfc_get_array_ss (gfc_ss *next, gfc_expr *expr, int dimen, gfc_ss_type type)
{
gfc_ss *ss;
- gfc_ss_info *info;
+ gfc_ss_info *ss_info;
int i;
+ ss_info = gfc_get_ss_info ();
+ ss_info->refcount++;
+ ss_info->type = type;
+ ss_info->expr = expr;
+
ss = gfc_get_ss ();
+ ss->info = ss_info;
ss->next = next;
- ss->type = type;
- ss->expr = expr;
- info = &ss->data.info;
- info->dimen = dimen;
- for (i = 0; i < info->dimen; i++)
- info->dim[i] = i;
+ ss->dimen = dimen;
+ for (i = 0; i < ss->dimen; i++)
+ ss->dim[i] = i;
return ss;
}
@@ -539,13 +556,21 @@ gfc_ss *
gfc_get_temp_ss (tree type, tree string_length, int dimen)
{
gfc_ss *ss;
+ gfc_ss_info *ss_info;
+ int i;
+
+ ss_info = gfc_get_ss_info ();
+ ss_info->refcount++;
+ ss_info->type = GFC_SS_TEMP;
+ ss_info->string_length = string_length;
+ ss_info->data.temp.type = type;
ss = gfc_get_ss ();
+ ss->info = ss_info;
ss->next = gfc_ss_terminator;
- ss->type = GFC_SS_TEMP;
- ss->string_length = string_length;
- ss->data.temp.dimen = dimen;
- ss->data.temp.type = type;
+ ss->dimen = dimen;
+ for (i = 0; i < ss->dimen; i++)
+ ss->dim[i] = i;
return ss;
}
@@ -557,11 +582,16 @@ gfc_ss *
gfc_get_scalar_ss (gfc_ss *next, gfc_expr *expr)
{
gfc_ss *ss;
+ gfc_ss_info *ss_info;
+
+ ss_info = gfc_get_ss_info ();
+ ss_info->refcount++;
+ ss_info->type = GFC_SS_SCALAR;
+ ss_info->expr = expr;
ss = gfc_get_ss ();
+ ss->info = ss_info;
ss->next = next;
- ss->type = GFC_SS_SCALAR;
- ss->expr = expr;
return ss;
}
@@ -572,6 +602,7 @@ gfc_get_scalar_ss (gfc_ss *next, gfc_expr *expr)
void
gfc_cleanup_loop (gfc_loopinfo * loop)
{
+ gfc_loopinfo *loop_next, **ploop;
gfc_ss *ss;
gfc_ss *next;
@@ -583,6 +614,44 @@ gfc_cleanup_loop (gfc_loopinfo * loop)
gfc_free_ss (ss);
ss = next;
}
+
+ /* Remove reference to self in the parent loop. */
+ if (loop->parent)
+ for (ploop = &loop->parent->nested; *ploop; ploop = &(*ploop)->next)
+ if (*ploop == loop)
+ {
+ *ploop = loop->next;
+ break;
+ }
+
+ /* Free non-freed nested loops. */
+ for (loop = loop->nested; loop; loop = loop_next)
+ {
+ loop_next = loop->next;
+ gfc_cleanup_loop (loop);
+ free (loop);
+ }
+}
+
+
+static void
+set_ss_loop (gfc_ss *ss, gfc_loopinfo *loop)
+{
+ int n;
+
+ for (; ss != gfc_ss_terminator; ss = ss->next)
+ {
+ ss->loop = loop;
+
+ if (ss->info->type == GFC_SS_SCALAR
+ || ss->info->type == GFC_SS_REFERENCE
+ || ss->info->type == GFC_SS_TEMP)
+ continue;
+
+ for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
+ if (ss->info->data.array.subscript[n] != NULL)
+ set_ss_loop (ss->info->data.array.subscript[n], loop);
+ }
}
@@ -592,13 +661,36 @@ void
gfc_add_ss_to_loop (gfc_loopinfo * loop, gfc_ss * head)
{
gfc_ss *ss;
+ gfc_loopinfo *nested_loop;
if (head == gfc_ss_terminator)
return;
+ set_ss_loop (head, loop);
+
ss = head;
for (; ss && ss != gfc_ss_terminator; ss = ss->next)
{
+ if (ss->nested_ss)
+ {
+ nested_loop = ss->nested_ss->loop;
+
+ /* More than one ss can belong to the same loop. Hence, we add the
+ loop to the chain only if it is different from the previously
+ added one, to avoid duplicate nested loops. */
+ if (nested_loop != loop->nested)
+ {
+ gcc_assert (nested_loop->parent == NULL);
+ nested_loop->parent = loop;
+
+ gcc_assert (nested_loop->next == NULL);
+ nested_loop->next = loop->nested;
+ loop->nested = nested_loop;
+ }
+ else
+ gcc_assert (nested_loop->parent == loop);
+ }
+
if (ss->next == gfc_ss_terminator)
ss->loop_chain = loop->ss;
else
@@ -633,41 +725,54 @@ void
gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping * mapping,
gfc_se * se, gfc_array_spec * as)
{
- int n, dim;
+ int n, dim, total_dim;
gfc_se tmpse;
+ gfc_ss *ss;
tree lower;
tree upper;
tree tmp;
- if (as && as->type == AS_EXPLICIT)
- for (n = 0; n < se->loop->dimen; n++)
- {
- dim = se->ss->data.info.dim[n];
- gcc_assert (dim < as->rank);
- gcc_assert (se->loop->dimen == as->rank);
- if (se->loop->to[n] == NULL_TREE)
- {
- /* Evaluate the lower bound. */
- gfc_init_se (&tmpse, NULL);
- gfc_apply_interface_mapping (mapping, &tmpse, as->lower[dim]);
- gfc_add_block_to_block (&se->pre, &tmpse.pre);
- gfc_add_block_to_block (&se->post, &tmpse.post);
- lower = fold_convert (gfc_array_index_type, tmpse.expr);
-
- /* ...and the upper bound. */
- gfc_init_se (&tmpse, NULL);
- gfc_apply_interface_mapping (mapping, &tmpse, as->upper[dim]);
- gfc_add_block_to_block (&se->pre, &tmpse.pre);
- gfc_add_block_to_block (&se->post, &tmpse.post);
- upper = fold_convert (gfc_array_index_type, tmpse.expr);
-
- /* Set the upper bound of the loop to UPPER - LOWER. */
- tmp = fold_build2_loc (input_location, MINUS_EXPR,
- gfc_array_index_type, upper, lower);
- tmp = gfc_evaluate_now (tmp, &se->pre);
- se->loop->to[n] = tmp;
- }
- }
+ total_dim = 0;
+
+ if (!as || as->type != AS_EXPLICIT)
+ return;
+
+ for (ss = se->ss; ss; ss = ss->parent)
+ {
+ total_dim += ss->loop->dimen;
+ for (n = 0; n < ss->loop->dimen; n++)
+ {
+ /* The bound is known, nothing to do. */
+ if (ss->loop->to[n] != NULL_TREE)
+ continue;
+
+ dim = ss->dim[n];
+ gcc_assert (dim < as->rank);
+ gcc_assert (ss->loop->dimen <= as->rank);
+
+ /* Evaluate the lower bound. */
+ gfc_init_se (&tmpse, NULL);
+ gfc_apply_interface_mapping (mapping, &tmpse, as->lower[dim]);
+ gfc_add_block_to_block (&se->pre, &tmpse.pre);
+ gfc_add_block_to_block (&se->post, &tmpse.post);
+ lower = fold_convert (gfc_array_index_type, tmpse.expr);
+
+ /* ...and the upper bound. */
+ gfc_init_se (&tmpse, NULL);
+ gfc_apply_interface_mapping (mapping, &tmpse, as->upper[dim]);
+ gfc_add_block_to_block (&se->pre, &tmpse.pre);
+ gfc_add_block_to_block (&se->post, &tmpse.post);
+ upper = fold_convert (gfc_array_index_type, tmpse.expr);
+
+ /* Set the upper bound of the loop to UPPER - LOWER. */
+ tmp = fold_build2_loc (input_location, MINUS_EXPR,
+ gfc_array_index_type, upper, lower);
+ tmp = gfc_evaluate_now (tmp, &se->pre);
+ ss->loop->to[n] = tmp;
+ }
+ }
+
+ gcc_assert (total_dim == as->rank);
}
@@ -685,7 +790,7 @@ gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping * mapping,
static void
gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
- gfc_ss_info * info, tree size, tree nelem,
+ gfc_array_info * info, tree size, tree nelem,
tree initial, bool dynamic, bool dealloc)
{
tree tmp;
@@ -800,28 +905,62 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
}
-/* Get the array reference dimension corresponding to the given loop dimension.
- It is different from the true array dimension given by the dim array in
- the case of a partial array reference
- It is different from the loop dimension in the case of a transposed array.
- */
+/* Get the scalarizer array dimension corresponding to actual array dimension
+ given by ARRAY_DIM.
+
+ For example, if SS represents the array ref a(1,:,:,1), it is a
+ bidimensional scalarizer array, and the result would be 0 for ARRAY_DIM=1,
+ and 1 for ARRAY_DIM=2.
+ If SS represents transpose(a(:,1,1,:)), it is again a bidimensional
+ scalarizer array, and the result would be 1 for ARRAY_DIM=0 and 0 for
+ ARRAY_DIM=3.
+ If SS represents sum(a(:,:,:,1), dim=1), it is a 2+1-dimensional scalarizer
+ array. If called on the inner ss, the result would be respectively 0,1,2 for
+ ARRAY_DIM=0,1,2. If called on the outer ss, the result would be 0,1
+ for ARRAY_DIM=1,2. */
static int
-get_array_ref_dim (gfc_ss_info *info, int loop_dim)
+get_scalarizer_dim_for_array_dim (gfc_ss *ss, int array_dim)
{
- int n, array_dim, array_ref_dim;
+ int array_ref_dim;
+ int n;
array_ref_dim = 0;
- array_dim = info->dim[loop_dim];
- for (n = 0; n < info->dimen; n++)
- if (n != loop_dim && info->dim[n] < array_dim)
- array_ref_dim++;
+ for (; ss; ss = ss->parent)
+ for (n = 0; n < ss->dimen; n++)
+ if (ss->dim[n] < array_dim)
+ array_ref_dim++;
return array_ref_dim;
}
+static gfc_ss *
+innermost_ss (gfc_ss *ss)
+{
+ while (ss->nested_ss != NULL)
+ ss = ss->nested_ss;
+
+ return ss;
+}
+
+
+
+/* Get the array reference dimension corresponding to the given loop dimension.
+ It is different from the true array dimension given by the dim array in
+ the case of a partial array reference (i.e. a(:,:,1,:) for example)
+ It is different from the loop dimension in the case of a transposed array.
+ */
+
+static int
+get_array_ref_dim_for_loop_dim (gfc_ss *ss, int loop_dim)
+{
+ return get_scalarizer_dim_for_array_dim (innermost_ss (ss),
+ ss->dim[loop_dim]);
+}
+
+
/* Generate code to create and initialize the descriptor for a temporary
array. This is used for both temporaries needed by the scalarizer, and
functions returning arrays. Adjusts the loop variables to be
@@ -833,15 +972,16 @@ get_array_ref_dim (gfc_ss_info *info, int loop_dim)
callee allocated array.
PRE, POST, INITIAL, DYNAMIC and DEALLOC are as for
- gfc_trans_allocate_array_storage.
- */
+ gfc_trans_allocate_array_storage. */
tree
-gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
- gfc_loopinfo * loop, gfc_ss_info * info,
+gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss,
tree eltype, tree initial, bool dynamic,
bool dealloc, bool callee_alloc, locus * where)
{
+ gfc_loopinfo *loop;
+ gfc_ss *s;
+ gfc_array_info *info;
tree from[GFC_MAX_DIMENSIONS], to[GFC_MAX_DIMENSIONS];
tree type;
tree desc;
@@ -851,49 +991,63 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
tree cond;
tree or_expr;
int n, dim, tmp_dim;
+ int total_dim = 0;
memset (from, 0, sizeof (from));
memset (to, 0, sizeof (to));
- gcc_assert (info->dimen > 0);
- gcc_assert (loop->dimen == info->dimen);
+ info = &ss->info->data.array;
+
+ gcc_assert (ss->dimen > 0);
+ gcc_assert (ss->loop->dimen == ss->dimen);
if (gfc_option.warn_array_temp && where)
gfc_warning ("Creating array temporary at %L", where);
/* Set the lower bound to zero. */
- for (n = 0; n < loop->dimen; n++)
+ for (s = ss; s; s = s->parent)
{
- dim = info->dim[n];
+ loop = s->loop;
+
+ total_dim += loop->dimen;
+ for (n = 0; n < loop->dimen; n++)
+ {
+ dim = s->dim[n];
- /* Callee allocated arrays may not have a known bound yet. */
- if (loop->to[n])
- loop->to[n] = gfc_evaluate_now (
+ /* Callee allocated arrays may not have a known bound yet. */
+ if (loop->to[n])
+ loop->to[n] = gfc_evaluate_now (
fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type,
loop->to[n], loop->from[n]),
pre);
- loop->from[n] = gfc_index_zero_node;
-
- /* We are constructing the temporary's descriptor based on the loop
- dimensions. As the dimensions may be accessed in arbitrary order
- (think of transpose) the size taken from the n'th loop may not map
- to the n'th dimension of the array. We need to reconstruct loop infos
- in the right order before using it to set the descriptor
- bounds. */
- tmp_dim = get_array_ref_dim (info, n);
- from[tmp_dim] = loop->from[n];
- to[tmp_dim] = loop->to[n];
-
- info->delta[dim] = gfc_index_zero_node;
- info->start[dim] = gfc_index_zero_node;
- info->end[dim] = gfc_index_zero_node;
- info->stride[dim] = gfc_index_one_node;
+ loop->from[n] = gfc_index_zero_node;
+
+ /* We have just changed the loop bounds, we must clear the
+ corresponding specloop, so that delta calculation is not skipped
+ later in gfc_set_delta. */
+ loop->specloop[n] = NULL;
+
+ /* We are constructing the temporary's descriptor based on the loop
+ dimensions. As the dimensions may be accessed in arbitrary order
+ (think of transpose) the size taken from the n'th loop may not map
+ to the n'th dimension of the array. We need to reconstruct loop
+ infos in the right order before using it to set the descriptor
+ bounds. */
+ tmp_dim = get_scalarizer_dim_for_array_dim (ss, dim);
+ from[tmp_dim] = loop->from[n];
+ to[tmp_dim] = loop->to[n];
+
+ info->delta[dim] = gfc_index_zero_node;
+ info->start[dim] = gfc_index_zero_node;
+ info->end[dim] = gfc_index_zero_node;
+ info->stride[dim] = gfc_index_one_node;
+ }
}
/* Initialize the descriptor. */
type =
- gfc_get_array_type_bounds (eltype, info->dimen, 0, from, to, 1,
+ gfc_get_array_type_bounds (eltype, total_dim, 0, from, to, 1,
GFC_ARRAY_UNKNOWN, true);
desc = gfc_create_var (type, "atmp");
GFC_DECL_PACKED_ARRAY (desc) = 1;
@@ -922,59 +1076,61 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
/* If there is at least one null loop->to[n], it is a callee allocated
array. */
- for (n = 0; n < loop->dimen; n++)
- if (loop->to[n] == NULL_TREE)
+ for (n = 0; n < total_dim; n++)
+ if (to[n] == NULL_TREE)
{
size = NULL_TREE;
break;
}
- for (n = 0; n < loop->dimen; n++)
- {
- dim = info->dim[n];
-
- if (size == NULL_TREE)
+ if (size == NULL_TREE)
+ for (s = ss; s; s = s->parent)
+ for (n = 0; n < s->loop->dimen; n++)
{
+ dim = get_scalarizer_dim_for_array_dim (ss, ss->dim[n]);
+
/* For a callee allocated array express the loop bounds in terms
of the descriptor fields. */
tmp = fold_build2_loc (input_location,
MINUS_EXPR, gfc_array_index_type,
gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[dim]),
gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[dim]));
- loop->to[n] = tmp;
- continue;
+ s->loop->to[n] = tmp;
}
-
- /* Store the stride and bound components in the descriptor. */
- gfc_conv_descriptor_stride_set (pre, desc, gfc_rank_cst[n], size);
+ else
+ {
+ for (n = 0; n < total_dim; n++)
+ {
+ /* Store the stride and bound components in the descriptor. */
+ gfc_conv_descriptor_stride_set (pre, desc, gfc_rank_cst[n], size);
- gfc_conv_descriptor_lbound_set (pre, desc, gfc_rank_cst[n],
- gfc_index_zero_node);
+ gfc_conv_descriptor_lbound_set (pre, desc, gfc_rank_cst[n],
+ gfc_index_zero_node);
- gfc_conv_descriptor_ubound_set (pre, desc, gfc_rank_cst[n],
- to[n]);
+ gfc_conv_descriptor_ubound_set (pre, desc, gfc_rank_cst[n], to[n]);
- tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
- to[n], gfc_index_one_node);
+ tmp = fold_build2_loc (input_location, PLUS_EXPR,
+ gfc_array_index_type,
+ to[n], gfc_index_one_node);
- /* Check whether the size for this dimension is negative. */
- cond = fold_build2_loc (input_location, LE_EXPR, boolean_type_node, tmp,
- gfc_index_zero_node);
- cond = gfc_evaluate_now (cond, pre);
+ /* Check whether the size for this dimension is negative. */
+ cond = fold_build2_loc (input_location, LE_EXPR, boolean_type_node,
+ tmp, gfc_index_zero_node);
+ cond = gfc_evaluate_now (cond, pre);
- if (n == 0)
- or_expr = cond;
- else
- or_expr = fold_build2_loc (input_location, TRUTH_OR_EXPR,
- boolean_type_node, or_expr, cond);
+ if (n == 0)
+ or_expr = cond;
+ else
+ or_expr = fold_build2_loc (input_location, TRUTH_OR_EXPR,
+ boolean_type_node, or_expr, cond);
- size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
- size, tmp);
- size = gfc_evaluate_now (size, pre);
+ size = fold_build2_loc (input_location, MULT_EXPR,
+ gfc_array_index_type, size, tmp);
+ size = gfc_evaluate_now (size, pre);
+ }
}
/* Get the size of the array. */
-
if (size && !callee_alloc)
{
/* If or_expr is true, then the extent in at least one
@@ -997,8 +1153,11 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
gfc_trans_allocate_array_storage (pre, post, info, size, nelem, initial,
dynamic, dealloc);
- if (info->dimen > loop->temp_dim)
- loop->temp_dim = info->dimen;
+ while (ss->parent)
+ ss = ss->parent;
+
+ if (ss->dimen > ss->loop->temp_dim)
+ ss->loop->temp_dim = ss->dimen;
return size;
}
@@ -1849,77 +2008,120 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type)
gfc_build_constant_array_constructor. */
static void
-gfc_trans_constant_array_constructor (gfc_loopinfo * loop,
- gfc_ss * ss, tree type)
+trans_constant_array_constructor (gfc_ss * ss, tree type)
{
- gfc_ss_info *info;
+ gfc_array_info *info;
tree tmp;
int i;
- tmp = gfc_build_constant_array_constructor (ss->expr, type);
+ tmp = gfc_build_constant_array_constructor (ss->info->expr, type);
- info = &ss->data.info;
+ info = &ss->info->data.array;
info->descriptor = tmp;
info->data = gfc_build_addr_expr (NULL_TREE, tmp);
info->offset = gfc_index_zero_node;
- for (i = 0; i < info->dimen; i++)
+ for (i = 0; i < ss->dimen; i++)
{
info->delta[i] = gfc_index_zero_node;
info->start[i] = gfc_index_zero_node;
info->end[i] = gfc_index_zero_node;
info->stride[i] = gfc_index_one_node;
}
+}
+
+
+static int
+get_rank (gfc_loopinfo *loop)
+{
+ int rank;
+
+ rank = 0;
+ for (; loop; loop = loop->parent)
+ rank += loop->dimen;
- if (info->dimen > loop->temp_dim)
- loop->temp_dim = info->dimen;
+ return rank;
}
+
/* Helper routine of gfc_trans_array_constructor to determine if the
bounds of the loop specified by LOOP are constant and simple enough
- to use with gfc_trans_constant_array_constructor. Returns the
+ to use with trans_constant_array_constructor. Returns the
iteration count of the loop if suitable, and NULL_TREE otherwise. */
static tree
-constant_array_constructor_loop_size (gfc_loopinfo * loop)
+constant_array_constructor_loop_size (gfc_loopinfo * l)
{
+ gfc_loopinfo *loop;
tree size = gfc_index_one_node;
tree tmp;
- int i;
+ int i, total_dim;
+
+ total_dim = get_rank (l);
- for (i = 0; i < loop->dimen; i++)
+ for (loop = l; loop; loop = loop->parent)
{
- /* If the bounds aren't constant, return NULL_TREE. */
- if (!INTEGER_CST_P (loop->from[i]) || !INTEGER_CST_P (loop->to[i]))
- return NULL_TREE;
- if (!integer_zerop (loop->from[i]))
+ for (i = 0; i < loop->dimen; i++)
{
- /* Only allow nonzero "from" in one-dimensional arrays. */
- if (loop->dimen != 1)
+ /* If the bounds aren't constant, return NULL_TREE. */
+ if (!INTEGER_CST_P (loop->from[i]) || !INTEGER_CST_P (loop->to[i]))
return NULL_TREE;
- tmp = fold_build2_loc (input_location, MINUS_EXPR,
- gfc_array_index_type,
- loop->to[i], loop->from[i]);
+ if (!integer_zerop (loop->from[i]))
+ {
+ /* Only allow nonzero "from" in one-dimensional arrays. */
+ if (total_dim != 1)
+ return NULL_TREE;
+ tmp = fold_build2_loc (input_location, MINUS_EXPR,
+ gfc_array_index_type,
+ loop->to[i], loop->from[i]);
+ }
+ else
+ tmp = loop->to[i];
+ tmp = fold_build2_loc (input_location, PLUS_EXPR,
+ gfc_array_index_type, tmp, gfc_index_one_node);
+ size = fold_build2_loc (input_location, MULT_EXPR,
+ gfc_array_index_type, size, tmp);
}
- else
- tmp = loop->to[i];
- tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
- tmp, gfc_index_one_node);
- size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
- size, tmp);
}
return size;
}
+static tree *
+get_loop_upper_bound_for_array (gfc_ss *array, int array_dim)
+{
+ gfc_ss *ss;
+ int n;
+
+ gcc_assert (array->nested_ss == NULL);
+
+ for (ss = array; ss; ss = ss->parent)
+ for (n = 0; n < ss->loop->dimen; n++)
+ if (array_dim == get_array_ref_dim_for_loop_dim (ss, n))
+ return &(ss->loop->to[n]);
+
+ gcc_unreachable ();
+}
+
+
+static gfc_loopinfo *
+outermost_loop (gfc_loopinfo * loop)
+{
+ while (loop->parent != NULL)
+ loop = loop->parent;
+
+ return loop;
+}
+
+
/* Array constructors are handled by constructing a temporary, then using that
within the scalarization loop. This is not optimal, but seems by far the
simplest method. */
static void
-gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
+trans_array_constructor (gfc_ss * ss, locus * where)
{
gfc_constructor_base c;
tree offset;
@@ -1927,90 +2129,107 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
tree desc;
tree type;
tree tmp;
+ tree *loop_ubound0;
bool dynamic;
bool old_first_len, old_typespec_chararray_ctor;
tree old_first_len_val;
+ gfc_loopinfo *loop, *outer_loop;
+ gfc_ss_info *ss_info;
+ gfc_expr *expr;
+ gfc_ss *s;
/* Save the old values for nested checking. */
old_first_len = first_len;
old_first_len_val = first_len_val;
old_typespec_chararray_ctor = typespec_chararray_ctor;
+ loop = ss->loop;
+ outer_loop = outermost_loop (loop);
+ ss_info = ss->info;
+ expr = ss_info->expr;
+
/* Do bounds-checking here and in gfc_trans_array_ctor_element only if no
typespec was given for the array constructor. */
- typespec_chararray_ctor = (ss->expr->ts.u.cl
- && ss->expr->ts.u.cl->length_from_typespec);
+ typespec_chararray_ctor = (expr->ts.u.cl
+ && expr->ts.u.cl->length_from_typespec);
if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
- && ss->expr->ts.type == BT_CHARACTER && !typespec_chararray_ctor)
+ && expr->ts.type == BT_CHARACTER && !typespec_chararray_ctor)
{
first_len_val = gfc_create_var (gfc_charlen_type_node, "len");
first_len = true;
}
- gcc_assert (ss->data.info.dimen == loop->dimen);
+ gcc_assert (ss->dimen == ss->loop->dimen);
- c = ss->expr->value.constructor;
- if (ss->expr->ts.type == BT_CHARACTER)
+ c = expr->value.constructor;
+ if (expr->ts.type == BT_CHARACTER)
{
bool const_string;
/* get_array_ctor_strlen walks the elements of the constructor, if a
typespec was given, we already know the string length and want the one
specified there. */
- if (typespec_chararray_ctor && ss->expr->ts.u.cl->length
- && ss->expr->ts.u.cl->length->expr_type != EXPR_CONSTANT)
+ if (typespec_chararray_ctor && expr->ts.u.cl->length
+ && expr->ts.u.cl->length->expr_type != EXPR_CONSTANT)
{
gfc_se length_se;
const_string = false;
gfc_init_se (&length_se, NULL);
- gfc_conv_expr_type (&length_se, ss->expr->ts.u.cl->length,
+ gfc_conv_expr_type (&length_se, expr->ts.u.cl->length,
gfc_charlen_type_node);
- ss->string_length = length_se.expr;
- gfc_add_block_to_block (&loop->pre, &length_se.pre);
- gfc_add_block_to_block (&loop->post, &length_se.post);
+ ss_info->string_length = length_se.expr;
+ gfc_add_block_to_block (&outer_loop->pre, &length_se.pre);
+ gfc_add_block_to_block (&outer_loop->post, &length_se.post);
}
else
- const_string = get_array_ctor_strlen (&loop->pre, c,
- &ss->string_length);
+ const_string = get_array_ctor_strlen (&outer_loop->pre, c,
+ &ss_info->string_length);
/* Complex character array constructors should have been taken care of
and not end up here. */
- gcc_assert (ss->string_length);
+ gcc_assert (ss_info->string_length);
- ss->expr->ts.u.cl->backend_decl = ss->string_length;
+ expr->ts.u.cl->backend_decl = ss_info->string_length;
- type = gfc_get_character_type_len (ss->expr->ts.kind, ss->string_length);
+ type = gfc_get_character_type_len (expr->ts.kind, ss_info->string_length);
if (const_string)
type = build_pointer_type (type);
}
else
- type = gfc_typenode_for_spec (&ss->expr->ts);
+ type = gfc_typenode_for_spec (&expr->ts);
/* See if the constructor determines the loop bounds. */
dynamic = false;
- if (ss->expr->shape && loop->dimen > 1 && loop->to[0] == NULL_TREE)
+ loop_ubound0 = get_loop_upper_bound_for_array (ss, 0);
+
+ if (expr->shape && get_rank (loop) > 1 && *loop_ubound0 == NULL_TREE)
{
/* We have a multidimensional parameter. */
- int n;
- for (n = 0; n < ss->expr->rank; n++)
- {
- loop->from[n] = gfc_index_zero_node;
- loop->to[n] = gfc_conv_mpz_to_tree (ss->expr->shape [n],
- gfc_index_integer_kind);
- loop->to[n] = fold_build2_loc (input_location, MINUS_EXPR,
- gfc_array_index_type,
- loop->to[n], gfc_index_one_node);
- }
+ for (s = ss; s; s = s->parent)
+ {
+ int n;
+ for (n = 0; n < s->loop->dimen; n++)
+ {
+ s->loop->from[n] = gfc_index_zero_node;
+ s->loop->to[n] = gfc_conv_mpz_to_tree (expr->shape[s->dim[n]],
+ gfc_index_integer_kind);
+ s->loop->to[n] = fold_build2_loc (input_location, MINUS_EXPR,
+ gfc_array_index_type,
+ s->loop->to[n],
+ gfc_index_one_node);
+ }
+ }
}
- if (loop->to[0] == NULL_TREE)
+ if (*loop_ubound0 == NULL_TREE)
{
mpz_t size;
/* We should have a 1-dimensional, zero-based loop. */
+ gcc_assert (loop->parent == NULL && loop->nested == NULL);
gcc_assert (loop->dimen == 1);
gcc_assert (integer_zerop (loop->from[0]));
@@ -2033,24 +2252,24 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
tree size = constant_array_constructor_loop_size (loop);
if (size && compare_tree_int (size, nelem) == 0)
{
- gfc_trans_constant_array_constructor (loop, ss, type);
+ trans_constant_array_constructor (ss, type);
goto finish;
}
}
}
- if (TREE_CODE (loop->to[0]) == VAR_DECL)
+ if (TREE_CODE (*loop_ubound0) == VAR_DECL)
dynamic = true;
- gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &ss->data.info,
- type, NULL_TREE, dynamic, true, false, where);
+ gfc_trans_create_temp_array (&outer_loop->pre, &outer_loop->post, ss, type,
+ NULL_TREE, dynamic, true, false, where);
- desc = ss->data.info.descriptor;
+ desc = ss_info->data.array.descriptor;
offset = gfc_index_zero_node;
offsetvar = gfc_create_var_np (gfc_array_index_type, "offset");
TREE_NO_WARNING (offsetvar) = 1;
TREE_USED (offsetvar) = 0;
- gfc_trans_array_constructor_value (&loop->pre, type, desc, c,
+ gfc_trans_array_constructor_value (&outer_loop->pre, type, desc, c,
&offset, &offsetvar, dynamic);
/* If the array grows dynamically, the upper bound of the loop variable
@@ -2060,12 +2279,12 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
tmp = fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type,
offsetvar, gfc_index_one_node);
- tmp = gfc_evaluate_now (tmp, &loop->pre);
+ tmp = gfc_evaluate_now (tmp, &outer_loop->pre);
gfc_conv_descriptor_ubound_set (&loop->pre, desc, gfc_rank_cst[0], tmp);
- if (loop->to[0] && TREE_CODE (loop->to[0]) == VAR_DECL)
- gfc_add_modify (&loop->pre, loop->to[0], tmp);
+ if (*loop_ubound0 && TREE_CODE (*loop_ubound0) == VAR_DECL)
+ gfc_add_modify (&outer_loop->pre, *loop_ubound0, tmp);
else
- loop->to[0] = tmp;
+ *loop_ubound0 = tmp;
}
if (TREE_USED (offsetvar))
@@ -2095,8 +2314,10 @@ finish:
loop bounds. */
static void
-gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info)
+set_vector_loop_bounds (gfc_ss * ss)
{
+ gfc_loopinfo *loop, *outer_loop;
+ gfc_array_info *info;
gfc_se se;
tree tmp;
tree desc;
@@ -2104,27 +2325,36 @@ gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info)
int n;
int dim;
- for (n = 0; n < loop->dimen; n++)
+ outer_loop = outermost_loop (ss->loop);
+
+ info = &ss->info->data.array;
+
+ for (; ss; ss = ss->parent)
{
- dim = info->dim[n];
- if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR
- && loop->to[n] == NULL)
+ loop = ss->loop;
+
+ for (n = 0; n < loop->dimen; n++)
{
+ dim = ss->dim[n];
+ if (info->ref->u.ar.dimen_type[dim] != DIMEN_VECTOR
+ || loop->to[n] != NULL)
+ continue;
+
/* Loop variable N indexes vector dimension DIM, and we don't
yet know the upper bound of loop variable N. Set it to the
difference between the vector's upper and lower bounds. */
gcc_assert (loop->from[n] == gfc_index_zero_node);
gcc_assert (info->subscript[dim]
- && info->subscript[dim]->type == GFC_SS_VECTOR);
+ && info->subscript[dim]->info->type == GFC_SS_VECTOR);
gfc_init_se (&se, NULL);
- desc = info->subscript[dim]->data.info.descriptor;
+ desc = info->subscript[dim]->info->data.array.descriptor;
zero = gfc_rank_cst[0];
tmp = fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type,
gfc_conv_descriptor_ubound_get (desc, zero),
gfc_conv_descriptor_lbound_get (desc, zero));
- tmp = gfc_evaluate_now (tmp, &loop->pre);
+ tmp = gfc_evaluate_now (tmp, &outer_loop->pre);
loop->to[n] = tmp;
}
}
@@ -2139,9 +2369,16 @@ static void
gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
locus * where)
{
+ gfc_loopinfo *nested_loop, *outer_loop;
gfc_se se;
+ gfc_ss_info *ss_info;
+ gfc_array_info *info;
+ gfc_expr *expr;
+ bool skip_nested = false;
int n;
+ outer_loop = outermost_loop (loop);
+
/* TODO: This can generate bad code if there are ordering dependencies,
e.g., a callee allocated function and an unknown size constructor. */
gcc_assert (ss != NULL);
@@ -2150,61 +2387,74 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
{
gcc_assert (ss);
- switch (ss->type)
+ /* Cross loop arrays are handled from within the most nested loop. */
+ if (ss->nested_ss != NULL)
+ continue;
+
+ ss_info = ss->info;
+ expr = ss_info->expr;
+ info = &ss_info->data.array;
+
+ switch (ss_info->type)
{
case GFC_SS_SCALAR:
/* Scalar expression. Evaluate this now. This includes elemental
dimension indices, but not array section bounds. */
gfc_init_se (&se, NULL);
- gfc_conv_expr (&se, ss->expr);
- gfc_add_block_to_block (&loop->pre, &se.pre);
+ gfc_conv_expr (&se, expr);
+ gfc_add_block_to_block (&outer_loop->pre, &se.pre);
- if (ss->expr->ts.type != BT_CHARACTER)
+ if (expr->ts.type != BT_CHARACTER)
{
/* Move the evaluation of scalar expressions outside the
scalarization loop, except for WHERE assignments. */
if (subscript)
se.expr = convert(gfc_array_index_type, se.expr);
- if (!ss->where)
- se.expr = gfc_evaluate_now (se.expr, &loop->pre);
- gfc_add_block_to_block (&loop->pre, &se.post);
+ if (!ss_info->where)
+ se.expr = gfc_evaluate_now (se.expr, &outer_loop->pre);
+ gfc_add_block_to_block (&outer_loop->pre, &se.post);
}
else
- gfc_add_block_to_block (&loop->post, &se.post);
+ gfc_add_block_to_block (&outer_loop->post, &se.post);
- ss->data.scalar.expr = se.expr;
- ss->string_length = se.string_length;
+ ss_info->data.scalar.value = se.expr;
+ ss_info->string_length = se.string_length;
break;
case GFC_SS_REFERENCE:
/* Scalar argument to elemental procedure. Evaluate this
now. */
gfc_init_se (&se, NULL);
- gfc_conv_expr (&se, ss->expr);
- gfc_add_block_to_block (&loop->pre, &se.pre);
- gfc_add_block_to_block (&loop->post, &se.post);
+ gfc_conv_expr (&se, expr);
+ gfc_add_block_to_block (&outer_loop->pre, &se.pre);
+ gfc_add_block_to_block (&outer_loop->post, &se.post);
- ss->data.scalar.expr = gfc_evaluate_now (se.expr, &loop->pre);
- ss->string_length = se.string_length;
+ ss_info->data.scalar.value = gfc_evaluate_now (se.expr,
+ &outer_loop->pre);
+ ss_info->string_length = se.string_length;
break;
case GFC_SS_SECTION:
/* Add the expressions for scalar and vector subscripts. */
for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
- if (ss->data.info.subscript[n])
- gfc_add_loop_ss_code (loop, ss->data.info.subscript[n], true,
- where);
-
- gfc_set_vector_loop_bounds (loop, &ss->data.info);
+ if (info->subscript[n])
+ {
+ gfc_add_loop_ss_code (loop, info->subscript[n], true, where);
+ /* The recursive call will have taken care of the nested loops.
+ No need to do it twice. */
+ skip_nested = true;
+ }
+
+ set_vector_loop_bounds (ss);
break;
case GFC_SS_VECTOR:
/* Get the vector's descriptor and store it in SS. */
gfc_init_se (&se, NULL);
- gfc_conv_expr_descriptor (&se, ss->expr, gfc_walk_expr (ss->expr));
- gfc_add_block_to_block (&loop->pre, &se.pre);
- gfc_add_block_to_block (&loop->post, &se.post);
- ss->data.info.descriptor = se.expr;
+ gfc_conv_expr_descriptor (&se, expr, gfc_walk_expr (expr));
+ gfc_add_block_to_block (&outer_loop->pre, &se.pre);
+ gfc_add_block_to_block (&outer_loop->post, &se.post);
+ info->descriptor = se.expr;
break;
case GFC_SS_INTRINSIC:
@@ -2217,26 +2467,26 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
gfc_init_se (&se, NULL);
se.loop = loop;
se.ss = ss;
- gfc_conv_expr (&se, ss->expr);
- gfc_add_block_to_block (&loop->pre, &se.pre);
- gfc_add_block_to_block (&loop->post, &se.post);
- ss->string_length = se.string_length;
+ gfc_conv_expr (&se, expr);
+ gfc_add_block_to_block (&outer_loop->pre, &se.pre);
+ gfc_add_block_to_block (&outer_loop->post, &se.post);
+ ss_info->string_length = se.string_length;
break;
case GFC_SS_CONSTRUCTOR:
- if (ss->expr->ts.type == BT_CHARACTER
- && ss->string_length == NULL
- && ss->expr->ts.u.cl
- && ss->expr->ts.u.cl->length)
+ if (expr->ts.type == BT_CHARACTER
+ && ss_info->string_length == NULL
+ && expr->ts.u.cl
+ && expr->ts.u.cl->length)
{
gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, ss->expr->ts.u.cl->length,
+ gfc_conv_expr_type (&se, expr->ts.u.cl->length,
gfc_charlen_type_node);
- ss->string_length = se.expr;
- gfc_add_block_to_block (&loop->pre, &se.pre);
- gfc_add_block_to_block (&loop->post, &se.post);
+ ss_info->string_length = se.expr;
+ gfc_add_block_to_block (&outer_loop->pre, &se.pre);
+ gfc_add_block_to_block (&outer_loop->post, &se.post);
}
- gfc_trans_array_constructor (loop, ss, where);
+ trans_array_constructor (ss, where);
break;
case GFC_SS_TEMP:
@@ -2248,6 +2498,11 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
gcc_unreachable ();
}
}
+
+ if (!skip_nested)
+ for (nested_loop = loop->nested; nested_loop;
+ nested_loop = nested_loop->next)
+ gfc_add_loop_ss_code (nested_loop, nested_loop->ss, subscript, where);
}
@@ -2258,16 +2513,21 @@ static void
gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base)
{
gfc_se se;
+ gfc_ss_info *ss_info;
+ gfc_array_info *info;
tree tmp;
+ ss_info = ss->info;
+ info = &ss_info->data.array;
+
/* Get the descriptor for the array to be scalarized. */
- gcc_assert (ss->expr->expr_type == EXPR_VARIABLE);
+ gcc_assert (ss_info->expr->expr_type == EXPR_VARIABLE);
gfc_init_se (&se, NULL);
se.descriptor_only = 1;
- gfc_conv_expr_lhs (&se, ss->expr);
+ gfc_conv_expr_lhs (&se, ss_info->expr);
gfc_add_block_to_block (block, &se.pre);
- ss->data.info.descriptor = se.expr;
- ss->string_length = se.string_length;
+ info->descriptor = se.expr;
+ ss_info->string_length = se.string_length;
if (base)
{
@@ -2281,15 +2541,15 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base)
|| (TREE_CODE (tmp) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (tmp, 0)))))
tmp = gfc_evaluate_now (tmp, block);
- ss->data.info.data = tmp;
+ info->data = tmp;
tmp = gfc_conv_array_offset (se.expr);
- ss->data.info.offset = gfc_evaluate_now (tmp, block);
+ info->offset = gfc_evaluate_now (tmp, block);
/* Make absolutely sure that the saved_offset is indeed saved
so that the variable is still accessible after the loops
are translated. */
- ss->data.info.saved_offset = ss->data.info.offset;
+ info->saved_offset = info->offset;
}
}
@@ -2430,42 +2690,25 @@ gfc_conv_array_ubound (tree descriptor, int dim)
/* Generate code to perform an array index bound check. */
static tree
-gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
- locus * where, bool check_upper)
+trans_array_bound_check (gfc_se * se, gfc_ss *ss, tree index, int n,
+ locus * where, bool check_upper)
{
tree fault;
tree tmp_lo, tmp_up;
+ tree descriptor;
char *msg;
const char * name = NULL;
if (!(gfc_option.rtcheck & GFC_RTCHECK_BOUNDS))
return index;
+ descriptor = ss->info->data.array.descriptor;
+
index = gfc_evaluate_now (index, &se->pre);
/* We find a name for the error message. */
- if (se->ss)
- name = se->ss->expr->symtree->name;
-
- if (!name && se->loop && se->loop->ss && se->loop->ss->expr
- && se->loop->ss->expr->symtree)
- name = se->loop->ss->expr->symtree->name;
-
- if (!name && se->loop && se->loop->ss && se->loop->ss->loop_chain
- && se->loop->ss->loop_chain->expr
- && se->loop->ss->loop_chain->expr->symtree)
- name = se->loop->ss->loop_chain->expr->symtree->name;
-
- if (!name && se->loop && se->loop->ss && se->loop->ss->expr)
- {
- if (se->loop->ss->expr->expr_type == EXPR_FUNCTION
- && se->loop->ss->expr->value.function.name)
- name = se->loop->ss->expr->value.function.name;
- else
- if (se->loop->ss->type == GFC_SS_CONSTRUCTOR
- || se->loop->ss->type == GFC_SS_SCALAR)
- name = "unnamed constant";
- }
+ name = ss->info->expr->symtree->n.sym->name;
+ gcc_assert (name != NULL);
if (TREE_CODE (descriptor) == VAR_DECL)
name = IDENTIFIER_POINTER (DECL_NAME (descriptor));
@@ -2525,13 +2768,16 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
DIM is the array dimension, I is the loop dimension. */
static tree
-gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
- gfc_array_ref * ar, tree stride)
+conv_array_index_offset (gfc_se * se, gfc_ss * ss, int dim, int i,
+ gfc_array_ref * ar, tree stride)
{
+ gfc_array_info *info;
tree index;
tree desc;
tree data;
+ info = &ss->info->data.array;
+
/* Get the index into the array for this dimension. */
if (ar)
{
@@ -2544,21 +2790,20 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
case DIMEN_ELEMENT:
/* Elemental dimension. */
gcc_assert (info->subscript[dim]
- && info->subscript[dim]->type == GFC_SS_SCALAR);
+ && info->subscript[dim]->info->type == GFC_SS_SCALAR);
/* We've already translated this value outside the loop. */
- index = info->subscript[dim]->data.scalar.expr;
+ index = info->subscript[dim]->info->data.scalar.value;
- index = gfc_trans_array_bound_check (se, info->descriptor,
- index, dim, &ar->where,
- ar->as->type != AS_ASSUMED_SIZE
- || dim < ar->dimen - 1);
+ index = trans_array_bound_check (se, ss, index, dim, &ar->where,
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_VECTOR:
gcc_assert (info && se->loop);
gcc_assert (info->subscript[dim]
- && info->subscript[dim]->type == GFC_SS_VECTOR);
- desc = info->subscript[dim]->data.info.descriptor;
+ && info->subscript[dim]->info->type == GFC_SS_VECTOR);
+ desc = info->subscript[dim]->info->data.array.descriptor;
/* Get a zero-based index into the vector. */
index = fold_build2_loc (input_location, MINUS_EXPR,
@@ -2578,10 +2823,9 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
index = fold_convert (gfc_array_index_type, index);
/* Do any bounds checking on the final info->descriptor index. */
- index = gfc_trans_array_bound_check (se, info->descriptor,
- index, dim, &ar->where,
- ar->as->type != AS_ASSUMED_SIZE
- || dim < ar->dimen - 1);
+ index = trans_array_bound_check (se, ss, index, dim, &ar->where,
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_RANGE:
@@ -2613,11 +2857,11 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* Pointer functions can have stride[0] different from unity.
Use the stride returned by the function call and stored in
the descriptor for the temporary. */
- if (se->ss && se->ss->type == GFC_SS_FUNCTION
- && se->ss->expr
- && se->ss->expr->symtree
- && se->ss->expr->symtree->n.sym->result
- && se->ss->expr->symtree->n.sym->result->attr.pointer)
+ if (se->ss && se->ss->info->type == GFC_SS_FUNCTION
+ && se->ss->info->expr
+ && se->ss->info->expr->symtree
+ && se->ss->info->expr->symtree->n.sym->result
+ && se->ss->info->expr->symtree->n.sym->result->attr.pointer)
stride = gfc_conv_descriptor_stride_get (info->descriptor,
gfc_rank_cst[dim]);
@@ -2640,31 +2884,33 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
static void
gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar)
{
- gfc_ss_info *info;
+ gfc_array_info *info;
tree decl = NULL_TREE;
tree index;
tree tmp;
+ gfc_ss *ss;
+ gfc_expr *expr;
int n;
- info = &se->ss->data.info;
+ ss = se->ss;
+ expr = ss->info->expr;
+ info = &ss->info->data.array;
if (ar)
n = se->loop->order[0];
else
n = 0;
- index = gfc_conv_array_index_offset (se, info, info->dim[n], n, ar,
- info->stride0);
+ index = conv_array_index_offset (se, ss, ss->dim[n], n, ar, info->stride0);
/* Add the offset for this dimension to the stored offset for all other
dimensions. */
if (!integer_zerop (info->offset))
index = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
index, info->offset);
- if (se->ss->expr && is_subref_array (se->ss->expr))
- decl = se->ss->expr->symtree->n.sym->backend_decl;
+ if (expr && is_subref_array (expr))
+ decl = expr->symtree->n.sym->backend_decl;
- tmp = build_fold_indirect_ref_loc (input_location,
- info->data);
+ tmp = build_fold_indirect_ref_loc (input_location, info->data);
se->expr = gfc_build_array_ref (tmp, index, decl);
}
@@ -2674,7 +2920,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar)
void
gfc_conv_tmp_array_ref (gfc_se * se)
{
- se->string_length = se->ss->string_length;
+ se->string_length = se->ss->info->string_length;
gfc_conv_scalarized_array_ref (se, NULL);
gfc_advance_se_ss_chain (se);
}
@@ -2830,6 +3076,33 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
}
+/* Add the offset corresponding to array's ARRAY_DIM dimension and loop's
+ LOOP_DIM dimension (if any) to array's offset. */
+
+static void
+add_array_offset (stmtblock_t *pblock, gfc_loopinfo *loop, gfc_ss *ss,
+ gfc_array_ref *ar, int array_dim, int loop_dim)
+{
+ gfc_se se;
+ gfc_array_info *info;
+ tree stride, index;
+
+ info = &ss->info->data.array;
+
+ gfc_init_se (&se, NULL);
+ se.loop = loop;
+ se.expr = info->descriptor;
+ stride = gfc_conv_array_stride (info->descriptor, array_dim);
+ index = conv_array_index_offset (&se, ss, array_dim, loop_dim, ar, stride);
+ gfc_add_block_to_block (pblock, &se.pre);
+
+ info->offset = fold_build2_loc (input_location, PLUS_EXPR,
+ gfc_array_index_type,
+ info->offset, index);
+ info->offset = gfc_evaluate_now (info->offset, pblock);
+}
+
+
/* Generate the code to be executed immediately before entering a
scalarization loop. */
@@ -2837,100 +3110,98 @@ static void
gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
stmtblock_t * pblock)
{
- tree index;
tree stride;
- gfc_ss_info *info;
- gfc_ss *ss;
- gfc_se se;
+ gfc_ss_info *ss_info;
+ gfc_array_info *info;
+ gfc_ss_type ss_type;
+ gfc_ss *ss, *pss;
+ gfc_loopinfo *ploop;
+ gfc_array_ref *ar;
int i;
/* This code will be executed before entering the scalarization loop
for this dimension. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- if ((ss->useflags & flag) == 0)
+ ss_info = ss->info;
+
+ if ((ss_info->useflags & flag) == 0)
continue;
- if (ss->type != GFC_SS_SECTION
- && ss->type != GFC_SS_FUNCTION && ss->type != GFC_SS_CONSTRUCTOR
- && ss->type != GFC_SS_COMPONENT)
+ ss_type = ss_info->type;
+ if (ss_type != GFC_SS_SECTION
+ && ss_type != GFC_SS_FUNCTION
+ && ss_type != GFC_SS_CONSTRUCTOR
+ && ss_type != GFC_SS_COMPONENT)
continue;
- info = &ss->data.info;
+ info = &ss_info->data.array;
- if (dim >= info->dimen)
- continue;
+ gcc_assert (dim < ss->dimen);
+ gcc_assert (ss->dimen == loop->dimen);
- if (dim == info->dimen - 1)
+ if (info->ref)
+ ar = &info->ref->u.ar;
+ else
+ ar = NULL;
+
+ if (dim == loop->dimen - 1 && loop->parent != NULL)
{
- /* For the outermost loop calculate the offset due to any
- elemental dimensions. It will have been initialized with the
- base offset of the array. */
- if (info->ref)
- {
- for (i = 0; i < info->ref->u.ar.dimen; i++)
- {
- if (info->ref->u.ar.dimen_type[i] != DIMEN_ELEMENT)
- continue;
+ /* If we are in the outermost dimension of this loop, the previous
+ dimension shall be in the parent loop. */
+ gcc_assert (ss->parent != NULL);
- gfc_init_se (&se, NULL);
- se.loop = loop;
- se.expr = info->descriptor;
- stride = gfc_conv_array_stride (info->descriptor, i);
- index = gfc_conv_array_index_offset (&se, info, i, -1,
- &info->ref->u.ar,
- stride);
- gfc_add_block_to_block (pblock, &se.pre);
-
- info->offset = fold_build2_loc (input_location, PLUS_EXPR,
- gfc_array_index_type,
- info->offset, index);
- info->offset = gfc_evaluate_now (info->offset, pblock);
- }
- }
+ pss = ss->parent;
+ ploop = loop->parent;
+
+ /* ss and ss->parent are about the same array. */
+ gcc_assert (ss_info == pss->info);
+ }
+ else
+ {
+ ploop = loop;
+ pss = ss;
+ }
+
+ if (dim == loop->dimen - 1)
+ i = 0;
+ else
+ i = dim + 1;
- i = loop->order[0];
- /* For the time being, the innermost loop is unconditionally on
- the first dimension of the scalarization loop. */
- gcc_assert (i == 0);
- stride = gfc_conv_array_stride (info->descriptor, info->dim[i]);
+ /* For the time being, there is no loop reordering. */
+ gcc_assert (i == ploop->order[i]);
+ i = ploop->order[i];
+
+ if (dim == loop->dimen - 1 && loop->parent == NULL)
+ {
+ stride = gfc_conv_array_stride (info->descriptor,
+ innermost_ss (ss)->dim[i]);
/* Calculate the stride of the innermost loop. Hopefully this will
allow the backend optimizers to do their stuff more effectively.
*/
info->stride0 = gfc_evaluate_now (stride, pblock);
- }
- else
- {
- /* Add the offset for the previous loop dimension. */
- gfc_array_ref *ar;
+ /* For the outermost loop calculate the offset due to any
+ elemental dimensions. It will have been initialized with the
+ base offset of the array. */
if (info->ref)
{
- ar = &info->ref->u.ar;
- i = loop->order[dim + 1];
- }
- else
- {
- ar = NULL;
- i = dim + 1;
- }
+ for (i = 0; i < ar->dimen; i++)
+ {
+ if (ar->dimen_type[i] != DIMEN_ELEMENT)
+ continue;
- gfc_init_se (&se, NULL);
- se.loop = loop;
- se.expr = info->descriptor;
- stride = gfc_conv_array_stride (info->descriptor, info->dim[i]);
- index = gfc_conv_array_index_offset (&se, info, info->dim[i], i,
- ar, stride);
- gfc_add_block_to_block (pblock, &se.pre);
- info->offset = fold_build2_loc (input_location, PLUS_EXPR,
- gfc_array_index_type, info->offset,
- index);
- info->offset = gfc_evaluate_now (info->offset, pblock);
+ add_array_offset (pblock, loop, ss, ar, i, /* unused */ -1);
+ }
+ }
}
+ else
+ /* Add the offset for the previous loop dimension. */
+ add_array_offset (pblock, ploop, ss, ar, pss->dim[i], i);
/* Remember this offset for the second loop. */
- if (dim == loop->temp_dim - 1)
+ if (dim == loop->temp_dim - 1 && loop->parent == NULL)
info->saved_offset = info->offset;
}
}
@@ -3114,8 +3385,9 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body)
gfc_add_expr_to_block (&loop->pre, tmp);
/* Clear all the used flags. */
- for (ss = loop->ss; ss; ss = ss->loop_chain)
- ss->useflags = 0;
+ for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
+ if (ss->parent == NULL)
+ ss->info->useflags = 0;
}
@@ -3147,15 +3419,22 @@ gfc_trans_scalarized_loop_boundary (gfc_loopinfo * loop, stmtblock_t * body)
/* Restore the initial offsets. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- if ((ss->useflags & 2) == 0)
+ gfc_ss_type ss_type;
+ gfc_ss_info *ss_info;
+
+ ss_info = ss->info;
+
+ if ((ss_info->useflags & 2) == 0)
continue;
- if (ss->type != GFC_SS_SECTION
- && ss->type != GFC_SS_FUNCTION && ss->type != GFC_SS_CONSTRUCTOR
- && ss->type != GFC_SS_COMPONENT)
+ ss_type = ss_info->type;
+ if (ss_type != GFC_SS_SECTION
+ && ss_type != GFC_SS_FUNCTION
+ && ss_type != GFC_SS_CONSTRUCTOR
+ && ss_type != GFC_SS_COMPONENT)
continue;
- ss->data.info.offset = ss->data.info.saved_offset;
+ ss_info->data.array.offset = ss_info->data.array.saved_offset;
}
/* Restart all the inner loops we just finished. */
@@ -3217,12 +3496,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
gfc_expr *stride = NULL;
tree desc;
gfc_se se;
- gfc_ss_info *info;
+ gfc_array_info *info;
gfc_array_ref *ar;
- gcc_assert (ss->type == GFC_SS_SECTION);
+ gcc_assert (ss->info->type == GFC_SS_SECTION);
- info = &ss->data.info;
+ info = &ss->info->data.array;
ar = &info->ref->u.ar;
if (ar->dimen_type[dim] == DIMEN_VECTOR)
@@ -3277,25 +3556,25 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
/* Determine the rank of the loop. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- switch (ss->type)
+ switch (ss->info->type)
{
case GFC_SS_SECTION:
case GFC_SS_CONSTRUCTOR:
case GFC_SS_FUNCTION:
case GFC_SS_COMPONENT:
- loop->dimen = ss->data.info.dimen;
+ loop->dimen = ss->dimen;
goto done;
/* As usual, lbound and ubound are exceptions!. */
case GFC_SS_INTRINSIC:
- switch (ss->expr->value.function.isym->id)
+ switch (ss->info->expr->value.function.isym->id)
{
case GFC_ISYM_LBOUND:
case GFC_ISYM_UBOUND:
case GFC_ISYM_LCOBOUND:
case GFC_ISYM_UCOBOUND:
case GFC_ISYM_THIS_IMAGE:
- loop->dimen = ss->data.info.dimen;
+ loop->dimen = ss->dimen;
goto done;
default:
@@ -3315,21 +3594,31 @@ done:
/* Loop over all the SS in the chain. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- if (ss->expr && ss->expr->shape && !ss->shape)
- ss->shape = ss->expr->shape;
+ gfc_ss_info *ss_info;
+ gfc_array_info *info;
+ gfc_expr *expr;
+
+ ss_info = ss->info;
+ expr = ss_info->expr;
+ info = &ss_info->data.array;
- switch (ss->type)
+ if (expr && expr->shape && !info->shape)
+ info->shape = expr->shape;
+
+ switch (ss_info->type)
{
case GFC_SS_SECTION:
- /* Get the descriptor for the array. */
- gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter);
+ /* Get the descriptor for the array. If it is a cross loops array,
+ we got the descriptor already in the outermost loop. */
+ if (ss->parent == NULL)
+ gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter);
- for (n = 0; n < ss->data.info.dimen; n++)
- gfc_conv_section_startstride (loop, ss, ss->data.info.dim[n]);
+ for (n = 0; n < ss->dimen; n++)
+ gfc_conv_section_startstride (loop, ss, ss->dim[n]);
break;
case GFC_SS_INTRINSIC:
- switch (ss->expr->value.function.isym->id)
+ switch (expr->value.function.isym->id)
{
/* Fall through to supply start and stride. */
case GFC_ISYM_LBOUND:
@@ -3345,11 +3634,13 @@ done:
case GFC_SS_CONSTRUCTOR:
case GFC_SS_FUNCTION:
- for (n = 0; n < ss->data.info.dimen; n++)
+ for (n = 0; n < ss->dimen; n++)
{
- ss->data.info.start[n] = gfc_index_zero_node;
- ss->data.info.end[n] = gfc_index_zero_node;
- ss->data.info.stride[n] = gfc_index_one_node;
+ int dim = ss->dim[n];
+
+ info->start[dim] = gfc_index_zero_node;
+ info->end[dim] = gfc_index_zero_node;
+ info->stride[dim] = gfc_index_one_node;
}
break;
@@ -3366,7 +3657,7 @@ done:
tree end;
tree size[GFC_MAX_DIMENSIONS];
tree stride_pos, stride_neg, non_zerosized, tmp2, tmp3;
- gfc_ss_info *info;
+ gfc_array_info *info;
char *msg;
int dim;
@@ -3378,18 +3669,27 @@ done:
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
stmtblock_t inner;
+ gfc_ss_info *ss_info;
+ gfc_expr *expr;
+ locus *expr_loc;
+ const char *expr_name;
- if (ss->type != GFC_SS_SECTION)
+ ss_info = ss->info;
+ if (ss_info->type != GFC_SS_SECTION)
continue;
/* Catch allocatable lhs in f2003. */
if (gfc_option.flag_realloc_lhs && ss->is_alloc_lhs)
continue;
+ expr = ss_info->expr;
+ expr_loc = &expr->where;
+ expr_name = expr->symtree->name;
+
gfc_start_block (&inner);
/* TODO: range checking for mapped dimensions. */
- info = &ss->data.info;
+ info = &ss_info->data.array;
/* This code only checks ranges. Elemental and vector
dimensions are checked later. */
@@ -3397,7 +3697,7 @@ done:
{
bool check_upper;
- dim = info->dim[n];
+ dim = ss->dim[n];
if (info->ref->u.ar.dimen_type[dim] != DIMEN_RANGE)
continue;
@@ -3411,12 +3711,12 @@ done:
tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node,
info->stride[dim], gfc_index_zero_node);
asprintf (&msg, "Zero stride is not allowed, for dimension %d "
- "of array '%s'", dim + 1, ss->expr->symtree->name);
+ "of array '%s'", dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
- &ss->expr->where, msg);
+ expr_loc, msg);
free (msg);
- desc = ss->data.info.descriptor;
+ desc = info->descriptor;
/* This is the run-time equivalent of resolve.c's
check_dimension(). The logical is more readable there
@@ -3470,14 +3770,14 @@ done:
non_zerosized, tmp2);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
"outside of expected range (%%ld:%%ld)",
- dim + 1, ss->expr->symtree->name);
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, info->start[dim]),
fold_convert (long_integer_type_node, lbound),
fold_convert (long_integer_type_node, ubound));
gfc_trans_runtime_check (true, false, tmp2, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, info->start[dim]),
fold_convert (long_integer_type_node, lbound),
fold_convert (long_integer_type_node, ubound));
@@ -3492,9 +3792,9 @@ done:
boolean_type_node, non_zerosized, tmp);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
"below lower bound of %%ld",
- dim + 1, ss->expr->symtree->name);
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, info->start[dim]),
fold_convert (long_integer_type_node, lbound));
free (msg);
@@ -3524,14 +3824,14 @@ done:
boolean_type_node, non_zerosized, tmp3);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
"outside of expected range (%%ld:%%ld)",
- dim + 1, ss->expr->symtree->name);
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, ubound),
fold_convert (long_integer_type_node, lbound));
gfc_trans_runtime_check (true, false, tmp3, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, ubound),
fold_convert (long_integer_type_node, lbound));
@@ -3541,9 +3841,9 @@ done:
{
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
"below lower bound of %%ld",
- dim + 1, ss->expr->symtree->name);
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, lbound));
free (msg);
@@ -3570,10 +3870,10 @@ done:
boolean_type_node, tmp, size[n]);
asprintf (&msg, "Array bound mismatch for dimension %d "
"of array '%s' (%%ld/%%ld)",
- dim + 1, ss->expr->symtree->name);
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp3, &inner,
- &ss->expr->where, msg,
+ expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, size[n]));
@@ -3587,10 +3887,10 @@ done:
/* For optional arguments, only check bounds if the argument is
present. */
- if (ss->expr->symtree->n.sym->attr.optional
- || ss->expr->symtree->n.sym->attr.not_always_present)
+ if (expr->symtree->n.sym->attr.optional
+ || expr->symtree->n.sym->attr.not_always_present)
tmp = build3_v (COND_EXPR,
- gfc_conv_expr_present (ss->expr->symtree->n.sym),
+ gfc_conv_expr_present (expr->symtree->n.sym),
tmp, build_empty_stmt (input_location));
gfc_add_expr_to_block (&block, tmp);
@@ -3600,6 +3900,9 @@ done:
tmp = gfc_finish_block (&block);
gfc_add_expr_to_block (&loop->pre, tmp);
}
+
+ for (loop = loop->nested; loop; loop = loop->next)
+ gfc_conv_ss_startstride (loop);
}
/* Return true if both symbols could refer to the same data object. Does
@@ -3643,12 +3946,16 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
{
gfc_ref *lref;
gfc_ref *rref;
+ gfc_expr *lexpr, *rexpr;
gfc_symbol *lsym;
gfc_symbol *rsym;
bool lsym_pointer, lsym_target, rsym_pointer, rsym_target;
- lsym = lss->expr->symtree->n.sym;
- rsym = rss->expr->symtree->n.sym;
+ lexpr = lss->info->expr;
+ rexpr = rss->info->expr;
+
+ lsym = lexpr->symtree->n.sym;
+ rsym = rexpr->symtree->n.sym;
lsym_pointer = lsym->attr.pointer;
lsym_target = lsym->attr.target;
@@ -3666,7 +3973,7 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
/* For derived types we must check all the component types. We can ignore
array references as these will have the same base type as the previous
component ref. */
- for (lref = lss->expr->ref; lref != lss->data.info.ref; lref = lref->next)
+ for (lref = lexpr->ref; lref != lss->info->data.array.ref; lref = lref->next)
{
if (lref->type != REF_COMPONENT)
continue;
@@ -3686,7 +3993,7 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
return 1;
}
- for (rref = rss->expr->ref; rref != rss->data.info.ref;
+ for (rref = rexpr->ref; rref != rss->info->data.array.ref;
rref = rref->next)
{
if (rref->type != REF_COMPONENT)
@@ -3721,7 +4028,7 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
lsym_pointer = lsym->attr.pointer;
lsym_target = lsym->attr.target;
- for (rref = rss->expr->ref; rref != rss->data.info.ref; rref = rref->next)
+ for (rref = rexpr->ref; rref != rss->info->data.array.ref; rref = rref->next)
{
if (rref->type != REF_COMPONENT)
break;
@@ -3757,20 +4064,25 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
gfc_ss *ss;
gfc_ref *lref;
gfc_ref *rref;
+ gfc_expr *dest_expr;
+ gfc_expr *ss_expr;
int nDepend = 0;
int i, j;
loop->temp_ss = NULL;
+ dest_expr = dest->info->expr;
for (ss = rss; ss != gfc_ss_terminator; ss = ss->next)
{
- if (ss->type != GFC_SS_SECTION)
+ if (ss->info->type != GFC_SS_SECTION)
continue;
- if (dest->expr->symtree->n.sym != ss->expr->symtree->n.sym)
+ ss_expr = ss->info->expr;
+
+ if (dest_expr->symtree->n.sym != ss_expr->symtree->n.sym)
{
if (gfc_could_be_alias (dest, ss)
- || gfc_are_equivalenced_arrays (dest->expr, ss->expr))
+ || gfc_are_equivalenced_arrays (dest_expr, ss_expr))
{
nDepend = 1;
break;
@@ -3778,18 +4090,18 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
}
else
{
- lref = dest->expr->ref;
- rref = ss->expr->ref;
+ lref = dest_expr->ref;
+ rref = ss_expr->ref;
nDepend = gfc_dep_resolver (lref, rref, &loop->reverse[0]);
if (nDepend == 1)
break;
- for (i = 0; i < dest->data.info.dimen; i++)
- for (j = 0; j < ss->data.info.dimen; j++)
+ for (i = 0; i < dest->dimen; i++)
+ for (j = 0; j < ss->dimen; j++)
if (i != j
- && dest->data.info.dim[i] == ss->data.info.dim[j])
+ && dest->dim[i] == ss->dim[j])
{
/* If we don't access array elements in the same order,
there is a dependency. */
@@ -3838,11 +4150,11 @@ temporary:
if (nDepend == 1)
{
- tree base_type = gfc_typenode_for_spec (&dest->expr->ts);
+ tree base_type = gfc_typenode_for_spec (&dest_expr->ts);
if (GFC_ARRAY_TYPE_P (base_type)
|| GFC_DESCRIPTOR_TYPE_P (base_type))
base_type = gfc_get_element_type (base_type);
- loop->temp_ss = gfc_get_temp_ss (base_type, dest->string_length,
+ loop->temp_ss = gfc_get_temp_ss (base_type, dest->info->string_length,
loop->dimen);
gfc_add_ss_to_loop (loop, loop->temp_ss);
}
@@ -3851,25 +4163,25 @@ temporary:
}
-/* Initialize the scalarization loop. Creates the loop variables. Determines
- the range of the loop variables. Creates a temporary if required.
- Calculates how to transform from loop variables to array indices for each
- expression. Also generates code for scalar expressions which have been
- moved outside the loop. */
+/* Browse through each array's information from the scalarizer and set the loop
+ bounds according to the "best" one (per dimension), i.e. the one which
+ provides the most information (constant bounds, shape, etc). */
-void
-gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
+static void
+set_loop_bounds (gfc_loopinfo *loop)
{
int n, dim, spec_dim;
- gfc_ss_info *info;
- gfc_ss_info *specinfo;
+ gfc_array_info *info;
+ gfc_array_info *specinfo;
gfc_ss *ss;
tree tmp;
- gfc_ss *loopspec[GFC_MAX_DIMENSIONS];
+ gfc_ss **loopspec;
bool dynamic[GFC_MAX_DIMENSIONS];
mpz_t *cshape;
mpz_t i;
+ loopspec = loop->specloop;
+
mpz_init (i);
for (n = 0; n < loop->dimen; n++)
{
@@ -3879,16 +4191,21 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
loop for this dimension. We try to pick the simplest term. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- if (ss->type == GFC_SS_SCALAR || ss->type == GFC_SS_REFERENCE)
+ gfc_ss_type ss_type;
+
+ ss_type = ss->info->type;
+ if (ss_type == GFC_SS_SCALAR
+ || ss_type == GFC_SS_TEMP
+ || ss_type == GFC_SS_REFERENCE)
continue;
- info = &ss->data.info;
- dim = info->dim[n];
+ info = &ss->info->data.array;
+ dim = ss->dim[n];
if (loopspec[n] != NULL)
{
- specinfo = &loopspec[n]->data.info;
- spec_dim = specinfo->dim[n];
+ specinfo = &loopspec[n]->info->data.array;
+ spec_dim = loopspec[n]->dim[n];
}
else
{
@@ -3897,19 +4214,19 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
spec_dim = 0;
}
- if (ss->shape)
+ if (info->shape)
{
- gcc_assert (ss->shape[dim]);
+ gcc_assert (info->shape[dim]);
/* The frontend has worked out the size for us. */
if (!loopspec[n]
- || !loopspec[n]->shape
+ || !specinfo->shape
|| !integer_zerop (specinfo->start[spec_dim]))
/* Prefer zero-based descriptors if possible. */
loopspec[n] = ss;
continue;
}
- if (ss->type == GFC_SS_CONSTRUCTOR)
+ if (ss_type == GFC_SS_CONSTRUCTOR)
{
gfc_constructor_base base;
/* An unknown size constructor will always be rank one.
@@ -3921,7 +4238,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
can be determined at compile time. Prefer not to otherwise,
since the general case involves realloc, and it's better to
avoid that overhead if possible. */
- base = ss->expr->value.constructor;
+ base = ss->info->expr->value.constructor;
dynamic[n] = gfc_get_array_constructor_size (&i, base);
if (!dynamic[n] || !loopspec[n])
loopspec[n] = ss;
@@ -3930,7 +4247,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
/* TODO: Pick the best bound if we have a choice between a
function and something else. */
- if (ss->type == GFC_SS_FUNCTION)
+ if (ss_type == GFC_SS_FUNCTION)
{
loopspec[n] = ss;
continue;
@@ -3941,7 +4258,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
if (loopspec[n] && ss->is_alloc_lhs)
continue;
- if (ss->type != GFC_SS_SECTION)
+ if (ss_type != GFC_SS_SECTION)
continue;
if (!loopspec[n])
@@ -3953,7 +4270,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
known lower bound
known upper bound
*/
- else if ((loopspec[n]->type == GFC_SS_CONSTRUCTOR && dynamic[n])
+ else if ((loopspec[n]->info->type == GFC_SS_CONSTRUCTOR && dynamic[n])
|| n >= loop->dimen)
loopspec[n] = ss;
else if (integer_onep (info->stride[dim])
@@ -3975,16 +4292,16 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
that's bad news. */
gcc_assert (loopspec[n]);
- info = &loopspec[n]->data.info;
- dim = info->dim[n];
+ info = &loopspec[n]->info->data.array;
+ dim = loopspec[n]->dim[n];
/* Set the extents of this range. */
- cshape = loopspec[n]->shape;
+ cshape = info->shape;
if (cshape && INTEGER_CST_P (info->start[dim])
&& INTEGER_CST_P (info->stride[dim]))
{
loop->from[n] = info->start[dim];
- mpz_set (i, cshape[get_array_ref_dim (info, n)]);
+ mpz_set (i, cshape[get_array_ref_dim_for_loop_dim (loopspec[n], n)]);
mpz_sub_ui (i, i, 1);
/* To = from + (size - 1) * stride. */
tmp = gfc_conv_mpz_to_tree (i, gfc_index_integer_kind);
@@ -3999,7 +4316,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
else
{
loop->from[n] = info->start[dim];
- switch (loopspec[n]->type)
+ switch (loopspec[n]->info->type)
{
case GFC_SS_CONSTRUCTOR:
/* The upper bound is calculated when we expand the
@@ -4046,65 +4363,98 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
loop->from[n] = gfc_index_zero_node;
}
}
+ mpz_clear (i);
+
+ for (loop = loop->nested; loop; loop = loop->next)
+ set_loop_bounds (loop);
+}
+
+
+/* Initialize the scalarization loop. Creates the loop variables. Determines
+ the range of the loop variables. Creates a temporary if required.
+ Also generates code for scalar expressions which have been
+ moved outside the loop. */
+
+void
+gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
+{
+ gfc_ss *tmp_ss;
+ tree tmp;
+
+ set_loop_bounds (loop);
/* Add all the scalar code that can be taken out of the loops.
This may include calculating the loop bounds, so do it before
allocating the temporary. */
gfc_add_loop_ss_code (loop, loop->ss, false, where);
+ tmp_ss = loop->temp_ss;
/* If we want a temporary then create it. */
- if (loop->temp_ss != NULL)
+ if (tmp_ss != NULL)
{
- gcc_assert (loop->temp_ss->type == GFC_SS_TEMP);
+ gfc_ss_info *tmp_ss_info;
+
+ tmp_ss_info = tmp_ss->info;
+ gcc_assert (tmp_ss_info->type == GFC_SS_TEMP);
+ gcc_assert (loop->parent == NULL);
/* Make absolutely sure that this is a complete type. */
- if (loop->temp_ss->string_length)
- loop->temp_ss->data.temp.type
+ if (tmp_ss_info->string_length)
+ tmp_ss_info->data.temp.type
= gfc_get_character_type_len_for_eltype
- (TREE_TYPE (loop->temp_ss->data.temp.type),
- loop->temp_ss->string_length);
+ (TREE_TYPE (tmp_ss_info->data.temp.type),
+ tmp_ss_info->string_length);
- tmp = loop->temp_ss->data.temp.type;
- n = loop->temp_ss->data.temp.dimen;
- memset (&loop->temp_ss->data.info, 0, sizeof (gfc_ss_info));
- loop->temp_ss->type = GFC_SS_SECTION;
- loop->temp_ss->data.info.dimen = n;
+ tmp = tmp_ss_info->data.temp.type;
+ memset (&tmp_ss_info->data.array, 0, sizeof (gfc_array_info));
+ tmp_ss_info->type = GFC_SS_SECTION;
- gcc_assert (loop->temp_ss->data.info.dimen != 0);
- for (n = 0; n < loop->temp_ss->data.info.dimen; n++)
- loop->temp_ss->data.info.dim[n] = n;
+ gcc_assert (tmp_ss->dimen != 0);
- gfc_trans_create_temp_array (&loop->pre, &loop->post, loop,
- &loop->temp_ss->data.info, tmp, NULL_TREE,
- false, true, false, where);
+ gfc_trans_create_temp_array (&loop->pre, &loop->post, tmp_ss, tmp,
+ NULL_TREE, false, true, false, where);
}
- for (n = 0; n < loop->temp_dim; n++)
- loopspec[loop->order[n]] = NULL;
-
- mpz_clear (i);
-
/* For array parameters we don't have loop variables, so don't calculate the
translations. */
- if (loop->array_parameter)
- return;
+ if (!loop->array_parameter)
+ gfc_set_delta (loop);
+}
+
+
+/* Calculates how to transform from loop variables to array indices for each
+ array: once loop bounds are chosen, sets the difference (DELTA field) between
+ loop bounds and array reference bounds, for each array info. */
+
+void
+gfc_set_delta (gfc_loopinfo *loop)
+{
+ gfc_ss *ss, **loopspec;
+ gfc_array_info *info;
+ tree tmp;
+ int n, dim;
+
+ loopspec = loop->specloop;
/* Calculate the translation from loop variables to array indices. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
- if (ss->type != GFC_SS_SECTION && ss->type != GFC_SS_COMPONENT
- && ss->type != GFC_SS_CONSTRUCTOR)
+ gfc_ss_type ss_type;
+ ss_type = ss->info->type;
+ if (ss_type != GFC_SS_SECTION
+ && ss_type != GFC_SS_COMPONENT
+ && ss_type != GFC_SS_CONSTRUCTOR)
continue;
- info = &ss->data.info;
+ info = &ss->info->data.array;
- for (n = 0; n < info->dimen; n++)
+ for (n = 0; n < ss->dimen; n++)
{
/* If we are specifying the range the delta is already set. */
if (loopspec[n] != ss)
{
- dim = ss->data.info.dim[n];
+ dim = ss->dim[n];
/* Calculate the offset relative to the loop variable.
First multiply by the stride. */
@@ -4123,6 +4473,9 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
}
}
}
+
+ for (loop = loop->nested; loop; loop = loop->next)
+ gfc_set_delta (loop);
}
@@ -5662,15 +6015,17 @@ get_array_charlen (gfc_expr *expr, gfc_se *se)
}
}
+
/* Helper function to check dimensions. */
static bool
-dim_ok (gfc_ss_info *info)
+transposed_dims (gfc_ss *ss)
{
int n;
- for (n = 0; n < info->dimen; n++)
- if (info->dim[n] != n)
- return false;
- return true;
+
+ for (n = 0; n < ss->dimen; n++)
+ if (ss->dim[n] != n)
+ return true;
+ return false;
}
/* Convert an array for passing as an actual argument. Expressions and
@@ -5705,8 +6060,10 @@ dim_ok (gfc_ss_info *info)
void
gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
{
+ gfc_ss_type ss_type;
+ gfc_ss_info *ss_info;
gfc_loopinfo loop;
- gfc_ss_info *info;
+ gfc_array_info *info;
int need_tmp;
int n;
tree tmp;
@@ -5716,11 +6073,15 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
tree offset;
int full;
bool subref_array_target = false;
- gfc_expr *arg;
+ gfc_expr *arg, *ss_expr;
gcc_assert (ss != NULL);
gcc_assert (ss != gfc_ss_terminator);
+ ss_info = ss->info;
+ ss_type = ss_info->type;
+ ss_expr = ss_info->expr;
+
/* Special case things we know we can pass easily. */
switch (expr->expr_type)
{
@@ -5728,9 +6089,9 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* If we have a linear array section, we can pass it directly.
Otherwise we need to copy it into a temporary. */
- gcc_assert (ss->type == GFC_SS_SECTION);
- gcc_assert (ss->expr == expr);
- info = &ss->data.info;
+ gcc_assert (ss_type == GFC_SS_SECTION);
+ gcc_assert (ss_expr == expr);
+ info = &ss_info->data.array;
/* Get the descriptor for the array. */
gfc_conv_ss_descriptor (&se->pre, ss, 0);
@@ -5757,7 +6118,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
else
full = gfc_full_array_ref_p (info->ref, NULL);
- if (full && dim_ok (info))
+ if (full && !transposed_dims (ss))
{
if (se->direct_byref && !se->byref_noassign)
{
@@ -5807,7 +6168,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
if (se->direct_byref)
{
- gcc_assert (ss->type == GFC_SS_FUNCTION && ss->expr == expr);
+ gcc_assert (ss_type == GFC_SS_FUNCTION && ss_expr == expr);
/* For pointer assignments pass the descriptor directly. */
if (se->ss == NULL)
@@ -5819,16 +6180,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
return;
}
- if (ss->expr != expr || ss->type != GFC_SS_FUNCTION)
+ if (ss_expr != expr || ss_type != GFC_SS_FUNCTION)
{
- if (ss->expr != expr)
+ if (ss_expr != expr)
/* Elemental function. */
gcc_assert ((expr->value.function.esym != NULL
&& expr->value.function.esym->attr.elemental)
|| (expr->value.function.isym != NULL
- && expr->value.function.isym->elemental));
+ && expr->value.function.isym->elemental)
+ || gfc_inline_intrinsic_function_p (expr));
else
- gcc_assert (ss->type == GFC_SS_INTRINSIC);
+ gcc_assert (ss_type == GFC_SS_INTRINSIC);
need_tmp = 1;
if (expr->ts.type == BT_CHARACTER
@@ -5840,19 +6202,19 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
else
{
/* Transformational function. */
- info = &ss->data.info;
+ info = &ss_info->data.array;
need_tmp = 0;
}
break;
case EXPR_ARRAY:
/* Constant array constructors don't need a temporary. */
- if (ss->type == GFC_SS_CONSTRUCTOR
+ if (ss_type == GFC_SS_CONSTRUCTOR
&& expr->ts.type != BT_CHARACTER
&& gfc_constant_array_constructor_p (expr->value.constructor))
{
need_tmp = 0;
- info = &ss->data.info;
+ info = &ss_info->data.array;
}
else
{
@@ -5900,8 +6262,8 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
: NULL),
loop.dimen);
- se->string_length = loop.temp_ss->string_length;
- gcc_assert (loop.temp_ss->data.temp.dimen == loop.dimen);
+ se->string_length = loop.temp_ss->info->string_length;
+ gcc_assert (loop.temp_ss->dimen == loop.dimen);
gfc_add_ss_to_loop (&loop, loop.temp_ss);
}
@@ -5952,12 +6314,12 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Finish the copying loops. */
gfc_trans_scalarizing_loops (&loop, &block);
- desc = loop.temp_ss->data.info.descriptor;
+ desc = loop.temp_ss->info->data.array.descriptor;
}
- else if (expr->expr_type == EXPR_FUNCTION && dim_ok (info))
+ else if (expr->expr_type == EXPR_FUNCTION && !transposed_dims (ss))
{
desc = info->descriptor;
- se->string_length = ss->string_length;
+ se->string_length = ss_info->string_length;
}
else
{
@@ -5974,7 +6336,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
tree to;
tree base;
- ndim = info->ref ? info->ref->u.ar.dimen : info->dimen;
+ ndim = info->ref ? info->ref->u.ar.dimen : ss->dimen;
if (se->want_coarray)
{
@@ -6058,8 +6420,8 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
&& info->ref->u.ar.dimen_type[n] == DIMEN_ELEMENT)
{
gcc_assert (info->subscript[n]
- && info->subscript[n]->type == GFC_SS_SCALAR);
- start = info->subscript[n]->data.scalar.expr;
+ && info->subscript[n]->info->type == GFC_SS_SCALAR);
+ start = info->subscript[n]->info->data.scalar.value;
}
else
{
@@ -6089,7 +6451,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* look for the corresponding scalarizer dimension: dim. */
for (dim = 0; dim < ndim; dim++)
- if (info->dim[dim] == n)
+ if (ss->dim[dim] == n)
break;
/* loop exited early: the DIM being looked for has been found. */
@@ -7145,6 +7507,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
stmtblock_t fblock;
gfc_ss *rss;
gfc_ss *lss;
+ gfc_array_info *linfo;
tree realloc_expr;
tree alloc_expr;
tree size1;
@@ -7175,11 +7538,11 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
/* Find the ss for the lhs. */
lss = loop->ss;
for (; lss && lss != gfc_ss_terminator; lss = lss->loop_chain)
- if (lss->expr && lss->expr->expr_type == EXPR_VARIABLE)
+ if (lss->info->expr && lss->info->expr->expr_type == EXPR_VARIABLE)
break;
if (lss == gfc_ss_terminator)
return NULL_TREE;
- expr1 = lss->expr;
+ expr1 = lss->info->expr;
}
/* Bail out if this is not a valid allocate on assignment. */
@@ -7190,17 +7553,19 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
/* Find the ss for the lhs. */
lss = loop->ss;
for (; lss && lss != gfc_ss_terminator; lss = lss->loop_chain)
- if (lss->expr == expr1)
+ if (lss->info->expr == expr1)
break;
if (lss == gfc_ss_terminator)
return NULL_TREE;
+ linfo = &lss->info->data.array;
+
/* Find an ss for the rhs. For operator expressions, we see the
ss's for the operands. Any one of these will do. */
rss = loop->ss;
for (; rss && rss != gfc_ss_terminator; rss = rss->loop_chain)
- if (rss->expr != expr1 && rss != loop->temp_ss)
+ if (rss->info->expr != expr1 && rss != loop->temp_ss)
break;
if (expr2 && rss == gfc_ss_terminator)
@@ -7210,7 +7575,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
/* Since the lhs is allocatable, this must be a descriptor type.
Get the data and array size. */
- desc = lss->data.info.descriptor;
+ desc = linfo->descriptor;
gcc_assert (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc)));
array1 = gfc_conv_descriptor_data_get (desc);
@@ -7280,7 +7645,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
/* Get the rhs size. Fix both sizes. */
if (expr2)
- desc2 = rss->data.info.descriptor;
+ desc2 = rss->info->data.array.descriptor;
else
desc2 = NULL_TREE;
size2 = gfc_index_one_node;
@@ -7370,21 +7735,21 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
running offset. Use the saved_offset instead. */
tmp = gfc_conv_descriptor_offset (desc);
gfc_add_modify (&fblock, tmp, offset);
- if (lss->data.info.saved_offset
- && TREE_CODE (lss->data.info.saved_offset) == VAR_DECL)
- gfc_add_modify (&fblock, lss->data.info.saved_offset, tmp);
+ if (linfo->saved_offset
+ && TREE_CODE (linfo->saved_offset) == VAR_DECL)
+ gfc_add_modify (&fblock, linfo->saved_offset, tmp);
/* Now set the deltas for the lhs. */
for (n = 0; n < expr1->rank; n++)
{
tmp = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n]);
- dim = lss->data.info.dim[n];
+ dim = lss->dim[n];
tmp = fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type, tmp,
loop->from[dim]);
- if (lss->data.info.delta[dim]
- && TREE_CODE (lss->data.info.delta[dim]) == VAR_DECL)
- gfc_add_modify (&fblock, lss->data.info.delta[dim], tmp);
+ if (linfo->delta[dim]
+ && TREE_CODE (linfo->delta[dim]) == VAR_DECL)
+ gfc_add_modify (&fblock, linfo->delta[dim], tmp);
}
/* Get the new lhs size in bytes. */
@@ -7448,11 +7813,11 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
gfc_add_expr_to_block (&fblock, tmp);
/* Make sure that the scalarizer data pointer is updated. */
- if (lss->data.info.data
- && TREE_CODE (lss->data.info.data) == VAR_DECL)
+ if (linfo->data
+ && TREE_CODE (linfo->data) == VAR_DECL)
{
tmp = gfc_conv_descriptor_data_get (desc);
- gfc_add_modify (&fblock, lss->data.info.data, tmp);
+ gfc_add_modify (&fblock, linfo->data, tmp);
}
/* Add the exit label. */
@@ -7636,13 +8001,13 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
switch (ar->type)
{
case AR_ELEMENT:
- for (n = ar->dimen + ar->codimen - 1; n >= 0; n--)
+ for (n = ar->dimen - 1; n >= 0; n--)
ss = gfc_get_scalar_ss (ss, ar->start[n]);
break;
case AR_FULL:
newss = gfc_get_array_ss (ss, expr, ar->as->rank, GFC_SS_SECTION);
- newss->data.info.ref = ref;
+ newss->info->data.array.ref = ref;
/* Make sure array is the same as array(:,:), this way
we don't need to special case all the time. */
@@ -7660,7 +8025,7 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
case AR_SECTION:
newss = gfc_get_array_ss (ss, expr, 0, GFC_SS_SECTION);
- newss->data.info.ref = ref;
+ newss->info->data.array.ref = ref;
/* We add SS chains for all the subscripts in the section. */
for (n = 0; n < ar->dimen; n++)
@@ -7674,14 +8039,14 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
gcc_assert (ar->start[n]);
indexss = gfc_get_scalar_ss (gfc_ss_terminator, ar->start[n]);
indexss->loop_chain = gfc_ss_terminator;
- newss->data.info.subscript[n] = indexss;
+ newss->info->data.array.subscript[n] = indexss;
break;
case DIMEN_RANGE:
/* We don't add anything for sections, just remember this
dimension for later. */
- newss->data.info.dim[newss->data.info.dimen] = n;
- newss->data.info.dimen++;
+ newss->dim[newss->dimen] = n;
+ newss->dimen++;
break;
case DIMEN_VECTOR:
@@ -7690,9 +8055,9 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
indexss = gfc_get_array_ss (gfc_ss_terminator, ar->start[n],
1, GFC_SS_VECTOR);
indexss->loop_chain = gfc_ss_terminator;
- newss->data.info.subscript[n] = indexss;
- newss->data.info.dim[newss->data.info.dimen] = n;
- newss->data.info.dimen++;
+ newss->info->data.array.subscript[n] = indexss;
+ newss->dim[newss->dimen] = n;
+ newss->dimen++;
break;
default:
@@ -7702,8 +8067,8 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
}
/* We should have at least one non-elemental dimension,
unless we are creating a descriptor for a (scalar) coarray. */
- gcc_assert (newss->data.info.dimen > 0
- || newss->data.info.ref->u.ar.as->corank > 0);
+ gcc_assert (newss->dimen > 0
+ || newss->info->data.array.ref->u.ar.as->corank > 0);
ss = newss;
break;
@@ -7814,7 +8179,7 @@ gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg,
/* Scalar argument. */
gcc_assert (type == GFC_SS_SCALAR || type == GFC_SS_REFERENCE);
newss = gfc_get_scalar_ss (head, arg->expr);
- newss->type = type;
+ newss->info->type = type;
}
else
scalar = 0;
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 4d737bde94f..bd593bdb487 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -31,9 +31,8 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *,
gfc_se *, gfc_array_spec *);
/* Generate code to create a temporary array. */
-tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *,
- gfc_ss_info *, tree, tree, bool, bool, bool,
- locus *);
+tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_ss *,
+ tree, tree, bool, bool, bool, locus *);
/* Generate function entry code for allocation of compiler allocated array
variables. */
@@ -89,6 +88,8 @@ void gfc_add_ss_to_loop (gfc_loopinfo *, gfc_ss *);
void gfc_mark_ss_chain_used (gfc_ss *, unsigned);
/* Free a gfc_ss chain. */
void gfc_free_ss_chain (gfc_ss *);
+/* Free a single gfc_ss element. */
+void gfc_free_ss (gfc_ss *);
/* Allocate a new array type ss. */
gfc_ss *gfc_get_array_ss (gfc_ss *, gfc_expr *, int, gfc_ss_type);
/* Allocate a new temporary type ss. */
@@ -112,6 +113,8 @@ void gfc_trans_scalarizing_loops (gfc_loopinfo *, stmtblock_t *);
void gfc_trans_scalarized_loop_boundary (gfc_loopinfo *, stmtblock_t *);
/* Initialize the scalarization loop parameters. */
void gfc_conv_loop_setup (gfc_loopinfo *, locus *);
+/* Set each array's delta. */
+void gfc_set_delta (gfc_loopinfo *);
/* Resolve array assignment dependencies. */
void gfc_conv_resolve_dependencies (gfc_loopinfo *, gfc_ss *, gfc_ss *);
/* Build a null array descriptor constructor. */
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 5fbe765c493..fa820ef10de 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -358,6 +358,8 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
void
gfc_conv_constant (gfc_se * se, gfc_expr * expr)
{
+ gfc_ss *ss;
+
/* We may be receiving an expression for C_NULL_PTR or C_NULL_FUNPTR. If
so, the expr_type will not yet be an EXPR_CONSTANT. We need to make
it so here. */
@@ -380,14 +382,18 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
return;
}
- if (se->ss != NULL)
+ ss = se->ss;
+ if (ss != NULL)
{
- gcc_assert (se->ss != gfc_ss_terminator);
- gcc_assert (se->ss->type == GFC_SS_SCALAR);
- gcc_assert (se->ss->expr == expr);
+ gfc_ss_info *ss_info;
+
+ ss_info = ss->info;
+ gcc_assert (ss != gfc_ss_terminator);
+ gcc_assert (ss_info->type == GFC_SS_SCALAR);
+ gcc_assert (ss_info->expr == expr);
- se->expr = se->ss->data.scalar.expr;
- se->string_length = se->ss->string_length;
+ se->expr = ss_info->data.scalar.value;
+ se->string_length = ss_info->string_length;
gfc_advance_se_ss_chain (se);
return;
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index b7460b779e2..b90b0ab25b6 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -517,6 +517,10 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
/* If it wasn't used we wouldn't be getting it. */
TREE_USED (decl) = 1;
+ if (sym->attr.flavor == FL_PARAMETER
+ && (sym->attr.dimension || sym->ts.type == BT_DERIVED))
+ TREE_READONLY (decl) = 1;
+
/* Chain this decl to the pending declarations. Don't do pushdecl()
because this would add them to the current scope rather than the
function scope. */
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 09b98d03faf..cf9f0f7cdb9 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -83,6 +83,7 @@ void
gfc_advance_se_ss_chain (gfc_se * se)
{
gfc_se *p;
+ gfc_ss *ss;
gcc_assert (se != NULL && se->ss != NULL && se->ss != gfc_ss_terminator);
@@ -91,9 +92,18 @@ gfc_advance_se_ss_chain (gfc_se * se)
while (p != NULL)
{
/* Simple consistency check. */
- gcc_assert (p->parent == NULL || p->parent->ss == p->ss);
+ gcc_assert (p->parent == NULL || p->parent->ss == p->ss
+ || p->parent->ss->nested_ss == p->ss);
+
+ /* If we were in a nested loop, the next scalarized expression can be
+ on the parent ss' next pointer. Thus we should not take the next
+ pointer blindly, but rather go up one nest level as long as next
+ is the end of chain. */
+ ss = p->ss;
+ while (ss->next == gfc_ss_terminator && ss->parent != NULL)
+ ss = ss->parent;
- p->ss = p->ss->next;
+ p->ss = ss->next;
p = p->parent;
}
@@ -613,6 +623,7 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
static void
gfc_conv_variable (gfc_se * se, gfc_expr * expr)
{
+ gfc_ss *ss;
gfc_ref *ref;
gfc_symbol *sym;
tree parent_decl = NULL_TREE;
@@ -622,16 +633,19 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
bool entry_master;
sym = expr->symtree->n.sym;
- if (se->ss != NULL)
+ ss = se->ss;
+ if (ss != NULL)
{
+ gfc_ss_info *ss_info = ss->info;
+
/* Check that something hasn't gone horribly wrong. */
- gcc_assert (se->ss != gfc_ss_terminator);
- gcc_assert (se->ss->expr == expr);
+ gcc_assert (ss != gfc_ss_terminator);
+ gcc_assert (ss_info->expr == expr);
/* A scalarized term. We already know the descriptor. */
- se->expr = se->ss->data.info.descriptor;
- se->string_length = se->ss->string_length;
- for (ref = se->ss->data.info.ref; ref; ref = ref->next)
+ se->expr = ss_info->data.array.descriptor;
+ se->string_length = ss_info->string_length;
+ for (ref = ss_info->data.array.ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
break;
}
@@ -2359,7 +2373,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
gfc_ss *rss;
gfc_loopinfo loop;
gfc_loopinfo loop2;
- gfc_ss_info *info;
+ gfc_array_info *info;
tree offset;
tree tmp_index;
tree tmp;
@@ -2400,7 +2414,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
: NULL),
loop.dimen);
- parmse->string_length = loop.temp_ss->string_length;
+ parmse->string_length = loop.temp_ss->info->string_length;
/* Associate the SS with the loop. */
gfc_add_ss_to_loop (&loop, loop.temp_ss);
@@ -2409,7 +2423,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
gfc_conv_loop_setup (&loop, &expr->where);
/* Pass the temporary descriptor back to the caller. */
- info = &loop.temp_ss->data.info;
+ info = &loop.temp_ss->info->data.array;
parmse->expr = info->descriptor;
/* Setup the gfc_se structures. */
@@ -2488,8 +2502,8 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
dimensions, so this is very simple. The offset is only computed
outside the innermost loop, so the overall transfer could be
optimized further. */
- info = &rse.ss->data.info;
- dimen = info->dimen;
+ info = &rse.ss->info->data.array;
+ dimen = rse.ss->dimen;
tmp_index = gfc_index_zero_node;
for (n = dimen - 1; n > 0; n--)
@@ -2854,7 +2868,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
tree fntype;
gfc_se parmse;
gfc_ss *argss;
- gfc_ss_info *info;
+ gfc_array_info *info;
int byref;
int parm_kind;
tree type;
@@ -2893,8 +2907,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
{
if (!sym->attr.elemental)
{
- gcc_assert (se->ss->type == GFC_SS_FUNCTION);
- if (se->ss->useflags)
+ gcc_assert (se->ss->info->type == GFC_SS_FUNCTION);
+ if (se->ss->info->useflags)
{
gcc_assert ((!comp && gfc_return_by_reference (sym)
&& sym->result->attr.dimension)
@@ -2906,7 +2920,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
return 0;
}
}
- info = &se->ss->data.info;
+ info = &se->ss->info->data.array;
}
else
info = NULL;
@@ -2979,12 +2993,23 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_init_se (&parmse, se);
gfc_conv_derived_to_class (&parmse, e, fsym->ts);
}
- else if (se->ss && se->ss->useflags)
+ else if (se->ss && se->ss->info->useflags)
{
/* An elemental function inside a scalarized loop. */
gfc_init_se (&parmse, se);
- gfc_conv_expr_reference (&parmse, e);
parm_kind = ELEMENTAL;
+
+ if (se->ss->dimen > 0
+ && se->ss->info->data.array.ref == NULL)
+ {
+ gfc_conv_tmp_array_ref (&parmse);
+ if (e->ts.type == BT_CHARACTER)
+ gfc_conv_string_parameter (&parmse);
+ else
+ parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
+ }
+ else
+ gfc_conv_expr_reference (&parmse, e);
}
else
{
@@ -3582,7 +3607,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Set the type of the array. */
tmp = gfc_typenode_for_spec (&comp->ts);
- gcc_assert (info->dimen == se->loop->dimen);
+ gcc_assert (se->ss->dimen == se->loop->dimen);
/* Evaluate the bounds of the result, if known. */
gfc_set_loop_bounds_from_array_spec (&mapping, se, comp->as);
@@ -3602,9 +3627,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
returns a pointer, the temporary will be a shallow copy and
mustn't be deallocated. */
callee_alloc = comp->attr.allocatable || comp->attr.pointer;
- gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp,
- NULL_TREE, false, !comp->attr.pointer,
- callee_alloc, &se->ss->expr->where);
+ gfc_trans_create_temp_array (&se->pre, &se->post, se->ss,
+ tmp, NULL_TREE, false,
+ !comp->attr.pointer, callee_alloc,
+ &se->ss->info->expr->where);
/* Pass the temporary as the first argument. */
result = info->descriptor;
@@ -3617,7 +3643,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Set the type of the array. */
tmp = gfc_typenode_for_spec (&ts);
- gcc_assert (info->dimen == se->loop->dimen);
+ gcc_assert (se->ss->dimen == se->loop->dimen);
/* Evaluate the bounds of the result, if known. */
gfc_set_loop_bounds_from_array_spec (&mapping, se, sym->result->as);
@@ -3637,9 +3663,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
returns a pointer, the temporary will be a shallow copy and
mustn't be deallocated. */
callee_alloc = sym->attr.allocatable || sym->attr.pointer;
- gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp,
- NULL_TREE, false, !sym->attr.pointer,
- callee_alloc, &se->ss->expr->where);
+ gfc_trans_create_temp_array (&se->pre, &se->post, se->ss,
+ tmp, NULL_TREE, false,
+ !sym->attr.pointer, callee_alloc,
+ &se->ss->info->expr->where);
/* Pass the temporary as the first argument. */
result = info->descriptor;
@@ -4237,8 +4264,11 @@ is_zero_initializer_p (gfc_expr * expr)
static void
gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
{
- gcc_assert (se->ss != NULL && se->ss != gfc_ss_terminator);
- gcc_assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR);
+ gfc_ss *ss;
+
+ ss = se->ss;
+ gcc_assert (ss != NULL && ss != gfc_ss_terminator);
+ gcc_assert (ss->info->expr == expr && ss->info->type == GFC_SS_CONSTRUCTOR);
gfc_conv_tmp_array_ref (se);
}
@@ -4342,6 +4372,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_se lse;
gfc_ss *rss;
gfc_ss *lss;
+ gfc_array_info *lss_array;
stmtblock_t body;
stmtblock_t block;
gfc_loopinfo loop;
@@ -4365,19 +4396,20 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
/* Create a SS for the destination. */
lss = gfc_get_array_ss (gfc_ss_terminator, NULL, cm->as->rank,
GFC_SS_COMPONENT);
- lss->shape = gfc_get_shape (cm->as->rank);
- lss->data.info.descriptor = dest;
- lss->data.info.data = gfc_conv_array_data (dest);
- lss->data.info.offset = gfc_conv_array_offset (dest);
+ lss_array = &lss->info->data.array;
+ lss_array->shape = gfc_get_shape (cm->as->rank);
+ lss_array->descriptor = dest;
+ lss_array->data = gfc_conv_array_data (dest);
+ lss_array->offset = gfc_conv_array_offset (dest);
for (n = 0; n < cm->as->rank; n++)
{
- lss->data.info.start[n] = gfc_conv_array_lbound (dest, n);
- lss->data.info.stride[n] = gfc_index_one_node;
+ lss_array->start[n] = gfc_conv_array_lbound (dest, n);
+ lss_array->stride[n] = gfc_index_one_node;
- mpz_init (lss->shape[n]);
- mpz_sub (lss->shape[n], cm->as->upper[n]->value.integer,
+ mpz_init (lss_array->shape[n]);
+ mpz_sub (lss_array->shape[n], cm->as->upper[n]->value.integer,
cm->as->lower[n]->value.integer);
- mpz_add_ui (lss->shape[n], lss->shape[n], 1);
+ mpz_add_ui (lss_array->shape[n], lss_array->shape[n], 1);
}
/* Associate the SS with the loop. */
@@ -4420,8 +4452,8 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
- gcc_assert (lss->shape != NULL);
- gfc_free_shape (&lss->shape, cm->as->rank);
+ gcc_assert (lss_array->shape != NULL);
+ gfc_free_shape (&lss_array->shape, cm->as->rank);
gfc_cleanup_loop (&loop);
return gfc_finish_block (&block);
@@ -4817,15 +4849,22 @@ gfc_conv_substring_expr (gfc_se * se, gfc_expr * expr)
void
gfc_conv_expr (gfc_se * se, gfc_expr * expr)
{
- if (se->ss && se->ss->expr == expr
- && (se->ss->type == GFC_SS_SCALAR || se->ss->type == GFC_SS_REFERENCE))
+ gfc_ss *ss;
+
+ ss = se->ss;
+ if (ss && ss->info->expr == expr
+ && (ss->info->type == GFC_SS_SCALAR
+ || ss->info->type == GFC_SS_REFERENCE))
{
+ gfc_ss_info *ss_info;
+
+ ss_info = ss->info;
/* Substitute a scalar expression evaluated outside the scalarization
loop. */
- se->expr = se->ss->data.scalar.expr;
- if (se->ss->type == GFC_SS_REFERENCE)
+ se->expr = ss_info->data.scalar.value;
+ if (ss_info->type == GFC_SS_REFERENCE)
se->expr = gfc_build_addr_expr (NULL_TREE, se->expr);
- se->string_length = se->ss->string_length;
+ se->string_length = ss_info->string_length;
gfc_advance_se_ss_chain (se);
return;
}
@@ -4942,10 +4981,12 @@ gfc_conv_expr_type (gfc_se * se, gfc_expr * expr, tree type)
void
gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
{
+ gfc_ss *ss;
tree var;
- if (se->ss && se->ss->expr == expr
- && se->ss->type == GFC_SS_REFERENCE)
+ ss = se->ss;
+ if (ss && ss->info->expr == expr
+ && ss->info->type == GFC_SS_REFERENCE)
{
/* Returns a reference to the scalar evaluated outside the loop
for this case. */
@@ -6150,7 +6191,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
/* Find a non-scalar SS from the lhs. */
while (lss_section != gfc_ss_terminator
- && lss_section->type != GFC_SS_SECTION)
+ && lss_section->info->type != GFC_SS_SECTION)
lss_section = lss_section->next;
gcc_assert (lss_section != gfc_ss_terminator);
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 83fc4fc52ef..4244570a7e9 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -1004,7 +1004,7 @@ trans_this_image (gfc_se * se, gfc_expr *expr)
gcc_assert (!expr->value.function.actual->next->expr);
gcc_assert (corank > 0);
gcc_assert (se->loop->dimen == 1);
- gcc_assert (se->ss->expr == expr);
+ gcc_assert (se->ss->info->expr == expr);
dim_arg = se->loop->loopvar[0];
dim_arg = fold_build2_loc (input_location, PLUS_EXPR,
@@ -1321,7 +1321,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
/* Create an implicit second parameter from the loop variable. */
gcc_assert (!arg2->expr);
gcc_assert (se->loop->dimen == 1);
- gcc_assert (se->ss->expr == expr);
+ gcc_assert (se->ss->info->expr == expr);
gfc_advance_se_ss_chain (se);
bound = se->loop->loopvar[0];
bound = fold_build2_loc (input_location, MINUS_EXPR,
@@ -1515,7 +1515,7 @@ conv_intrinsic_cobound (gfc_se * se, gfc_expr * expr)
gcc_assert (!arg2->expr);
gcc_assert (corank > 0);
gcc_assert (se->loop->dimen == 1);
- gcc_assert (se->ss->expr == expr);
+ gcc_assert (se->ss->info->expr == expr);
bound = se->loop->loopvar[0];
bound = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
@@ -2323,7 +2323,7 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
gfc_symbol *sym;
VEC(tree,gc) *append_args;
- gcc_assert (!se->ss || se->ss->expr == expr);
+ gcc_assert (!se->ss || se->ss->info->expr == expr);
if (se->ss)
gcc_assert (expr->rank > 0);
@@ -2557,6 +2557,20 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
se->expr = resvar;
}
+
+/* Update given gfc_se to have ss component pointing to the nested gfc_ss
+ struct and return the corresponding loopinfo. */
+
+static gfc_loopinfo *
+enter_nested_loop (gfc_se *se)
+{
+ se->ss = se->ss->nested_ss;
+ gcc_assert (se->ss == se->ss->loop->ss);
+
+ return se->ss->loop;
+}
+
+
/* Inline implementation of the sum and product intrinsics. */
static void
gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
@@ -2568,20 +2582,23 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
stmtblock_t body;
stmtblock_t block;
tree tmp;
- gfc_loopinfo loop;
- gfc_actual_arglist *actual;
- gfc_ss *arrayss;
- gfc_ss *maskss;
+ gfc_loopinfo loop, *ploop;
+ gfc_actual_arglist *arg_array, *arg_mask;
+ gfc_ss *arrayss = NULL;
+ gfc_ss *maskss = NULL;
gfc_se arrayse;
gfc_se maskse;
+ gfc_se *parent_se;
gfc_expr *arrayexpr;
gfc_expr *maskexpr;
- if (se->ss)
+ if (expr->rank > 0)
{
- gfc_conv_intrinsic_funcall (se, expr);
- return;
+ gcc_assert (gfc_inline_intrinsic_function_p (expr));
+ parent_se = se;
}
+ else
+ parent_se = NULL;
type = gfc_typenode_for_spec (&expr->ts);
/* Initialize the result. */
@@ -2608,52 +2625,66 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
gfc_add_modify (&se->pre, resvar, tmp);
- /* Walk the arguments. */
- actual = expr->value.function.actual;
- arrayexpr = actual->expr;
- arrayss = gfc_walk_expr (arrayexpr);
- gcc_assert (arrayss != gfc_ss_terminator);
+ arg_array = expr->value.function.actual;
+
+ arrayexpr = arg_array->expr;
if (op == NE_EXPR || norm2)
/* PARITY and NORM2. */
maskexpr = NULL;
else
{
- actual = actual->next->next;
- gcc_assert (actual);
- maskexpr = actual->expr;
+ arg_mask = arg_array->next->next;
+ gcc_assert (arg_mask != NULL);
+ maskexpr = arg_mask->expr;
}
- if (maskexpr && maskexpr->rank != 0)
+ if (expr->rank == 0)
{
- maskss = gfc_walk_expr (maskexpr);
- gcc_assert (maskss != gfc_ss_terminator);
+ /* Walk the arguments. */
+ arrayss = gfc_walk_expr (arrayexpr);
+ gcc_assert (arrayss != gfc_ss_terminator);
+
+ if (maskexpr && maskexpr->rank > 0)
+ {
+ maskss = gfc_walk_expr (maskexpr);
+ gcc_assert (maskss != gfc_ss_terminator);
+ }
+ else
+ maskss = NULL;
+
+ /* Initialize the scalarizer. */
+ gfc_init_loopinfo (&loop);
+ gfc_add_ss_to_loop (&loop, arrayss);
+ if (maskexpr && maskexpr->rank > 0)
+ gfc_add_ss_to_loop (&loop, maskss);
+
+ /* Initialize the loop. */
+ gfc_conv_ss_startstride (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
+
+ gfc_mark_ss_chain_used (arrayss, 1);
+ if (maskexpr && maskexpr->rank > 0)
+ gfc_mark_ss_chain_used (maskss, 1);
+
+ ploop = &loop;
}
else
- maskss = NULL;
-
- /* Initialize the scalarizer. */
- gfc_init_loopinfo (&loop);
- gfc_add_ss_to_loop (&loop, arrayss);
- if (maskss)
- gfc_add_ss_to_loop (&loop, maskss);
+ /* All the work has been done in the parent loops. */
+ ploop = enter_nested_loop (se);
- /* Initialize the loop. */
- gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop, &expr->where);
+ gcc_assert (ploop);
- gfc_mark_ss_chain_used (arrayss, 1);
- if (maskss)
- gfc_mark_ss_chain_used (maskss, 1);
/* Generate the loop body. */
- gfc_start_scalarized_body (&loop, &body);
+ gfc_start_scalarized_body (ploop, &body);
/* If we have a mask, only add this element if the mask is set. */
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
- gfc_init_se (&maskse, NULL);
- gfc_copy_loopinfo_to_se (&maskse, &loop);
- maskse.ss = maskss;
+ gfc_init_se (&maskse, parent_se);
+ gfc_copy_loopinfo_to_se (&maskse, ploop);
+ if (expr->rank == 0)
+ maskse.ss = maskss;
gfc_conv_expr_val (&maskse, maskexpr);
gfc_add_block_to_block (&body, &maskse.pre);
@@ -2663,9 +2694,10 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
gfc_init_block (&block);
/* Do the actual summation/product. */
- gfc_init_se (&arrayse, NULL);
- gfc_copy_loopinfo_to_se (&arrayse, &loop);
- arrayse.ss = arrayss;
+ gfc_init_se (&arrayse, parent_se);
+ gfc_copy_loopinfo_to_se (&arrayse, ploop);
+ if (expr->rank == 0)
+ arrayse.ss = arrayss;
gfc_conv_expr_val (&arrayse, arrayexpr);
gfc_add_block_to_block (&block, &arrayse.pre);
@@ -2740,7 +2772,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
gfc_add_block_to_block (&block, &arrayse.post);
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
/* We enclose the above in if (mask) {...} . */
@@ -2752,30 +2784,43 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
tmp = gfc_finish_block (&block);
gfc_add_expr_to_block (&body, tmp);
- gfc_trans_scalarizing_loops (&loop, &body);
+ gfc_trans_scalarizing_loops (ploop, &body);
/* For a scalar mask, enclose the loop in an if statement. */
- if (maskexpr && maskss == NULL)
+ if (maskexpr && maskexpr->rank == 0)
{
- gfc_init_se (&maskse, NULL);
- gfc_conv_expr_val (&maskse, maskexpr);
gfc_init_block (&block);
- gfc_add_block_to_block (&block, &loop.pre);
- gfc_add_block_to_block (&block, &loop.post);
+ gfc_add_block_to_block (&block, &ploop->pre);
+ gfc_add_block_to_block (&block, &ploop->post);
tmp = gfc_finish_block (&block);
- tmp = build3_v (COND_EXPR, maskse.expr, tmp,
- build_empty_stmt (input_location));
+ if (expr->rank > 0)
+ {
+ tmp = build3_v (COND_EXPR, se->ss->info->data.scalar.value, tmp,
+ build_empty_stmt (input_location));
+ gfc_advance_se_ss_chain (se);
+ }
+ else
+ {
+ gcc_assert (expr->rank == 0);
+ gfc_init_se (&maskse, NULL);
+ gfc_conv_expr_val (&maskse, maskexpr);
+ tmp = build3_v (COND_EXPR, maskse.expr, tmp,
+ build_empty_stmt (input_location));
+ }
+
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&se->pre, &block);
+ gcc_assert (se->post.head == NULL);
}
else
{
- gfc_add_block_to_block (&se->pre, &loop.pre);
- gfc_add_block_to_block (&se->pre, &loop.post);
+ gfc_add_block_to_block (&se->pre, &ploop->pre);
+ gfc_add_block_to_block (&se->pre, &ploop->post);
}
- gfc_cleanup_loop (&loop);
+ if (expr->rank == 0)
+ gfc_cleanup_loop (ploop);
if (norm2)
{
@@ -3061,6 +3106,23 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
+
+ /* The code generated can have more than one loop in sequence (see the
+ comment at the function header). This doesn't work well with the
+ scalarizer, which changes arrays' offset when the scalarization loops
+ are generated (see gfc_trans_preloop_setup). Fortunately, {min,max}loc
+ are currently inlined in the scalar case only (for which loop is of rank
+ one). As there is no dependency to care about in that case, there is no
+ temporary, so that we can use the scalarizer temporary code to handle
+ multiple loops. Thus, we set temp_dim here, we call gfc_mark_ss_chain_used
+ with flag=3 later, and we use gfc_trans_scalarized_loop_boundary even later
+ to restore offset.
+ TODO: this prevents inlining of rank > 0 minmaxloc calls, so this
+ should eventually go away. We could either create two loops properly,
+ or find another way to save/restore the array offsets between the two
+ loops (without conflicting with temporary management), or use a single
+ loop minmaxloc implementation. See PR 31067. */
+ loop.temp_dim = loop.dimen;
gfc_conv_loop_setup (&loop, &expr->where);
gcc_assert (loop.dimen == 1);
@@ -3090,9 +3152,17 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
TREE_USED (lab2) = 1;
}
- gfc_mark_ss_chain_used (arrayss, 1);
+ /* An offset must be added to the loop
+ counter to obtain the required position. */
+ gcc_assert (loop.from[0]);
+
+ tmp = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
+ gfc_index_one_node, loop.from[0]);
+ gfc_add_modify (&loop.pre, offset, tmp);
+
+ gfc_mark_ss_chain_used (arrayss, lab1 ? 3 : 1);
if (maskss)
- gfc_mark_ss_chain_used (maskss, 1);
+ gfc_mark_ss_chain_used (maskss, lab1 ? 3 : 1);
/* Generate the loop body. */
gfc_start_scalarized_body (&loop, &body);
@@ -3123,16 +3193,6 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
/* Assign the value to the limit... */
gfc_add_modify (&ifblock, limit, arrayse.expr);
- /* Remember where we are. An offset must be added to the loop
- counter to obtain the required position. */
- if (loop.from[0])
- tmp = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
- gfc_index_one_node, loop.from[0]);
- else
- tmp = gfc_index_one_node;
-
- gfc_add_modify (&block, offset, tmp);
-
if (nonempty == NULL && HONOR_NANS (DECL_MODE (limit)))
{
stmtblock_t ifblock2;
@@ -3188,7 +3248,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
if (lab1)
{
- gfc_trans_scalarized_loop_end (&loop, 0, &body);
+ gfc_trans_scalarized_loop_boundary (&loop, &body);
if (HONOR_NANS (DECL_MODE (limit)))
{
@@ -3203,7 +3263,6 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
gfc_add_expr_to_block (&loop.code[0], build1_v (GOTO_EXPR, lab2));
gfc_add_expr_to_block (&loop.code[0], build1_v (LABEL_EXPR, lab1));
- gfc_start_block (&body);
/* If we have a mask, only check this element if the mask is set. */
if (maskss)
@@ -3232,16 +3291,6 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
/* Assign the value to the limit... */
gfc_add_modify (&ifblock, limit, arrayse.expr);
- /* Remember where we are. An offset must be added to the loop
- counter to obtain the required position. */
- if (loop.from[0])
- tmp = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
- gfc_index_one_node, loop.from[0]);
- else
- tmp = gfc_index_one_node;
-
- gfc_add_modify (&block, offset, tmp);
-
tmp = fold_build2_loc (input_location, PLUS_EXPR, TREE_TYPE (pos),
loop.loopvar[0], offset);
gfc_add_modify (&ifblock, pos, tmp);
@@ -3518,6 +3567,22 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
+
+ /* The code generated can have more than one loop in sequence (see the
+ comment at the function header). This doesn't work well with the
+ scalarizer, which changes arrays' offset when the scalarization loops
+ are generated (see gfc_trans_preloop_setup). Fortunately, {min,max}val
+ are currently inlined in the scalar case only. As there is no dependency
+ to care about in that case, there is no temporary, so that we can use the
+ scalarizer temporary code to handle multiple loops. Thus, we set temp_dim
+ here, we call gfc_mark_ss_chain_used with flag=3 later, and we use
+ gfc_trans_scalarized_loop_boundary even later to restore offset.
+ TODO: this prevents inlining of rank > 0 minmaxval calls, so this
+ should eventually go away. We could either create two loops properly,
+ or find another way to save/restore the array offsets between the two
+ loops (without conflicting with temporary management), or use a single
+ loop minmaxval implementation. See PR 31067. */
+ loop.temp_dim = loop.dimen;
gfc_conv_loop_setup (&loop, &expr->where);
if (nonempty == NULL && maskss == NULL
@@ -3549,9 +3614,9 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op)
}
}
- gfc_mark_ss_chain_used (arrayss, 1);
+ gfc_mark_ss_chain_used (arrayss, lab ? 3 : 1);
if (maskss)
- gfc_mark_ss_chain_used (maskss, 1);
+ gfc_mark_ss_chain_used (maskss, lab ? 3 : 1);
/* Generate the loop body. */
gfc_start_scalarized_body (&loop, &body);
@@ -3661,15 +3726,13 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op)
if (lab)
{
- gfc_trans_scalarized_loop_end (&loop, 0, &body);
+ gfc_trans_scalarized_loop_boundary (&loop, &body);
tmp = fold_build3_loc (input_location, COND_EXPR, type, nonempty,
nan_cst, huge_cst);
gfc_add_modify (&loop.code[0], limit, tmp);
gfc_add_expr_to_block (&loop.code[0], build1_v (LABEL_EXPR, lab));
- gfc_start_block (&body);
-
/* If we have a mask, only add this element if the mask is set. */
if (maskss)
{
@@ -5269,14 +5332,14 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
gfc_actual_arglist *arg;
gfc_se argse;
gfc_ss *ss;
- gfc_ss_info *info;
+ gfc_array_info *info;
stmtblock_t block;
int n;
bool scalar_mold;
info = NULL;
if (se->loop)
- info = &se->ss->data.info;
+ info = &se->ss->info->data.array;
/* Convert SOURCE. The output from this stage is:-
source_bytes = length of the source in bytes
@@ -5501,9 +5564,8 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
/* Build a destination descriptor, using the pointer, source, as the
data field. */
- gfc_trans_create_temp_array (&se->pre, &se->post, se->loop,
- info, mold_type, NULL_TREE, false, true, false,
- &expr->where);
+ gfc_trans_create_temp_array (&se->pre, &se->post, se->ss, mold_type,
+ NULL_TREE, false, true, false, &expr->where);
/* Cast the pointer to the result. */
tmp = gfc_conv_descriptor_data_get (info->descriptor);
@@ -6634,7 +6696,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
break;
case GFC_ISYM_TRANSFER:
- if (se->ss && se->ss->useflags)
+ if (se->ss && se->ss->info->useflags)
/* Access the previously obtained result. */
gfc_conv_tmp_array_ref (se);
else
@@ -6753,19 +6815,17 @@ walk_inline_intrinsic_transpose (gfc_ss *ss, gfc_expr *expr)
for (tmp_ss = arg_ss; ; tmp_ss = tmp_ss->next)
{
- if (tmp_ss->type != GFC_SS_SCALAR
- && tmp_ss->type != GFC_SS_REFERENCE)
+ if (tmp_ss->info->type != GFC_SS_SCALAR
+ && tmp_ss->info->type != GFC_SS_REFERENCE)
{
int tmp_dim;
- gfc_ss_info *info;
- info = &tmp_ss->data.info;
- gcc_assert (info->dimen == 2);
+ gcc_assert (tmp_ss->dimen == 2);
/* We just invert dimensions. */
- tmp_dim = info->dim[0];
- info->dim[0] = info->dim[1];
- info->dim[1] = tmp_dim;
+ tmp_dim = tmp_ss->dim[0];
+ tmp_ss->dim[0] = tmp_ss->dim[1];
+ tmp_ss->dim[1] = tmp_dim;
}
/* Stop when tmp_ss points to the last valid element of the chain... */
@@ -6780,12 +6840,127 @@ walk_inline_intrinsic_transpose (gfc_ss *ss, gfc_expr *expr)
}
+/* Move the given dimension of the given gfc_ss list to a nested gfc_ss list.
+ This has the side effect of reversing the nested list, so there is no
+ need to call gfc_reverse_ss on it (the given list is assumed not to be
+ reversed yet). */
+
+static gfc_ss *
+nest_loop_dimension (gfc_ss *ss, int dim)
+{
+ int ss_dim, i;
+ gfc_ss *new_ss, *prev_ss = gfc_ss_terminator;
+ gfc_loopinfo *new_loop;
+
+ gcc_assert (ss != gfc_ss_terminator);
+
+ for (; ss != gfc_ss_terminator; ss = ss->next)
+ {
+ new_ss = gfc_get_ss ();
+ new_ss->next = prev_ss;
+ new_ss->parent = ss;
+ new_ss->info = ss->info;
+ new_ss->info->refcount++;
+ if (ss->dimen != 0)
+ {
+ gcc_assert (ss->info->type != GFC_SS_SCALAR
+ && ss->info->type != GFC_SS_REFERENCE);
+
+ new_ss->dimen = 1;
+ new_ss->dim[0] = ss->dim[dim];
+
+ gcc_assert (dim < ss->dimen);
+
+ ss_dim = --ss->dimen;
+ for (i = dim; i < ss_dim; i++)
+ ss->dim[i] = ss->dim[i + 1];
+
+ ss->dim[ss_dim] = 0;
+ }
+ prev_ss = new_ss;
+
+ if (ss->nested_ss)
+ {
+ ss->nested_ss->parent = new_ss;
+ new_ss->nested_ss = ss->nested_ss;
+ }
+ ss->nested_ss = new_ss;
+ }
+
+ new_loop = gfc_get_loopinfo ();
+ gfc_init_loopinfo (new_loop);
+
+ gcc_assert (prev_ss != NULL);
+ gcc_assert (prev_ss != gfc_ss_terminator);
+ gfc_add_ss_to_loop (new_loop, prev_ss);
+ return new_ss->parent;
+}
+
+
+/* Create the gfc_ss list for the SUM/PRODUCT arguments when the function
+ is to be inlined. */
+
+static gfc_ss *
+walk_inline_intrinsic_arith (gfc_ss *ss, gfc_expr *expr)
+{
+ gfc_ss *tmp_ss, *tail, *array_ss;
+ gfc_actual_arglist *arg1, *arg2, *arg3;
+ int sum_dim;
+ bool scalar_mask = false;
+
+ /* The rank of the result will be determined later. */
+ arg1 = expr->value.function.actual;
+ arg2 = arg1->next;
+ arg3 = arg2->next;
+ gcc_assert (arg3 != NULL);
+
+ if (expr->rank == 0)
+ return ss;
+
+ tmp_ss = gfc_ss_terminator;
+
+ if (arg3->expr)
+ {
+ gfc_ss *mask_ss;
+
+ mask_ss = gfc_walk_subexpr (tmp_ss, arg3->expr);
+ if (mask_ss == tmp_ss)
+ scalar_mask = 1;
+
+ tmp_ss = mask_ss;
+ }
+
+ array_ss = gfc_walk_subexpr (tmp_ss, arg1->expr);
+ gcc_assert (array_ss != tmp_ss);
+
+ /* Odd thing: If the mask is scalar, it is used by the frontend after
+ the array (to make an if around the nested loop). Thus it shall
+ be after array_ss once the gfc_ss list is reversed. */
+ if (scalar_mask)
+ tmp_ss = gfc_get_scalar_ss (array_ss, arg3->expr);
+ else
+ tmp_ss = array_ss;
+
+ /* "Hide" the dimension on which we will sum in the first arg's scalarization
+ chain. */
+ sum_dim = mpz_get_si (arg2->expr->value.integer) - 1;
+ tail = nest_loop_dimension (tmp_ss, sum_dim);
+ tail->next = ss;
+
+ return tmp_ss;
+}
+
+
static gfc_ss *
walk_inline_intrinsic_function (gfc_ss * ss, gfc_expr * expr)
{
switch (expr->value.function.isym->id)
{
+ case GFC_ISYM_PRODUCT:
+ case GFC_ISYM_SUM:
+ return walk_inline_intrinsic_arith (ss, expr);
+
case GFC_ISYM_TRANSPOSE:
return walk_inline_intrinsic_transpose (ss, expr);
@@ -6802,7 +6977,7 @@ walk_inline_intrinsic_function (gfc_ss * ss, gfc_expr * expr)
void
gfc_add_intrinsic_ss_code (gfc_loopinfo * loop ATTRIBUTE_UNUSED, gfc_ss * ss)
{
- switch (ss->expr->value.function.isym->id)
+ switch (ss->info->expr->value.function.isym->id)
{
case GFC_ISYM_UBOUND:
case GFC_ISYM_LBOUND:
@@ -6847,11 +7022,26 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr)
bool
gfc_inline_intrinsic_function_p (gfc_expr *expr)
{
+ gfc_actual_arglist *args;
+
if (!expr->value.function.isym)
return false;
switch (expr->value.function.isym->id)
{
+ case GFC_ISYM_PRODUCT:
+ case GFC_ISYM_SUM:
+ /* Disable inline expansion if code size matters. */
+ if (optimize_size)
+ return false;
+
+ args = expr->value.function.actual;
+ /* We need to be able to subset the SUM argument at compile-time. */
+ if (args->next->expr && args->next->expr->expr_type != EXPR_CONSTANT)
+ return false;
+
+ return true;
+
case GFC_ISYM_TRANSPOSE:
return true;
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index bbf5a02eff4..12dfcf82333 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1937,6 +1937,7 @@ transfer_array_component (tree expr, gfc_component * cm, locus * where)
int n;
gfc_ss *ss;
gfc_se se;
+ gfc_array_info *ss_array;
gfc_start_block (&block);
gfc_init_se (&se, NULL);
@@ -1948,19 +1949,20 @@ transfer_array_component (tree expr, gfc_component * cm, locus * where)
ss = gfc_get_array_ss (gfc_ss_terminator, NULL, cm->as->rank,
GFC_SS_COMPONENT);
- ss->shape = gfc_get_shape (cm->as->rank);
- ss->data.info.descriptor = expr;
- ss->data.info.data = gfc_conv_array_data (expr);
- ss->data.info.offset = gfc_conv_array_offset (expr);
+ ss_array = &ss->info->data.array;
+ ss_array->shape = gfc_get_shape (cm->as->rank);
+ ss_array->descriptor = expr;
+ ss_array->data = gfc_conv_array_data (expr);
+ ss_array->offset = gfc_conv_array_offset (expr);
for (n = 0; n < cm->as->rank; n++)
{
- ss->data.info.start[n] = gfc_conv_array_lbound (expr, n);
- ss->data.info.stride[n] = gfc_index_one_node;
+ ss_array->start[n] = gfc_conv_array_lbound (expr, n);
+ ss_array->stride[n] = gfc_index_one_node;
- mpz_init (ss->shape[n]);
- mpz_sub (ss->shape[n], cm->as->upper[n]->value.integer,
+ mpz_init (ss_array->shape[n]);
+ mpz_sub (ss_array->shape[n], cm->as->upper[n]->value.integer,
cm->as->lower[n]->value.integer);
- mpz_add_ui (ss->shape[n], ss->shape[n], 1);
+ mpz_add_ui (ss_array->shape[n], ss_array->shape[n], 1);
}
/* Once we got ss, we use scalarizer to create the loop. */
@@ -1995,8 +1997,8 @@ transfer_array_component (tree expr, gfc_component * cm, locus * where)
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
- gcc_assert (ss->shape != NULL);
- gfc_free_shape (&ss->shape, cm->as->rank);
+ gcc_assert (ss_array->shape != NULL);
+ gfc_free_shape (&ss_array->shape, cm->as->rank);
gfc_cleanup_loop (&loop);
return gfc_finish_block (&block);
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index c71eeec400f..0d793f96858 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -178,6 +178,41 @@ gfc_trans_entry (gfc_code * code)
}
+/* Replace a gfc_ss structure by another both in the gfc_se struct
+ and the gfc_loopinfo struct. This is used in gfc_conv_elemental_dependencies
+ to replace a variable ss by the corresponding temporary. */
+
+static void
+replace_ss (gfc_se *se, gfc_ss *old_ss, gfc_ss *new_ss)
+{
+ gfc_ss **sess, **loopss;
+
+ /* The old_ss is a ss for a single variable. */
+ gcc_assert (old_ss->info->type == GFC_SS_SECTION);
+
+ for (sess = &(se->ss); *sess != gfc_ss_terminator; sess = &((*sess)->next))
+ if (*sess == old_ss)
+ break;
+ gcc_assert (*sess != gfc_ss_terminator);
+
+ *sess = new_ss;
+ new_ss->next = old_ss->next;
+
+
+ for (loopss = &(se->loop->ss); *loopss != gfc_ss_terminator;
+ loopss = &((*loopss)->loop_chain))
+ if (*loopss == old_ss)
+ break;
+ gcc_assert (*loopss != gfc_ss_terminator);
+
+ *loopss = new_ss;
+ new_ss->loop_chain = old_ss->loop_chain;
+ new_ss->loop = old_ss->loop;
+
+ gfc_free_ss (old_ss);
+}
+
+
/* Check for dependencies between INTENT(IN) and INTENT(OUT) arguments of
elemental subroutines. Make temporaries for output arguments if any such
dependencies are found. Output arguments are chosen because internal_unpack
@@ -190,15 +225,10 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
gfc_actual_arglist *arg0;
gfc_expr *e;
gfc_formal_arglist *formal;
- gfc_loopinfo tmp_loop;
gfc_se parmse;
gfc_ss *ss;
- gfc_ss_info *info;
gfc_symbol *fsym;
- gfc_ref *ref;
- int n;
tree data;
- tree offset;
tree size;
tree tmp;
@@ -217,14 +247,9 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
continue;
/* Obtain the info structure for the current argument. */
- info = NULL;
for (ss = loopse->ss; ss && ss != gfc_ss_terminator; ss = ss->next)
- {
- if (ss->expr != e)
- continue;
- info = &ss->data.info;
+ if (ss->info->expr == e)
break;
- }
/* If there is a dependency, create a temporary and use it
instead of the variable. */
@@ -237,49 +262,17 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
{
tree initial, temptype;
stmtblock_t temp_post;
+ gfc_ss *tmp_ss;
- /* Make a local loopinfo for the temporary creation, so that
- none of the other ss->info's have to be renormalized. */
- gfc_init_loopinfo (&tmp_loop);
- tmp_loop.dimen = info->dimen;
- for (n = 0; n < info->dimen; n++)
- {
- tmp_loop.to[n] = loopse->loop->to[n];
- tmp_loop.from[n] = loopse->loop->from[n];
- tmp_loop.order[n] = loopse->loop->order[n];
- }
+ tmp_ss = gfc_get_array_ss (gfc_ss_terminator, NULL, ss->dimen,
+ GFC_SS_SECTION);
+ gfc_mark_ss_chain_used (tmp_ss, 1);
+ tmp_ss->info->expr = ss->info->expr;
+ replace_ss (loopse, ss, tmp_ss);
/* Obtain the argument descriptor for unpacking. */
gfc_init_se (&parmse, NULL);
parmse.want_pointer = 1;
-
- /* The scalarizer introduces some specific peculiarities when
- handling elemental subroutines; the stride can be needed up to
- the dim_array - 1, rather than dim_loop - 1 to calculate
- offsets outside the loop. For this reason, we make sure that
- the descriptor has the dimensionality of the array by converting
- trailing elements into ranges with end = start. */
- for (ref = e->ref; ref; ref = ref->next)
- if (ref->type == REF_ARRAY && ref->u.ar.type == AR_SECTION)
- break;
-
- if (ref)
- {
- bool seen_range = false;
- for (n = 0; n < ref->u.ar.dimen; n++)
- {
- if (ref->u.ar.dimen_type[n] == DIMEN_RANGE)
- seen_range = true;
-
- if (!seen_range
- || ref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
- continue;
-
- ref->u.ar.end[n] = gfc_copy_expr (ref->u.ar.start[n]);
- ref->u.ar.dimen_type[n] = DIMEN_RANGE;
- }
- }
-
gfc_conv_expr_descriptor (&parmse, e, gfc_walk_expr (e));
gfc_add_block_to_block (&se->pre, &parmse.pre);
@@ -309,29 +302,15 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
size = gfc_create_var (gfc_array_index_type, NULL);
data = gfc_create_var (pvoid_type_node, NULL);
gfc_init_block (&temp_post);
- tmp = gfc_trans_create_temp_array (&se->pre, &temp_post,
- &tmp_loop, info, temptype,
- initial,
- false, true, false,
- &arg->expr->where);
+ tmp = gfc_trans_create_temp_array (&se->pre, &temp_post, tmp_ss,
+ temptype, initial, false, true,
+ false, &arg->expr->where);
gfc_add_modify (&se->pre, size, tmp);
- tmp = fold_convert (pvoid_type_node, info->data);
+ tmp = fold_convert (pvoid_type_node, tmp_ss->info->data.array.data);
gfc_add_modify (&se->pre, data, tmp);
- /* Calculate the offset for the temporary. */
- offset = gfc_index_zero_node;
- for (n = 0; n < info->dimen; n++)
- {
- tmp = gfc_conv_descriptor_stride_get (info->descriptor,
- gfc_rank_cst[n]);
- tmp = fold_build2_loc (input_location, MULT_EXPR,
- gfc_array_index_type,
- loopse->loop->from[n], tmp);
- offset = fold_build2_loc (input_location, MINUS_EXPR,
- gfc_array_index_type, offset, tmp);
- }
- info->offset = gfc_create_var (gfc_array_index_type, NULL);
- gfc_add_modify (&se->pre, info->offset, offset);
+ /* Update other ss' delta. */
+ gfc_set_delta (loopse->loop);
/* Copy the result back using unpack. */
tmp = build_call_expr_loc (input_location,
@@ -3306,7 +3285,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
gfc_ss *lss, *rss;
gfc_se lse;
gfc_se rse;
- gfc_ss_info *info;
+ gfc_array_info *info;
gfc_loopinfo loop;
tree desc;
tree parm;
@@ -3388,7 +3367,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
gfc_conv_loop_setup (&loop, &expr2->where);
- info = &rss->data.info;
+ info = &rss->info->data.array;
desc = info->descriptor;
/* Make a new descriptor. */
@@ -4048,7 +4027,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
/* Find a non-scalar SS from the lhs. */
while (lss_section != gfc_ss_terminator
- && lss_section->type != GFC_SS_SECTION)
+ && lss_section->info->type != GFC_SS_SECTION)
lss_section = lss_section->next;
gcc_assert (lss_section != gfc_ss_terminator);
@@ -4062,7 +4041,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
{
/* The rhs is scalar. Add a ss for the expression. */
rss = gfc_get_scalar_ss (gfc_ss_terminator, expr2);
- rss->where = 1;
+ rss->info->where = 1;
}
/* Associate the SS with the loop. */
@@ -4501,7 +4480,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
if (tsss == gfc_ss_terminator)
{
tsss = gfc_get_scalar_ss (gfc_ss_terminator, tsrc);
- tsss->where = 1;
+ tsss->info->where = 1;
}
gfc_add_ss_to_loop (&loop, tdss);
gfc_add_ss_to_loop (&loop, tsss);
@@ -4516,7 +4495,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
if (esss == gfc_ss_terminator)
{
esss = gfc_get_scalar_ss (gfc_ss_terminator, esrc);
- esss->where = 1;
+ esss->info->where = 1;
}
gfc_add_ss_to_loop (&loop, edss);
gfc_add_ss_to_loop (&loop, esss);
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 535c207fcd4..22033d38d15 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -108,17 +108,13 @@ typedef enum
gfc_coarray_type;
-/* Scalarization State chain. Created by walking an expression tree before
- creating the scalarization loops. Then passed as part of a gfc_se structure
- to translate the expression inside the loop. Note that these chains are
- terminated by gfc_se_terminator, not NULL. A NULL pointer in a gfc_se
- indicates to gfc_conv_* that this is a scalar expression.
- Note that some member arrays correspond to scalarizer rank and others
- are the variable rank. */
+/* The array-specific scalarization informations. The array members of
+ this struct are indexed by actual array index, and thus can be sparse. */
-typedef struct gfc_ss_info
+typedef struct gfc_array_info
{
- int dimen;
+ mpz_t *shape;
+
/* The ref that holds information on this section. */
gfc_ref *ref;
/* The descriptor of this array. */
@@ -139,12 +135,8 @@ typedef struct gfc_ss_info
tree end[GFC_MAX_DIMENSIONS];
tree stride[GFC_MAX_DIMENSIONS];
tree delta[GFC_MAX_DIMENSIONS];
-
- /* Translation from loop dimensions to actual dimensions.
- actual_dim = dim[loop_dim] */
- int dim[GFC_MAX_DIMENSIONS];
}
-gfc_ss_info;
+gfc_array_info;
typedef enum
{
@@ -190,47 +182,82 @@ typedef enum
}
gfc_ss_type;
-/* SS structures can only belong to a single loopinfo. They must be added
- otherwise they will not get freed. */
-typedef struct gfc_ss
+
+typedef struct gfc_ss_info
{
+ int refcount;
gfc_ss_type type;
gfc_expr *expr;
- mpz_t *shape;
tree string_length;
+
union
{
/* If type is GFC_SS_SCALAR or GFC_SS_REFERENCE. */
struct
{
- tree expr;
+ tree value;
}
scalar;
/* GFC_SS_TEMP. */
struct
{
- /* The rank of the temporary. May be less than the rank of the
- assigned expression. */
- int dimen;
tree type;
}
temp;
+
/* All other types. */
- gfc_ss_info info;
+ gfc_array_info array;
}
data;
+ /* This is used by assignments requiring temporaries. The bits specify which
+ loops the terms appear in. This will be 1 for the RHS expressions,
+ 2 for the LHS expressions, and 3(=1|2) for the temporary. */
+ unsigned useflags:2;
+
+ /* Suppresses precalculation of scalars in WHERE assignments. */
+ unsigned where:1;
+}
+gfc_ss_info;
+
+#define gfc_get_ss_info() XCNEW (gfc_ss_info)
+
+
+/* Scalarization State chain. Created by walking an expression tree before
+ creating the scalarization loops. Then passed as part of a gfc_se structure
+ to translate the expression inside the loop. Note that these chains are
+ terminated by gfc_ss_terminator, not NULL. A NULL pointer in a gfc_se
+ indicates to gfc_conv_* that this is a scalar expression.
+ SS structures can only belong to a single loopinfo. They must be added
+ otherwise they will not get freed. */
+
+typedef struct gfc_ss
+{
+ gfc_ss_info *info;
+
+ int dimen;
+ /* Translation from loop dimensions to actual array dimensions.
+ actual_dim = dim[loop_dim] */
+ int dim[GFC_MAX_DIMENSIONS];
+
/* All the SS in a loop and linked through loop_chain. The SS for an
expression are linked by the next pointer. */
struct gfc_ss *loop_chain;
struct gfc_ss *next;
- /* This is used by assignments requiring temporaries. The bits specify which
- loops the terms appear in. This will be 1 for the RHS expressions,
- 2 for the LHS expressions, and 3(=1|2) for the temporary. The bit
- 'where' suppresses precalculation of scalars in WHERE assignments. */
- unsigned useflags:2, where:1, is_alloc_lhs:1;
+ /* Non-null if the ss is part of a nested loop. */
+ struct gfc_ss *parent;
+
+ /* If the evaluation of an expression requires a nested loop (for example
+ if the sum intrinsic is evaluated inline), this points to the nested
+ loop's gfc_ss. */
+ struct gfc_ss *nested_ss;
+
+ /* The loop this gfc_ss is in. */
+ struct gfc_loopinfo *loop;
+
+ unsigned is_alloc_lhs:1;
}
gfc_ss;
#define gfc_get_ss() XCNEW (gfc_ss)
@@ -252,6 +279,12 @@ typedef struct gfc_loopinfo
/* The SS describing the temporary used in an assignment. */
gfc_ss *temp_ss;
+ /* Non-null if this loop is nested in another one. */
+ struct gfc_loopinfo *parent;
+
+ /* Chain of nested loops. */
+ struct gfc_loopinfo *nested, *next;
+
/* The scalarization loop index variables. */
tree loopvar[GFC_MAX_DIMENSIONS];
@@ -277,6 +310,7 @@ typedef struct gfc_loopinfo
}
gfc_loopinfo;
+#define gfc_get_loopinfo() XCNEW (gfc_loopinfo)
/* Information about a symbol that has been shadowed by a temporary. */
typedef struct
@@ -363,9 +397,6 @@ tree gfc_builtin_decl_for_float_kind (enum built_in_function, int);
tree gfc_conv_intrinsic_subroutine (gfc_code *);
void gfc_conv_intrinsic_function (gfc_se *, gfc_expr *);
-/* Is the intrinsic expanded inline. */
-bool gfc_inline_intrinsic_function_p (gfc_expr *);
-
/* Does an intrinsic map directly to an external library call
This is true for array-returning intrinsics, unless
gfc_inline_intrinsic_function_p returns true. */
diff --git a/gcc/fortran/types.def b/gcc/fortran/types.def
index 5bcdb5261d9..a2762c6257b 100644
--- a/gcc/fortran/types.def
+++ b/gcc/fortran/types.def
@@ -57,6 +57,7 @@ DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node)
DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node)
DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node)
DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1))
+DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1))
DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1))
@@ -70,7 +71,10 @@ DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE)))
-
+DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
DEF_POINTER_TYPE (BT_PTR_ULONGLONG, BT_ULONGLONG)
DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR)
@@ -85,6 +89,8 @@ DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
+DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
+
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
@@ -98,6 +104,21 @@ DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4)
DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8)
DEF_FUNCTION_TYPE_2 (BT_FN_I16_VPTR_I16, BT_I16, BT_VOLATILE_PTR, BT_I16)
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_I1_CONST_VPTR_INT, BT_I1, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I2_CONST_VPTR_INT, BT_I2, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I4_CONST_VPTR_INT, BT_I4, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_VPTR_INT, BT_I8, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
+ BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_INT, BT_VOID, BT_VOLATILE_PTR, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_VPTR_INT, BT_BOOL, BT_VOLATILE_PTR, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_VPTR, BT_BOOL, BT_SIZE,
+ BT_CONST_VOLATILE_PTR)
+
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
@@ -119,15 +140,31 @@ DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR,
BT_I16, BT_I16)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR,
BT_PTR, BT_UINT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_INT, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_INT, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
+DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_INT)
+DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
+DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
@@ -138,6 +175,23 @@ DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
+ BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
+ BT_INT)
+DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
+ BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0fd4edda28f..46130dc1001 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3137,16 +3137,6 @@ driver_wrong_lang_callback (const struct cl_decoded_option *decoded,
&decoded->canonical_option[1], false);
}
-/* Note that an option (index OPT_INDEX, argument ARG, value VALUE)
- has been successfully handled with a handler for mask MASK. */
-
-static void
-driver_post_handling_callback (const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
- unsigned int mask ATTRIBUTE_UNUSED)
-{
- /* Nothing to do here. */
-}
-
static const char *spec_lang = 0;
static int last_language_n_infiles;
@@ -3533,7 +3523,6 @@ set_option_handlers (struct cl_option_handlers *handlers)
{
handlers->unknown_option_callback = driver_unknown_option_callback;
handlers->wrong_lang_callback = driver_wrong_lang_callback;
- handlers->post_handling_callback = driver_post_handling_callback;
handlers->num_handlers = 3;
handlers->handlers[0].handler = driver_handle_option;
handlers->handlers[0].mask = CL_DRIVER;
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index 200917053fb..a6c5b33c622 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -276,23 +276,28 @@ dump_file (const char *filename)
static void
tag_function (const char *filename ATTRIBUTE_UNUSED,
- unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
+ unsigned tag ATTRIBUTE_UNUSED, unsigned length)
{
unsigned long pos = gcov_position ();
- printf (" ident=%u", gcov_read_unsigned ());
- printf (", lineno_checksum=0x%08x", gcov_read_unsigned ());
- printf (", cfg_checksum_checksum=0x%08x", gcov_read_unsigned ());
-
- if (gcov_position () - pos < length)
+ if (!length)
+ printf (" placeholder");
+ else
{
- const char *name;
+ printf (" ident=%u", gcov_read_unsigned ());
+ printf (", lineno_checksum=0x%08x", gcov_read_unsigned ());
+ printf (", cfg_checksum_checksum=0x%08x", gcov_read_unsigned ());
- name = gcov_read_string ();
- printf (", `%s'", name ? name : "NULL");
- name = gcov_read_string ();
- printf (" %s", name ? name : "NULL");
- printf (":%u", gcov_read_unsigned ());
+ if (gcov_position () - pos < length)
+ {
+ const char *name;
+
+ name = gcov_read_string ();
+ printf (", `%s'", name ? name : "NULL");
+ name = gcov_read_string ();
+ printf (" %s", name ? name : "NULL");
+ printf (":%u", gcov_read_unsigned ());
+ }
}
}
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 4f5013e1156..3ff9fcd22f0 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -130,26 +130,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
blocks they are for.
The data file contains the following records.
- data: {unit function-data* summary:object summary:program*}*
+ data: {unit summary:object summary:program* function-data*}*
unit: header int32:checksum
- function-data: announce_function arc_counts
+ function-data: announce_function present counts
announce_function: header int32:ident
int32:lineno_checksum int32:cfg_checksum
- arc_counts: header int64:count*
- summary: int32:checksum {count-summary}GCOV_COUNTERS
+ present: header int32:present
+ counts: header int64:count*
+ summary: int32:checksum {count-summary}GCOV_COUNTERS_SUMMABLE
count-summary: int32:num int32:runs int64:sum
int64:max int64:sum_max
The ANNOUNCE_FUNCTION record is the same as that in the note file,
- but without the source location. The ARC_COUNTS gives the counter
- values for those arcs that are instrumented. The SUMMARY records
- give information about the whole object file and about the whole
+ but without the source location. The COUNTS gives the
+ counter values for instrumented features. The about the whole
program. The checksum is used for whole program summaries, and
disambiguates different programs which include the same
instrumented object file. There may be several program summaries,
- each with a unique checksum. The object summary's checksum is zero.
- Note that the data file might contain information from several runs
- concatenated, or the data might be merged.
+ each with a unique checksum. The object summary's checksum is
+ zero. Note that the data file might contain information from
+ several runs concatenated, or the data might be merged.
This file is included by both the compiler, gcov tools and the
runtime support library libgcov. IN_LIBGCOV and IN_GCOV are used to
@@ -307,7 +307,7 @@ typedef HOST_WIDEST_INT gcov_type;
#define GCOV_TAG_COUNTER_BASE ((gcov_unsigned_t)0x01a10000)
#define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 2)
#define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2)
-#define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000)
+#define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */
#define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000)
#define GCOV_TAG_SUMMARY_LENGTH \
(1 + GCOV_COUNTERS_SUMMABLE * (2 + 3 * 2))
@@ -343,7 +343,7 @@ typedef HOST_WIDEST_INT gcov_type;
/* A list of human readable names of the counters */
#define GCOV_COUNTER_NAMES {"arcs", "interval", "pow2", "single", \
- "delta","indirect_call", "average", "ior"}
+ "delta", "indirect_call", "average", "ior"}
/* Names of merge functions for counters. */
#define GCOV_MERGE_FUNCTIONS {"__gcov_merge_add", \
@@ -410,30 +410,31 @@ struct gcov_summary
by write_profile must match these. */
#if IN_LIBGCOV
+/* Information about counters for a single function. */
+struct gcov_ctr_info
+{
+ gcov_unsigned_t num; /* number of counters. */
+ gcov_type *values; /* their values. */
+};
+
/* Information about a single function. This uses the trailing array
- idiom. The number of counters is determined from the counter_mask
- in gcov_info. We hold an array of function info, so have to
- explicitly calculate the correct array stride. */
+ idiom. The number of counters is determined from the merge pointer
+ array in gcov_info. The key is used to detect which of a set of
+ comdat functions was selected -- it points to the gcov_info object
+ of the object file containing the selected comdat function. */
struct gcov_fn_info
{
- gcov_unsigned_t ident; /* unique ident of function */
+ const struct gcov_info *key; /* comdat key */
+ gcov_unsigned_t ident; /* unique ident of function */
gcov_unsigned_t lineno_checksum; /* function lineo_checksum */
- gcov_unsigned_t cfg_checksum; /* function cfg checksum */
- unsigned n_ctrs[0]; /* instrumented counters */
+ gcov_unsigned_t cfg_checksum; /* function cfg checksum */
+ struct gcov_ctr_info ctrs[0]; /* instrumented counters */
};
/* Type of function used to merge counters. */
typedef void (*gcov_merge_fn) (gcov_type *, gcov_unsigned_t);
-/* Information about counters. */
-struct gcov_ctr_info
-{
- gcov_unsigned_t num; /* number of counters. */
- gcov_type *values; /* their values. */
- gcov_merge_fn merge; /* The function used to merge them. */
-};
-
/* Information about a single object file. */
struct gcov_info
{
@@ -443,14 +444,12 @@ struct gcov_info
gcov_unsigned_t stamp; /* uniquifying time stamp */
const char *filename; /* output file name */
+ gcov_merge_fn merge[GCOV_COUNTERS]; /* merge functions (null for
+ unused) */
+
unsigned n_functions; /* number of functions */
- const struct gcov_fn_info *functions; /* table of functions */
-
- unsigned ctr_mask; /* mask of counters instrumented. */
- struct gcov_ctr_info counts[0]; /* count data. The number of bits
- set in the ctr_mask field
- determines how big this array
- is. */
+ const struct gcov_fn_info *functions[0]; /* pointers to function
+ information */
};
/* Register a new object file module. */
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 94a1c350c80..6711f7e6a47 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -265,7 +265,7 @@ static unsigned source_index;
/* This holds data summary information. */
-static struct gcov_summary object_summary;
+static unsigned object_runs;
static unsigned program_count;
/* Modification time of graph file. */
@@ -362,6 +362,7 @@ static int output_branch_count (FILE *, int, const arc_t *);
static void output_lines (FILE *, const source_t *);
static char *make_gcov_file_name (const char *, const char *);
static void release_structures (void);
+static void release_function (function_t *);
extern int main (int, char **);
int
@@ -537,7 +538,7 @@ static void
process_file (const char *file_name)
{
function_t *fn;
- function_t *fn_p;
+ function_t **fn_p;
function_t *old_functions;
/* Save and clear the list of current functions. They will be appended
@@ -558,11 +559,25 @@ process_file (const char *file_name)
if (read_count_file ())
return;
- for (fn_p = NULL, fn = functions; fn; fn_p = fn, fn = fn->next)
- solve_flow_graph (fn);
+ fn_p = &functions;
+ while ((fn = *fn_p) != NULL)
+ {
+ if (fn->counts)
+ {
+ solve_flow_graph (fn);
+ fn_p = &fn->next;
+ }
+ else
+ {
+ /* The function was not in the executable -- some other
+ instance must have been selected. */
+ function_t *next = fn->next;
+ release_function (fn);
+ *fn_p = next;
+ }
+ }
- if (fn_p)
- fn_p->next = old_functions;
+ *fn_p = old_functions;
}
static void
@@ -591,7 +606,7 @@ generate_results (const char *file_name)
{
accumulate_line_counts (src);
function_summary (&src->coverage, "File");
- if (flag_gcov_file)
+ if (flag_gcov_file && src->coverage.lines)
{
char *gcov_file_name = make_gcov_file_name (file_name, src->name);
FILE *gcov_file = fopen (gcov_file_name, "w");
@@ -615,6 +630,28 @@ generate_results (const char *file_name)
}
}
+/* Release a function structure */
+
+static void
+release_function (function_t *fn)
+{
+ unsigned ix;
+ block_t *block;
+
+ for (ix = fn->num_blocks, block = fn->blocks; ix--; block++)
+ {
+ arc_t *arc, *arc_n;
+
+ for (arc = block->succ; arc; arc = arc_n)
+ {
+ arc_n = arc->succ_next;
+ free (arc);
+ }
+ }
+ free (fn->blocks);
+ free (fn->counts);
+}
+
/* Release all memory used. */
static void
@@ -633,22 +670,8 @@ release_structures (void)
while ((fn = functions))
{
- unsigned ix;
- block_t *block;
-
functions = fn->next;
- for (ix = fn->num_blocks, block = fn->blocks; ix--; block++)
- {
- arc_t *arc, *arc_n;
-
- for (arc = block->succ; arc; arc = arc_n)
- {
- arc_n = arc->succ_next;
- free (arc);
- }
- }
- free (fn->blocks);
- free (fn->counts);
+ release_function (fn);
}
}
@@ -1085,35 +1108,39 @@ read_count_file (void)
unsigned length = gcov_read_unsigned ();
unsigned long base = gcov_position ();
- if (tag == GCOV_TAG_OBJECT_SUMMARY)
- gcov_read_summary (&object_summary);
- else if (tag == GCOV_TAG_PROGRAM_SUMMARY)
- program_count++;
- else if (tag == GCOV_TAG_FUNCTION)
+ if (tag == GCOV_TAG_PROGRAM_SUMMARY)
{
- {
- unsigned ident = gcov_read_unsigned ();
- struct function_info *fn_n = functions;
+ struct gcov_summary summary;
+ gcov_read_summary (&summary);
+ object_runs += summary.ctrs[GCOV_COUNTER_ARCS].runs;
+ program_count++;
+ }
+ else if (tag == GCOV_TAG_FUNCTION && !length)
+ ; /* placeholder */
+ else if (tag == GCOV_TAG_FUNCTION && length == GCOV_TAG_FUNCTION_LENGTH)
+ {
+ unsigned ident;
+ struct function_info *fn_n;
- /* Try to find the function in the list.
- To speed up the search, first start from the last function
- found. */
- for (fn = fn ? fn->next : NULL; ; fn = fn->next)
- {
- if (fn)
- ;
- else if ((fn = fn_n))
- fn_n = NULL;
- else
- {
- fnotice (stderr, "%s:unknown function '%u'\n",
- da_file_name, ident);
- break;
- }
- if (fn->ident == ident)
+ /* Try to find the function in the list. To speed up the
+ search, first start from the last function found. */
+ ident = gcov_read_unsigned ();
+ fn_n = functions;
+ for (fn = fn ? fn->next : NULL; ; fn = fn->next)
+ {
+ if (fn)
+ ;
+ else if ((fn = fn_n))
+ fn_n = NULL;
+ else
+ {
+ fnotice (stderr, "%s:unknown function '%u'\n",
+ da_file_name, ident);
break;
- }
- }
+ }
+ if (fn->ident == ident)
+ break;
+ }
if (!fn)
;
@@ -1908,8 +1935,7 @@ output_lines (FILE *gcov_file, const source_t *src)
fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name);
fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0,
no_data_file ? "-" : da_file_name);
- fprintf (gcov_file, "%9s:%5d:Runs:%u\n", "-", 0,
- object_summary.ctrs[GCOV_COUNTER_ARCS].runs);
+ fprintf (gcov_file, "%9s:%5d:Runs:%u\n", "-", 0, object_runs);
}
fprintf (gcov_file, "%9s:%5d:Programs:%u\n", "-", 0, program_count);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 8adbc38bc0b..4806753f4a7 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -23,10 +23,6 @@ along with GCC; see the file COPYING3. If not see
- do rough calc of how many regs are needed in each block, and a rough
calc of how many regs are available in each class and use that to
throttle back the code in cases where RTX_COST is minimal.
- - a store to the same address as a load does not kill the load if the
- source of the store is also the destination of the load. Handling this
- allows more load motion, particularly out of loops.
-
*/
/* References searched while implementing this.
@@ -267,7 +263,7 @@ struct reg_use {rtx reg_rtx; };
struct expr
{
- /* The expression (SET_SRC for expressions, PATTERN for assignments). */
+ /* The expression. */
rtx expr;
/* Index in the available expression bitmaps. */
int bitmap_index;
@@ -346,14 +342,12 @@ static struct hash_table_d expr_hash_table;
/* This is a list of expressions which are MEMs and will be used by load
or store motion.
- Load motion tracks MEMs which aren't killed by
- anything except itself. (i.e., loads and stores to a single location).
+ Load motion tracks MEMs which aren't killed by anything except itself,
+ i.e. loads and stores to a single location.
We can then allow movement of these MEM refs with a little special
allowance. (all stores copy the same value to the reaching reg used
for the loads). This means all values used to store into memory must have
- no side effects so we can re-issue the setter value.
- Store Motion uses this structure as an expression table to track stores
- which look interesting, and might be moveable towards the exit block. */
+ no side effects so we can re-issue the setter value. */
struct ls_expr
{
@@ -454,14 +448,14 @@ static int load_killed_in_block_p (const_basic_block, int, const_rtx, int);
static void canon_list_insert (rtx, const_rtx, void *);
static void alloc_pre_mem (int, int);
static void free_pre_mem (void);
-static void compute_pre_data (void);
+static struct edge_list *compute_pre_data (void);
static int pre_expr_reaches_here_p (basic_block, struct expr *,
basic_block);
static void insert_insn_end_basic_block (struct expr *, basic_block);
static void pre_insert_copy_insn (struct expr *, rtx);
static void pre_insert_copies (void);
static int pre_delete (void);
-static int pre_gcse (void);
+static int pre_gcse (struct edge_list *);
static int one_pre_gcse_pass (void);
static void add_label_notes (rtx, rtx);
static void alloc_code_hoist_mem (int, int);
@@ -478,11 +472,9 @@ static int pre_expr_reaches_here_p_work (basic_block, struct expr *,
basic_block, char *);
static struct ls_expr * ldst_entry (rtx);
static void free_ldst_entry (struct ls_expr *);
-static void free_ldst_mems (void);
+static void free_ld_motion_mems (void);
static void print_ldst_list (FILE *);
static struct ls_expr * find_rtx_in_ldst (rtx);
-static inline struct ls_expr * first_ls_expr (void);
-static inline struct ls_expr * next_ls_expr (struct ls_expr *);
static int simple_mem (const_rtx);
static void invalidate_any_buried_refs (rtx);
static void compute_ld_motion_mems (void);
@@ -555,7 +547,6 @@ can_copy_p (enum machine_mode mode)
return can_copy[mode] != 0;
}
-
/* Cover function to xmalloc to record bytes allocated. */
@@ -714,7 +705,6 @@ struct reg_avail_info
static struct reg_avail_info *reg_avail_info;
static basic_block current_bb;
-
/* See whether X, the source of a set, is something we want to consider for
GCSE. */
@@ -935,25 +925,29 @@ oprs_unchanged_p (const_rtx x, const_rtx insn, int avail_p)
return 1;
}
-/* Used for communication between mems_conflict_for_gcse_p and
- load_killed_in_block_p. Nonzero if mems_conflict_for_gcse_p finds a
- conflict between two memory references. */
-static int gcse_mems_conflict_p;
+/* Info passed from load_killed_in_block_p to mems_conflict_for_gcse_p. */
-/* Used for communication between mems_conflict_for_gcse_p and
- load_killed_in_block_p. A memory reference for a load instruction,
- mems_conflict_for_gcse_p will see if a memory store conflicts with
- this memory load. */
-static const_rtx gcse_mem_operand;
+struct mem_conflict_info
+{
+ /* A memory reference for a load instruction, mems_conflict_for_gcse_p will
+ see if a memory store conflicts with this memory load. */
+ const_rtx mem;
-/* DEST is the output of an instruction. If it is a memory reference, and
- possibly conflicts with the load found in gcse_mem_operand, then set
- gcse_mems_conflict_p to a nonzero value. */
+ /* True if mems_conflict_for_gcse_p finds a conflict between two memory
+ references. */
+ bool conflict;
+};
+
+/* DEST is the output of an instruction. If it is a memory reference and
+ possibly conflicts with the load found in DATA, then communicate this
+ information back through DATA. */
static void
mems_conflict_for_gcse_p (rtx dest, const_rtx setter ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
+ void *data)
{
+ struct mem_conflict_info *mci = (struct mem_conflict_info *) data;
+
while (GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT
|| GET_CODE (dest) == STRICT_LOW_PART)
@@ -967,17 +961,15 @@ mems_conflict_for_gcse_p (rtx dest, const_rtx setter ATTRIBUTE_UNUSED,
/* If we are setting a MEM in our list of specially recognized MEMs,
don't mark as killed this time. */
-
- if (expr_equiv_p (dest, gcse_mem_operand) && pre_ldst_mems != NULL)
+ if (pre_ldst_mems != NULL && expr_equiv_p (dest, mci->mem))
{
if (!find_rtx_in_ldst (dest))
- gcse_mems_conflict_p = 1;
+ mci->conflict = true;
return;
}
- if (true_dependence (dest, GET_MODE (dest), gcse_mem_operand,
- rtx_addr_varies_p))
- gcse_mems_conflict_p = 1;
+ if (true_dependence (dest, GET_MODE (dest), mci->mem, rtx_addr_varies_p))
+ mci->conflict = true;
}
/* Return nonzero if the expression in X (a memory reference) is killed
@@ -989,7 +981,8 @@ mems_conflict_for_gcse_p (rtx dest, const_rtx setter ATTRIBUTE_UNUSED,
AVAIL_P to 0. */
static int
-load_killed_in_block_p (const_basic_block bb, int uid_limit, const_rtx x, int avail_p)
+load_killed_in_block_p (const_basic_block bb, int uid_limit, const_rtx x,
+ int avail_p)
{
VEC (rtx,heap) *list = modify_mem_list[bb->index];
rtx setter;
@@ -1001,6 +994,8 @@ load_killed_in_block_p (const_basic_block bb, int uid_limit, const_rtx x, int av
FOR_EACH_VEC_ELT_REVERSE (rtx, list, ix, setter)
{
+ struct mem_conflict_info mci;
+
/* Ignore entries in the list that do not apply. */
if ((avail_p
&& DF_INSN_LUID (setter) < uid_limit)
@@ -1015,14 +1010,11 @@ load_killed_in_block_p (const_basic_block bb, int uid_limit, const_rtx x, int av
return 1;
/* SETTER must be an INSN of some kind that sets memory. Call
- note_stores to examine each hunk of memory that is modified.
-
- The note_stores interface is pretty limited, so we have to
- communicate via global variables. Yuk. */
- gcse_mem_operand = x;
- gcse_mems_conflict_p = 0;
- note_stores (PATTERN (setter), mems_conflict_for_gcse_p, NULL);
- if (gcse_mems_conflict_p)
+ note_stores to examine each hunk of memory that is modified. */
+ mci.mem = x;
+ mci.conflict = false;
+ note_stores (PATTERN (setter), mems_conflict_for_gcse_p, &mci);
+ if (mci.conflict)
return 1;
}
return 0;
@@ -1061,8 +1053,7 @@ hash_expr (const_rtx x, enum machine_mode mode, int *do_not_record_p,
*do_not_record_p = 0;
- hash = hash_rtx (x, mode, do_not_record_p,
- NULL, /*have_reg_qty=*/false);
+ hash = hash_rtx (x, mode, do_not_record_p, NULL, /*have_reg_qty=*/false);
return hash % hash_table_size;
}
@@ -1190,13 +1181,13 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
}
}
-/* Scan pattern PAT of INSN and add an entry to the hash TABLE. */
+/* Scan SET present in INSN and add an entry to the hash TABLE. */
static void
-hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
+hash_scan_set (rtx set, rtx insn, struct hash_table_d *table)
{
- rtx src = SET_SRC (pat);
- rtx dest = SET_DEST (pat);
+ rtx src = SET_SRC (set);
+ rtx dest = SET_DEST (set);
rtx note;
if (GET_CODE (src) == CALL)
@@ -1227,7 +1218,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
&& REG_NOTE_KIND (note) == REG_EQUAL
&& !REG_P (src)
&& want_to_gcse_p (XEXP (note, 0), NULL))
- src = XEXP (note, 0), pat = gen_rtx_SET (VOIDmode, dest, src);
+ src = XEXP (note, 0), set = gen_rtx_SET (VOIDmode, dest, src);
/* Only record sets of pseudo-regs in the hash table. */
if (regno >= FIRST_PSEUDO_REGISTER
@@ -1242,7 +1233,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
/* Is SET_SRC something we want to gcse? */
&& want_to_gcse_p (src, &max_distance)
/* Don't CSE a nop. */
- && ! set_noop_p (pat)
+ && ! set_noop_p (set)
/* Don't GCSE if it has attached REG_EQUIV note.
At this point this only function parameters should have
REG_EQUIV notes and if the argument slot is used somewhere
@@ -1286,7 +1277,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
/* Is SET_DEST something we want to gcse? */
&& want_to_gcse_p (dest, &max_distance)
/* Don't CSE a nop. */
- && ! set_noop_p (pat)
+ && ! set_noop_p (set)
/* Don't GCSE if it has attached REG_EQUIV note.
At this point this only function parameters should have
REG_EQUIV notes and if the argument slot is used somewhere
@@ -1325,16 +1316,7 @@ hash_scan_call (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED,
/* Currently nothing to do. */
}
-/* Process INSN and add hash table entries as appropriate.
-
- Only available expressions that set a single pseudo-reg are recorded.
-
- Single sets in a PARALLEL could be handled, but it's an extra complication
- that isn't dealt with right now. The trick is handling the CLOBBERs that
- are also in the PARALLEL. Later.
-
- If SET_P is nonzero, this is for the assignment hash table,
- otherwise it is for the expression hash table. */
+/* Process INSN and add hash table entries as appropriate. */
static void
hash_scan_insn (rtx insn, struct hash_table_d *table)
@@ -1347,6 +1329,13 @@ hash_scan_insn (rtx insn, struct hash_table_d *table)
if (GET_CODE (pat) == SET)
hash_scan_set (pat, insn, table);
+
+ else if (GET_CODE (pat) == CLOBBER)
+ hash_scan_clobber (pat, insn, table);
+
+ else if (GET_CODE (pat) == CALL)
+ hash_scan_call (pat, insn, table);
+
else if (GET_CODE (pat) == PARALLEL)
for (i = 0; i < XVECLEN (pat, 0); i++)
{
@@ -1359,13 +1348,10 @@ hash_scan_insn (rtx insn, struct hash_table_d *table)
else if (GET_CODE (x) == CALL)
hash_scan_call (x, insn, table);
}
-
- else if (GET_CODE (pat) == CLOBBER)
- hash_scan_clobber (pat, insn, table);
- else if (GET_CODE (pat) == CALL)
- hash_scan_call (pat, insn, table);
}
+/* Dump the hash table TABLE to file FILE under the name NAME. */
+
static void
dump_hash_table (FILE *file, const char *name, struct hash_table_d *table)
{
@@ -1429,13 +1415,12 @@ record_last_reg_set_info (rtx insn, int regno)
}
}
-
/* Record all of the canonicalized MEMs of record_last_mem_set_info's insn.
Note we store a pair of elements in the list, so they have to be
taken off pairwise. */
static void
-canon_list_insert (rtx dest ATTRIBUTE_UNUSED, const_rtx unused1 ATTRIBUTE_UNUSED,
+canon_list_insert (rtx dest ATTRIBUTE_UNUSED, const_rtx x ATTRIBUTE_UNUSED,
void * v_insn)
{
rtx dest_addr, insn;
@@ -1634,7 +1619,6 @@ free_modify_mem_tables (void)
modify_mem_list = 0;
canon_modify_mem_list = 0;
}
-
/* For each block, compute whether X is transparent. X is either an
expression or an assignment [though we don't care which, for this context
@@ -1745,11 +1729,11 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap)
compute_transp (XVECEXP (x, i, j), indx, bmap);
}
}
-
/* Compute PRE+LCM working variables. */
/* Local properties of expressions. */
+
/* Nonzero for expressions that are transparent in the block. */
static sbitmap *transp;
@@ -1772,9 +1756,6 @@ static sbitmap *pre_insert_map;
/* Nonzero for expressions which should be deleted in a specific block. */
static sbitmap *pre_delete_map;
-/* Contains the edge_list returned by pre_edge_lcm. */
-static struct edge_list *edge_list;
-
/* Allocate vars used for PRE analysis. */
static void
@@ -1826,6 +1807,7 @@ static void
prune_expressions (bool pre_p)
{
sbitmap prune_exprs;
+ struct expr *expr;
unsigned int ui;
basic_block bb;
@@ -1833,17 +1815,16 @@ prune_expressions (bool pre_p)
sbitmap_zero (prune_exprs);
for (ui = 0; ui < expr_hash_table.size; ui++)
{
- struct expr *e;
- for (e = expr_hash_table.table[ui]; e != NULL; e = e->next_same_hash)
+ for (expr = expr_hash_table.table[ui]; expr; expr = expr->next_same_hash)
{
/* Note potentially trapping expressions. */
- if (may_trap_p (e->expr))
+ if (may_trap_p (expr->expr))
{
- SET_BIT (prune_exprs, e->bitmap_index);
+ SET_BIT (prune_exprs, expr->bitmap_index);
continue;
}
- if (!pre_p && MEM_P (e->expr))
+ if (!pre_p && MEM_P (expr->expr))
/* Note memory references that can be clobbered by a call.
We do not split abnormal edges in hoisting, so would
a memory reference get hoisted along an abnormal edge,
@@ -1851,13 +1832,13 @@ prune_expressions (bool pre_p)
constant memory references can be hoisted along abnormal
edges. */
{
- if (GET_CODE (XEXP (e->expr, 0)) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (XEXP (e->expr, 0)))
+ if (GET_CODE (XEXP (expr->expr, 0)) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (XEXP (expr->expr, 0)))
continue;
- if (MEM_READONLY_P (e->expr)
- && !MEM_VOLATILE_P (e->expr)
- && MEM_NOTRAP_P (e->expr))
+ if (MEM_READONLY_P (expr->expr)
+ && !MEM_VOLATILE_P (expr->expr)
+ && MEM_NOTRAP_P (expr->expr))
/* Constant memory reference, e.g., a PIC address. */
continue;
@@ -1865,7 +1846,7 @@ prune_expressions (bool pre_p)
analysis to determine if this mem is actually killed
by this call. */
- SET_BIT (prune_exprs, e->bitmap_index);
+ SET_BIT (prune_exprs, expr->bitmap_index);
}
}
}
@@ -1976,9 +1957,10 @@ prune_insertions_deletions (int n_elems)
/* Top level routine to do the dataflow analysis needed by PRE. */
-static void
+static struct edge_list *
compute_pre_data (void)
{
+ struct edge_list *edge_list;
basic_block bb;
compute_local_properties (transp, comp, antloc, &expr_hash_table);
@@ -2004,6 +1986,8 @@ compute_pre_data (void)
ae_kill = NULL;
prune_insertions_deletions (expr_hash_table.n_elems);
+
+ return edge_list;
}
/* PRE utilities */
@@ -2022,7 +2006,8 @@ compute_pre_data (void)
the closest such expression. */
static int
-pre_expr_reaches_here_p_work (basic_block occr_bb, struct expr *expr, basic_block bb, char *visited)
+pre_expr_reaches_here_p_work (basic_block occr_bb, struct expr *expr,
+ basic_block bb, char *visited)
{
edge pred;
edge_iterator ei;
@@ -2079,15 +2064,13 @@ pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
return rval;
}
-
-/* Given an expr, generate RTL which we can insert at the end of a BB,
- or on an edge. Set the block number of any insns generated to
- the value of BB. */
+/* Generate RTL to copy an EXPR to its `reaching_reg' and return it. */
static rtx
process_insert_insn (struct expr *expr)
{
rtx reg = expr->reaching_reg;
+ /* Copy the expression to make sure we don't have any sharing issues. */
rtx exp = copy_rtx (expr->expr);
rtx pat;
@@ -2099,8 +2082,7 @@ process_insert_insn (struct expr *expr)
emit_move_insn (reg, exp);
/* Otherwise, make a new insn to compute this expression and make sure the
- insn will be recognized (this also adds any needed CLOBBERs). Copy the
- expression to make sure we don't have any sharing issues. */
+ insn will be recognized (this also adds any needed CLOBBERs). */
else
{
rtx insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
@@ -2109,7 +2091,6 @@ process_insert_insn (struct expr *expr)
gcc_unreachable ();
}
-
pat = get_insns ();
end_sequence ();
@@ -2254,7 +2235,9 @@ pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
{
SBITMAP_ELT_TYPE insert = pre_insert_map[e]->elms[i];
- for (j = indx; insert && j < (int) expr_hash_table.n_elems; j++, insert >>= 1)
+ for (j = indx;
+ insert && j < (int) expr_hash_table.n_elems;
+ j++, insert >>= 1)
if ((insert & 1) != 0 && index_map[j]->reaching_reg != NULL_RTX)
{
struct expr *expr = index_map[j];
@@ -2430,7 +2413,7 @@ pre_insert_copies (void)
Need to do some profiling. */
for (i = 0; i < expr_hash_table.size; i++)
- for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
+ for (expr = expr_hash_table.table[i]; expr; expr = expr->next_same_hash)
{
/* If the basic block isn't reachable, PPOUT will be TRUE. However,
we don't want to insert a copy here because the expression may not
@@ -2481,8 +2464,9 @@ pre_insert_copies (void)
/* Emit move from SRC to DEST noting the equivalence with expression computed
in INSN. */
+
static rtx
-gcse_emit_move_after (rtx src, rtx dest, rtx insn)
+gcse_emit_move_after (rtx dest, rtx src, rtx insn)
{
rtx new_rtx;
rtx set = single_set (insn), set2;
@@ -2513,7 +2497,7 @@ gcse_emit_move_after (rtx src, rtx dest, rtx insn)
the expression into the result of the SET. It is left to later passes
(cprop, cse2, flow, combine, regmove) to propagate the copy or eliminate it.
- Returns nonzero if a change is made. */
+ Return nonzero if a change is made. */
static int
pre_delete (void)
@@ -2525,15 +2509,11 @@ pre_delete (void)
changed = 0;
for (i = 0; i < expr_hash_table.size; i++)
- for (expr = expr_hash_table.table[i];
- expr != NULL;
- expr = expr->next_same_hash)
+ for (expr = expr_hash_table.table[i]; expr; expr = expr->next_same_hash)
{
int indx = expr->bitmap_index;
- /* We only need to search antic_occr since we require
- ANTLOC != 0. */
-
+ /* We only need to search antic_occr since we require ANTLOC != 0. */
for (occr = expr->antic_occr; occr != NULL; occr = occr->next)
{
rtx insn = occr->insn;
@@ -2551,7 +2531,7 @@ pre_delete (void)
if (expr->reaching_reg == NULL)
expr->reaching_reg = gen_reg_rtx_and_attrs (SET_DEST (set));
- gcse_emit_move_after (expr->reaching_reg, SET_DEST (set), insn);
+ gcse_emit_move_after (SET_DEST (set), expr->reaching_reg, insn);
delete_insn (insn);
occr->deleted_p = 1;
changed = 1;
@@ -2593,7 +2573,7 @@ pre_delete (void)
redundancies. */
static int
-pre_gcse (void)
+pre_gcse (struct edge_list *edge_list)
{
unsigned int i;
int did_insert, changed;
@@ -2605,7 +2585,7 @@ pre_gcse (void)
index_map = XCNEWVEC (struct expr *, expr_hash_table.n_elems);
for (i = 0; i < expr_hash_table.size; i++)
- for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
+ for (expr = expr_hash_table.table[i]; expr; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
/* Delete the redundant insns first so that
@@ -2659,20 +2639,23 @@ one_pre_gcse_pass (void)
compute_ld_motion_mems ();
compute_hash_table (&expr_hash_table);
- trim_ld_motion_mems ();
+ if (flag_gcse_lm)
+ trim_ld_motion_mems ();
if (dump_file)
dump_hash_table (dump_file, "Expression", &expr_hash_table);
if (expr_hash_table.n_elems > 0)
{
+ struct edge_list *edge_list;
alloc_pre_mem (last_basic_block, expr_hash_table.n_elems);
- compute_pre_data ();
- changed |= pre_gcse ();
+ edge_list = compute_pre_data ();
+ changed |= pre_gcse (edge_list);
free_edge_list (edge_list);
free_pre_mem ();
}
- free_ldst_mems ();
+ if (flag_gcse_lm)
+ free_ld_motion_mems ();
remove_fake_exit_edges ();
free_hash_table (&expr_hash_table);
@@ -2924,6 +2907,7 @@ hoist_expr_reaches_here_p (basic_block expr_bb, int expr_index, basic_block bb,
}
/* Find occurence in BB. */
+
static struct occr *
find_occr_in_bb (struct occr *occr, basic_block bb)
{
@@ -2955,7 +2939,7 @@ hoist_code (void)
index_map = XCNEWVEC (struct expr *, expr_hash_table.n_elems);
for (i = 0; i < expr_hash_table.size; i++)
- for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
+ for (expr = expr_hash_table.table[i]; expr; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
/* Calculate sizes of basic blocks and note how far
@@ -3145,7 +3129,7 @@ hoist_code (void)
expr->reaching_reg
= gen_reg_rtx_and_attrs (SET_DEST (set));
- gcse_emit_move_after (expr->reaching_reg, SET_DEST (set),
+ gcse_emit_move_after (SET_DEST (set), expr->reaching_reg,
insn);
delete_insn (insn);
occr->deleted_p = 1;
@@ -3233,9 +3217,9 @@ one_code_hoisting_pass (void)
return changed;
}
-/* Here we provide the things required to do store motion towards
- the exit. In order for this to be effective, gcse also needed to
- be taught how to move a load when it is kill only by a store to itself.
+/* Here we provide the things required to do store motion towards the exit.
+ In order for this to be effective, gcse also needed to be taught how to
+ move a load when it is killed only by a store to itself.
int i;
float a[10];
@@ -3251,7 +3235,7 @@ one_code_hoisting_pass (void)
of the loop.
The 'Load Motion' referred to and implemented in this file is
- an enhancement to gcse which when using edge based lcm, recognizes
+ an enhancement to gcse which when using edge based LCM, recognizes
this situation and allows gcse to move the load out of the loop.
Once gcse has hoisted the load, store motion can then push this
@@ -3263,7 +3247,8 @@ pre_ldst_expr_hash (const void *p)
{
int do_not_record_p = 0;
const struct ls_expr *const x = (const struct ls_expr *) p;
- return hash_rtx (x->pattern, GET_MODE (x->pattern), &do_not_record_p, NULL, false);
+ return
+ hash_rtx (x->pattern, GET_MODE (x->pattern), &do_not_record_p, NULL, false);
}
static int
@@ -3326,7 +3311,7 @@ free_ldst_entry (struct ls_expr * ptr)
/* Free up all memory associated with the ldst list. */
static void
-free_ldst_mems (void)
+free_ld_motion_mems (void)
{
if (pre_ldst_table)
htab_delete (pre_ldst_table);
@@ -3353,7 +3338,7 @@ print_ldst_list (FILE * file)
fprintf (file, "LDST list: \n");
- for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
+ for (ptr = pre_ldst_mems; ptr != NULL; ptr = ptr->next)
{
fprintf (file, " Pattern (%3d): ", ptr->index);
@@ -3394,35 +3379,16 @@ find_rtx_in_ldst (rtx x)
return NULL;
return (struct ls_expr *) *slot;
}
-
-/* Return first item in the list. */
-
-static inline struct ls_expr *
-first_ls_expr (void)
-{
- return pre_ldst_mems;
-}
-
-/* Return the next item in the list after the specified one. */
-
-static inline struct ls_expr *
-next_ls_expr (struct ls_expr * ptr)
-{
- return ptr->next;
-}
/* Load Motion for loads which only kill themselves. */
-/* Return true if x is a simple MEM operation, with no registers or
- side effects. These are the types of loads we consider for the
- ld_motion list, otherwise we let the usual aliasing take care of it. */
+/* Return true if x, a MEM, is a simple access with no side effects.
+ These are the types of loads we consider for the ld_motion list,
+ otherwise we let the usual aliasing take care of it. */
static int
simple_mem (const_rtx x)
{
- if (! MEM_P (x))
- return 0;
-
if (MEM_VOLATILE_P (x))
return 0;
@@ -3499,8 +3465,8 @@ compute_ld_motion_mems (void)
rtx insn;
pre_ldst_mems = NULL;
- pre_ldst_table = htab_create (13, pre_ldst_expr_hash,
- pre_ldst_expr_eq, NULL);
+ pre_ldst_table
+ = htab_create (13, pre_ldst_expr_hash, pre_ldst_expr_eq, NULL);
FOR_EACH_BB (bb)
{
@@ -3641,7 +3607,7 @@ update_ld_motion_stores (struct expr * expr)
if (dump_file)
{
fprintf (dump_file, "PRE: store updated with reaching reg ");
- print_rtl (dump_file, expr->reaching_reg);
+ print_rtl (dump_file, reg);
fprintf (dump_file, ":\n ");
print_inline_rtx (dump_file, insn, 8);
fprintf (dump_file, "\n");
@@ -3698,7 +3664,6 @@ is_too_expensive (const char *pass)
return false;
}
-
/* All the passes implemented in this file. Each pass has its
own gate and execute function, and at the end of the file a
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 6063d81daa5..c9c08a4db31 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1015,6 +1015,7 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
{
case NOTE_INSN_MAX:
case NOTE_INSN_DELETED_LABEL:
+ case NOTE_INSN_DELETED_DEBUG_LABEL:
note_flds = create_field (note_flds, &string_type, "rt_str");
break;
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index 4c64842ea27..44eba24f11a 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -243,6 +243,28 @@ static const char * const optabs[] =
"set_direct_optab_handler (sync_compare_and_swap_optab, $A, CODE_FOR_$(sync_compare_and_swap$I$a$))",
"set_direct_optab_handler (sync_lock_test_and_set_optab, $A, CODE_FOR_$(sync_lock_test_and_set$I$a$))",
"set_direct_optab_handler (sync_lock_release_optab, $A, CODE_FOR_$(sync_lock_release$I$a$))",
+ "set_direct_optab_handler (atomic_exchange_optab, $A, CODE_FOR_$(atomic_exchange$I$a$))",
+ "set_direct_optab_handler (atomic_compare_and_swap_optab, $A, CODE_FOR_$(atomic_compare_and_swap$I$a$))",
+ "set_direct_optab_handler (atomic_load_optab, $A, CODE_FOR_$(atomic_load$I$a$))",
+ "set_direct_optab_handler (atomic_store_optab, $A, CODE_FOR_$(atomic_store$I$a$))",
+ "set_direct_optab_handler (atomic_add_fetch_optab, $A, CODE_FOR_$(atomic_add_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_sub_fetch_optab, $A, CODE_FOR_$(atomic_sub_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_and_fetch_optab, $A, CODE_FOR_$(atomic_and_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_nand_fetch_optab, $A, CODE_FOR_$(atomic_nand_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_xor_fetch_optab, $A, CODE_FOR_$(atomic_xor_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_or_fetch_optab, $A, CODE_FOR_$(atomic_or_fetch$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_add_optab, $A, CODE_FOR_$(atomic_fetch_add$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_sub_optab, $A, CODE_FOR_$(atomic_fetch_sub$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_and_optab, $A, CODE_FOR_$(atomic_fetch_and$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_nand_optab, $A, CODE_FOR_$(atomic_fetch_nand$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_xor_optab, $A, CODE_FOR_$(atomic_fetch_xor$I$a$))",
+ "set_direct_optab_handler (atomic_fetch_or_optab, $A, CODE_FOR_$(atomic_fetch_or$I$a$))",
+ "set_direct_optab_handler (atomic_add_optab, $A, CODE_FOR_$(atomic_add$I$a$))",
+ "set_direct_optab_handler (atomic_sub_optab, $A, CODE_FOR_$(atomic_sub$I$a$))",
+ "set_direct_optab_handler (atomic_and_optab, $A, CODE_FOR_$(atomic_and$I$a$))",
+ "set_direct_optab_handler (atomic_nand_optab, $A, CODE_FOR_$(atomic_nand$I$a$))",
+ "set_direct_optab_handler (atomic_xor_optab, $A, CODE_FOR_$(atomic_xor$I$a$))",
+ "set_direct_optab_handler (atomic_or_optab, $A, CODE_FOR_$(atomic_or$I$a$))",
"set_optab_handler (vec_set_optab, $A, CODE_FOR_$(vec_set$a$))",
"set_optab_handler (vec_extract_optab, $A, CODE_FOR_$(vec_extract$a$))",
"set_optab_handler (vec_extract_even_optab, $A, CODE_FOR_$(vec_extract_even$a$))",
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index aa67d248c53..53bfb9641f8 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1057,53 +1057,82 @@ gimple_extract_devirt_binfo_from_cst (tree cst)
simplifies to a constant value. Return true if any changes were made.
It is assumed that the operands have been previously folded. */
-bool
+static bool
gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
{
gimple stmt = gsi_stmt (*gsi);
tree callee;
+ bool changed = false;
+ unsigned i;
- /* Check for builtins that CCP can handle using information not
- available in the generic fold routines. */
- callee = gimple_call_fndecl (stmt);
- if (!inplace && callee && DECL_BUILT_IN (callee))
- {
- tree result = gimple_fold_builtin (stmt);
-
- if (result)
- {
- if (!update_call_from_tree (gsi, result))
- gimplify_and_update_call_from_tree (gsi, result);
- return true;
- }
- }
+ /* Fold *& in call arguments. */
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ if (REFERENCE_CLASS_P (gimple_call_arg (stmt, i)))
+ {
+ tree tmp = maybe_fold_reference (gimple_call_arg (stmt, i), false);
+ if (tmp)
+ {
+ gimple_call_set_arg (stmt, i, tmp);
+ changed = true;
+ }
+ }
/* Check for virtual calls that became direct calls. */
callee = gimple_call_fn (stmt);
if (callee && TREE_CODE (callee) == OBJ_TYPE_REF)
{
- tree binfo, fndecl, obj;
- HOST_WIDE_INT token;
-
if (gimple_call_addr_fndecl (OBJ_TYPE_REF_EXPR (callee)) != NULL_TREE)
{
gimple_call_set_fn (stmt, OBJ_TYPE_REF_EXPR (callee));
- return true;
+ changed = true;
}
+ else
+ {
+ tree obj = OBJ_TYPE_REF_OBJECT (callee);
+ tree binfo = gimple_extract_devirt_binfo_from_cst (obj);
+ if (binfo)
+ {
+ HOST_WIDE_INT token
+ = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee));
+ tree fndecl = gimple_get_virt_method_for_binfo (token, binfo);
+ if (fndecl)
+ {
+ gimple_call_set_fndecl (stmt, fndecl);
+ changed = true;
+ }
+ }
+ }
+ }
- obj = OBJ_TYPE_REF_OBJECT (callee);
- binfo = gimple_extract_devirt_binfo_from_cst (obj);
- if (!binfo)
- return false;
- token = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee));
- fndecl = gimple_get_virt_method_for_binfo (token, binfo);
- if (!fndecl)
- return false;
- gimple_call_set_fndecl (stmt, fndecl);
- return true;
+ /* Check whether propagating into the function address made the
+ call direct, and thus possibly non-inlineable.
+ ??? This asks for a more conservative setting of the non-inlinable
+ flag, namely true for all indirect calls. But that would require
+ that we can re-compute the flag conservatively, thus it isn't
+ ever initialized from something else than return/argument type
+ checks . */
+ callee = gimple_call_fndecl (stmt);
+ if (callee
+ && !gimple_check_call_matching_types (stmt, callee))
+ gimple_call_set_cannot_inline (stmt, true);
+
+ if (inplace)
+ return changed;
+
+ /* Check for builtins that CCP can handle using information not
+ available in the generic fold routines. */
+ if (callee && DECL_BUILT_IN (callee))
+ {
+ tree result = gimple_fold_builtin (stmt);
+ if (result)
+ {
+ if (!update_call_from_tree (gsi, result))
+ gimplify_and_update_call_from_tree (gsi, result);
+ changed = true;
+ }
}
- return false;
+ return changed;
}
/* Worker for both fold_stmt and fold_stmt_inplace. The INPLACE argument
@@ -1162,17 +1191,6 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace)
break;
case GIMPLE_CALL:
- /* Fold *& in call arguments. */
- for (i = 0; i < gimple_call_num_args (stmt); ++i)
- if (REFERENCE_CLASS_P (gimple_call_arg (stmt, i)))
- {
- tree tmp = maybe_fold_reference (gimple_call_arg (stmt, i), false);
- if (tmp)
- {
- gimple_call_set_arg (stmt, i, tmp);
- changed = true;
- }
- }
changed |= gimple_fold_call (gsi, inplace);
break;
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 4b78ff5270d..ffecc2617af 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -959,7 +959,6 @@ 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);
-bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace);
tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree);
void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree);
tree gimple_extract_devirt_binfo_from_cst (tree);
diff --git a/gcc/ginclude/stdalign.h b/gcc/ginclude/stdalign.h
new file mode 100644
index 00000000000..fd55ed3010a
--- /dev/null
+++ b/gcc/ginclude/stdalign.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2011 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/>. */
+
+/* ISO C1X: 7.15 Alignment <stdalign.h>. */
+
+#ifndef _STDALIGN_H
+#define _STDALIGN_H
+
+#ifndef __cplusplus
+
+#define alignas _Alignas
+#define alignof _Alignof
+
+#define __alignas_is_defined 1
+#define __alignof_is_defined 1
+
+#endif
+
+#endif /* stdalign.h */
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index 565ef7b8f84..1cc3cb4e75a 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004, 2009
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004, 2009, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -412,6 +412,20 @@ typedef __WINT_TYPE__ wint_t;
/* Offset of member MEMBER in a struct of type TYPE. */
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 199901L) \
+ || (defined(__cplusplus) && __cplusplus >= 201103L)
+#ifndef _GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
+/* Type whose alignment is supported in every context and is at least
+ as great as that of any standard type not using alignment
+ specifiers. */
+typedef struct {
+ long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
+ long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+#endif
+#endif /* C1X or C++11. */
+
#endif /* _STDDEF_H was defined this time */
#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 3802fa8e463..2eaf210c94f 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (gospec.o): Pass SHLIB instead of SHLIB_LINK.
+
2011-08-24 Roberto Lublinerman <rluble@gmail.com>
* lang.opt: Add fgo-optimize-.
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index d7ae7aee6fb..62a4d6f0dee 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -32,7 +32,7 @@ go: go1$(exeext)
gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
$(CONFIG_H) opts.h
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
$(INCLUDES) $(srcdir)/go/gospec.c)
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index abc629e12c3..156977d3f5d 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -4559,10 +4559,26 @@ Select_clauses::Select_clause::lower(Gogo* gogo, Named_object* function,
loc);
Statement* s = Statement::make_tuple_receive_assignment(val, closed, ref,
true, loc);
+
// We have to put S in STATEMENTS_, because that is where the
// variables are declared.
+
go_assert(this->statements_ != NULL);
- this->statements_->add_statement_at_front(s);
+
+ // Skip the variable declaration statements themselves.
+ size_t skip = 1;
+ if (this->var_ != NULL)
+ skip = 2;
+
+ // Verify that we are only skipping variable declarations.
+ size_t i = 0;
+ for (Block::iterator p = this->statements_->begin();
+ i < skip && p != this->statements_->end();
+ ++p, ++i)
+ go_assert((*p)->variable_declaration_statement() != NULL);
+
+ this->statements_->insert_statement_before(skip, s);
+
// We have to lower STATEMENTS_ again, to lower the tuple
// receive assignment we just added.
gogo->lower_block(function, this->statements_);
@@ -4655,7 +4671,8 @@ Select_clauses::Select_clause::dump_clause(
{
ast_dump_context->dump_expression(this->channel_);
ast_dump_context->ostream() << " <- " ;
- ast_dump_context->dump_expression(this->val_);
+ if (this->val_ != NULL)
+ ast_dump_context->dump_expression(this->val_);
}
else
{
@@ -4667,8 +4684,7 @@ Select_clauses::Select_clause::dump_clause(
ast_dump_context->ostream() << " , " ;
ast_dump_context->dump_expression(this->closed_);
}
- if (this->closedvar_ != NULL ||
- this->var_ != NULL)
+ if (this->closedvar_ != NULL || this->var_ != NULL)
ast_dump_context->ostream() << " := " ;
ast_dump_context->ostream() << " <- " ;
diff --git a/gcc/godump.c b/gcc/godump.c
index f9f767c8113..a42e641d181 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -62,7 +62,47 @@ static GTY(()) VEC(tree,gc) *queue;
static htab_t macro_hash;
-/* For the hash tables. */
+/* The type of a value in macro_hash. */
+
+struct macro_hash_value
+{
+ /* The name stored in the hash table. */
+ char *name;
+ /* The value of the macro. */
+ char *value;
+};
+
+/* Calculate the hash value for an entry in the macro hash table. */
+
+static hashval_t
+macro_hash_hashval (const void *val)
+{
+ const struct macro_hash_value *mhval = (const struct macro_hash_value *) val;
+ return htab_hash_string (mhval->name);
+}
+
+/* Compare values in the macro hash table for equality. */
+
+static int
+macro_hash_eq (const void *v1, const void *v2)
+{
+ const struct macro_hash_value *mhv1 = (const struct macro_hash_value *) v1;
+ const struct macro_hash_value *mhv2 = (const struct macro_hash_value *) v2;
+ return strcmp (mhv1->name, mhv2->name) == 0;
+}
+
+/* Free values deleted from the macro hash table. */
+
+static void
+macro_hash_del (void *v)
+{
+ struct macro_hash_value *mhv = (struct macro_hash_value *) v;
+ XDELETEVEC (mhv->name);
+ XDELETEVEC (mhv->value);
+ XDELETE (mhv);
+}
+
+/* For the string hash tables. */
static int
string_hash_eq (const void *y1, const void *y2)
@@ -77,10 +117,12 @@ go_define (unsigned int lineno, const char *buffer)
{
const char *p;
const char *name_end;
+ size_t out_len;
char *out_buffer;
char *q;
bool saw_operand;
bool need_operand;
+ struct macro_hash_value *mhval;
char *copy;
hashval_t hashval;
void **slot;
@@ -105,17 +147,17 @@ go_define (unsigned int lineno, const char *buffer)
memcpy (copy, buffer, name_end - buffer);
copy[name_end - buffer] = '\0';
+ mhval = XNEW (struct macro_hash_value);
+ mhval->name = copy;
+ mhval->value = NULL;
+
hashval = htab_hash_string (copy);
- slot = htab_find_slot_with_hash (macro_hash, copy, hashval, NO_INSERT);
- if (slot != NULL)
- {
- XDELETEVEC (copy);
- return;
- }
+ slot = htab_find_slot_with_hash (macro_hash, mhval, hashval, NO_INSERT);
/* For simplicity, we force all names to be hidden by adding an
initial underscore, and let the user undo this as needed. */
- out_buffer = XNEWVEC (char, strlen (p) * 2 + 1);
+ out_len = strlen (p) * 2 + 1;
+ out_buffer = XNEWVEC (char, out_len);
q = out_buffer;
saw_operand = false;
need_operand = false;
@@ -141,6 +183,7 @@ go_define (unsigned int lineno, const char *buffer)
don't worry about them. */
const char *start;
char *n;
+ struct macro_hash_value idval;
if (saw_operand)
goto unknown;
@@ -151,8 +194,9 @@ go_define (unsigned int lineno, const char *buffer)
n = XALLOCAVEC (char, p - start + 1);
memcpy (n, start, p - start);
n[p - start] = '\0';
- slot = htab_find_slot (macro_hash, n, NO_INSERT);
- if (slot == NULL || *slot == NULL)
+ idval.name = n;
+ idval.value = NULL;
+ if (htab_find (macro_hash, &idval) == NULL)
{
/* This is a reference to a name which was not defined
as a macro. */
@@ -382,18 +426,30 @@ go_define (unsigned int lineno, const char *buffer)
if (need_operand)
goto unknown;
+ gcc_assert ((size_t) (q - out_buffer) < out_len);
*q = '\0';
- slot = htab_find_slot_with_hash (macro_hash, copy, hashval, INSERT);
- *slot = copy;
+ mhval->value = out_buffer;
- fprintf (go_dump_file, "const _%s = %s\n", copy, out_buffer);
+ if (slot == NULL)
+ {
+ slot = htab_find_slot_with_hash (macro_hash, mhval, hashval, INSERT);
+ gcc_assert (slot != NULL && *slot == NULL);
+ }
+ else
+ {
+ if (*slot != NULL)
+ macro_hash_del (*slot);
+ }
+
+ *slot = mhval;
- XDELETEVEC (out_buffer);
return;
unknown:
fprintf (go_dump_file, "// unknowndefine %s\n", buffer);
+ if (slot != NULL)
+ htab_clear_slot (macro_hash, slot);
XDELETEVEC (out_buffer);
XDELETEVEC (copy);
}
@@ -403,16 +459,16 @@ go_define (unsigned int lineno, const char *buffer)
static void
go_undef (unsigned int lineno, const char *buffer)
{
+ struct macro_hash_value mhval;
void **slot;
real_debug_hooks->undef (lineno, buffer);
- slot = htab_find_slot (macro_hash, buffer, NO_INSERT);
- if (slot == NULL)
- return;
- fprintf (go_dump_file, "// undef _%s\n", buffer);
- /* We don't delete the slot from the hash table because that will
- cause a duplicate const definition. */
+ mhval.name = CONST_CAST (char *, buffer);
+ mhval.value = NULL;
+ slot = htab_find_slot (macro_hash, &mhval, NO_INSERT);
+ if (slot != NULL)
+ htab_clear_slot (macro_hash, slot);
}
/* A function or variable decl. */
@@ -909,32 +965,37 @@ go_output_typedef (struct godump_container *container, tree decl)
element = TREE_CHAIN (element))
{
const char *name;
+ struct macro_hash_value *mhval;
void **slot;
+ char buf[100];
name = IDENTIFIER_POINTER (TREE_PURPOSE (element));
/* Sometimes a name will be defined as both an enum constant
and a macro. Avoid duplicate definition errors by
treating enum constants as macros. */
- slot = htab_find_slot (macro_hash, name, INSERT);
- if (*slot == NULL)
- {
- *slot = CONST_CAST (char *, name);
- fprintf (go_dump_file, "const _%s = ", name);
- if (host_integerp (TREE_VALUE (element), 0))
- fprintf (go_dump_file, HOST_WIDE_INT_PRINT_DEC,
- tree_low_cst (TREE_VALUE (element), 0));
- else if (host_integerp (TREE_VALUE (element), 1))
- fprintf (go_dump_file, HOST_WIDE_INT_PRINT_UNSIGNED,
- ((unsigned HOST_WIDE_INT)
- tree_low_cst (TREE_VALUE (element), 1)));
- else
- fprintf (go_dump_file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- ((unsigned HOST_WIDE_INT)
- TREE_INT_CST_HIGH (TREE_VALUE (element))),
- TREE_INT_CST_LOW (TREE_VALUE (element)));
- fprintf (go_dump_file, "\n");
- }
+ mhval = XNEW (struct macro_hash_value);
+ mhval->name = xstrdup (name);
+ mhval->value = NULL;
+ slot = htab_find_slot (macro_hash, mhval, INSERT);
+ if (*slot != NULL)
+ macro_hash_del (*slot);
+
+ if (host_integerp (TREE_VALUE (element), 0))
+ snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC,
+ tree_low_cst (TREE_VALUE (element), 0));
+ else if (host_integerp (TREE_VALUE (element), 1))
+ snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_UNSIGNED,
+ ((unsigned HOST_WIDE_INT)
+ tree_low_cst (TREE_VALUE (element), 1)));
+ else
+ snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ ((unsigned HOST_WIDE_INT)
+ TREE_INT_CST_HIGH (TREE_VALUE (element))),
+ TREE_INT_CST_LOW (TREE_VALUE (element)));
+
+ mhval->value = xstrdup (buf);
+ *slot = mhval;
}
pointer_set_insert (container->decls_seen, TREE_TYPE (decl));
if (TYPE_CANONICAL (TREE_TYPE (decl)) != NULL_TREE)
@@ -1039,6 +1100,17 @@ go_output_var (struct godump_container *container, tree decl)
}
}
+/* Output the final value of a preprocessor macro or enum constant.
+ This is called via htab_traverse_noresize. */
+
+static int
+go_print_macro (void **slot, void *arg ATTRIBUTE_UNUSED)
+{
+ struct macro_hash_value *mhval = (struct macro_hash_value *) *slot;
+ fprintf (go_dump_file, "const _%s = %s\n", mhval->name, mhval->value);
+ return 1;
+}
+
/* Build a hash table with the Go keywords. */
static const char * const keywords[] = {
@@ -1123,6 +1195,8 @@ go_finish (const char *filename)
}
}
+ htab_traverse_noresize (macro_hash, go_print_macro, NULL);
+
/* To emit dummy definitions. */
pointer_set_traverse (container.pot_dummy_types, find_dummy_types,
(void *) &container);
@@ -1163,7 +1237,8 @@ dump_go_spec_init (const char *filename, const struct gcc_debug_hooks *hooks)
go_debug_hooks.global_decl = go_global_decl;
go_debug_hooks.type_decl = go_type_decl;
- macro_hash = htab_create (100, htab_hash_string, string_hash_eq, NULL);
+ macro_hash = htab_create (100, macro_hash_hashval, macro_hash_eq,
+ macro_hash_del);
return &go_debug_hooks;
}
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 784e2e8b106..3b05c2a8ad8 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2329,12 +2329,12 @@ noce_operand_ok (const_rtx op)
{
/* We special-case memories, so handle any of them with
no address side effects. */
- if (MEM_P (op))
- return ! side_effects_p (XEXP (op, 0));
-
if (side_effects_p (op))
return FALSE;
+ if (MEM_P (op))
+ return ! side_effects_p (XEXP (op, 0));
+
return ! may_trap_p (op);
}
diff --git a/gcc/insn-notes.def b/gcc/insn-notes.def
index 2ea673f05e6..c1d621a1d16 100644
--- a/gcc/insn-notes.def
+++ b/gcc/insn-notes.def
@@ -36,6 +36,10 @@ INSN_NOTE (DELETED)
/* Generated in place of user-declared labels when they are deleted. */
INSN_NOTE (DELETED_LABEL)
+/* Similarly, but for labels that have been present in debug stmts
+ earlier and thus will only appear with -g. These must use different
+ label namespace. */
+INSN_NOTE (DELETED_DEBUG_LABEL)
/* These are used to mark the beginning and end of a lexical block.
See NOTE_BLOCK and reorder_blocks. */
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 18efc02e9d5..3dadf8d12d7 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1957,6 +1957,8 @@ early_inliner (void)
= estimate_num_insns (edge->call_stmt, &eni_size_weights);
es->call_stmt_time
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
+ edge->call_stmt_cannot_inline_p
+ = gimple_call_cannot_inline_p (edge->call_stmt);
}
timevar_pop (TV_INTEGRATION);
iterations++;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index e624426d698..7946aca0bff 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -271,8 +271,20 @@ ipa_print_all_jump_functions (FILE *f)
struct type_change_info
{
+ /* Offset into the object where there is the virtual method pointer we are
+ looking for. */
+ HOST_WIDE_INT offset;
+ /* The declaration or SSA_NAME pointer of the base that we are checking for
+ type change. */
+ tree object;
+ /* If we actually can tell the type that the object has changed to, it is
+ stored in this field. Otherwise it remains NULL_TREE. */
+ tree known_current_type;
/* Set to true if dynamic type change has been detected. */
bool type_maybe_changed;
+ /* Set to true if multiple types have been encountered. known_current_type
+ must be disregarded in that case. */
+ bool multiple_types_encountered;
};
/* Return true if STMT can modify a virtual method table pointer.
@@ -338,6 +350,50 @@ stmt_may_be_vtbl_ptr_store (gimple stmt)
return true;
}
+/* If STMT can be proved to be an assignment to the virtual method table
+ pointer of ANALYZED_OBJ and the type associated with the new table
+ identified, return the type. Otherwise return NULL_TREE. */
+
+static tree
+extr_type_from_vtbl_ptr_store (gimple stmt, struct type_change_info *tci)
+{
+ HOST_WIDE_INT offset, size, max_size;
+ tree lhs, rhs, base;
+
+ if (!gimple_assign_single_p (stmt))
+ return NULL_TREE;
+
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
+ if (TREE_CODE (lhs) != COMPONENT_REF
+ || !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1))
+ || TREE_CODE (rhs) != ADDR_EXPR)
+ return NULL_TREE;
+ rhs = get_base_address (TREE_OPERAND (rhs, 0));
+ if (!rhs
+ || TREE_CODE (rhs) != VAR_DECL
+ || !DECL_VIRTUAL_P (rhs))
+ return NULL_TREE;
+
+ base = get_ref_base_and_extent (lhs, &offset, &size, &max_size);
+ if (offset != tci->offset
+ || size != POINTER_SIZE
+ || max_size != POINTER_SIZE)
+ return NULL_TREE;
+ if (TREE_CODE (base) == MEM_REF)
+ {
+ if (TREE_CODE (tci->object) != MEM_REF
+ || TREE_OPERAND (tci->object, 0) != TREE_OPERAND (base, 0)
+ || !tree_int_cst_equal (TREE_OPERAND (tci->object, 1),
+ TREE_OPERAND (base, 1)))
+ return NULL_TREE;
+ }
+ else if (tci->object != base)
+ return NULL_TREE;
+
+ return DECL_CONTEXT (rhs);
+}
+
/* Callback of walk_aliased_vdefs and a helper function for
detect_type_change to check whether a particular statement may modify
the virtual table pointer, and if possible also determine the new type of
@@ -352,6 +408,12 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
if (stmt_may_be_vtbl_ptr_store (stmt))
{
+ tree type;
+ type = extr_type_from_vtbl_ptr_store (stmt, tci);
+ if (tci->type_maybe_changed
+ && type != tci->known_current_type)
+ tci->multiple_types_encountered = true;
+ tci->known_current_type = type;
tci->type_maybe_changed = true;
return true;
}
@@ -359,16 +421,15 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
return false;
}
-/* Detect whether the dynamic type of ARG has changed (before callsite CALL) by
- looking for assignments to its virtual table pointer. If it is, return true
- and fill in the jump function JFUNC with relevant type information or set it
- to unknown. ARG is the object itself (not a pointer to it, unless
- dereferenced). BASE is the base of the memory access as returned by
- get_ref_base_and_extent, as is the offset. */
+
+
+/* Like detect_type_change but with extra argument COMP_TYPE which will become
+ the component type part of new JFUNC of dynamic type change is detected and
+ the new base type is identified. */
static bool
-detect_type_change (tree arg, tree base, gimple call,
- struct ipa_jump_func *jfunc, HOST_WIDE_INT offset)
+detect_type_change_1 (tree arg, tree base, tree comp_type, gimple call,
+ struct ipa_jump_func *jfunc, HOST_WIDE_INT offset)
{
struct type_change_info tci;
ao_ref ao;
@@ -381,8 +442,6 @@ detect_type_change (tree arg, tree base, gimple call,
if (!flag_devirtualize || !gimple_vuse (call))
return false;
- tci.type_maybe_changed = false;
-
ao.ref = arg;
ao.base = base;
ao.offset = offset;
@@ -391,15 +450,45 @@ detect_type_change (tree arg, tree base, gimple call,
ao.ref_alias_set = -1;
ao.base_alias_set = -1;
+ tci.offset = offset;
+ tci.object = get_base_address (arg);
+ tci.known_current_type = NULL_TREE;
+ tci.type_maybe_changed = false;
+ tci.multiple_types_encountered = false;
+
walk_aliased_vdefs (&ao, gimple_vuse (call), check_stmt_for_type_change,
&tci, NULL);
if (!tci.type_maybe_changed)
return false;
- jfunc->type = IPA_JF_UNKNOWN;
+ if (!tci.known_current_type
+ || tci.multiple_types_encountered
+ || offset != 0)
+ jfunc->type = IPA_JF_UNKNOWN;
+ else
+ {
+ jfunc->type = IPA_JF_KNOWN_TYPE;
+ jfunc->value.known_type.base_type = tci.known_current_type;
+ jfunc->value.known_type.component_type = comp_type;
+ }
+
return true;
}
+/* Detect whether the dynamic type of ARG has changed (before callsite CALL) by
+ looking for assignments to its virtual table pointer. If it is, return true
+ and fill in the jump function JFUNC with relevant type information or set it
+ to unknown. ARG is the object itself (not a pointer to it, unless
+ dereferenced). BASE is the base of the memory access as returned by
+ get_ref_base_and_extent, as is the offset. */
+
+static bool
+detect_type_change (tree arg, tree base, gimple call,
+ struct ipa_jump_func *jfunc, HOST_WIDE_INT offset)
+{
+ return detect_type_change_1 (arg, base, TREE_TYPE (arg), call, jfunc, offset);
+}
+
/* Like detect_type_change but ARG is supposed to be a non-dereferenced pointer
SSA name (its dereference will become the base and the offset is assumed to
be zero). */
@@ -407,16 +496,19 @@ detect_type_change (tree arg, tree base, gimple call,
static bool
detect_type_change_ssa (tree arg, gimple call, struct ipa_jump_func *jfunc)
{
+ tree comp_type;
+
gcc_checking_assert (TREE_CODE (arg) == SSA_NAME);
if (!flag_devirtualize
|| !POINTER_TYPE_P (TREE_TYPE (arg))
|| TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) != RECORD_TYPE)
return false;
+ comp_type = TREE_TYPE (TREE_TYPE (arg));
arg = build2 (MEM_REF, ptr_type_node, arg,
- build_int_cst (ptr_type_node, 0));
+ build_int_cst (ptr_type_node, 0));
- return detect_type_change (arg, arg, call, jfunc, 0);
+ return detect_type_change_1 (arg, arg, comp_type, call, jfunc, 0);
}
/* Callback of walk_aliased_vdefs. Flags that it has been invoked to the
@@ -2476,8 +2568,11 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
gimple_set_block (new_stmt, gimple_block (stmt));
if (gimple_has_location (stmt))
gimple_set_location (new_stmt, gimple_location (stmt));
- gimple_call_copy_flags (new_stmt, stmt);
gimple_call_set_chain (new_stmt, gimple_call_chain (stmt));
+ gimple_call_copy_flags (new_stmt, stmt);
+ if (gimple_call_cannot_inline_p (stmt))
+ gimple_call_set_cannot_inline
+ (new_stmt, !gimple_check_call_matching_types (new_stmt, callee_decl));
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index ac83a40c50b..715d1f5885c 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (jvspec.o): Pass SHLIB instead of SHLIB_LINK.
+
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index 1d9fd2b2988..4d6b63b3708 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -58,7 +58,7 @@ JAVA_TARGET_INDEPENDENT_BIN_TOOLS = jcf-dump
jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) coretypes.h $(TM_H) \
$(GCC_H) $(CONFIG_H) java/jcf.h java/javaop.h $(OPTS_H)
- (SHLIB_LINK='$(SHLIB_LINK)'; \
+ (SHLIB='$(SHLIB)'; \
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
$(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION))
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 296739ed738..47f73aa01c6 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -1,6 +1,6 @@
/* LTO IL options.
- Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Simon Baldwin <simonb@google.com>
This file is part of GCC.
@@ -33,390 +33,89 @@ along with GCC; see the file COPYING3. If not see
#include "common/common-target.h"
#include "diagnostic.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_EACH_VEC_ELT (opt_t, *opts_p, i, o)
- 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));
-}
-
-/* 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;
-
- lto_input_data_block (ib, &flag, sizeof (flag));
- if (flag)
- {
- size_t length;
- char *string;
-
- lto_input_data_block (ib, &length, sizeof (length));
- string = (char *) xcalloc (1, length + 1);
- lto_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, unsigned 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,
- unsigned 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_EACH_VEC_ELT (opt_t, opts, i, o)
- {
- 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);
-}
+#include "toplev.h"
/* 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, NULL);
struct lto_output_stream stream;
- struct lto_simple_header header;
- struct lto_output_stream *header_stream;
-
- /* Targets and languages can provide defaults for -fexceptions but
- we only process user options from the command-line. Until we
- serialize out a white list of options from the new global state
- explicitly append important options as user options here. */
- if (flag_exceptions)
- lto_register_user_option (OPT_fexceptions, NULL, 1, CL_COMMON);
-
- lto_begin_section (section_name, !flag_wpa);
- free (section_name);
+ char *section_name;
+ struct obstack temporary_obstack;
+ unsigned int i, j;
+ char *args;
+ section_name = lto_get_section_name (LTO_section_opts, NULL, NULL);
+ lto_begin_section (section_name, false);
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;
-
- lto_input_data_block (ib, &length, sizeof (length));
-
- for (i = 0; i < length; i++)
+ obstack_init (&temporary_obstack);
+ for (i = 1; i < save_decoded_options_count; ++i)
{
- opt_t o;
-
- lto_input_data_block (ib, &o.type, sizeof (o.type));
- lto_input_data_block (ib, &o.code, sizeof (o.code));
- o.arg = input_string_block (ib);
- lto_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, l, skip;
- const char *data, *p;
- 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);
- if (!data)
- return;
-
- /* Option could be multiple sections merged (through ld -r)
- Keep reading all options. This is ok right now because
- the options just get mashed together anyways.
- This will have to be done differently once lto-opts knows
- how to associate options with different files. */
- l = len;
- p = data;
- do
- {
- header = (const struct lto_simple_header *) p;
- opts_offset = sizeof (*header);
-
- lto_check_version (header->lto_header.major_version,
- header->lto_header.minor_version);
-
- LTO_INIT_INPUT_BLOCK (ib, p + opts_offset, 0, header->main_size);
- input_options (&ib);
-
- skip = header->main_size + opts_offset;
- l -= skip;
- p += skip;
- }
- while (l > 0);
-
- 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;
+ struct cl_decoded_option *option = &save_decoded_options[i];
+ const char *q, *p;
+
+ /* Skip frontend and driver specific options here. */
+ if (!(cl_options[option->opt_index].flags & (CL_COMMON|CL_TARGET|CL_LTO)))
+ continue;
+
+ /* Drop options created from the gcc driver that will be rejected
+ when passed on to the driver again. */
+ if (cl_options[option->opt_index].cl_reject_driver)
+ continue;
+
+ /* Also drop all options that are handled by the driver as well,
+ which includes things like -o and -v or -fhelp for example.
+ We do not need those. Also drop all diagnostic options. */
+ if (cl_options[option->opt_index].flags & (CL_DRIVER|CL_WARNING))
+ continue;
+
+ /* Skip explicitly some common options that we do not need. */
+ switch (option->opt_index)
+ {
+ case OPT_dumpbase:
+ case OPT_SPECIAL_input_file:
+ continue;
- FOR_EACH_VEC_ELT (opt_t, opts, i, o)
- {
- void *flag_var = option_flag_var (o->code, &global_options);
+ default:
+ break;
+ }
- if (flag_var)
- set_option (&global_options, &global_options_set,
- o->code, o->value, o->arg,
- DK_UNSPECIFIED, UNKNOWN_LOCATION, global_dc);
+ if (i != 1)
+ obstack_grow (&temporary_obstack, " ", 1);
+ obstack_grow (&temporary_obstack, "'", 1);
+ q = option->canonical_option[0];
+ while ((p = strchr (q, '\'')))
+ {
+ obstack_grow (&temporary_obstack, q, p - q);
+ obstack_grow (&temporary_obstack, "'\\''", 4);
+ q = ++p;
+ }
+ obstack_grow (&temporary_obstack, q, strlen (q));
+ obstack_grow (&temporary_obstack, "'", 1);
- if (o->type == CL_TARGET)
+ for (j = 1; j < option->canonical_option_num_elements; ++j)
{
- struct cl_decoded_option decoded;
- generate_option (o->code, o->arg, o->value, CL_TARGET, &decoded);
- targetm_common.handle_option (&global_options, &global_options_set,
- &decoded, UNKNOWN_LOCATION);
+ obstack_grow (&temporary_obstack, " '", 2);
+ q = option->canonical_option[j];
+ while ((p = strchr (q, '\'')))
+ {
+ obstack_grow (&temporary_obstack, q, p - q);
+ obstack_grow (&temporary_obstack, "'\\''", 4);
+ q = ++p;
+ }
+ obstack_grow (&temporary_obstack, q, strlen (q));
+ obstack_grow (&temporary_obstack, "'", 1);
}
- else if (o->type == CL_COMMON)
- gcc_assert (flag_var);
- else
- gcc_unreachable ();
}
+ obstack_grow (&temporary_obstack, "\0", 1);
+ args = XOBFINISH (&temporary_obstack, char *);
+ lto_output_data_stream (&stream, args, strlen (args) + 1);
- /* Flag_shlib is usually set by finish_options, but we are issuing flag_pic
- too late. */
- if (flag_pic && !flag_pie)
- flag_shlib = 1;
- VEC_free (opt_t, heap, opts);
+ lto_write_stream (&stream);
+ lto_end_section ();
+
+ obstack_free (&temporary_obstack, NULL);
+ free (section_name);
}
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index f3c93682633..58d487485ec 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -882,12 +882,7 @@ extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
/* In lto-opts.c. */
-extern void lto_register_user_option (size_t, const char *, int, unsigned 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 */
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 1bf7ded2524..5fb37624810 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -45,6 +45,14 @@ along with GCC; see the file COPYING3. If not see
#include "obstack.h"
#include "opts.h"
#include "options.h"
+#include "simple-object.h"
+
+/* From lto-streamer.h which we cannot include with -fkeep-inline-functions.
+ ??? Split out a lto-streamer-core.h. */
+
+#define LTO_SECTION_NAME_PREFIX ".gnu.lto_"
+
+/* End of lto-streamer.h copy. */
int debug; /* true if -save-temps. */
int verbose; /* true if -v. */
@@ -292,41 +300,122 @@ get_options_from_collect_gcc_options (const char *collect_gcc,
struct cl_decoded_option **decoded_options,
unsigned int *decoded_options_count)
{
+ struct obstack argv_obstack;
char *argv_storage;
const char **argv;
- int i, j, argc;
-
- /* Count arguments, account for the program name. */
- argc = 2;
- for (j = 0; collect_gcc_options[j] != '\0'; ++j)
- if (collect_gcc_options[j] == '\'')
- ++argc;
- if (argc % 2 != 0)
- fatal ("malformed COLLECT_GCC_OPTIONS");
-
- /* Copy the options to a argv-like array. */
- argc /= 2;
- argv = (const char **) xmalloc ((argc + 2) * sizeof (char *));
- argv[0] = collect_gcc;
+ int j, k, argc;
+
argv_storage = xstrdup (collect_gcc_options);
- for (i = 1, j = 0; argv_storage[j] != '\0'; ++j)
+ obstack_init (&argv_obstack);
+ obstack_ptr_grow (&argv_obstack, collect_gcc);
+
+ for (j = 0, k = 0; argv_storage[j] != '\0'; ++j)
{
if (argv_storage[j] == '\'')
{
- argv[i++] = &argv_storage[++j];
- while (argv_storage[j] != '\'')
- ++j;
- argv_storage[j] = '\0';
+ obstack_ptr_grow (&argv_obstack, &argv_storage[k]);
+ ++j;
+ do
+ {
+ if (argv_storage[j] == '\0')
+ fatal ("malformed COLLECT_GCC_OPTIONS");
+ else if (strncmp (&argv_storage[j], "'\\''", 4) == 0)
+ {
+ argv_storage[k++] = '\'';
+ j += 4;
+ }
+ else if (argv_storage[j] == '\'')
+ break;
+ else
+ argv_storage[k++] = argv_storage[j++];
+ }
+ while (1);
+ argv_storage[k++] = '\0';
}
}
- argv[i] = NULL;
+
+ obstack_ptr_grow (&argv_obstack, NULL);
+ argc = obstack_object_size (&argv_obstack) / sizeof (void *) - 1;
+ argv = XOBFINISH (&argv_obstack, const char **);
decode_cmdline_options_to_array (argc, (const char **)argv,
lang_mask,
decoded_options, decoded_options_count);
- free (argv);
+ obstack_free (&argv_obstack, NULL);
+}
+
+/* Append OPTION to the options array DECODED_OPTIONS with size
+ DECODED_OPTIONS_COUNT. */
+
+static void
+append_option (struct cl_decoded_option **decoded_options,
+ unsigned int *decoded_options_count,
+ struct cl_decoded_option *option)
+{
+ ++*decoded_options_count;
+ *decoded_options
+ = (struct cl_decoded_option *)
+ xrealloc (*decoded_options,
+ (*decoded_options_count
+ * sizeof (struct cl_decoded_option)));
+ memcpy (&(*decoded_options)[*decoded_options_count - 1], option,
+ sizeof (struct cl_decoded_option));
}
+/* Try to merge and complain about options FDECODED_OPTIONS when applied
+ ontop of DECODED_OPTIONS. */
+
+static void
+merge_and_complain (struct cl_decoded_option **decoded_options,
+ unsigned int *decoded_options_count,
+ struct cl_decoded_option *fdecoded_options,
+ unsigned int fdecoded_options_count)
+{
+ unsigned int i, j;
+
+ /* ??? Merge options from files. Most cases can be
+ handled by either unioning or intersecting
+ (for example -fwrapv is a case for unioning,
+ -ffast-math is for intersection). Most complaints
+ about real conflicts between different options can
+ be deferred to the compiler proper. Options that
+ we can neither safely handle by intersection nor
+ unioning would need to be complained about here.
+ Ideally we'd have a flag in the opt files that
+ tells whether to union or intersect or reject.
+ In absence of that it's unclear what a good default is.
+ It's also difficult to get positional handling correct. */
+
+ /* The following does what the old LTO option code did,
+ union all target and a selected set of common options. */
+ for (i = 0; i < fdecoded_options_count; ++i)
+ {
+ struct cl_decoded_option *foption = &fdecoded_options[i];
+ switch (foption->opt_index)
+ {
+ default:
+ if (!(cl_options[foption->opt_index].flags & CL_TARGET))
+ break;
+
+ /* Fallthru. */
+ case OPT_fPIC:
+ case OPT_fpic:
+ case OPT_fpie:
+ case OPT_fcommon:
+ case OPT_fexceptions:
+ /* Do what the old LTO code did - collect exactly one option
+ setting per OPT code, we pick the first we encounter.
+ ??? This doesn't make too much sense, but when it doesn't
+ then we should complain. */
+ for (j = 0; j < *decoded_options_count; ++j)
+ if ((*decoded_options)[j].opt_index == foption->opt_index)
+ break;
+ if (j == *decoded_options_count)
+ append_option (decoded_options, decoded_options_count, foption);
+ break;
+ }
+ }
+}
/* Execute gcc. ARGC is the number of arguments. ARGV contains the arguments. */
@@ -342,6 +431,8 @@ run_gcc (unsigned argc, char *argv[])
int parallel = 0;
int jobserver = 0;
bool no_partition = false;
+ struct cl_decoded_option *fdecoded_options = NULL;
+ unsigned int fdecoded_options_count = 0;
struct cl_decoded_option *decoded_options;
unsigned int decoded_options_count;
struct obstack argv_obstack;
@@ -359,11 +450,125 @@ run_gcc (unsigned argc, char *argv[])
&decoded_options,
&decoded_options_count);
+ /* Look at saved options in the IL files. */
+ for (i = 1; i < argc; ++i)
+ {
+ char *data, *p;
+ char *fopts;
+ int fd;
+ const char *errmsg;
+ int err;
+ off_t file_offset = 0, offset, length;
+ long loffset;
+ simple_object_read *sobj;
+ int consumed;
+ struct cl_decoded_option *f2decoded_options;
+ unsigned int f2decoded_options_count;
+ char *filename = argv[i];
+ if ((p = strrchr (argv[i], '@'))
+ && p != argv[i]
+ && sscanf (p, "@%li%n", &loffset, &consumed) >= 1
+ && strlen (p) == (unsigned int) consumed)
+ {
+ filename = XNEWVEC (char, p - argv[i] + 1);
+ memcpy (filename, argv[i], p - argv[i]);
+ filename[p - argv[i]] = '\0';
+ file_offset = (off_t) loffset;
+ }
+ fd = open (argv[i], O_RDONLY);
+ if (fd == -1)
+ continue;
+ sobj = simple_object_start_read (fd, file_offset, NULL, &errmsg, &err);
+ if (!sobj)
+ {
+ close (fd);
+ continue;
+ }
+ if (!simple_object_find_section (sobj, LTO_SECTION_NAME_PREFIX "." "opts",
+ &offset, &length, &errmsg, &err))
+ {
+ simple_object_release_read (sobj);
+ close (fd);
+ continue;
+ }
+ lseek (fd, file_offset + offset, SEEK_SET);
+ data = (char *)xmalloc (length);
+ read (fd, data, length);
+ fopts = data;
+ do
+ {
+ get_options_from_collect_gcc_options (collect_gcc,
+ fopts, CL_LANG_ALL,
+ &f2decoded_options,
+ &f2decoded_options_count);
+ if (!fdecoded_options)
+ {
+ fdecoded_options = f2decoded_options;
+ fdecoded_options_count = f2decoded_options_count;
+ }
+ else
+ merge_and_complain (&fdecoded_options,
+ &fdecoded_options_count,
+ f2decoded_options, f2decoded_options_count);
+
+ fopts += strlen (fopts) + 1;
+ }
+ while (fopts - data < length);
+
+ free (data);
+ simple_object_release_read (sobj);
+ close (fd);
+ }
+
/* Initalize the common arguments for the driver. */
obstack_init (&argv_obstack);
obstack_ptr_grow (&argv_obstack, collect_gcc);
obstack_ptr_grow (&argv_obstack, "-xlto");
obstack_ptr_grow (&argv_obstack, "-c");
+
+ /* Append compiler driver arguments as far as they were merged. */
+ for (j = 1; j < fdecoded_options_count; ++j)
+ {
+ struct cl_decoded_option *option = &fdecoded_options[j];
+
+ /* File options have been properly filtered by lto-opts.c. */
+ switch (option->opt_index)
+ {
+ /* Drop arguments that we want to take from the link line. */
+ case OPT_flto_:
+ case OPT_flto:
+ case OPT_flto_partition_none:
+ case OPT_flto_partition_1to1:
+ case OPT_flto_partition_balanced:
+ continue;
+
+ default:
+ break;
+ }
+
+ /* For now do what the original LTO option code was doing - pass
+ on any CL_TARGET flag and a few selected others. */
+ switch (option->opt_index)
+ {
+ case OPT_fPIC:
+ case OPT_fpic:
+ case OPT_fpie:
+ case OPT_fcommon:
+ case OPT_fexceptions:
+ break;
+
+ default:
+ if (!(cl_options[option->opt_index].flags & CL_TARGET))
+ continue;
+ }
+
+ /* Pass the option on. */
+ for (i = 0; i < option->canonical_option_num_elements; ++i)
+ obstack_ptr_grow (&argv_obstack, option->canonical_option[i]);
+ }
+
+ /* Append linker driver arguments. Compiler options from the linker
+ driver arguments will override / merge with those from the compiler. */
for (j = 1; j < decoded_options_count; ++j)
{
struct cl_decoded_option *option = &decoded_options[j];
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 5de85dd4f33..d8bbd9ca8dd 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR lto/44965
+ * lto-lang.c (lto_post_options): Do not read file options.
+ * lto.c (lto_read_all_file_options): Remove.
+ (lto_init): Call lto_set_in_hooks here.
+
2011-10-09 Jan Hubicka <jh@suse.cz>
* lto.c (node_cmp, varpool_node_cmp): New functions.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 4a5f6fe8ab5..c702b9a2d24 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -692,8 +692,6 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
support. */
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
- lto_read_all_file_options ();
-
/* Initialize the compiler back end. */
return false;
}
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c50a97ec205..3b35604af8d 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2494,60 +2494,6 @@ lto_fixup_decls (struct lto_file_decl_data **files)
}
}
-/* 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);
- if (!quiet_flag)
- fprintf (stderr, "Reading command line options:");
-
- for (i = 0; i < num_in_fnames; i++)
- {
- struct lto_file_decl_data *file_data;
- lto_file *file = lto_obj_file_open (in_fnames[i], false);
- if (!file)
- break;
- if (!quiet_flag)
- {
- fprintf (stderr, " %s", in_fnames[i]);
- fflush (stderr);
- }
-
- file_data = XCNEW (struct lto_file_decl_data);
- file_data->file_name = file->filename;
- file_data->section_hash_table = lto_obj_build_section_table (file, NULL);
-
- lto_read_file_options (file_data);
-
- lto_obj_file_close (file);
- htab_delete (file_data->section_hash_table);
- free (file_data);
- }
-
- if (!quiet_flag)
- fprintf (stderr, "\n");
-
- /* Apply globally the options read from all the files. */
- lto_reissue_options ();
-}
-
static GTY((length ("lto_stats.num_input_files + 1"))) struct lto_file_decl_data **all_file_decl_data;
/* Turn file datas for sub files into a single array, so that they look
@@ -2921,6 +2867,7 @@ lto_init (void)
lto_process_name ();
lto_streamer_hooks_init ();
lto_reader_init ();
+ lto_set_in_hooks (NULL, get_section_data, free_section_data);
memset (&lto_stats, 0, sizeof (lto_stats));
bitmap_obstack_initialize (NULL);
gimple_register_cfg_hooks ();
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
index d96af1d2f2b..e93d45fabb3 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -89,9 +89,8 @@ if [ -n "$HEADERS" ]; then
fi
# If this is tm.h, now include insn-flags.h only if IN_GCC is defined
-# but neither GENERATOR_FILE nor USED_FOR_TARGET is defined. Also
-# include libgcc_tm.h if USED_FOR_TARGET is defined. (Much of this is
-# temporary.)
+# but neither GENERATOR_FILE nor USED_FOR_TARGET is defined. (Much of this
+# is temporary.)
case $output in
tm.h )
@@ -99,9 +98,6 @@ case $output in
#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET
# include "insn-flags.h"
#endif
-#ifdef USED_FOR_TARGET
-# include "libgcc_tm.h"
-#endif
EOF
;;
esac
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index ff36803c4e2..424c1f45b54 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -4999,7 +4999,7 @@ expand_omp_atomic_store (basic_block load_bb, tree addr)
}
/* A subroutine of expand_omp_atomic. Attempt to implement the atomic
- operation as a __sync_fetch_and_op builtin. INDEX is log2 of the
+ operation as a __atomic_fetch_op builtin. INDEX is log2 of the
size of the data type, and thus usable to find the index of the builtin
decl. Returns false if the expression is not of the proper form. */
@@ -5010,13 +5010,14 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
{
enum built_in_function oldbase, newbase, tmpbase;
tree decl, itype, call;
- direct_optab optab, oldoptab, newoptab;
tree lhs, rhs;
basic_block store_bb = single_succ (load_bb);
gimple_stmt_iterator gsi;
gimple stmt;
location_t loc;
+ enum tree_code code;
bool need_old, need_new;
+ enum machine_mode imode;
/* We expect to find the following sequences:
@@ -5048,47 +5049,34 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
return false;
/* Check for one of the supported fetch-op operations. */
- switch (gimple_assign_rhs_code (stmt))
+ code = gimple_assign_rhs_code (stmt);
+ switch (code)
{
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
- oldbase = BUILT_IN_SYNC_FETCH_AND_ADD_N;
- newbase = BUILT_IN_SYNC_ADD_AND_FETCH_N;
- optab = sync_add_optab;
- oldoptab = sync_old_add_optab;
- newoptab = sync_new_add_optab;
+ oldbase = BUILT_IN_ATOMIC_FETCH_ADD_N;
+ newbase = BUILT_IN_ATOMIC_ADD_FETCH_N;
break;
case MINUS_EXPR:
- oldbase = BUILT_IN_SYNC_FETCH_AND_SUB_N;
- newbase = BUILT_IN_SYNC_SUB_AND_FETCH_N;
- optab = sync_add_optab;
- oldoptab = sync_old_add_optab;
- newoptab = sync_new_add_optab;
+ oldbase = BUILT_IN_ATOMIC_FETCH_SUB_N;
+ newbase = BUILT_IN_ATOMIC_SUB_FETCH_N;
break;
case BIT_AND_EXPR:
- oldbase = BUILT_IN_SYNC_FETCH_AND_AND_N;
- newbase = BUILT_IN_SYNC_AND_AND_FETCH_N;
- optab = sync_and_optab;
- oldoptab = sync_old_and_optab;
- newoptab = sync_new_and_optab;
+ oldbase = BUILT_IN_ATOMIC_FETCH_AND_N;
+ newbase = BUILT_IN_ATOMIC_AND_FETCH_N;
break;
case BIT_IOR_EXPR:
- oldbase = BUILT_IN_SYNC_FETCH_AND_OR_N;
- newbase = BUILT_IN_SYNC_OR_AND_FETCH_N;
- optab = sync_ior_optab;
- oldoptab = sync_old_ior_optab;
- newoptab = sync_new_ior_optab;
+ oldbase = BUILT_IN_ATOMIC_FETCH_OR_N;
+ newbase = BUILT_IN_ATOMIC_OR_FETCH_N;
break;
case BIT_XOR_EXPR:
- oldbase = BUILT_IN_SYNC_FETCH_AND_XOR_N;
- newbase = BUILT_IN_SYNC_XOR_AND_FETCH_N;
- optab = sync_xor_optab;
- oldoptab = sync_old_xor_optab;
- newoptab = sync_new_xor_optab;
+ oldbase = BUILT_IN_ATOMIC_FETCH_XOR_N;
+ newbase = BUILT_IN_ATOMIC_XOR_FETCH_N;
break;
default:
return false;
}
+
/* Make sure the expression is of the proper form. */
if (operand_equal_p (gimple_assign_rhs1 (stmt), loaded_val, 0))
rhs = gimple_assign_rhs2 (stmt);
@@ -5104,37 +5092,25 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
if (decl == NULL_TREE)
return false;
itype = TREE_TYPE (TREE_TYPE (decl));
+ imode = TYPE_MODE (itype);
- if (need_new)
- {
- /* expand_sync_fetch_operation can always compensate when interested
- in the new value. */
- if (direct_optab_handler (newoptab, TYPE_MODE (itype))
- == CODE_FOR_nothing
- && direct_optab_handler (oldoptab, TYPE_MODE (itype))
- == CODE_FOR_nothing)
- return false;
- }
- else if (need_old)
- {
- /* When interested in the old value, expand_sync_fetch_operation
- can compensate only if the operation is reversible. AND and OR
- are not reversible. */
- if (direct_optab_handler (oldoptab, TYPE_MODE (itype))
- == CODE_FOR_nothing
- && (oldbase == BUILT_IN_SYNC_FETCH_AND_AND_N
- || oldbase == BUILT_IN_SYNC_FETCH_AND_OR_N
- || direct_optab_handler (newoptab, TYPE_MODE (itype))
- == CODE_FOR_nothing))
- return false;
- }
- else if (direct_optab_handler (optab, TYPE_MODE (itype)) == CODE_FOR_nothing)
+ /* We could test all of the various optabs involved, but the fact of the
+ matter is that (with the exception of i486 vs i586 and xadd) all targets
+ that support any atomic operaton optab also implements compare-and-swap.
+ Let optabs.c take care of expanding any compare-and-swap loop. */
+ if (!can_compare_and_swap_p (imode))
return false;
gsi = gsi_last_bb (load_bb);
gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_ATOMIC_LOAD);
- call = build_call_expr_loc (loc, decl, 2, addr,
- fold_convert_loc (loc, itype, rhs));
+
+ /* OpenMP does not imply any barrier-like semantics on its atomic ops.
+ It only requires that the operation happen atomically. Thus we can
+ use the RELAXED memory model. */
+ call = build_call_expr_loc (loc, decl, 3, addr,
+ fold_convert_loc (loc, itype, rhs),
+ build_int_cst (NULL, MEMMODEL_RELAXED));
+
if (need_old || need_new)
{
lhs = need_old ? loaded_val : stored_val;
@@ -5183,6 +5159,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
edge e;
enum built_in_function fncode;
+ /* ??? We need a non-pointer interface to __atomic_compare_exchange in
+ order to use the RELAXED memory model effectively. */
fncode = (enum built_in_function)((int)BUILT_IN_SYNC_VAL_COMPARE_AND_SWAP_N
+ index + 1);
cmpxchg = builtin_decl_explicit (fncode);
@@ -5191,8 +5169,7 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
itype = TREE_TYPE (TREE_TYPE (cmpxchg));
- if (direct_optab_handler (sync_compare_and_swap_optab, TYPE_MODE (itype))
- == CODE_FOR_nothing)
+ if (!can_compare_and_swap_p (TYPE_MODE (itype)))
return false;
/* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD. */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index f07381cf836..a466e56fc68 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -7162,43 +7162,25 @@ expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2,
}
-/* This is an internal subroutine of the other compare_and_swap expanders.
- MEM, OLD_VAL and NEW_VAL are as you'd expect for a compare-and-swap
- operation. TARGET is an optional place to store the value result of
- the operation. ICODE is the particular instruction to expand. Return
- the result of the operation. */
+/* Return true if there is a compare_and_swap pattern. */
-static rtx
-expand_val_compare_and_swap_1 (rtx mem, rtx old_val, rtx new_val,
- rtx target, enum insn_code icode)
+bool
+can_compare_and_swap_p (enum machine_mode mode)
{
- struct expand_operand ops[4];
- enum machine_mode mode = GET_MODE (mem);
-
- create_output_operand (&ops[0], target, mode);
- create_fixed_operand (&ops[1], mem);
- /* OLD_VAL and NEW_VAL may have been promoted to a wider mode.
- Shrink them if so. */
- create_convert_operand_to (&ops[2], old_val, mode, true);
- create_convert_operand_to (&ops[3], new_val, mode, true);
- if (maybe_expand_insn (icode, 4, ops))
- return ops[0].value;
- return NULL_RTX;
-}
-
-/* Expand a compare-and-swap operation and return its value. */
+ enum insn_code icode;
-rtx
-expand_val_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
-{
- enum machine_mode mode = GET_MODE (mem);
- enum insn_code icode
- = direct_optab_handler (sync_compare_and_swap_optab, mode);
+ /* Check for __sync_compare_and_swap. */
+ icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
+ if (icode != CODE_FOR_nothing)
+ return true;
- if (icode == CODE_FOR_nothing)
- return NULL_RTX;
+ /* Check for __atomic_compare_and_swap. */
+ icode = direct_optab_handler (atomic_compare_and_swap_optab, mode);
+ if (icode != CODE_FOR_nothing)
+ return true;
- return expand_val_compare_and_swap_1 (mem, old_val, new_val, target, icode);
+ /* No inline compare and swap. */
+ return false;
}
/* Helper function to find the MODE_CC set in a sync_compare_and_swap
@@ -7216,58 +7198,6 @@ find_cc_set (rtx x, const_rtx pat, void *data)
}
}
-/* Expand a compare-and-swap operation and store true into the result if
- the operation was successful and false otherwise. Return the result.
- Unlike other routines, TARGET is not optional. */
-
-rtx
-expand_bool_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
-{
- enum machine_mode mode = GET_MODE (mem);
- enum insn_code icode;
- rtx subtarget, seq, cc_reg;
-
- /* If the target supports a compare-and-swap pattern that simultaneously
- sets some flag for success, then use it. Otherwise use the regular
- compare-and-swap and follow that immediately with a compare insn. */
- icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
- if (icode == CODE_FOR_nothing)
- return NULL_RTX;
-
- do_pending_stack_adjust ();
- do
- {
- start_sequence ();
- subtarget = expand_val_compare_and_swap_1 (mem, old_val, new_val,
- NULL_RTX, icode);
- cc_reg = NULL_RTX;
- if (subtarget == NULL_RTX)
- {
- end_sequence ();
- return NULL_RTX;
- }
-
- if (have_insn_for (COMPARE, CCmode))
- note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
- seq = get_insns ();
- end_sequence ();
-
- /* We might be comparing against an old value. Try again. :-( */
- if (!cc_reg && MEM_P (old_val))
- {
- seq = NULL_RTX;
- old_val = force_reg (mode, old_val);
- }
- }
- while (!seq);
-
- emit_insn (seq);
- if (cc_reg)
- return emit_store_flag_force (target, EQ, cc_reg, const0_rtx, VOIDmode, 0, 1);
- else
- return emit_store_flag_force (target, EQ, subtarget, old_val, VOIDmode, 1, 1);
-}
-
/* This is a helper function for the other atomic operations. This function
emits a loop that contains SEQ that iterates until a compare-and-swap
operation at the end succeeds. MEM is the memory to be modified. SEQ is
@@ -7281,8 +7211,7 @@ static bool
expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
{
enum machine_mode mode = GET_MODE (mem);
- enum insn_code icode;
- rtx label, cmp_reg, subtarget, cc_reg;
+ rtx label, cmp_reg, success, oldval;
/* The loop we want to generate looks like
@@ -7290,8 +7219,8 @@ expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
label:
old_reg = cmp_reg;
seq;
- cmp_reg = compare-and-swap(mem, old_reg, new_reg)
- if (cmp_reg != old_reg)
+ (success, cmp_reg) = compare-and-swap(mem, old_reg, new_reg)
+ if (success)
goto label;
Note that we only do the plain load from memory once. Subsequent
@@ -7306,331 +7235,600 @@ expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
if (seq)
emit_insn (seq);
- /* If the target supports a compare-and-swap pattern that simultaneously
- sets some flag for success, then use it. Otherwise use the regular
- compare-and-swap and follow that immediately with a compare insn. */
- icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
- if (icode == CODE_FOR_nothing)
+ success = NULL_RTX;
+ oldval = cmp_reg;
+ if (!expand_atomic_compare_and_swap (&success, &oldval, mem, old_reg,
+ new_reg, false, MEMMODEL_SEQ_CST,
+ MEMMODEL_RELAXED))
return false;
- subtarget = expand_val_compare_and_swap_1 (mem, old_reg, new_reg,
- cmp_reg, icode);
- if (subtarget == NULL_RTX)
- return false;
+ if (oldval != cmp_reg)
+ emit_move_insn (cmp_reg, oldval);
- cc_reg = NULL_RTX;
- if (have_insn_for (COMPARE, CCmode))
- note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
- if (cc_reg)
+ /* ??? Mark this jump predicted not taken? */
+ emit_cmp_and_jump_insns (success, const0_rtx, EQ, const0_rtx,
+ GET_MODE (success), 1, label);
+ return true;
+}
+
+
+/* This function expands the atomic exchange operation:
+ atomically store VAL in MEM and return the previous value in MEM.
+
+ MEMMODEL is the memory model variant to use.
+ TARGET is an optional place to stick the return value.
+ USE_TEST_AND_SET indicates whether __sync_lock_test_and_set should be used
+ as a fall back if the atomic_exchange pattern does not exist. */
+
+rtx
+expand_atomic_exchange (rtx target, rtx mem, rtx val, enum memmodel model,
+ bool use_test_and_set)
+{
+ enum machine_mode mode = GET_MODE (mem);
+ enum insn_code icode;
+ rtx last_insn;
+
+ /* If the target supports the exchange directly, great. */
+ icode = direct_optab_handler (atomic_exchange_optab, mode);
+ if (icode != CODE_FOR_nothing)
{
- cmp_reg = cc_reg;
- old_reg = const0_rtx;
+ struct expand_operand ops[4];
+
+ create_output_operand (&ops[0], target, mode);
+ create_fixed_operand (&ops[1], mem);
+ /* VAL may have been promoted to a wider mode. Shrink it if so. */
+ create_convert_operand_to (&ops[2], val, mode, true);
+ create_integer_operand (&ops[3], model);
+ if (maybe_expand_insn (icode, 4, ops))
+ return ops[0].value;
}
- else
+
+ /* Legacy sync_lock_test_and_set works the same, but is only defined as an
+ acquire barrier. If the pattern exists, and the memory model is stronger
+ than acquire, add a release barrier before the instruction.
+ The barrier is not needed if sync_lock_test_and_set doesn't exist since
+ it will expand into a compare-and-swap loop.
+
+ Some targets have non-compliant test_and_sets, so it would be incorrect
+ to emit a test_and_set in place of an __atomic_exchange. The test_and_set
+ builtin shares this expander since exchange can always replace the
+ test_and_set. */
+
+ if (use_test_and_set)
{
- if (subtarget != cmp_reg)
- emit_move_insn (cmp_reg, subtarget);
+ icode = direct_optab_handler (sync_lock_test_and_set_optab, mode);
+ last_insn = get_last_insn ();
+ if ((icode != CODE_FOR_nothing) && (model == MEMMODEL_SEQ_CST ||
+ model == MEMMODEL_RELEASE ||
+ model == MEMMODEL_ACQ_REL))
+ expand_builtin_mem_thread_fence (model);
+
+ if (icode != CODE_FOR_nothing)
+ {
+ struct expand_operand ops[3];
+
+ create_output_operand (&ops[0], target, mode);
+ create_fixed_operand (&ops[1], mem);
+ /* VAL may have been promoted to a wider mode. Shrink it if so. */
+ create_convert_operand_to (&ops[2], val, mode, true);
+ if (maybe_expand_insn (icode, 3, ops))
+ return ops[0].value;
+ }
+
+ /* Remove any fence that was inserted since a compare and swap loop is
+ already a full memory barrier. */
+ if (last_insn != get_last_insn ())
+ delete_insns_since (last_insn);
}
- /* ??? Mark this jump predicted not taken? */
- emit_cmp_and_jump_insns (cmp_reg, old_reg, NE, const0_rtx, GET_MODE (cmp_reg), 1,
- label);
+ /* Otherwise, use a compare-and-swap loop for the exchange. */
+ if (can_compare_and_swap_p (mode))
+ {
+ if (!target || !register_operand (target, mode))
+ target = gen_reg_rtx (mode);
+ if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
+ val = convert_modes (mode, GET_MODE (val), val, 1);
+ if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX))
+ return target;
+ }
+
+ return NULL_RTX;
+}
+
+/* This function expands the atomic compare exchange operation:
+
+ *PTARGET_BOOL is an optional place to store the boolean success/failure.
+ *PTARGET_OVAL is an optional place to store the old value from memory.
+ Both target parameters may be NULL to indicate that we do not care about
+ that return value. Both target parameters are updated on success to
+ the actual location of the corresponding result.
+
+ MEMMODEL is the memory model variant to use.
+
+ The return value of the function is true for success. */
+
+bool
+expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval,
+ rtx mem, rtx expected, rtx desired,
+ bool is_weak, enum memmodel succ_model,
+ enum memmodel fail_model)
+{
+ enum machine_mode mode = GET_MODE (mem);
+ struct expand_operand ops[8];
+ enum insn_code icode;
+ rtx target_bool, target_oval;
+
+ /* Load expected into a register for the compare and swap. */
+ if (MEM_P (expected))
+ expected = copy_to_reg (expected);
+
+ /* Make sure we always have some place to put the return oldval.
+ Further, make sure that place is distinct from the input expected,
+ just in case we need that path down below. */
+ if (ptarget_oval == NULL
+ || (target_oval = *ptarget_oval) == NULL
+ || reg_overlap_mentioned_p (expected, target_oval))
+ target_oval = gen_reg_rtx (mode);
+
+ icode = direct_optab_handler (atomic_compare_and_swap_optab, mode);
+ if (icode != CODE_FOR_nothing)
+ {
+ enum machine_mode bool_mode = insn_data[icode].operand[0].mode;
+
+ /* Make sure we always have a place for the bool operand. */
+ if (ptarget_bool == NULL
+ || (target_bool = *ptarget_bool) == NULL
+ || GET_MODE (target_bool) != bool_mode)
+ target_bool = gen_reg_rtx (bool_mode);
+
+ /* Emit the compare_and_swap. */
+ create_output_operand (&ops[0], target_bool, bool_mode);
+ create_output_operand (&ops[1], target_oval, mode);
+ create_fixed_operand (&ops[2], mem);
+ create_convert_operand_to (&ops[3], expected, mode, true);
+ create_convert_operand_to (&ops[4], desired, mode, true);
+ create_integer_operand (&ops[5], is_weak);
+ create_integer_operand (&ops[6], succ_model);
+ create_integer_operand (&ops[7], fail_model);
+ expand_insn (icode, 8, ops);
+
+ /* Return success/failure. */
+ target_bool = ops[0].value;
+ target_oval = ops[1].value;
+ goto success;
+ }
+
+ /* Otherwise fall back to the original __sync_val_compare_and_swap
+ which is always seq-cst. */
+ icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
+ if (icode != CODE_FOR_nothing)
+ {
+ rtx cc_reg;
+
+ create_output_operand (&ops[0], target_oval, mode);
+ create_fixed_operand (&ops[1], mem);
+ create_convert_operand_to (&ops[2], expected, mode, true);
+ create_convert_operand_to (&ops[3], desired, mode, true);
+ if (!maybe_expand_insn (icode, 4, ops))
+ return false;
+
+ target_oval = ops[0].value;
+ target_bool = NULL_RTX;
+
+ /* If the caller isn't interested in the boolean return value,
+ skip the computation of it. */
+ if (ptarget_bool == NULL)
+ goto success;
+
+ /* Otherwise, work out if the compare-and-swap succeeded. */
+ cc_reg = NULL_RTX;
+ if (have_insn_for (COMPARE, CCmode))
+ note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
+
+ target_bool
+ = (cc_reg
+ ? emit_store_flag_force (target_bool, EQ, cc_reg,
+ const0_rtx, VOIDmode, 0, 1)
+ : emit_store_flag_force (target_bool, EQ, target_oval,
+ expected, VOIDmode, 1, 1));
+ goto success;
+ }
+ return false;
+
+ success:
+ /* Make sure that the oval output winds up where the caller asked. */
+ if (ptarget_oval)
+ *ptarget_oval = target_oval;
+ if (ptarget_bool)
+ *ptarget_bool = target_bool;
return true;
}
-/* This function generates the atomic operation MEM CODE= VAL. In this
- case, we do not care about any resulting value. Returns NULL if we
- cannot generate the operation. */
+/* This function expands the atomic load operation:
+ return the atomically loaded value in MEM.
+
+ MEMMODEL is the memory model variant to use.
+ TARGET is an option place to stick the return value. */
rtx
-expand_sync_operation (rtx mem, rtx val, enum rtx_code code)
+expand_atomic_load (rtx target, rtx mem, enum memmodel model)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code icode;
- rtx insn;
- /* Look to see if the target supports the operation directly. */
- switch (code)
+ /* If the target supports the load directly, great. */
+ icode = direct_optab_handler (atomic_load_optab, mode);
+ if (icode != CODE_FOR_nothing)
{
- case PLUS:
- icode = direct_optab_handler (sync_add_optab, mode);
- break;
- case IOR:
- icode = direct_optab_handler (sync_ior_optab, mode);
- break;
- case XOR:
- icode = direct_optab_handler (sync_xor_optab, mode);
- break;
- case AND:
- icode = direct_optab_handler (sync_and_optab, mode);
- break;
- case NOT:
- icode = direct_optab_handler (sync_nand_optab, mode);
- break;
+ struct expand_operand ops[3];
- case MINUS:
- icode = direct_optab_handler (sync_sub_optab, mode);
- if (icode == CODE_FOR_nothing || CONST_INT_P (val))
- {
- icode = direct_optab_handler (sync_add_optab, mode);
- if (icode != CODE_FOR_nothing)
- {
- val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
- code = PLUS;
- }
- }
- break;
+ create_output_operand (&ops[0], target, mode);
+ create_fixed_operand (&ops[1], mem);
+ create_integer_operand (&ops[2], model);
+ if (maybe_expand_insn (icode, 3, ops))
+ return ops[0].value;
+ }
- default:
- gcc_unreachable ();
+ /* If the size of the object is greater than word size on this target,
+ then we assume that a load will not be atomic. */
+ if (GET_MODE_PRECISION (mode) > BITS_PER_WORD)
+ {
+ /* Issue val = compare_and_swap (mem, 0, 0).
+ This may cause the occasional harmless store of 0 when the value is
+ already 0, but it seems to be OK according to the standards guys. */
+ expand_atomic_compare_and_swap (NULL, &target, mem, const0_rtx,
+ const0_rtx, false, model, model);
+ return target;
}
- /* Generate the direct operation, if present. */
+ /* Otherwise assume loads are atomic, and emit the proper barriers. */
+ if (!target || target == const0_rtx)
+ target = gen_reg_rtx (mode);
+
+ /* Emit the appropriate barrier before the load. */
+ expand_builtin_mem_thread_fence (model);
+
+ emit_move_insn (target, mem);
+
+ /* For SEQ_CST, also emit a barrier after the load. */
+ if (model == MEMMODEL_SEQ_CST)
+ expand_builtin_mem_thread_fence (model);
+
+ return target;
+}
+
+/* This function expands the atomic store operation:
+ Atomically store VAL in MEM.
+ MEMMODEL is the memory model variant to use.
+ USE_RELEASE is true if __sync_lock_release can be used as a fall back.
+ function returns const0_rtx if a pattern was emitted. */
+
+rtx
+expand_atomic_store (rtx mem, rtx val, enum memmodel model, bool use_release)
+{
+ enum machine_mode mode = GET_MODE (mem);
+ enum insn_code icode;
+ struct expand_operand ops[3];
+
+ /* If the target supports the store directly, great. */
+ icode = direct_optab_handler (atomic_store_optab, mode);
if (icode != CODE_FOR_nothing)
{
- struct expand_operand ops[2];
-
create_fixed_operand (&ops[0], mem);
- /* VAL may have been promoted to a wider mode. Shrink it if so. */
- create_convert_operand_to (&ops[1], val, mode, true);
- if (maybe_expand_insn (icode, 2, ops))
+ create_input_operand (&ops[1], val, mode);
+ create_integer_operand (&ops[2], model);
+ if (maybe_expand_insn (icode, 3, ops))
return const0_rtx;
}
- /* Failing that, generate a compare-and-swap loop in which we perform the
- operation with normal arithmetic instructions. */
- if (direct_optab_handler (sync_compare_and_swap_optab, mode)
- != CODE_FOR_nothing)
+ /* If using __sync_lock_release is a viable alternative, try it. */
+ if (use_release)
{
- rtx t0 = gen_reg_rtx (mode), t1;
-
- start_sequence ();
-
- t1 = t0;
- if (code == NOT)
+ icode = direct_optab_handler (sync_lock_release_optab, mode);
+ if (icode != CODE_FOR_nothing)
{
- t1 = expand_simple_binop (mode, AND, t1, val, NULL_RTX,
- true, OPTAB_LIB_WIDEN);
- t1 = expand_simple_unop (mode, code, t1, NULL_RTX, true);
+ create_fixed_operand (&ops[0], mem);
+ create_input_operand (&ops[1], const0_rtx, mode);
+ if (maybe_expand_insn (icode, 2, ops))
+ {
+ /* lock_release is only a release barrier. */
+ if (model == MEMMODEL_SEQ_CST)
+ expand_builtin_mem_thread_fence (model);
+ return const0_rtx;
+ }
}
- else
- t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX,
- true, OPTAB_LIB_WIDEN);
- insn = get_insns ();
- end_sequence ();
+ }
- if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn))
- return const0_rtx;
+ /* If the size of the object is greater than word size on this target,
+ a default store will not be atomic, Try a mem_exchange and throw away
+ the result. If that doesn't work, don't do anything. */
+ if (GET_MODE_PRECISION(mode) > BITS_PER_WORD)
+ {
+ rtx target = expand_atomic_exchange (NULL_RTX, mem, val, model, false);
+ if (target)
+ return const0_rtx;
+ else
+ return NULL_RTX;
}
- return NULL_RTX;
+ /* If there is no mem_store, default to a move with barriers */
+ if (model == MEMMODEL_SEQ_CST || model == MEMMODEL_RELEASE)
+ expand_builtin_mem_thread_fence (model);
+
+ emit_move_insn (mem, val);
+
+ /* For SEQ_CST, also emit a barrier after the load. */
+ if (model == MEMMODEL_SEQ_CST)
+ expand_builtin_mem_thread_fence (model);
+
+ return const0_rtx;
}
-/* This function generates the atomic operation MEM CODE= VAL. In this
- case, we do care about the resulting value: if AFTER is true then
- return the value MEM holds after the operation, if AFTER is false
- then return the value MEM holds before the operation. TARGET is an
- optional place for the result value to be stored. */
-rtx
-expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code,
- bool after, rtx target)
+/* Structure containing the pointers and values required to process the
+ various forms of the atomic_fetch_op and atomic_op_fetch builtins. */
+
+struct atomic_op_functions
{
- enum machine_mode mode = GET_MODE (mem);
- enum insn_code old_code, new_code, icode;
- bool compensate;
- rtx insn;
+ struct direct_optab_d *mem_fetch_before;
+ struct direct_optab_d *mem_fetch_after;
+ struct direct_optab_d *mem_no_result;
+ struct direct_optab_d *fetch_before;
+ struct direct_optab_d *fetch_after;
+ struct direct_optab_d *no_result;
+ enum rtx_code reverse_code;
+};
+
+
+/* Fill in structure pointed to by OP with the various optab entries for an
+ operation of type CODE. */
+
+static void
+get_atomic_op_for_code (struct atomic_op_functions *op, enum rtx_code code)
+{
+ gcc_assert (op!= NULL);
- /* Look to see if the target supports the operation directly. */
+ /* If SWITCHABLE_TARGET is defined, then subtargets can be switched
+ in the source code during compilation, and the optab entries are not
+ computable until runtime. Fill in the values at runtime. */
switch (code)
{
case PLUS:
- old_code = direct_optab_handler (sync_old_add_optab, mode);
- new_code = direct_optab_handler (sync_new_add_optab, mode);
+ op->mem_fetch_before = atomic_fetch_add_optab;
+ op->mem_fetch_after = atomic_add_fetch_optab;
+ op->mem_no_result = atomic_add_optab;
+ op->fetch_before = sync_old_add_optab;
+ op->fetch_after = sync_new_add_optab;
+ op->no_result = sync_add_optab;
+ op->reverse_code = MINUS;
break;
- case IOR:
- old_code = direct_optab_handler (sync_old_ior_optab, mode);
- new_code = direct_optab_handler (sync_new_ior_optab, mode);
+ case MINUS:
+ op->mem_fetch_before = atomic_fetch_sub_optab;
+ op->mem_fetch_after = atomic_sub_fetch_optab;
+ op->mem_no_result = atomic_sub_optab;
+ op->fetch_before = sync_old_sub_optab;
+ op->fetch_after = sync_new_sub_optab;
+ op->no_result = sync_sub_optab;
+ op->reverse_code = PLUS;
break;
case XOR:
- old_code = direct_optab_handler (sync_old_xor_optab, mode);
- new_code = direct_optab_handler (sync_new_xor_optab, mode);
+ op->mem_fetch_before = atomic_fetch_xor_optab;
+ op->mem_fetch_after = atomic_xor_fetch_optab;
+ op->mem_no_result = atomic_xor_optab;
+ op->fetch_before = sync_old_xor_optab;
+ op->fetch_after = sync_new_xor_optab;
+ op->no_result = sync_xor_optab;
+ op->reverse_code = XOR;
break;
case AND:
- old_code = direct_optab_handler (sync_old_and_optab, mode);
- new_code = direct_optab_handler (sync_new_and_optab, mode);
+ op->mem_fetch_before = atomic_fetch_and_optab;
+ op->mem_fetch_after = atomic_and_fetch_optab;
+ op->mem_no_result = atomic_and_optab;
+ op->fetch_before = sync_old_and_optab;
+ op->fetch_after = sync_new_and_optab;
+ op->no_result = sync_and_optab;
+ op->reverse_code = UNKNOWN;
break;
- case NOT:
- old_code = direct_optab_handler (sync_old_nand_optab, mode);
- new_code = direct_optab_handler (sync_new_nand_optab, mode);
+ case IOR:
+ op->mem_fetch_before = atomic_fetch_or_optab;
+ op->mem_fetch_after = atomic_or_fetch_optab;
+ op->mem_no_result = atomic_or_optab;
+ op->fetch_before = sync_old_ior_optab;
+ op->fetch_after = sync_new_ior_optab;
+ op->no_result = sync_ior_optab;
+ op->reverse_code = UNKNOWN;
break;
-
- case MINUS:
- old_code = direct_optab_handler (sync_old_sub_optab, mode);
- new_code = direct_optab_handler (sync_new_sub_optab, mode);
- if ((old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing)
- || CONST_INT_P (val))
- {
- old_code = direct_optab_handler (sync_old_add_optab, mode);
- new_code = direct_optab_handler (sync_new_add_optab, mode);
- if (old_code != CODE_FOR_nothing || new_code != CODE_FOR_nothing)
- {
- val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
- code = PLUS;
- }
- }
+ case NOT:
+ op->mem_fetch_before = atomic_fetch_nand_optab;
+ op->mem_fetch_after = atomic_nand_fetch_optab;
+ op->mem_no_result = atomic_nand_optab;
+ op->fetch_before = sync_old_nand_optab;
+ op->fetch_after = sync_new_nand_optab;
+ op->no_result = sync_nand_optab;
+ op->reverse_code = UNKNOWN;
break;
-
default:
gcc_unreachable ();
}
+}
+
+/* Try to emit an instruction for a specific operation varaition.
+ OPTAB contains the OP functions.
+ TARGET is an optional place to return the result. const0_rtx means unused.
+ MEM is the memory location to operate on.
+ VAL is the value to use in the operation.
+ USE_MEMMODEL is TRUE if the variation with a memory model should be tried.
+ MODEL is the memory model, if used.
+ AFTER is true if the returned result is the value after the operation. */
+
+static rtx
+maybe_emit_op (const struct atomic_op_functions *optab, rtx target, rtx mem,
+ rtx val, bool use_memmodel, enum memmodel model, bool after)
+{
+ enum machine_mode mode = GET_MODE (mem);
+ struct direct_optab_d *this_optab;
+ struct expand_operand ops[4];
+ enum insn_code icode;
+ int op_counter = 0;
+ int num_ops;
- /* If the target does supports the proper new/old operation, great. But
- if we only support the opposite old/new operation, check to see if we
- can compensate. In the case in which the old value is supported, then
- we can always perform the operation again with normal arithmetic. In
- the case in which the new value is supported, then we can only handle
- this in the case the operation is reversible. */
- compensate = false;
- if (after)
+ /* Check to see if there is a result returned. */
+ if (target == const0_rtx)
{
- icode = new_code;
- if (icode == CODE_FOR_nothing)
- {
- icode = old_code;
- if (icode != CODE_FOR_nothing)
- compensate = true;
+ if (use_memmodel)
+ {
+ this_optab = optab->mem_no_result;
+ create_integer_operand (&ops[2], model);
+ num_ops = 3;
+ }
+ else
+ {
+ this_optab = optab->no_result;
+ num_ops = 2;
}
}
+ /* Otherwise, we need to generate a result. */
else
{
- icode = old_code;
- if (icode == CODE_FOR_nothing
- && (code == PLUS || code == MINUS || code == XOR))
+ if (use_memmodel)
+ {
+ this_optab = after ? optab->mem_fetch_after : optab->mem_fetch_before;
+ create_integer_operand (&ops[3], model);
+ num_ops= 4;
+ }
+ else
{
- icode = new_code;
- if (icode != CODE_FOR_nothing)
- compensate = true;
+ this_optab = after ? optab->fetch_after : optab->fetch_before;
+ num_ops = 3;
}
+ create_output_operand (&ops[op_counter++], target, mode);
}
- /* If we found something supported, great. */
- if (icode != CODE_FOR_nothing)
+ icode = direct_optab_handler (this_optab, mode);
+ if (icode == CODE_FOR_nothing)
+ return NULL_RTX;
+
+ create_fixed_operand (&ops[op_counter++], mem);
+ /* VAL may have been promoted to a wider mode. Shrink it if so. */
+ create_convert_operand_to (&ops[op_counter++], val, mode, true);
+
+ if (maybe_expand_insn (icode, num_ops, ops))
+ return ((target == const0_rtx) ? const0_rtx : ops[0].value);
+
+ return NULL_RTX;
+}
+
+
+/* This function expands an atomic fetch_OP or OP_fetch operation:
+ TARGET is an option place to stick the return value. const0_rtx indicates
+ the result is unused.
+ atomically fetch MEM, perform the operation with VAL and return it to MEM.
+ CODE is the operation being performed (OP)
+ MEMMODEL is the memory model variant to use.
+ AFTER is true to return the result of the operation (OP_fetch).
+ AFTER is false to return the value before the operation (fetch_OP). */
+rtx
+expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code,
+ enum memmodel model, bool after)
+{
+ enum machine_mode mode = GET_MODE (mem);
+ struct atomic_op_functions optab;
+ rtx result;
+ bool unused_result = (target == const0_rtx);
+
+ get_atomic_op_for_code (&optab, code);
+
+ /* Check for the case where the result isn't used and try those patterns. */
+ if (unused_result)
{
- struct expand_operand ops[3];
+ /* Try the memory model variant first. */
+ result = maybe_emit_op (&optab, target, mem, val, true, model, true);
+ if (result)
+ return result;
- create_output_operand (&ops[0], target, mode);
- create_fixed_operand (&ops[1], mem);
- /* VAL may have been promoted to a wider mode. Shrink it if so. */
- create_convert_operand_to (&ops[2], val, mode, true);
- if (maybe_expand_insn (icode, 3, ops))
- {
- target = ops[0].value;
- val = ops[2].value;
- /* If we need to compensate for using an operation with the
- wrong return value, do so now. */
- if (compensate)
- {
- if (!after)
- {
- if (code == PLUS)
- code = MINUS;
- else if (code == MINUS)
- code = PLUS;
- }
+ /* Next try the old style withuot a memory model. */
+ result = maybe_emit_op (&optab, target, mem, val, false, model, true);
+ if (result)
+ return result;
- if (code == NOT)
- {
- target = expand_simple_binop (mode, AND, target, val,
- NULL_RTX, true,
- OPTAB_LIB_WIDEN);
- target = expand_simple_unop (mode, code, target,
- NULL_RTX, true);
- }
- else
- target = expand_simple_binop (mode, code, target, val,
- NULL_RTX, true,
- OPTAB_LIB_WIDEN);
- }
+ /* There is no no-result pattern, so try patterns with a result. */
+ target = NULL_RTX;
+ }
- return target;
+ /* Try the __atomic version. */
+ result = maybe_emit_op (&optab, target, mem, val, true, model, after);
+ if (result)
+ return result;
+
+ /* Try the older __sync version. */
+ result = maybe_emit_op (&optab, target, mem, val, false, model, after);
+ if (result)
+ return result;
+
+ /* If the fetch value can be calculated from the other variation of fetch,
+ try that operation. */
+ if (after || optab.reverse_code != UNKNOWN || target == const0_rtx)
+ {
+ /* Try the __atomic version, then the older __sync version. */
+ result = maybe_emit_op (&optab, target, mem, val, true, model, !after);
+ if (!result)
+ result = maybe_emit_op (&optab, target, mem, val, false, model, !after);
+
+ if (result)
+ {
+ /* If the result isn't used, no need to do compensation code. */
+ if (unused_result)
+ return target;
+
+ /* Issue compensation code. Fetch_after == fetch_before OP val.
+ Fetch_before == after REVERSE_OP val. */
+ if (!after)
+ code = optab.reverse_code;
+ result = expand_simple_binop (mode, code, result, val, NULL_RTX, true,
+ OPTAB_LIB_WIDEN);
+ return result;
}
}
- /* Failing that, generate a compare-and-swap loop in which we perform the
- operation with normal arithmetic instructions. */
- if (direct_optab_handler (sync_compare_and_swap_optab, mode)
- != CODE_FOR_nothing)
+ /* If nothing else has succeeded, default to a compare and swap loop. */
+ if (can_compare_and_swap_p (mode))
{
+ rtx insn;
rtx t0 = gen_reg_rtx (mode), t1;
- if (!target || !register_operand (target, mode))
- target = gen_reg_rtx (mode);
-
start_sequence ();
- if (!after)
- emit_move_insn (target, t0);
+ /* If the result is used, get a register for it. */
+ if (!unused_result)
+ {
+ if (!target || !register_operand (target, mode))
+ target = gen_reg_rtx (mode);
+ /* If fetch_before, copy the value now. */
+ if (!after)
+ emit_move_insn (target, t0);
+ }
+ else
+ target = const0_rtx;
+
t1 = t0;
if (code == NOT)
- {
+ {
t1 = expand_simple_binop (mode, AND, t1, val, NULL_RTX,
true, OPTAB_LIB_WIDEN);
t1 = expand_simple_unop (mode, code, t1, NULL_RTX, true);
}
else
- t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX,
- true, OPTAB_LIB_WIDEN);
- if (after)
- emit_move_insn (target, t1);
+ t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX, true,
+ OPTAB_LIB_WIDEN);
+ /* For after, copy the value now. */
+ if (!unused_result && after)
+ emit_move_insn (target, t1);
insn = get_insns ();
end_sequence ();
if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn))
- return target;
- }
-
- return NULL_RTX;
-}
-
-/* This function expands a test-and-set operation. Ideally we atomically
- store VAL in MEM and return the previous value in MEM. Some targets
- may not support this operation and only support VAL with the constant 1;
- in this case while the return value will be 0/1, but the exact value
- stored in MEM is target defined. TARGET is an option place to stick
- the return value. */
-
-rtx
-expand_sync_lock_test_and_set (rtx mem, rtx val, rtx target)
-{
- enum machine_mode mode = GET_MODE (mem);
- enum insn_code icode;
-
- /* If the target supports the test-and-set directly, great. */
- icode = direct_optab_handler (sync_lock_test_and_set_optab, mode);
- if (icode != CODE_FOR_nothing)
- {
- struct expand_operand ops[3];
-
- create_output_operand (&ops[0], target, mode);
- create_fixed_operand (&ops[1], mem);
- /* VAL may have been promoted to a wider mode. Shrink it if so. */
- create_convert_operand_to (&ops[2], val, mode, true);
- if (maybe_expand_insn (icode, 3, ops))
- return ops[0].value;
- }
-
- /* Otherwise, use a compare-and-swap loop for the exchange. */
- if (direct_optab_handler (sync_compare_and_swap_optab, mode)
- != CODE_FOR_nothing)
- {
- if (!target || !register_operand (target, mode))
- target = gen_reg_rtx (mode);
- if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
- val = convert_modes (mode, GET_MODE (val), val, 1);
- if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX))
- return target;
+ return target;
}
return NULL_RTX;
@@ -7838,6 +8036,14 @@ maybe_gen_insn (enum insn_code icode, unsigned int nops,
case 6:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value, ops[5].value);
+ case 7:
+ return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
+ ops[3].value, ops[4].value, ops[5].value,
+ ops[6].value);
+ case 8:
+ return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
+ ops[3].value, ops[4].value, ops[5].value,
+ ops[6].value, ops[7].value);
}
gcc_unreachable ();
}
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 8357a298618..d70b3fa0f91 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -695,6 +695,34 @@ enum direct_optab_index
/* Atomic clear with release semantics. */
DOI_sync_lock_release,
+ /* Atomic operations with memory model parameters. */
+ DOI_atomic_exchange,
+ DOI_atomic_compare_and_swap,
+ DOI_atomic_load,
+ DOI_atomic_store,
+ DOI_atomic_add_fetch,
+ DOI_atomic_sub_fetch,
+ DOI_atomic_and_fetch,
+ DOI_atomic_nand_fetch,
+ DOI_atomic_xor_fetch,
+ DOI_atomic_or_fetch,
+ DOI_atomic_fetch_add,
+ DOI_atomic_fetch_sub,
+ DOI_atomic_fetch_and,
+ DOI_atomic_fetch_nand,
+ DOI_atomic_fetch_xor,
+ DOI_atomic_fetch_or,
+ DOI_atomic_add,
+ DOI_atomic_sub,
+ DOI_atomic_and,
+ DOI_atomic_nand,
+ DOI_atomic_xor,
+ DOI_atomic_or,
+ DOI_atomic_always_lock_free,
+ DOI_atomic_is_lock_free,
+ DOI_atomic_thread_fence,
+ DOI_atomic_signal_fence,
+
/* Vector permutation. */
DOI_vec_perm,
DOI_vec_perm_const,
@@ -744,6 +772,60 @@ typedef struct direct_optab_d *direct_optab;
(&direct_optab_table[(int) DOI_sync_lock_test_and_set])
#define sync_lock_release_optab \
(&direct_optab_table[(int) DOI_sync_lock_release])
+
+#define atomic_exchange_optab \
+ (&direct_optab_table[(int) DOI_atomic_exchange])
+#define atomic_compare_and_swap_optab \
+ (&direct_optab_table[(int) DOI_atomic_compare_and_swap])
+#define atomic_load_optab \
+ (&direct_optab_table[(int) DOI_atomic_load])
+#define atomic_store_optab \
+ (&direct_optab_table[(int) DOI_atomic_store])
+#define atomic_add_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_add_fetch])
+#define atomic_sub_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_sub_fetch])
+#define atomic_and_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_and_fetch])
+#define atomic_nand_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_nand_fetch])
+#define atomic_xor_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_xor_fetch])
+#define atomic_or_fetch_optab \
+ (&direct_optab_table[(int) DOI_atomic_or_fetch])
+#define atomic_fetch_add_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_add])
+#define atomic_fetch_sub_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_sub])
+#define atomic_fetch_and_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_and])
+#define atomic_fetch_nand_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_nand])
+#define atomic_fetch_xor_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_xor])
+#define atomic_fetch_or_optab \
+ (&direct_optab_table[(int) DOI_atomic_fetch_or])
+#define atomic_add_optab \
+ (&direct_optab_table[(int) DOI_atomic_add])
+#define atomic_sub_optab \
+ (&direct_optab_table[(int) DOI_atomic_sub])
+#define atomic_and_optab \
+ (&direct_optab_table[(int) DOI_atomic_and])
+#define atomic_nand_optab \
+ (&direct_optab_table[(int) DOI_atomic_nand])
+#define atomic_xor_optab \
+ (&direct_optab_table[(int) DOI_atomic_xor])
+#define atomic_or_optab \
+ (&direct_optab_table[(int) DOI_atomic_or])
+#define atomic_always_lock_free_optab \
+ (&direct_optab_table[(int) DOI_atomic_always_lock_free])
+#define atomic_is_lock_free_optab \
+ (&direct_optab_table[(int) DOI_atomic_is_lock_free])
+#define atomic_thread_fence_optab \
+ (&direct_optab_table[(int) DOI_atomic_thread_fence])
+#define atomic_signal_fence_optab \
+ (&direct_optab_table[(int) DOI_atomic_signal_fence])
+
#define vec_perm_optab (&direct_optab_table[DOI_vec_perm])
#define vec_perm_const_optab (&direct_optab_table[(int) DOI_vec_perm_const])
@@ -883,6 +965,13 @@ extern void expand_float (rtx, rtx, int);
/* Return the insn_code for a FLOAT_EXPR. */
enum insn_code can_float_p (enum machine_mode, enum machine_mode, int);
+/* Return true if there is an inline compare and swap pattern. */
+extern bool can_compare_and_swap_p (enum machine_mode);
+
+/* Generate code for a compare and swap. */
+extern bool expand_atomic_compare_and_swap (rtx *, rtx *, rtx, rtx, rtx, bool,
+ enum memmodel, enum memmodel);
+
/* Check whether an operation represented by the code CODE is a
convert operation that is supported by the target platform in
vector form */
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index 0b86764cd79..00edbe6601c 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -878,9 +878,6 @@ handle_option (struct gcc_options *opts,
lang_mask, kind, loc,
handlers, dc))
return false;
- else
- handlers->post_handling_callback (decoded,
- handlers->handlers[i].mask);
}
return true;
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index 6fdc9519ca9..b93d56fcd8d 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -160,19 +160,6 @@ unknown_option_callback (const struct cl_decoded_option *decoded)
return true;
}
-/* Note that an option DECODED has been successfully handled with a
- handler for mask MASK. */
-
-static void
-post_handling_callback (const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
- unsigned int mask ATTRIBUTE_UNUSED)
-{
-#ifdef ENABLE_LTO
- lto_register_user_option (decoded->opt_index, decoded->arg,
- decoded->value, mask);
-#endif
-}
-
/* Handle a front-end option; arguments and return value as for
handle_option. */
@@ -282,7 +269,6 @@ set_default_handlers (struct cl_option_handlers *handlers)
{
handlers->unknown_option_callback = unknown_option_callback;
handlers->wrong_lang_callback = complain_wrong_lang;
- handlers->post_handling_callback = post_handling_callback;
handlers->num_handlers = 3;
handlers->handlers[0].handler = lang_handle_option;
handlers->handlers[0].mask = initial_lang_mask;
@@ -314,11 +300,6 @@ decode_options (struct gcc_options *opts, struct gcc_options *opts_set,
decoded_options, decoded_options_count,
loc, lang_mask, &handlers, dc);
-#ifdef ENABLE_LTO
- /* Clear any options currently held for LTO. */
- lto_clear_user_options ();
-#endif
-
read_cmdline_options (opts, opts_set,
decoded_options, decoded_options_count,
loc, lang_mask,
diff --git a/gcc/opts.h b/gcc/opts.h
index 621cdea4934..dbefc6401d9 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -291,10 +291,6 @@ struct cl_option_handlers
void (*wrong_lang_callback) (const struct cl_decoded_option *decoded,
unsigned int lang_mask);
- /* Callback to call after the successful handling of any option. */
- void (*post_handling_callback) (const struct cl_decoded_option *decoded,
- unsigned int mask);
-
/* The number of individual handlers. */
size_t num_handlers;
diff --git a/gcc/params.def b/gcc/params.def
index b55449b1d2c..239b684b5fc 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -928,11 +928,26 @@ DEFPARAM (PARAM_CASE_VALUES_THRESHOLD,
0, 0, 0)
/* Data race flags for C++0x memory model compliance. */
+DEFPARAM (PARAM_ALLOW_LOAD_DATA_RACES,
+ "allow-load-data-races",
+ "Allow new data races on loads to be introduced",
+ 1, 0, 1)
+
DEFPARAM (PARAM_ALLOW_STORE_DATA_RACES,
"allow-store-data-races",
"Allow new data races on stores to be introduced",
1, 0, 1)
+DEFPARAM (PARAM_ALLOW_PACKED_LOAD_DATA_RACES,
+ "allow-packed-load-data-races",
+ "Allow new data races on packed data loads to be introduced",
+ 1, 0, 1)
+
+DEFPARAM (PARAM_ALLOW_PACKED_STORE_DATA_RACES,
+ "allow-packed-store-data-races",
+ "Allow new data races on packed data stores to be introduced",
+ 1, 0, 1)
+
/* Reassociation width to be used by tree reassoc optimization. */
DEFPARAM (PARAM_TREE_REASSOC_WIDTH,
"tree-reassoc-width",
diff --git a/gcc/params.h b/gcc/params.h
index 783f3b3d51d..0bf8961fd0e 100644
--- a/gcc/params.h
+++ b/gcc/params.h
@@ -211,6 +211,13 @@ extern void init_param_values (int *params);
PARAM_VALUE (PARAM_MIN_NONDEBUG_INSN_UID)
#define MAX_STORES_TO_SINK \
PARAM_VALUE (PARAM_MAX_STORES_TO_SINK)
+#define ALLOW_LOAD_DATA_RACES \
+ PARAM_VALUE (PARAM_ALLOW_LOAD_DATA_RACES)
#define ALLOW_STORE_DATA_RACES \
PARAM_VALUE (PARAM_ALLOW_STORE_DATA_RACES)
+#define ALLOW_PACKED_LOAD_DATA_RACES \
+ PARAM_VALUE (PARAM_ALLOW_PACKED_LOAD_DATA_RACES)
+#define ALLOW_PACKED_STORE_DATA_RACES \
+ PARAM_VALUE (PARAM_ALLOW_PACKED_STORE_DATA_RACES)
+
#endif /* ! GCC_PARAMS_H */
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 70827cb6e6d..c7164125d0c 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,18 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * EXCLUDES (gthr-aix.h, gthr-dce.h, gthr-posix.c, gthr-posix.h)
+ (gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h)
+ (gthr-win32.h, gthr.h): Remove.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * EXCLUDES (config/vxlib.c, gbl-ctors.h, libgcc2.c, libgcc2.h)
+ (longlong.h): Remove.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * EXCLUDES (crtstuff.c): Remove.
+
2011-10-30 Joseph Myers <joseph@codesourcery.com>
* ja.po: Update.
diff --git a/gcc/po/EXCLUDES b/gcc/po/EXCLUDES
index 5a4ad770973..e04b9239363 100644
--- a/gcc/po/EXCLUDES
+++ b/gcc/po/EXCLUDES
@@ -22,26 +22,10 @@
# .def are examined to begin with.
# These files are part of libgcc, or target headers provided by gcc.
-config/vxlib.c
-crtstuff.c
-gbl-ctors.h
gcov-io.h
gcov-iov.c
-gthr-aix.h
-gthr-dce.h
-gthr-posix.c
-gthr-posix.h
-gthr-rtems.h
-gthr-single.h
-gthr-solaris.h
-gthr-vxworks.h
-gthr-win32.h
-gthr.h
-libgcc2.c
-libgcc2.h
limitx.h
limity.h
-longlong.h
# These programs are meant to be executed only by GCC maintainers or
# installers. Such files do not need to be translated, as these
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 8994366d922..886d024926c 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -112,8 +112,8 @@ reload_cse_simplify (rtx insn, rtx testreg)
if (REG_P (value)
&& ! REG_FUNCTION_VALUE_P (value))
value = 0;
- check_for_inc_dec (insn);
- delete_insn_and_edges (insn);
+ if (check_for_inc_dec (insn))
+ delete_insn_and_edges (insn);
return;
}
@@ -164,8 +164,8 @@ reload_cse_simplify (rtx insn, rtx testreg)
if (i < 0)
{
- check_for_inc_dec (insn);
- delete_insn_and_edges (insn);
+ if (check_for_inc_dec (insn))
+ delete_insn_and_edges (insn);
/* We're done with this insn. */
return;
}
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index db9c0fbbdd0..9bd8621c4ed 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -283,6 +283,7 @@ print_rtx (const_rtx in_rtx)
}
case NOTE_INSN_DELETED_LABEL:
+ case NOTE_INSN_DELETED_DEBUG_LABEL:
{
const char *label = NOTE_DELETED_LABEL_NAME (in_rtx);
if (label)
@@ -442,7 +443,8 @@ print_rtx (const_rtx in_rtx)
{
/* This field is only used for NOTE_INSN_DELETED_LABEL, and
other times often contains garbage from INSN->NOTE death. */
- if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL)
+ if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL
+ || NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_DEBUG_LABEL)
fprintf (outfile, " %d", XINT (in_rtx, i));
}
#if !defined(GENERATOR_FILE) && NUM_UNSPECV_VALUES > 0
@@ -466,11 +468,10 @@ print_rtx (const_rtx in_rtx)
const char *name;
#ifndef GENERATOR_FILE
- if (REG_P (in_rtx) && value < FIRST_PSEUDO_REGISTER)
- fprintf (outfile, " %d %s", REGNO (in_rtx),
- reg_names[REGNO (in_rtx)]);
+ if (REG_P (in_rtx) && (unsigned) value < FIRST_PSEUDO_REGISTER)
+ fprintf (outfile, " %d %s", value, reg_names[value]);
else if (REG_P (in_rtx)
- && value <= LAST_VIRTUAL_REGISTER)
+ && (unsigned) value <= LAST_VIRTUAL_REGISTER)
{
if (value == VIRTUAL_INCOMING_ARGS_REGNUM)
fprintf (outfile, " %d virtual-incoming-args", value);
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 537364192da..e9bf65f3003 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -1,7 +1,7 @@
/* Compute different info about registers.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -94,6 +94,9 @@ static tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
in dataflow more conveniently. */
regset regs_invalidated_by_call_regset;
+/* Same information as FIXED_REG_SET but in regset form. */
+regset fixed_reg_set_regset;
+
/* The bitmap_obstack is used to hold some static variables that
should not be reset after each function is compiled. */
static bitmap_obstack persistent_obstack;
@@ -451,6 +454,10 @@ init_reg_sets_1 (void)
}
else
CLEAR_REG_SET (regs_invalidated_by_call_regset);
+ if (!fixed_reg_set_regset)
+ fixed_reg_set_regset = ALLOC_REG_SET (&persistent_obstack);
+ else
+ CLEAR_REG_SET (fixed_reg_set_regset);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
@@ -462,7 +469,10 @@ init_reg_sets_1 (void)
#endif
if (fixed_regs[i])
- SET_HARD_REG_BIT (fixed_reg_set, i);
+ {
+ SET_HARD_REG_BIT (fixed_reg_set, i);
+ SET_REGNO_REG_SET (fixed_reg_set_regset, i);
+ }
if (call_used_regs[i])
SET_HARD_REG_BIT (call_used_reg_set, i);
diff --git a/gcc/regset.h b/gcc/regset.h
index 75082a06322..af807b03597 100644
--- a/gcc/regset.h
+++ b/gcc/regset.h
@@ -1,6 +1,6 @@
/* Define regsets.
Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -115,6 +115,9 @@ typedef bitmap_iterator reg_set_iterator;
extern regset regs_invalidated_by_call_regset;
+/* Same information as FIXED_REG_SET but in regset form. */
+extern regset fixed_reg_set_regset;
+
/* An obstack for regsets. */
extern bitmap_obstack reg_obstack;
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 04a839ede7b..c9fb57baa4c 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -8601,10 +8601,10 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type);
if (GET_MODE (loc) != GET_MODE (out))
- out = gen_rtx_REG (GET_MODE (loc), REGNO (out));
+ out = gen_rtx_REG (GET_MODE (loc), reg_or_subregno (out));
if (GET_MODE (loc) != GET_MODE (in))
- in = gen_rtx_REG (GET_MODE (loc), REGNO (in));
+ in = gen_rtx_REG (GET_MODE (loc), reg_or_subregno (in));
gen_reload (loc, in, opnum, type);
gen_reload (out, loc, opnum, type);
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 41536bea02c..fd3e3ef641e 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2396,7 +2396,7 @@ extern int exp_equiv_p (const_rtx, const_rtx, int, bool);
extern unsigned hash_rtx (const_rtx x, enum machine_mode, int *, int *, bool);
/* In dse.c */
-extern void check_for_inc_dec (rtx insn);
+extern bool check_for_inc_dec (rtx insn);
/* In jump.c */
extern int comparison_dominates_p (enum rtx_code, enum rtx_code);
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 8c15788eecd..5b6ea9ed88a 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -511,6 +511,12 @@ print_value (char *buf, const_rtx x, int verbose)
sprintf (t, "#%d", SUBREG_BYTE (x));
cur = safe_concat (buf, cur, t);
break;
+ case STRICT_LOW_PART:
+ print_value (t, XEXP (x, 0), verbose);
+ cur = safe_concat (buf, cur, "strict_low_part(");
+ cur = safe_concat (buf, cur, t);
+ cur = safe_concat (buf, cur, ")");
+ break;
case SCRATCH:
cur = safe_concat (buf, cur, "scratch");
break;
diff --git a/gcc/sync-builtins.def b/gcc/sync-builtins.def
index 731d4a237c2..1a2df9ac018 100644
--- a/gcc/sync-builtins.def
+++ b/gcc/sync-builtins.def
@@ -256,3 +256,341 @@ DEF_SYNC_BUILTIN (BUILT_IN_SYNC_LOCK_RELEASE_16, "__sync_lock_release_16",
DEF_SYNC_BUILTIN (BUILT_IN_SYNC_SYNCHRONIZE, "__sync_synchronize",
BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
+
+/* __sync* builtins for the C++ memory model. */
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE,
+ "__atomic_exchange",
+ BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_N,
+ "__atomic_exchange_n",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_1,
+ "__atomic_exchange_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_2,
+ "__atomic_exchange_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_4,
+ "__atomic_exchange_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_8,
+ "__atomic_exchange_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_16,
+ "__atomic_exchange_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD,
+ "__atomic_load",
+ BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_N,
+ "__atomic_load_n",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_1,
+ "__atomic_load_1",
+ BT_FN_I1_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_2,
+ "__atomic_load_2",
+ BT_FN_I2_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_4,
+ "__atomic_load_4",
+ BT_FN_I4_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_8,
+ "__atomic_load_8",
+ BT_FN_I8_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_16,
+ "__atomic_load_16",
+ BT_FN_I16_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE,
+ "__atomic_compare_exchange",
+ BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT,
+ ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N,
+ "__atomic_compare_exchange_n",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1,
+ "__atomic_compare_exchange_1",
+ BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_2,
+ "__atomic_compare_exchange_2",
+ BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_4,
+ "__atomic_compare_exchange_4",
+ BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_8,
+ "__atomic_compare_exchange_8",
+ BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_16,
+ "__atomic_compare_exchange_16",
+ BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE,
+ "__atomic_store",
+ BT_FN_VOID_SIZE_VPTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_N,
+ "__atomic_store_n",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_1,
+ "__atomic_store_1",
+ BT_FN_VOID_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_2,
+ "__atomic_store_2",
+ BT_FN_VOID_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_4,
+ "__atomic_store_4",
+ BT_FN_VOID_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_8,
+ "__atomic_store_8",
+ BT_FN_VOID_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_16,
+ "__atomic_store_16",
+ BT_FN_VOID_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_N,
+ "__atomic_add_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_1,
+ "__atomic_add_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_2,
+ "__atomic_add_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_4,
+ "__atomic_add_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_8,
+ "__atomic_add_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_16,
+ "__atomic_add_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_N,
+ "__atomic_sub_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_1,
+ "__atomic_sub_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_2,
+ "__atomic_sub_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_4,
+ "__atomic_sub_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_8,
+ "__atomic_sub_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_16,
+ "__atomic_sub_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_N,
+ "__atomic_and_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_1,
+ "__atomic_and_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_2,
+ "__atomic_and_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_4,
+ "__atomic_and_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_8,
+ "__atomic_and_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_16,
+ "__atomic_and_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_N,
+ "__atomic_nand_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_1,
+ "__atomic_nand_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_2,
+ "__atomic_nand_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_4,
+ "__atomic_nand_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_8,
+ "__atomic_nand_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_16,
+ "__atomic_nand_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_N,
+ "__atomic_xor_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_1,
+ "__atomic_xor_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_2,
+ "__atomic_xor_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_4,
+ "__atomic_xor_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_8,
+ "__atomic_xor_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_16,
+ "__atomic_xor_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_N,
+ "__atomic_or_fetch",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_1,
+ "__atomic_or_fetch_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_2,
+ "__atomic_or_fetch_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_4,
+ "__atomic_or_fetch_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_8,
+ "__atomic_or_fetch_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_16,
+ "__atomic_or_fetch_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_N,
+ "__atomic_fetch_add",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_1,
+ "__atomic_fetch_add_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_2,
+ "__atomic_fetch_add_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_4,
+ "__atomic_fetch_add_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_8,
+ "__atomic_fetch_add_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_16,
+ "__atomic_fetch_add_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_N,
+ "__atomic_fetch_sub",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_1,
+ "__atomic_fetch_sub_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_2,
+ "__atomic_fetch_sub_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_4,
+ "__atomic_fetch_sub_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_8,
+ "__atomic_fetch_sub_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_16,
+ "__atomic_fetch_sub_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_N,
+ "__atomic_fetch_and",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_1,
+ "__atomic_fetch_and_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_2,
+ "__atomic_fetch_and_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_4,
+ "__atomic_fetch_and_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_8,
+ "__atomic_fetch_and_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_16,
+ "__atomic_fetch_and_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_N,
+ "__atomic_fetch_nand",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_1,
+ "__atomic_fetch_nand_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_2,
+ "__atomic_fetch_nand_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_4,
+ "__atomic_fetch_nand_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_8,
+ "__atomic_fetch_nand_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_16,
+ "__atomic_fetch_nand_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_N,
+ "__atomic_fetch_xor",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_1,
+ "__atomic_fetch_xor_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_2,
+ "__atomic_fetch_xor_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_4,
+ "__atomic_fetch_xor_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_8,
+ "__atomic_fetch_xor_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_16,
+ "__atomic_fetch_xor_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_N,
+ "__atomic_fetch_or",
+ BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_1,
+ "__atomic_fetch_or_1",
+ BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_2,
+ "__atomic_fetch_or_2",
+ BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_4,
+ "__atomic_fetch_or_4",
+ BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_8,
+ "__atomic_fetch_or_8",
+ BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_16,
+ "__atomic_fetch_or_16",
+ BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE,
+ "__atomic_always_lock_free",
+ BT_FN_BOOL_SIZE_CONST_VPTR, ATTR_CONST_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_IS_LOCK_FREE,
+ "__atomic_is_lock_free",
+ BT_FN_BOOL_SIZE_CONST_VPTR, ATTR_CONST_NOTHROW_LEAF_LIST)
+
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_THREAD_FENCE,
+ "__atomic_thread_fence",
+ BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
+
+DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SIGNAL_FENCE,
+ "__atomic_signal_fence",
+ BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
+
diff --git a/gcc/target.def b/gcc/target.def
index d6d6cc39ca1..62bd06e976f 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -1039,6 +1039,14 @@ DEFHOOK
(void),
default_autovectorize_vector_sizes)
+/* Target builtin that implements vector gather operation. */
+DEFHOOK
+(builtin_gather,
+ "",
+ tree,
+ (const_tree mem_vectype, const_tree index_type, int scale),
+ NULL)
+
HOOK_VECTOR_END (vectorize)
#undef HOOK_PREFIX
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 28f918a4324..1560c27c25d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,392 @@
+2011-11-07 Dodji Seketeli <dodji@redhat.com>
+
+ Support C++11 alias-declaration
+ PR c++/45114
+ * g++.dg/cpp0x/alias-decl-0.C: New test case.
+ * g++.dg/cpp0x/alias-decl-1.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-3.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-4.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-6.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-7.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-8.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-9.C: Likewise.
+ * g++.dg/cpp0x/alias-decl-10.C: Likewise.
+ * g++.dg/ext/alias-decl-attr1.C: Likewise.
+ * g++.dg/ext/alias-decl-attr2.C: Likewise.
+ * g++.dg/ext/alias-decl-attr3.C: Likewise.
+ * g++.dg/ext/alias-decl-attr4.C: Likewise.
+
+2011-11-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pragma-align-2.c: Compile with -std=gnu99.
+
+2011-11-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50919
+ * gfortran.dg/typebound_call_21.f03: New.
+
+2011-11-07 Nathan Sidwell <nathan@acm.org>
+
+ * gcc.dg/profile-dir-1.c: Adjust final scan.
+ * gcc.dg/profile-dir-2.c: Adjust final scan.
+ * gcc.dg/profile-dir-3.c: Adjust final scan.
+ * gcc.misc-tests/gcov.exp: Adjust regexp.
+ * gcc.misc-tests/gcov-12.c: New.
+ * gcc.misc-tests/gcov-13.c: New.
+ * gcc.misc-tests/gcovpart-13b.c: New.
+ * gcc.misc-tests/gcov-14.c: New.
+
+2011-11-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * g++.dg/ext/visibility/template8.C: New.
+
+2011-11-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/50789
+ * gcc.target/i386/avx2-gather-1.c: New test.
+ * gcc.target/i386/avx2-gather-2.c: New test.
+ * gcc.target/i386/avx2-gather-3.c: New test.
+ * gcc.target/i386/avx2-gather-4.c: New test.
+
+2011-11-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr49781-1.c (dg-options): Add -mtune=generic.
+
+2011-11-07 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/45723
+ * gfortran.dg/open_dev_null.f90: Remove testcase.
+
+2011-11-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_effective_target_sync_int_128):
+ Don't cache the result.
+ (check_effective_target_sync_long_long): Ditto.
+
+2011-11-07 Sergey Ostanevich <sergos.gnu@gmail.com>
+
+ PR rtl-optimization/47698
+ * gcc.target/i386/47698.c: New test.
+
+2011-11-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/35688
+ * g++.dg/ext/visibility/template7.C: New.
+
+2011-11-07 Terry Guo <terry.guo@arm.com>
+
+ * gcc.target/arm/wmul-1.c: Adjust optimization level.
+ * gcc.target/arm/wmul-2.c: Ditto.
+ * gcc.target/arm/wmul-3.c: Ditto.
+ * gcc.target/arm/wmul-4.c: Ditto.
+
+2011-11-06 Joseph Myers <joseph@codesourcery.com>
+
+ * g++.dg/cpp0x/alignof3.C, gcc.dg/c1x-align-1.c,
+ gcc.dg/c1x-align-2.c, gcc.dg/c1x-align-3.c, gcc.dg/c1x-align-4.c,
+ gcc.dg/c90-align-1.c, gcc.dg/c99-align-1.c: New tests.
+ * gcc.dg/gnu89-const-expr-1.c, gcc.dg/gnu90-const-expr-1.c,
+ gcc.dg/gnu99-const-expr-1.c, gcc.dg/gnu99-static-1.c: Update
+ expected diagnostics.
+
+2011-11-06 Andrew MacLeod <amacleod@redhat.com>
+ Richard Henderson <rth@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ Merged from cxx-mem-model.
+
+ * lib/target-supports.exp (check_effective_target_sync_int_128,
+ check_effective_target_sync_long_long): Check whether the target
+ supports 64 and 128 bit __sync builtins.
+ (check_effective_target_cas_char): New.
+ (check_effective_target_cas_int): New.
+ * gcc.dg/dg.exp: Exclude simulate-thread tests.
+ * gcc.dg/atomic-noinline[-aux].c: New. Make a variety of atomics calls.
+ * gcc.dg/atomic-generic[-aux].c: New. Test that generic functions
+ produce the expected library calls.
+ * gcc.dg/atomic-fence.c: New functional tests.
+ * gcc.dg/atomic-param.c: New. Checl for illegal number of parameters.
+ * gcc.dg/atomic-invalid.c: New. Test invalid parameters.
+ * gcc.dg/atomic-lockfree[-aux].c: New tests.
+ * gcc.dg/atomic-compare-exchange-{1-5}.c: New functional tests.
+ * gcc.dg/atomic-op-[1-5].c: New. Test atomic fetch functionality.
+ * gcc.dg/atomic-exchange-{1-5}.c: New functional tests.
+ * gcc.dg/atomic-load-{1-5}.c: New functional tests.
+ * gcc.dg/atomic-store-{1-5}.c: New functional tests.
+ * gcc.dg/simulate-thread/atomic-load-int128.c: New. Verify int128 loads
+ are atomic.
+ * gcc.dg/simulate-thread/atomic-load-longlong.c: New. Verify 8 byte
+ loads are atomic.
+ * gcc.dg/simulate-thread/atomic-load-int.c: New. Verify 4 byte loads
+ are atomic.
+ * gcc.dg/simulate-thread/atomic-load-short.c: New. Verify 2 byte loads
+ are atomic.
+ * gcc.dg/simulate-thread/atomic-other-int128.c: New. Verify other
+ int128 operations are atomic.
+ * gcc.dg/simulate-thread/atomic-other-int.c: New. Verify other 4 byte
+ operations are atomic.
+ * gcc.dg/simulate-thread/atomic-other-longlong.c: New. Verify 8 byte
+ operations are atomic.
+ * gcc.dg/simulate-thread/atomic-other-short.c: New. Verify other 2 byte
+ operations are atomic.
+ * gcc.dg/simulate-thread/speculative-store.c: New. Verify speculative
+ stores aren't moved out of a loop.
+ * gcc.dg/simulate-thread/strict-align-global.c: New. Verify small
+ globals don't overwrite neighbouring globals.
+ * gcc.dg/simulate-thread/subfields.c: New. Verify struct component
+ writes dont overwrite neighbouring components.
+ * c-c++-common/gomp/atomic-10.c: Use cas_int; match __atomic builtin.
+ * c-c++-common/gomp/atomic-3.c: Likewise.
+ * c-c++-common/gomp/atomic-9.c: Likewise.
+ * gcc.dg/gomp/atomic-1.c, gcc.dg/gomp/atomic-2.c,
+ gcc.dg/gomp/atomic-3.c, gcc.dg/gomp/atomic-4.c, gcc.dg/gomp/atomic-7.c,
+ gcc.dg/gomp/atomic-8.c, gcc.dg/gomp/atomic-9.c,
+ gcc.dg/gomp/atomic-10.c, gcc.dg/gomp/atomic-12.c,
+ gcc.dg/gomp/atomic-13.c, gcc.dg/gomp/atomic-14.c,
+ gcc.dg/gomp/atomic-15.c: Move to c-c++-common/gomp/.
+ * g++.dg/gomp/atomic-1.C, g++.dg/gomp/atomic-2.C,
+ g++.dg/gomp/atomic-3.C, g++.dg/gomp/atomic-4.C, g++.dg/gomp/atomic-7.C,
+ g++.dg/gomp/atomic-8.C, g++.dg/gomp/atomic-9.C,
+ g++.dg/gomp/atomic-10.C, g++.dg/gomp/atomic-11.C,
+ g++.dg/gomp/atomic-12.C, g++.dg/gomp/atomic-13.C,
+ g++.dg/gomp/atomic-15.C: Remove.
+ * gcc.dg/gomp/gomp.exp, g++.dg/gomp/gomp.exp: Run c-c++-common tests.
+ * gcc.dg/gomp/atomic-11.c: Remove test.
+
+2011-11-06 Ira Rosen <ira.rosen@linaro.org>
+
+ * gcc.dg/vect/bb-slp-cond-1.c: New test.
+ * gcc.dg/vect/slp-cond-1.c: New test.
+ * gcc.dg/vect/slp-cond-2.c: New test.
+
+2011-11-05 David S. Miller <davem@davemloft.net>
+
+ * lib/test-supports.exp
+ (check_effective_target_ultrasparc_vis2_hw): New proc.
+ (check_effective_target_ultrasparc_vis3_hw): New proc.
+ * gcc.target/sparc/vec-init-1.inc: New vector init common code.
+ * gcc.target/sparc/vec-init-2.inc: Likewise.
+ * gcc.target/sparc/vec-init-3.inc: Likewise.
+ * gcc.target/sparc/vec-init-1-vis1.c: New test.
+ * gcc.target/sparc/vec-init-1-vis2.c: New test.
+ * gcc.target/sparc/vec-init-1-vis3.c: New test.
+ * gcc.target/sparc/vec-init-2-vis1.c: New test.
+ * gcc.target/sparc/vec-init-2-vis2.c: New test.
+ * gcc.target/sparc/vec-init-2-vis3.c: New test.
+ * gcc.target/sparc/vec-init-3-vis1.c: New test.
+ * gcc.target/sparc/vec-init-3-vis2.c: New test.
+ * gcc.target/sparc/vec-init-3-vis3.c: New test.
+
+2011-11-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x:
+ Disable test on Epiphany.
+ * gcc.c-torture/execute/20101011-1.c: Disable test on Epiphany.
+ * gcc.dg/stack-usage-1.c [__epiphany__] (SIZE): Define.
+ * gcc.dg/pragma-pack-3.c: Disable test on Epiphany.
+ * g++.dg/parse/pragma3.C: Likewise.
+ * stackalign/builtin-apply-2.c (STACK_ARGUMENTS_SIZE): Define.
+ (bar): Use it.
+ * gcc.dg/weak/typeof-2.c [epiphany-*-*]: Add option -mshort-calls.
+ * gcc.dg/tls/thr-cse-1.c: Likewise.
+ * g++.dg/opt/devirt2.C: Likewise.
+ * gcc.dg/20020312-2.c [epiphany-*-*] (PIC_REG): Define.
+ * gcc.dg/builtin-apply2.c [__epiphany__]: (STACK_ARGUMENTS_SIZE): 20.
+ * gcc.target/epiphany: New directory.
+
+2011-11-05 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/quad_2.f90: New.
+
+2011-11-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/strlenopt-22g.c: New wrapper around...
+ * gcc.dg/strlenopt-22.c: ...this. Do not define USE_GNU and adjust.
+
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/26714
+ * g++.dg/init/lifetime2.C: New.
+ * g++.dg/cpp0x/initlist-lifetime2.C: New.
+
+ PR c++/48370
+ * g++.dg/init/lifetime1.C: Test cleanup order.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/other/offsetof7.C: New test.
+
+2011-11-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * lib/gcc-dg.exp (gcc_force_conventional_output): New global
+ variable, default empty, -ffat-lto-objects for effective_target_lto.
+ (gcc-dg-test-1): Add options from dg-final methods.
+ * lib/scanasm.exp (scan-assembler_required_options)
+ (scan-assembler-not_required_options): New procs.
+
+2011-10-09 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * g++.dg/cpp0x/enum21a.C: Test that enum x { y, } does
+ generate a pedwarn in c++98-mode.
+ * g++.dg/cpp0x/enum21b.C: Test that enum x { y, }
+ don't generate a pedwarn in c++0x-mode.
+
+2011-11-04 Olivier Goffart <olivier@woboq.com>
+
+ PR c++/50965
+ * g++.dg/cpp0x/nsdmi1.C: Add more cases.
+
+2011-11-04 Jiangning Liu <jiangning.liu@arm.com>
+
+ PR rtl-optimization/38644
+ * gcc.target/arm/stack-red-zone.c: New.
+
+2011-11-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/48420
+ * g++.dg/warn/Wconversion-null-3.C: New.
+
+2011-11-04 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ PR c++/50941
+ * g++.dg/cpp0x/udlit-strint-length.C: New.
+
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * g++.dg/cpp0x/initlist-lifetime1.C: New.
+ * g++.dg/init/lifetime1.C: New.
+ * g++.dg/init/ref21.C: New.
+ * g++.dg/eh/array1.C: New.
+
+2011-11-04 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50763
+ * gcc.dg/pr50763-5.c: New test.
+
+2011-11-04 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50763
+ * g++.dg/pr50763-4.C: New test.
+
+2011-11-04 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/torture/vec-cvt-1.c: Enable commented out inttoflttestui
+ test.
+
+ * gcc.dg/torture/vec-cvt-1.c: Enable flttointtestui test.
+
+ * gcc.dg/torture/vec-cvt-1.c: New test.
+
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/private1[-sub].ads: New test.
+
+2011-11-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/43829
+ * gfortran.dg/function_optimize_7.f90: Disable sum inlining.
+ * gfortran.dg/inline_sum_1.f90: New.
+ * gfortran.dg/inline_sum_2.f90: New.
+ * gfortran.dg/inline_sum_bounds_check_1.f90: New.
+ * gfortran.dg/inline_sum_bounds_check_2.f90: New.
+ * gfortran.dg/inline_product_1.f90: New.
+
+2011-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50933
+ * gfortran.dg/bind_c_dts_5.f90: New.
+
+2011-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50960
+ * gfortran.dg/module_parameter_array_refs_2.f90: New.
+
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/50079
+ * g++.dg/init/copy7.C: Remove testcase.
+
+2011-11-03 Martin Jambor <mjambor@suse.cz>
+
+ * g++.dg/ipa/devirt-c-1.C: Add dump scans.
+ * g++.dg/ipa/devirt-c-2.C: Likewise.
+ * g++.dg/ipa/devirt-c-7.C: New test.
+ * g++.dg/ipa/devirt-c-8.C: Likewise.
+
+2011-11-03 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/50912
+ * gnat.dg/loop_optimization10.ad[sb]: New test.
+ * gnat.dg/loop_optimization10_pkg.ads: New helper.
+
+2011-11-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/50930
+ * g++.dg/cpp0x/nsdmi-list2.C: New.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50810
+ * g++.dg/cpp0x/warn_cxx0x2.C: New.
+ * g++.dg/cpp0x/warn_cxx0x3.C: Likewise.
+
+2011-11-02 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50769
+ * gfortran.dg/pr50769.f90: New test.
+
+2011-11-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/20111102-1.c: New test.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50956
+ * g++.dg/warn/Wcast-qual2.C: New.
+
+2011-11-02 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50763
+ * g++.dg/pr50763-3.C: New test.
+
+2011-11-02 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50672
+ * g++.dg/pr50672.C: New test.
+
+2011-11-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/avx-cvt-2.c (dg-options): Add -mtune=generic.
+ * gcc.target/i386/avx2-cvt-2.c (dg-options): Ditto.
+ * gcc.target/i386/sse2-cvt-2.c (dg-options): Ditto.
+
+ * gcc.target/i386/vectorize4-avx.c (scan-assembler): Remove xfail.
+
+2011-11-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50902
+ * gcc.dg/torture/pr50902.c: New testcase.
+
+2010-11-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50890
+ * gcc.dg/torture/pr50890.c: New testcase.
+
+2011-11-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44277
+ * g++.dg/warn/Wzero-as-null-pointer-constant-1.C: New.
+ * g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C: Likewise.
+
+2011-11-01 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/50908
+ * gcc.dg/pr50908.c: New test.
+ * gcc.dg/pr50908-2.c: Same.
+ * gcc.dg/pr50908-3.c: Same.
+
2011-11-01 Ira Rosen <ira.rosen@linaro.org>
* gcc.dg/vect/no-scevccp-outer-6-global.c: Expect to vectorize
@@ -62,7 +451,7 @@
2011-10-28 Paolo Carlini <paolo.carlini@oracle.com>
Revert:
- 2011-10-28 Paolo Carlini <paolo.carlini@oracle.com>
+ 2011-10-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50864
* g++.dg/template/crash109.C: New.
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-1.c b/gcc/testsuite/c-c++-common/gomp/atomic-1.c
index 3e4bc569ba7..3e4bc569ba7 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-1.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-10.c b/gcc/testsuite/c-c++-common/gomp/atomic-10.c
index 936d0c1f223..21d035e15c9 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-10.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-10.c
@@ -1,6 +1,7 @@
/* PR middle-end/28046 */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+/* { dg-require-effective-target cas_int } */
int a[3], b;
struct C { int x; int y; } c;
@@ -20,5 +21,5 @@ foo (void)
*baz () += bar ();
}
-/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 4 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "__atomic_fetch_add" 4 "ompexp" } } */
/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-12.c b/gcc/testsuite/c-c++-common/gomp/atomic-12.c
index 618c4c8e648..618c4c8e648 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-12.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-12.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-13.c b/gcc/testsuite/c-c++-common/gomp/atomic-13.c
index 0146825f2bb..0146825f2bb 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-13.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-13.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-14.c b/gcc/testsuite/c-c++-common/gomp/atomic-14.c
index f8fc9d87257..f8fc9d87257 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-14.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-14.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-15.c b/gcc/testsuite/c-c++-common/gomp/atomic-15.c
index 13a9e0ce48a..13a9e0ce48a 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-15.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-15.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-2.c b/gcc/testsuite/c-c++-common/gomp/atomic-2.c
index 720ec9e8ba0..720ec9e8ba0 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-2.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-3.c b/gcc/testsuite/c-c++-common/gomp/atomic-3.c
index 7ea792d3457..5b9e60cde8b 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-3.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+/* { dg-require-effective-target cas_int } */
int *xyzzy;
@@ -9,5 +10,5 @@ void f1(void)
xyzzy++;
}
-/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "ompexp" } } */
/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-4.c b/gcc/testsuite/c-c++-common/gomp/atomic-4.c
index 7f27370d535..7f27370d535 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-4.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-7.c b/gcc/testsuite/c-c++-common/gomp/atomic-7.c
index 612e97f4530..612e97f4530 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-7.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-7.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-8.c b/gcc/testsuite/c-c++-common/gomp/atomic-8.c
index 2f04151f0ed..2f04151f0ed 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-8.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-8.c
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-9.c b/gcc/testsuite/c-c++-common/gomp/atomic-9.c
index 2fafbd4097a..ff5cb4091f9 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-9.c
+++ b/gcc/testsuite/c-c++-common/gomp/atomic-9.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+/* { dg-require-effective-target cas_int } */
volatile int *bar(void);
@@ -9,5 +10,5 @@ void f1(void)
*bar() += 1;
}
-/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "__atomic_fetch_add" 1 "ompexp" } } */
/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C b/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C
new file mode 100644
index 00000000000..aad273792ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C
@@ -0,0 +1,161 @@
+// { dg-options "-std=c++0x -Wzero-as-null-pointer-constant" }
+
+struct A;
+
+typedef int (A::*pointmemfun) (int);
+typedef int (A::*pointdmem);
+typedef int (*pointfun) (int);
+
+pointmemfun pmfs;
+pointdmem pdms;
+pointfun pfs;
+int* ps;
+
+void f()
+{
+ pointmemfun pmf(0); // { dg-warning "zero as null pointer" }
+ pointdmem pdm(0); // { dg-warning "zero as null pointer" }
+ pointfun pf(0); // { dg-warning "zero as null pointer" }
+ int* p(0); // { dg-warning "zero as null pointer" }
+
+ pointmemfun pmfn(nullptr);
+ pointdmem pdmn(nullptr);
+ pointfun pfn(nullptr);
+ int* pn(nullptr);
+
+ pmf = 0; // { dg-warning "zero as null pointer" }
+
+ pdm = 0; // { dg-warning "zero as null pointer" }
+
+ pf = 0; // { dg-warning "zero as null pointer" }
+
+ p = 0; // { dg-warning "zero as null pointer" }
+
+ pmf = nullptr;
+
+ pdm = nullptr;
+
+ pf = nullptr;
+
+ p = nullptr;
+
+ if (pmf)
+ ;
+
+ if (pdm)
+ ;
+
+ if (pf)
+ ;
+
+ if (p)
+ ;
+
+ if (!pmf)
+ ;
+
+ if (!pdm)
+ ;
+
+ if (!pf)
+ ;
+
+ if (!p)
+ ;
+
+ if (pmf == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pdm == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pf == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (p == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pmf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pdm) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == p) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pmf != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pdm != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pf != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (p != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pmf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pdm) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != p) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pmf == nullptr)
+ ;
+
+ if (pdm == nullptr)
+ ;
+
+ if (pf == nullptr)
+ ;
+
+ if (p == nullptr)
+ ;
+
+ if (nullptr == pmf)
+ ;
+
+ if (nullptr == pdm)
+ ;
+
+ if (nullptr == pf)
+ ;
+
+ if (nullptr == p)
+ ;
+
+ if (pmf != nullptr)
+ ;
+
+ if (pdm != nullptr)
+ ;
+
+ if (pf != nullptr)
+ ;
+
+ if (p != nullptr)
+ ;
+
+ if (nullptr != pmf)
+ ;
+
+ if (nullptr != pdm)
+ ;
+
+ if (nullptr != pf)
+ ;
+
+ if (nullptr != p)
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-0.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-0.C
new file mode 100644
index 00000000000..c5760cfe537
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-0.C
@@ -0,0 +1,37 @@
+// { dg-options "-std=c++0x" }
+
+template<template<class> class TT> struct X { };
+template<class> struct Y { };
+template<class T> using Z = Y<T>;
+
+void f(X<Y>);
+void g(X<Z>);
+
+void
+foo()
+{
+ // Below x and y don't have the same type, because Y and Z don't
+ // designate the same template ...
+ X<Y> y;
+ X<Z> z;
+
+ // ... So these must fail to compile.
+ f(z); // { dg-error "" }
+ g(y); // { dg-error "" }
+}
+
+template<class> struct A0 {};
+template<class T> using AA0 = A0<T>;
+template<class T> using AAA0 = AA0<T>;
+
+void f0(A0<int>);
+void
+g0()
+{
+ AA0<int> a;
+ AAA0<int> b;
+ f0(a);
+ f0(b);
+}
+
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C
new file mode 100644
index 00000000000..d0eda5ff1b9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C
@@ -0,0 +1,15 @@
+// { dg-options "-std=c++0x" }
+
+// These also represent tests for printing alias declarations and
+// their instantiations.
+
+template<class T, class U> struct A0 {};
+template<class T, class U> using AA0 = A0<T, U>;
+template<class T> struct AA0<int, T> {}; // { dg-error "partial specialization" }
+
+template <class U> using Ptr = U*;
+template<class U> struct Ptr<U*> {}; // { dg-error "partial specialization" }
+
+struct A {
+ using A = int;//{ dg-error "nested|has|same name as|class|in which|declared" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
new file mode 100644
index 00000000000..856e4297af5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
@@ -0,0 +1,18 @@
+// { dg-options "-std=c++0x" }
+
+template <class T> using Ptr = T*;
+Ptr<unsigned>; // { dg-error "does not declare anything" }
+Ptr<char><int>; // { dg-error "not a template|does not declare anything" }
+template class Ptr<int>;//{ dg-error "explicit instantiation|non-class templ|does not decl|anything" }
+
+template <class T> using Arg = T;
+struct A {};
+template class Arg<A>;// { dg-error "explicit instantiation|non-class templ" }
+
+template <template <class> class TT, class T> using Instantiate = TT<T>;
+template <class> struct Vector {};
+template class Instantiate<Vector, int>; // OK Vector<int> can be explicitely instantiated
+
+template <class T> struct S {};
+template<class T> using SFor = S<T>;
+template class SFor<int>; // OK, S<int> can be explicitely instantiated
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C
new file mode 100644
index 00000000000..2e03dd897b5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C
@@ -0,0 +1,33 @@
+// { dg-options "-std=c++0x" }
+
+template<class T> struct S0 {};
+template<class T> using AS0 = S0<T>;
+
+template<template<class> class TT>
+void f(TT<int>);
+
+template class AS0<char>;
+
+void
+foo()
+{
+ AS0<int> a;
+ f(a);
+}
+
+template<class T, class U> struct Vector{};
+template<class T> struct Alloc {};
+
+template<class T> using Vec = Vector<T, Alloc<T> >;
+
+template<class T> void g(Vector<T, Alloc<T> >);
+
+template<template<class T> class TT> void h(TT<int>); // { dg-error "provided for" }
+
+void
+bar()
+{
+ Vec<int> a;
+ g(a);
+ h(a); // { dg-error "no matching function|wrong number of template arguments" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C
new file mode 100644
index 00000000000..5484efce19e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C
@@ -0,0 +1,42 @@
+// { dg-options "-std=c++0x" }
+
+// Exercise some member alias templates ...
+
+template<class T, class U> class A0 {};
+
+template<class T>
+struct A1 {
+ template<class U> struct S {};
+ template<class U> using AA0 = A0<T, U>;
+
+ void f(A0<T, int>);
+
+ void
+ foo()
+ {
+ AA0<int> a;
+ const AA0<int> b;
+ f(a);
+ f(b);
+ }
+};
+
+void
+bar()
+{
+ A1<int> a1;
+ a1.foo();
+ A1<int>::AA0<int> a1aa0;
+ a1.f(a1aa0);
+}
+
+// ... some simple member alias ...
+struct B {
+ using A = int;
+};
+
+B::A a;
+
+// ... and some simple alias
+
+using Int = int;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
new file mode 100644
index 00000000000..876944e23c3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
@@ -0,0 +1,14 @@
+// { dg-options "-std=c++0x" }
+
+// [temp.alias]/3:
+// The type-id in an alias template declaration shall not refer
+// to the alias template being declared. The type produced by an
+// alias template specialization shall not directly or indirectly
+// make use of that specialization.
+
+template <class T> struct A;
+template <class T> using B = typename A<T>::U; // { dg-error "type" }
+template <class T> struct A {
+ typedef B<T> U;
+};
+B<short> b; // { dg-error "invalid type" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-5.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-5.C
new file mode 100644
index 00000000000..1a4cbd5e5bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-5.C
@@ -0,0 +1,34 @@
+// { dg-options "-std=c++0x" }
+
+// alias template of a partial specialization
+
+template<class T, class U, class W> struct S0 {};
+template<class T, class U> struct S0<T, U, char> {};
+template<class T> using AS0 = S0<T, int, char>;
+void foo(S0<bool, int, char>);
+
+AS0<bool> a; // OK
+
+void
+f()
+{
+ foo(a); //OK
+}
+
+// alias template of an explicit specialization of a member template
+
+template<class T>
+struct S1 {
+ template<class U>
+ struct M {};
+};
+template<class T> using AM = S1<int>::M<T>;
+void bar(S1<int>::M<bool>);
+
+AM<bool> b; //OK.
+
+void
+g()
+{
+ bar(b); //OK
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-6.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-6.C
new file mode 100644
index 00000000000..f60b2ea7fc0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-6.C
@@ -0,0 +1,12 @@
+// { dg-options "-std=c++0x" }
+
+// Alias template of non-class types.
+
+template <class T, class U> struct same;
+template <class T> struct same<T,T> {};
+
+template <class T> using Ptr = T*;
+template <template <class> class T> struct A {
+ template <class U> using X = T<U>;
+};
+same<A<Ptr>::X<int>,int*> s;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-7.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-7.C
new file mode 100644
index 00000000000..96c349a0da6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-7.C
@@ -0,0 +1,23 @@
+// { dg-options "-std=c++0x" }
+
+// Add arguments to unbound template template parameter.
+
+template <template <class> class Template>
+struct Internal {
+ template <class Arg> using Bind = Template<Arg>;
+};
+
+template <template <class> class Template, class Arg>
+using Instantiate = Template<Arg>; // After parsing #1, the
+ // BOUND_TEMPLATE_TEMPLATE_PARM
+ // parameter Template gets
+ // the UNBOUND_CLASS_TEMPLATE
+ // Internal<Template>::template Bind
+ // as an argument, and the
+ // parameter Arg gets Argument as
+ // an argument. And we build
+ // 'Bind<Argument>'.
+
+template <template <class> class Template, class Argument>
+using Bind = Instantiate<Internal<Template>::template Bind, Argument>; //#1
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-8.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-8.C
new file mode 100644
index 00000000000..c926df7539b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-8.C
@@ -0,0 +1,32 @@
+// { dg-options "-std=c++0x" }
+
+struct A {
+ template <class U> using C = U;
+};
+
+// The particularity of the below struct is to have more than 7
+// fields. In this case, looking up a member here should exercise
+// cp/search.c:lookup_field_1 in such a way that it finds it in the
+// CLASSTYPE_SORTED_FIELDS of struct A7.
+struct A7 {
+ int f0;
+ int f1;
+ int f2;
+ int f3;
+ int f4;
+ int f5;
+ int f6;
+ int f7;
+ template <class U> using C = U;
+};
+
+template <class T>
+struct B {
+ typename T::template C<int> n; //#0
+};
+
+// These should trigger the lookup
+// of template C inside class A or
+// A7, via #0.
+B<A> b;
+B<A7> c;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-9.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-9.C
new file mode 100644
index 00000000000..dcf642d7683
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-9.C
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++0x" }
+
+template <class T>
+struct A {
+ using Result = T;
+};
+template <class A> using Arg = typename A::Result;
+Arg<A<int>> b;
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/alignof3.C b/gcc/testsuite/g++.dg/cpp0x/alignof3.C
new file mode 100644
index 00000000000..50c6ac915e1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alignof3.C
@@ -0,0 +1,6 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x -pedantic" }
+int main(void)
+{
+ alignof(void (void)); // { dg-warning "function type" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto1.C b/gcc/testsuite/g++.dg/cpp0x/auto1.C
index 9e274b62239..f5c0ea6e4d3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto1.C
@@ -1,8 +1,8 @@
-// { dg-options "-std=c++98 -Wc++0x-compat" }
+// { dg-options "-std=c++98 -Wc++11-compat" }
-// Test warning for use of auto in C++98 mode with C++0x
+// Test warning for use of auto in C++98 mode with C++11
// compatibility warnings
void f()
{
- auto int x = 5; // { dg-warning "will change meaning" }
+ auto int x = 5; // { dg-warning "changes meaning" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket3.C b/gcc/testsuite/g++.dg/cpp0x/bracket3.C
index 4ef7a0e9d30..f86aa041a24 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket3.C
@@ -1,10 +1,10 @@
-// { dg-options "-std=c++98 -Wc++0x-compat" }
+// { dg-options "-std=c++98 -Wc++11-compat" }
template<int N> struct X {};
-X<1 >> 2> x; // { dg-warning "will be treated as|suggest parentheses" }
+X<1 >> 2> x; // { dg-warning "is treated as|suggest parentheses" }
// From cp/parser.c
typedef int Y;
template <int V> struct Foo {};
-Foo<Y () >> 5> r; // { dg-warning "will be treated as|suggest parentheses" }
+Foo<Y () >> 5> r; // { dg-warning "is treated as|suggest parentheses" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum21a.C b/gcc/testsuite/g++.dg/cpp0x/enum21a.C
new file mode 100644
index 00000000000..5526811a635
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum21a.C
@@ -0,0 +1,4 @@
+// { dg-do compile }
+// { dg-options "-pedantic -std=c++98" }
+
+enum x { y, }; // { dg-warning "comma at end of enumerator list" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum21b.C b/gcc/testsuite/g++.dg/cpp0x/enum21b.C
new file mode 100644
index 00000000000..48989128d89
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum21b.C
@@ -0,0 +1,4 @@
+// { dg-do compile }
+// { dg-options "-pedantic -std=c++0x" }
+
+enum x { y, };
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime1.C b/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime1.C
new file mode 100644
index 00000000000..e43ce5d62cd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime1.C
@@ -0,0 +1,34 @@
+// Test that we properly extend the lifetime of the initializer_list
+// array even if the initializer_list is a subobject.
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+#include <initializer_list>
+
+extern "C" void abort();
+bool ok;
+
+bool do_throw;
+
+struct A {
+ A(int) { if (do_throw) throw 42; }
+ ~A() { if (!ok) abort(); }
+};
+
+typedef std::initializer_list<A> AL;
+typedef std::initializer_list<AL> AL2;
+typedef std::initializer_list<AL2> AL3;
+
+struct B {
+ AL al;
+ const AL& alr;
+};
+
+int main(int argc, const char** argv)
+{
+ do_throw = (argc > 1); // always false, but optimizer can't tell
+ AL ar[] = {{1,2},{3,4}};
+ B b = {{5,6},{7,8}};
+ AL3 al3 = {{{1},{2},{3}}};
+ ok = true;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime2.C b/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime2.C
new file mode 100644
index 00000000000..16ae1ac6e07
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime2.C
@@ -0,0 +1,64 @@
+// Test that we properly extend the lifetime of the initializer_list
+// array even if the initializer_list is a subobject.
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+#include <initializer_list>
+
+extern "C" void abort();
+bool ok;
+
+bool do_throw;
+
+struct A {
+ A(int) { if (do_throw) throw 42; }
+ ~A() { if (!ok) abort(); }
+};
+
+typedef std::initializer_list<A> AL;
+typedef std::initializer_list<AL> AL2;
+typedef std::initializer_list<AL2> AL3;
+
+struct B {
+ AL al;
+ const AL& alr;
+};
+
+struct A2
+{
+ const A& a1;
+ const A& a2;
+};
+
+struct C {
+ AL ar[2];
+ B b;
+ AL3 al3;
+ A2 a2;
+ A2 a2r[2];
+ C():
+ ar{{1,2},{3,4}},
+ b{{5,6},{7,8}},
+ al3{{{1},{2},{3}}},
+ a2{1,2},
+ a2r{{1,2},{3,4}}
+ { ok = true; }
+};
+
+struct D {
+ AL ar[2] = {{1,2},{3,4}};
+ B b = {{5,6},{7,8}};
+ AL3 al3 = {{{1},{2},{3}}};
+ A2 a2 = {1,2};
+ A2 a2r[2] = {{1,2},{3,4}};
+ D() { ok = true; }
+};
+
+int main(int argc, const char** argv)
+{
+ do_throw = (argc > 1); // always false, but optimizer can't tell
+ ok = false;
+ C c;
+ ok = false;
+ D d;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-list2.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list2.C
new file mode 100644
index 00000000000..a6321ffb605
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list2.C
@@ -0,0 +1,32 @@
+// PR c++/50930
+// { dg-options -std=c++0x }
+
+struct nmc {
+ nmc() = default;
+ nmc(nmc&&) = delete; // line 3
+};
+
+struct A { // line 6
+ nmc n{};
+ nmc n2 = {};
+} a; // line 8
+
+// ------
+
+struct lock_t {
+ int lock[4];
+};
+
+struct pthread_mutex_t {
+ volatile lock_t __spinlock;
+};
+
+struct mutex {
+ pthread_mutex_t m = { };
+ mutex() = default;
+};
+
+int main()
+{
+ mutex mx;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C
index f6381d0fdb4..159c16de851 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C
@@ -31,8 +31,8 @@ int main()
{
A a1;
if (a1.i != 42) return 1;
- A a2 = { 24 };
- if (a2.i != 24) return 2;
+ A a2{};
+ if (a2.i != 42) return 2;
A a3[1];
if (a3[0].i != 42) return 3;
@@ -43,7 +43,7 @@ int main()
C<int,3> c1;
if (c1.m != 3) return 5;
- C<int,3> c2 { 5 };
+ C<int,5> c2 {};
if (c2.m != 5) return 6;
D<int,3> d1;
diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-string-length.C b/gcc/testsuite/g++.dg/cpp0x/udlit-string-length.C
new file mode 100644
index 00000000000..86903e8355a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/udlit-string-length.C
@@ -0,0 +1,46 @@
+// { dg-options "-std=c++0x" }
+// PR c++/50941
+
+typedef decltype(sizeof(0)) size_type;
+
+constexpr size_type
+operator"" _len(const char*, size_type len)
+{
+ return len;
+}
+
+constexpr size_type
+operator"" _len(const wchar_t*, size_type len)
+{
+ return len;
+}
+
+constexpr size_type
+operator"" _len(const char16_t*, size_type len)
+{
+ return len;
+}
+
+constexpr size_type
+operator"" _len(const char32_t*, size_type len)
+{
+ return len;
+}
+
+static_assert( ""_len == 0, "Ouch");
+static_assert(u8""_len == 0, "Ouch");
+static_assert( L""_len == 0, "Ouch");
+static_assert( u""_len == 0, "Ouch");
+static_assert( U""_len == 0, "Ouch");
+
+static_assert( "1"_len == 1, "Ouch");
+static_assert(u8"1"_len == 1, "Ouch");
+static_assert( L"1"_len == 1, "Ouch");
+static_assert( u"1"_len == 1, "Ouch");
+static_assert( U"1"_len == 1, "Ouch");
+
+static_assert( "123"_len == 3, "Ouch");
+static_assert(u8"123"_len == 3, "Ouch");
+static_assert( L"123"_len == 3, "Ouch");
+static_assert( u"123"_len == 3, "Ouch");
+static_assert( U"123"_len == 3, "Ouch");
diff --git a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C
index 5ad9b61b83a..5c5eeffb350 100644
--- a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C
+++ b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C
@@ -1,6 +1,6 @@
-// { dg-options "-std=gnu++98 -Wc++0x-compat" }
-int static_assert; // { dg-warning "will become a keyword" }
-int nullptr; // { dg-warning "will become a keyword" }
+// { dg-options "-std=gnu++98 -Wc++11-compat" }
+int static_assert; // { dg-warning "is a keyword" }
+int nullptr; // { dg-warning "is a keyword" }
void foo()
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x2.C b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x2.C
new file mode 100644
index 00000000000..116b2331762
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x2.C
@@ -0,0 +1,4 @@
+// PR c++/50810
+// { dg-options "-std=gnu++98 -Wc++11-compat" }
+
+signed char data[] = { 0xff }; // { dg-warning "narrowing" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x3.C b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x3.C
new file mode 100644
index 00000000000..c3df9d99ed3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x3.C
@@ -0,0 +1,4 @@
+// PR c++/50810
+// { dg-options "-std=gnu++98 -Wc++11-compat -Wno-narrowing" }
+
+signed char data[] = { 0xff };
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index 0144eef2a4f..ad1f7e23700 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -49,6 +49,7 @@ set tests [prune $tests $srcdir/$subdir/torture/*]
set tests [prune $tests $srcdir/$subdir/graphite/*]
set tests [prune $tests $srcdir/$subdir/tm/*]
set tests [prune $tests $srcdir/$subdir/guality/*]
+set tests [prune $tests $srcdir/$subdir/simulate-thread/*]
# Main loop.
dg-runtest $tests "" $DEFAULT_CXXFLAGS
diff --git a/gcc/testsuite/g++.dg/eh/array1.C b/gcc/testsuite/g++.dg/eh/array1.C
new file mode 100644
index 00000000000..157450a9592
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/array1.C
@@ -0,0 +1,15 @@
+// Test that we have one EH cleanup region for the whole array
+// rather than one for each element.
+// { dg-options -fdump-tree-gimple }
+// { dg-final { scan-tree-dump-times "catch" 1 "gimple" } }
+
+struct A
+{
+ A();
+ ~A();
+};
+
+void f()
+{
+ A a[10] = { };
+}
diff --git a/gcc/testsuite/g++.dg/ext/alias-decl-attr1.C b/gcc/testsuite/g++.dg/ext/alias-decl-attr1.C
new file mode 100644
index 00000000000..e83fe441275
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/alias-decl-attr1.C
@@ -0,0 +1,19 @@
+// { dg-options "-std=c++0x" }
+
+template <unsigned Len, unsigned Align>
+struct aligned_storage
+{
+ using type __attribute__((aligned((Align)))) =
+ char[Len];
+};
+
+template<typename T>
+struct X
+{
+ typename aligned_storage<sizeof(T),__alignof(T)>::type data;
+};
+
+template<bool> struct StaticAssert;
+template<> struct StaticAssert<true> {};
+
+StaticAssert<__alignof (X<double>) == __alignof (double)> dummy;
diff --git a/gcc/testsuite/g++.dg/ext/alias-decl-attr2.C b/gcc/testsuite/g++.dg/ext/alias-decl-attr2.C
new file mode 100644
index 00000000000..83e557c43fb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/alias-decl-attr2.C
@@ -0,0 +1,42 @@
+// { dg-options "-std=c++0x" }
+
+template<typename T>
+struct X {
+ using layout_type __attribute ((aligned(__alignof(double)))) =
+ char[sizeof(T)];
+ layout_type data;
+};
+
+template<typename T>
+struct Y {
+ using layout_type __attribute ((aligned(__alignof(T)))) =
+ char[sizeof(T)];
+ layout_type data;
+};
+
+template<typename T>
+struct Z {
+ using layout_type __attribute ((aligned(__alignof(T)))) =
+ char[sizeof(T)];
+ struct Z2 {
+ layout_type data;
+ } in;
+};
+
+template<typename T>
+struct A;
+
+template <typename T>
+struct A<T*> {
+ using layout_type __attribute ((aligned(__alignof(T)))) =
+ char[sizeof(T)];
+ layout_type data;
+};
+
+template<bool> struct StaticAssert;
+template<> struct StaticAssert<true> {};
+
+StaticAssert<__alignof(X<double>) == __alignof(double)> d1;
+StaticAssert<__alignof(Y<double>) == __alignof(double)> d2;
+StaticAssert<__alignof(Z<double>) == __alignof(double)> d3;
+StaticAssert<__alignof(A<double*>) == __alignof(double)> d4;
diff --git a/gcc/testsuite/g++.dg/ext/alias-decl-attr3.C b/gcc/testsuite/g++.dg/ext/alias-decl-attr3.C
new file mode 100644
index 00000000000..369aa10e65e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/alias-decl-attr3.C
@@ -0,0 +1,21 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run }
+
+template <class T>
+int
+align_of_type_wide_array()
+{
+ using type_wide_array __attribute((aligned(__alignof(T))))
+ = unsigned char[sizeof (T)];
+
+ return __alignof(type_wide_array);
+}
+
+int
+main ()
+{
+ if (align_of_type_wide_array<int>() == __alignof(int))
+ return 0;
+ else
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/ext/alias-decl-attr4.C b/gcc/testsuite/g++.dg/ext/alias-decl-attr4.C
new file mode 100644
index 00000000000..c4dd0487789
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/alias-decl-attr4.C
@@ -0,0 +1,34 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run }
+
+using global_vector_type __attribute__((vector_size(16))) = float;
+
+template <class T> struct A
+{
+ using type = T;
+};
+
+template < typename Val > struct S
+{
+ using vector_type __attribute__((vector_size(16))) =
+ typename A<Val>::type
+ typedef Val vector_type2 __attribute__((vector_size(16)));
+ int pr_size() { return sizeof(vector_type); }
+ int pr_size2() { return sizeof(vector_type2); }
+};
+
+int main()
+{
+ if (sizeof (S<float>::vector_type) != sizeof (global_vector_type))
+ return 1;
+ if (sizeof (S<float>::vector_type2) != sizeof (global_vector_type))
+ return 2;
+
+ S<float> x;
+ if (x.pr_size() != sizeof (global_vector_type))
+ return 3;
+ if (x.pr_size2() != sizeof (global_vector_type))
+ return 4;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/visibility/template7.C b/gcc/testsuite/g++.dg/ext/visibility/template7.C
new file mode 100644
index 00000000000..5197fb1c960
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/template7.C
@@ -0,0 +1,29 @@
+// PR c++/35688
+// { dg-require-visibility "" }
+// { dg-options "-fvisibility=hidden" }
+
+// { dg-final { scan-hidden "_ZN1s6vectorI1AEC1Ev" } }
+// { dg-final { scan-hidden "_ZN1s3fooI1AEEvT_" } }
+
+namespace s __attribute__((visibility("default"))) {
+ template <class T>
+ class vector {
+ public:
+ vector() { }
+ };
+ template <class T>
+ void foo(T t) {
+ }
+}
+
+class A {
+public:
+ A() { }
+};
+
+s::vector<A> v;
+
+int main() {
+ A a;
+ s::foo(a);
+}
diff --git a/gcc/testsuite/g++.dg/ext/visibility/template8.C b/gcc/testsuite/g++.dg/ext/visibility/template8.C
new file mode 100644
index 00000000000..e491882e057
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/template8.C
@@ -0,0 +1,26 @@
+// PR c++/35688
+// { dg-require-visibility "" }
+// { dg-options "-fvisibility=hidden" }
+
+// { dg-final { scan-hidden "_Z1gI1BEvT_" } }
+// { dg-final { scan-hidden "_Z1gI1AI1BEEvT_" } }
+
+// Test that template argument visibility takes priority even over an
+// explicit visibility attribute on a template.
+
+template <class T>
+struct __attribute ((visibility ("default"))) A { };
+template <class T>
+void g(T) __attribute ((visibility ("default")));
+
+struct B { };
+
+template <class T>
+void g(T)
+{ }
+
+int main()
+{
+ g(B());
+ g(A<B>());
+}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-1.C b/gcc/testsuite/g++.dg/gomp/atomic-1.C
deleted file mode 100644
index 3e4bc569ba7..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-1.C
+++ /dev/null
@@ -1,99 +0,0 @@
-/* { dg-do compile } */
-
-int x;
-volatile int y;
-volatile unsigned char z;
-
-void f1(void)
-{
- #pragma omp atomic
- x++;
- #pragma omp atomic
- x--;
- #pragma omp atomic
- ++x;
- #pragma omp atomic
- --x;
- #pragma omp atomic
- x += 1;
- #pragma omp atomic
- x -= y;
- #pragma omp atomic
- x |= 1;
- #pragma omp atomic
- x &= 1;
- #pragma omp atomic
- x ^= 1;
- #pragma omp atomic
- x *= 3;
- #pragma omp atomic
- x /= 3;
- #pragma omp atomic
- x /= 3;
- #pragma omp atomic
- x <<= 3;
- #pragma omp atomic
- x >>= 3;
-}
-
-void f2(void)
-{
- #pragma omp atomic
- y++;
- #pragma omp atomic
- y--;
- #pragma omp atomic
- ++y;
- #pragma omp atomic
- --y;
- #pragma omp atomic
- y += 1;
- #pragma omp atomic
- y -= x;
- #pragma omp atomic
- y |= 1;
- #pragma omp atomic
- y &= 1;
- #pragma omp atomic
- y ^= 1;
- #pragma omp atomic
- y *= 3;
- #pragma omp atomic
- y /= 3;
- #pragma omp atomic
- y /= 3;
- #pragma omp atomic
- y <<= 3;
- #pragma omp atomic
- y >>= 3;
-}
-
-void f3(void)
-{
- #pragma omp atomic
- z++;
- #pragma omp atomic
- z--;
- #pragma omp atomic
- ++z;
- #pragma omp atomic
- --z;
- #pragma omp atomic
- z += 1;
- #pragma omp atomic
- z |= 1;
- #pragma omp atomic
- z &= 1;
- #pragma omp atomic
- z ^= 1;
- #pragma omp atomic
- z *= 3;
- #pragma omp atomic
- z /= 3;
- #pragma omp atomic
- z /= 3;
- #pragma omp atomic
- z <<= 3;
- #pragma omp atomic
- z >>= 3;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-10.C b/gcc/testsuite/g++.dg/gomp/atomic-10.C
deleted file mode 100644
index fe64f0f0631..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-10.C
+++ /dev/null
@@ -1,24 +0,0 @@
-// PR middle-end/28046
-// { dg-do compile }
-// { dg-options "-fopenmp -fdump-tree-ompexp" }
-
-int a[3], b;
-struct C { int x; int y; } c;
-
-int bar (void), *baz (void);
-
-void
-foo (void)
-{
-#pragma omp atomic
- a[2] += bar ();
-#pragma omp atomic
- b += bar ();
-#pragma omp atomic
- c.y += bar ();
-#pragma omp atomic
- *baz () += bar ();
-}
-
-// { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 4 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } }
-// { dg-final { cleanup-tree-dump "ompexp" } }
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-11.C b/gcc/testsuite/g++.dg/gomp/atomic-11.C
deleted file mode 100644
index 618c4c8e648..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-11.C
+++ /dev/null
@@ -1,306 +0,0 @@
-/* PR middle-end/45423 */
-/* { dg-do compile } */
-/* { dg-options "-fopenmp -fdump-tree-gimple -g0" } */
-/* atomicvar should never be referenced in between the barrier and
- following #pragma omp atomic_load. */
-/* { dg-final { scan-tree-dump-not "barrier\[^#\]*atomicvar" "gimple" } } */
-/* { dg-final { cleanup-tree-dump "gimple" } } */
-
-#ifdef __cplusplus
-bool atomicvar, c;
-#else
-_Bool atomicvar, c;
-#endif
-int i, atomicvar2, c2;
-
-int
-foo (void)
-{
- #pragma omp barrier
- #pragma omp atomic
- atomicvar |= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar |= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar |= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar |= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar |= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar ^= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar ^= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar ^= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar ^= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar ^= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar &= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar &= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar &= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar &= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar &= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar += -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar += 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar += 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar += 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar += c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar -= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar -= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar -= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar -= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar -= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar *= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar *= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar *= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar *= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar *= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar /= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar /= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar /= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar /= c;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar <<= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar <<= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar <<= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar <<= i;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar >>= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar >>= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar >>= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar >>= i;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar++;
- #pragma omp barrier
- #pragma omp atomic
- ++atomicvar;
- #pragma omp barrier
-#ifndef __cplusplus
- #pragma omp atomic
- atomicvar--;
- #pragma omp barrier
- #pragma omp atomic
- --atomicvar;
- #pragma omp barrier
-#endif
- return 0;
-}
-
-int
-bar (void)
-{
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 |= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 |= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 |= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 |= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 |= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 ^= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 ^= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 ^= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 ^= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 ^= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 &= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 &= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 &= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 &= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 &= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 += -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 += 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 += 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 += 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 += c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 -= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 -= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 -= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 -= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 -= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 *= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 *= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 *= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 *= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 *= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 /= -1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 /= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 /= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 /= c2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 <<= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 <<= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 <<= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 <<= i;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 >>= 0;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 >>= 1;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 >>= 2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2 >>= i;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2++;
- #pragma omp barrier
- #pragma omp atomic
- ++atomicvar2;
- #pragma omp barrier
- #pragma omp atomic
- atomicvar2--;
- #pragma omp barrier
- #pragma omp atomic
- --atomicvar2;
- #pragma omp barrier
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-12.C b/gcc/testsuite/g++.dg/gomp/atomic-12.C
deleted file mode 100644
index 6c1f965021d..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-12.C
+++ /dev/null
@@ -1,9 +0,0 @@
-/* PR middle-end/45423 */
-/* { dg-do compile } */
-/* { dg-options "-fopenmp -fdump-tree-gimple -g0 -O2" } */
-/* atomicvar should never be referenced in between the barrier and
- following #pragma omp atomic_load. */
-/* { dg-final { scan-tree-dump-not "barrier\[^#\]*atomicvar" "gimple" } } */
-/* { dg-final { cleanup-tree-dump "gimple" } } */
-
-#include "atomic-11.C"
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-13.C b/gcc/testsuite/g++.dg/gomp/atomic-13.C
deleted file mode 100644
index f8fc9d87257..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-13.C
+++ /dev/null
@@ -1,43 +0,0 @@
-/* PR middle-end/45423 */
-/* { dg-do compile } */
-/* { dg-options "-fopenmp" } */
-
-#ifdef __cplusplus
-bool *baz ();
-#else
-_Bool *baz ();
-#endif
-int *bar ();
-
-int
-foo (void)
-{
- #pragma omp barrier
- #pragma omp atomic
- (*bar ())++;
- #pragma omp barrier
- #pragma omp atomic
- ++(*bar ());
- #pragma omp barrier
- #pragma omp atomic
- (*bar ())--;
- #pragma omp barrier
- #pragma omp atomic
- --(*bar ());
- #pragma omp barrier
- #pragma omp atomic
- (*baz ())++;
- #pragma omp barrier
- #pragma omp atomic
- ++(*baz ());
-#ifndef __cplusplus
- #pragma omp barrier
- #pragma omp atomic
- (*baz ())--;
- #pragma omp barrier
- #pragma omp atomic
- --(*baz ());
- #pragma omp barrier
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-15.C b/gcc/testsuite/g++.dg/gomp/atomic-15.C
deleted file mode 100644
index 95eb8b4534d..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-15.C
+++ /dev/null
@@ -1,46 +0,0 @@
-// { dg-do compile }
-// { dg-options "-fopenmp" }
-
-int x = 6;
-
-int
-main ()
-{
- int v;
- #pragma omp atomic
- x = x * 7 + 6; // { dg-error "expected" }
- #pragma omp atomic
- x = x * 7 ^ 6; // { dg-error "expected" }
- #pragma omp atomic update
- x = x - 8 + 6; // { dg-error "expected" }
- #pragma omp atomic
- x = x ^ 7 | 2; // { dg-error "expected" }
- #pragma omp atomic
- x = x / 7 * 2; // { dg-error "expected" }
- #pragma omp atomic
- x = x / 7 / 2; // { dg-error "expected" }
- #pragma omp atomic capture
- v = x = x | 6; // { dg-error "invalid operator" }
- #pragma omp atomic capture
- { v = x; x = x * 7 + 6; } // { dg-error "expected" }
- #pragma omp atomic capture
- { v = x; x = x * 7 ^ 6; } // { dg-error "expected" }
- #pragma omp atomic capture
- { v = x; x = x - 8 + 6; } // { dg-error "expected" }
- #pragma omp atomic capture
- { v = x; x = x ^ 7 | 2; } // { dg-error "expected" }
- #pragma omp atomic capture
- { v = x; x = x / 7 * 2; } // { dg-error "expected" }
- #pragma omp atomic capture
- { v = x; x = x / 7 / 2; } // { dg-error "expected" }
- #pragma omp atomic capture
- { x = x * 7 + 6; v = x; } // { dg-error "expected" }
- #pragma omp atomic capture
- { x = x * 7 ^ 6; v = x; } // { dg-error "expected" }
- #pragma omp atomic capture
- { x = x - 8 + 6; v = x; } // { dg-error "expected" }
- #pragma omp atomic capture
- { x = x ^ 7 | 2; v = x; } // { dg-error "expected" }
- (void) v;
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-2.C b/gcc/testsuite/g++.dg/gomp/atomic-2.C
deleted file mode 100644
index 720ec9e8ba0..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-2.C
+++ /dev/null
@@ -1,23 +0,0 @@
-/* { dg-do compile } */
-
-float x, y;
-
-void f1(void)
-{
- #pragma omp atomic
- x++;
- #pragma omp atomic
- x--;
- #pragma omp atomic
- ++x;
- #pragma omp atomic
- --x;
- #pragma omp atomic
- x += 1;
- #pragma omp atomic
- x -= y;
- #pragma omp atomic
- x *= 3;
- #pragma omp atomic
- x /= 3;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-3.C b/gcc/testsuite/g++.dg/gomp/atomic-3.C
deleted file mode 100644
index 7ea792d3457..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-3.C
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
-
-int *xyzzy;
-
-void f1(void)
-{
- #pragma omp atomic
- xyzzy++;
-}
-
-/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
-/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-4.C b/gcc/testsuite/g++.dg/gomp/atomic-4.C
deleted file mode 100644
index 7f27370d535..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-4.C
+++ /dev/null
@@ -1,24 +0,0 @@
-/* { dg-do compile } */
-
-int a[4];
-int *p;
-struct S { int x; int y[4]; } s;
-int *bar(void);
-
-void f1(void)
-{
- #pragma omp atomic
- a[4] += 1;
- #pragma omp atomic
- *p += 1;
- #pragma omp atomic
- s.x += 1;
- #pragma omp atomic
- s.y[*p] += 1;
- #pragma omp atomic
- s.y[*p] *= 42;
- #pragma omp atomic
- *bar() += 1;
- #pragma omp atomic
- *bar() *= 42;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-7.C b/gcc/testsuite/g++.dg/gomp/atomic-7.C
deleted file mode 100644
index 612e97f4530..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-7.C
+++ /dev/null
@@ -1,23 +0,0 @@
-/* { dg-do compile } */
-
-double x, y;
-
-void f2(void)
-{
- #pragma omp atomic
- y++;
- #pragma omp atomic
- y--;
- #pragma omp atomic
- ++y;
- #pragma omp atomic
- --y;
- #pragma omp atomic
- y += 1;
- #pragma omp atomic
- y -= x;
- #pragma omp atomic
- y *= 3;
- #pragma omp atomic
- y /= 3;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-8.C b/gcc/testsuite/g++.dg/gomp/atomic-8.C
deleted file mode 100644
index 2f04151f0ed..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-8.C
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do compile } */
-
-long double z;
-
-void f3(void)
-{
- #pragma omp atomic
- z++;
- #pragma omp atomic
- z--;
- #pragma omp atomic
- ++z;
- #pragma omp atomic
- --z;
- #pragma omp atomic
- z += 1;
- #pragma omp atomic
- z *= 3;
- #pragma omp atomic
- z /= 3;
-}
diff --git a/gcc/testsuite/g++.dg/gomp/atomic-9.C b/gcc/testsuite/g++.dg/gomp/atomic-9.C
deleted file mode 100644
index 2fafbd4097a..00000000000
--- a/gcc/testsuite/g++.dg/gomp/atomic-9.C
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
-
-volatile int *bar(void);
-
-void f1(void)
-{
- #pragma omp atomic
- *bar() += 1;
-}
-
-/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "ompexp" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
-/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc/testsuite/g++.dg/gomp/gomp.exp b/gcc/testsuite/g++.dg/gomp/gomp.exp
index 9f60bc1c5f3..b99d302ddf5 100644
--- a/gcc/testsuite/g++.dg/gomp/gomp.exp
+++ b/gcc/testsuite/g++.dg/gomp/gomp.exp
@@ -27,7 +27,7 @@ if ![check_effective_target_fopenmp] {
dg-init
# Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" "-fopenmp"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/gomp/*.c]] "" "-fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/g++.dg/init/copy7.C b/gcc/testsuite/g++.dg/init/copy7.C
deleted file mode 100644
index 20e1e47dbb9..00000000000
--- a/gcc/testsuite/g++.dg/init/copy7.C
+++ /dev/null
@@ -1,39 +0,0 @@
-// PR c++/39480
-// It isn't always safe to call memcpy with identical arguments.
-// { dg-do run }
-
-extern "C" void abort();
-extern "C" void *
-memcpy(void *dest, void *src, __SIZE_TYPE__ n)
-{
- if (dest == src)
- abort();
- else
- {
- __SIZE_TYPE__ i;
- for (i = 0; i < n; i++)
- ((char *)dest)[i] = ((const char*)src)[i];
- }
-}
-
-struct A
-{
- double d[10];
-};
-
-struct B: public A
-{
- char bc;
-};
-
-B b;
-
-void f(B *a1, B* a2)
-{
- *a1 = *a2;
-}
-
-int main()
-{
- f(&b,&b);
-}
diff --git a/gcc/testsuite/g++.dg/init/lifetime1.C b/gcc/testsuite/g++.dg/init/lifetime1.C
new file mode 100644
index 00000000000..57f8c62179a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/lifetime1.C
@@ -0,0 +1,29 @@
+// PR c++/48370
+// { dg-do run }
+
+extern "C" void abort();
+
+int last = 4;
+
+struct A {
+ int i;
+ A(int i): i(i) { }
+ ~A() { if (i > last) abort(); last = i; }
+};
+
+struct D { int i; };
+
+struct B: D, A { B(int i): A(i) { } };
+struct E: D, virtual A { E(int i): A(i) { } };
+
+struct C
+{
+ const A& ar1;
+ const A& ar2;
+ const A& ar3;
+};
+
+int main()
+{
+ C c = { 1, B(2), E(3) };
+}
diff --git a/gcc/testsuite/g++.dg/init/lifetime2.C b/gcc/testsuite/g++.dg/init/lifetime2.C
new file mode 100644
index 00000000000..293bd692e9c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/lifetime2.C
@@ -0,0 +1,23 @@
+// PR c++/26714
+// { dg-do run }
+
+extern "C" void abort();
+
+bool ok = false;
+struct A
+{
+ A() { }
+ ~A() { if (!ok) abort(); }
+};
+
+struct B
+{
+ const A &a1;
+ const A &a2;
+ B() : a1(A()),a2(A()) { ok = true; }
+};
+
+int main()
+{
+ B b;
+}
diff --git a/gcc/testsuite/g++.dg/init/ref21.C b/gcc/testsuite/g++.dg/init/ref21.C
new file mode 100644
index 00000000000..db4ac4a300f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ref21.C
@@ -0,0 +1,7 @@
+struct A
+{
+ const int &i1;
+ const int &i2;
+};
+
+A a = { 1, 2 };
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-1.C b/gcc/testsuite/g++.dg/ipa/devirt-c-1.C
index df2230d4c66..dcd8046597c 100644
--- a/gcc/testsuite/g++.dg/ipa/devirt-c-1.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-c-1.C
@@ -1,7 +1,7 @@
/* Verify that ipa-cp correctly detects the dynamic type of an object
under construction when doing devirtualization. */
/* { dg-do run } */
-/* { dg-options "-O3 -fno-early-inlining -fno-inline" } */
+/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
extern "C" void abort (void);
@@ -69,3 +69,8 @@ int main (int argc, char *argv[])
bah ();
return 0;
}
+
+/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*A::foo" "cp" } } */
+/* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-2.C b/gcc/testsuite/g++.dg/ipa/devirt-c-2.C
index d37fe50cda2..b9a36e29f87 100644
--- a/gcc/testsuite/g++.dg/ipa/devirt-c-2.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-c-2.C
@@ -1,7 +1,7 @@
/* Verify that ipa-cp correctly detects the dynamic type of an object
under construction when doing devirtualization. */
/* { dg-do run } */
-/* { dg-options "-O3 -fno-early-inlining -fno-inline" } */
+/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
extern "C" void abort (void);
@@ -77,3 +77,8 @@ int main (int argc, char *argv[])
bah ();
return 0;
}
+
+/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*A::foo" "cp" } } */
+/* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C
new file mode 100644
index 00000000000..89d04328c18
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C
@@ -0,0 +1,87 @@
+/* Verify that ipa-cp will not get confused by placement new constructing an
+ object within another one when looking for dynamic type change . */
+/* { dg-do run } */
+/* { dg-options "-O3 -Wno-attributes" } */
+
+extern "C" void abort (void);
+namespace std {
+ typedef __SIZE_TYPE__ size_t;
+}
+inline void* __attribute__ ((always_inline))
+operator new(std::size_t, void* __p) throw()
+{
+ return __p;
+}
+
+class A
+{
+public:
+ char data[256];
+ A();
+ virtual int foo (int i);
+};
+
+class B : public A
+{
+public:
+ virtual int foo (int i);
+};
+
+class C
+{
+public:
+ C();
+ virtual double foo (double i);
+};
+
+int A::foo (int i)
+{
+ return i + 1;
+}
+
+int B::foo (int i)
+{
+ return i + 2;
+}
+
+double C::foo (double i)
+{
+ return i + 3.5;
+}
+
+static int __attribute__ ((noinline)) middleman (class A *obj, int i)
+{
+ return obj->foo (i);
+}
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+__attribute__ ((always_inline)) C::C ()
+{
+}
+
+A::A ()
+{
+}
+
+static __attribute__ ((noinline)) void bah ()
+{
+ class B b;
+
+ C *c = new ((void *) &b.data) C;
+
+ if (middleman (&b, get_input ()) != 3)
+ abort ();
+}
+
+int main (int argc, char *argv[])
+{
+ int i;
+
+ for (i = 0; i < 10; i++)
+ bah ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-8.C b/gcc/testsuite/g++.dg/ipa/devirt-c-8.C
new file mode 100644
index 00000000000..309644d92ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/devirt-c-8.C
@@ -0,0 +1,82 @@
+/* Verify that ipa-cp correctly detects the dynamic type of an object
+ under construction when doing devirtualization. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
+
+extern "C" void abort (void);
+
+class A
+{
+public:
+ int data;
+ A();
+ virtual int foo (int i);
+};
+
+class B : public A
+{
+public:
+ B();
+ virtual int foo (int i);
+};
+
+class C : public A
+{
+public:
+ virtual int foo (int i);
+};
+
+int A::foo (int i)
+{
+ return i + 1;
+}
+
+int B::foo (int i)
+{
+ return i + 2;
+}
+
+int C::foo (int i)
+{
+ return i + 3;
+}
+
+static int __attribute__ ((noinline))
+middleman (class A *obj, int i)
+{
+ return obj->foo (i);
+}
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+inline __attribute__ ((always_inline)) A::A ()
+{
+ if (middleman (this, get_input ()) != 2)
+ abort ();
+}
+
+inline __attribute__ ((always_inline)) B::B ()
+{
+}
+
+static void bah ()
+{
+ class B b;
+}
+
+int main (int argc, char *argv[])
+{
+ int i;
+
+ for (i = 0; i < 10; i++)
+ bah ();
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*A::foo" "cp" } } */
+/* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/g++.dg/opt/devirt2.C b/gcc/testsuite/g++.dg/opt/devirt2.C
index b068f4dedd7..1198abdd776 100644
--- a/gcc/testsuite/g++.dg/opt/devirt2.C
+++ b/gcc/testsuite/g++.dg/opt/devirt2.C
@@ -1,5 +1,8 @@
// { dg-do compile }
// { dg-options "-O2" }
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+// { dg-additional-options "-mshort-calls" {target epiphany-*-*} }
// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } }
// The IA64 and HPPA compilers generate external declarations in addition
// to the call so those scans need to be more specific.
diff --git a/gcc/testsuite/g++.dg/other/offsetof7.C b/gcc/testsuite/g++.dg/other/offsetof7.C
new file mode 100644
index 00000000000..0ce2ee02aa8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/offsetof7.C
@@ -0,0 +1,17 @@
+// PR c++/50608
+// Testcase by <dberger@oubliette.org>
+// { dg-do compile }
+
+struct A {
+ int offset;
+};
+
+struct B: public A {
+};
+
+struct C {
+ A a;
+ B b;
+};
+
+int fails = __builtin_offsetof (C, b.offset);
diff --git a/gcc/testsuite/g++.dg/parse/pragma3.C b/gcc/testsuite/g++.dg/parse/pragma3.C
index 36d7a8c6284..57793b385d0 100644
--- a/gcc/testsuite/g++.dg/parse/pragma3.C
+++ b/gcc/testsuite/g++.dg/parse/pragma3.C
@@ -1,5 +1,6 @@
// PR c++/25294
-// { dg-do run }
+// Epiphany makes struct S 8-byte aligned.
+// { dg-do run { target { ! epiphany-*-* } } }
extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/pr50672.C b/gcc/testsuite/g++.dg/pr50672.C
new file mode 100644
index 00000000000..fb310082edc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr50672.C
@@ -0,0 +1,101 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+typedef int BoxCoordinate;
+typedef int BoxDimension;
+const BoxDimension X = 0;
+const BoxDimension Y = 1;
+const BoxDimension NDimensions = 2;
+class BoxPoint {
+ BoxCoordinate point[NDimensions];
+public:
+ bool isValid() const;
+ void operator += (const BoxPoint& p) {
+ if (isValid() && p.isValid()) {
+ point[X] += p.point[X];
+ }
+ }
+ const BoxCoordinate& operator [] (const BoxDimension& dimension) const {
+ return point[dimension];
+ }
+};
+class BoxRegion {
+public:
+ BoxCoordinate& origin(BoxDimension d) const;
+ BoxCoordinate& space(BoxDimension d) const;
+};
+inline bool operator <= (const BoxPoint& p, const BoxRegion& r) {
+ for (BoxDimension d = X;
+ d <= Y;
+ d++) if (p[d] < r.origin(d) || p[d] >= r.origin(d) + r.space(d))
+return false;
+ return true;
+}
+typedef struct _WidgetRec *Widget;
+struct GraphGC {
+ BoxPoint offsetIfSelected;
+};
+class GraphNode;
+class GraphEdge {
+public:
+ GraphNode *from() const;
+ GraphNode *to() const;
+};
+class LineGraphEdge: public GraphEdge {
+protected:
+ virtual void drawLine(Widget w, const GraphGC& gc) const;
+ void _print(const GraphGC &gc) const;
+};
+class ArcGraphEdge: public LineGraphEdge {
+ static bool center(const BoxPoint& p1, const BoxPoint& p2,
+ const BoxPoint& p3, double& x, double& y);
+ void makeLine(Widget w, const GraphGC& gc) const;
+};
+class GraphNode {
+public:
+ bool& selected();
+ GraphEdge *firstTo() const;
+ GraphEdge *nextTo(GraphEdge *ref) const;
+ virtual const BoxPoint& pos() const = 0;
+ virtual const BoxRegion& region(const GraphGC& gc) const = 0;
+ virtual bool isHint() const;
+};
+class PosGraphNode: public GraphNode { };
+class RegionGraphNode: public PosGraphNode { };
+class HintGraphNode: public RegionGraphNode { };
+void ArcGraphEdge::makeLine(Widget w, const GraphGC& gc) const {
+ HintGraphNode *arc_hint = 0;
+ RegionGraphNode *arc_from = 0;
+ RegionGraphNode *arc_to = 0;
+ bool make_arc = true;
+ if (from()->isHint() && to()->isHint()) {
+ make_arc = false;
+ }
+ else if (from()->isHint() && from()->firstTo() != 0) {
+ if (arc_hint == 0 || arc_from == 0 || arc_to == 0
+ || arc_hint->nextTo(arc_hint->firstTo()) != 0) {
+ make_arc = false;
+ }
+ }
+ if (!make_arc) {
+ if (w != 0) LineGraphEdge::drawLine(w, gc);
+ else LineGraphEdge::_print(gc);
+ return;
+ }
+ BoxPoint pos_from = arc_from->pos();
+ BoxRegion region_from = arc_from->region(gc);
+ BoxPoint pos_to = arc_to->pos();
+ BoxRegion region_to = arc_to->region(gc);
+ BoxPoint pos_hint = arc_hint->pos();
+ if (arc_hint->selected()) {
+ pos_hint += gc.offsetIfSelected;
+ }
+ if (pos_hint <= region_from || pos_hint <= region_to) {
+ return;
+ }
+ double cx, cy;
+ bool ok = center(pos_from, pos_hint, pos_to, cx, cy);
+ if (!ok) {
+ if (w != 0) LineGraphEdge::drawLine(w, gc);
+ else LineGraphEdge::_print(gc);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/pr50763-3.C b/gcc/testsuite/g++.dg/pr50763-3.C
new file mode 100644
index 00000000000..b66be87b1b8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr50763-3.C
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+class v2d {
+public:
+ double x;
+ double y;
+};
+
+class v3d {
+public:
+ double x;
+ v3d() {}
+ v3d(const v2d & cr2Dv) {}
+};
+
+class e2d {
+protected:
+ v2d _Min;
+ v2d _Max;
+public:
+ int cop2d(const v2d & rPnt) const;
+ v2d clp2d(const v2d & rPnt) const;
+};
+
+inline int e2d::cop2d(const v2d & rPnt) const {
+ int bRet = 1;
+ if (rPnt.x < _Min.x) bRet = 0;
+ else if (rPnt.x > _Max.x) bRet = 0;
+ else if (rPnt.y > _Max.y) bRet = 0;
+ return bRet;
+}
+
+inline v2d e2d::clp2d(const v2d & rPnt) const {
+ v2d sRet = rPnt;
+ if (rPnt.x < _Min.x) sRet.x = _Min.x;
+ if (rPnt.y < _Min.y) sRet.y = _Min.y;
+ if (rPnt.x > _Max.x) sRet.x = _Max.x;
+ if (rPnt.y > _Max.y) sRet.y = _Max.y;
+ return sRet;
+}
+
+class sExt {
+protected:
+ e2d _Dom;
+ long eval() const;
+ long evalPoint(const v2d & crUV, v3d & rPnt) const;
+};
+
+long sExt::evalPoint(const v2d & crUV, v3d & rPnt) const {
+ v3d sUV = crUV;
+ if (!_Dom.cop2d(crUV)) {
+ sUV = _Dom.clp2d(crUV);
+ }
+ eval();
+}
diff --git a/gcc/testsuite/g++.dg/pr50763-4.C b/gcc/testsuite/g++.dg/pr50763-4.C
new file mode 100644
index 00000000000..2605d81925b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr50763-4.C
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+float
+clamp (const float x)
+{
+ return x <= 1 ? 1 : x;
+}
+
+template < class T > struct VECTOR
+{
+ float x;
+};
+template < class TV > class JOINT
+{
+ virtual void Constrain_Angles (VECTOR < float >&angles) const;
+};
+
+template < class TV > class ANGLE_JOINT:public JOINT < TV >
+{
+ virtual ~ ANGLE_JOINT ()
+ {
+ }
+ void Constrain_Angles (VECTOR < float >&angles) const
+ {
+ VECTOR < float >v;
+ if (v.x)
+ v.x = clamp (angles.x);
+ else
+ v.x = angles.x;
+ angles.x = v.x;
+ }
+};
+template ANGLE_JOINT < int >::~ANGLE_JOINT ();
diff --git a/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C b/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C
new file mode 100644
index 00000000000..7e0041ee382
--- /dev/null
+++ b/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C
@@ -0,0 +1,73 @@
+/* { dg-do link } */
+/* { dg-options "-std=c++0x" } */
+/* { dg-final { simulate-thread } } */
+
+/* Test that atomic int and atomic char work properly. */
+
+using namespace std;
+
+#include <atomic>
+#include <limits.h>
+#include <stdio.h>
+#include "simulate-thread.h"
+
+atomic<int> atomi;
+atomic<char> atomc;
+
+/* No need for parallel threads to do anything */
+void simulate_thread_other_threads()
+{
+}
+
+/* Verify after every instruction is executed, that the atmoic int and
+ char have one of the 2 legitimate values. */
+int simulate_thread_step_verify()
+{
+ if (atomi != 0 && atomi != INT_MAX)
+ {
+ printf ("FAIL: invalid intermediate result for atomi (%d).\n",
+ (int)atomi);
+ return 1;
+ }
+ if (atomc != 0 && atomc != CHAR_MAX)
+ {
+ printf ("FAIL: invalid intermediate result for atomc (%d).\n",
+ (int)atomc);
+ return 1;
+ }
+ return 0;
+}
+
+
+/* Verify that both atmoics have the corerct value. */
+int simulate_thread_final_verify()
+{
+ if (atomi != INT_MAX)
+ {
+ printf ("FAIL: invalid final result for atomi (%d).\n",
+ (int)atomi);
+ return 1;
+ }
+ if (atomc != CHAR_MAX)
+ {
+ printf ("FAIL: invalid final result for atomc (%d).\n",
+ (int)atomc);
+ return 1;
+ }
+ return 0;
+}
+
+/* Test a store to an atomic int and an atomic char. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ atomi = INT_MAX;
+ atomc = CHAR_MAX;
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C b/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C
new file mode 100644
index 00000000000..be3232d7087
--- /dev/null
+++ b/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C
@@ -0,0 +1,58 @@
+/* { dg-do link } */
+/* { dg-options "-std=c++0x" } */
+/* { dg-final { simulate-thread } } */
+
+using namespace std;
+
+#include <atomic>
+#include <limits.h>
+#include <stdio.h>
+#include "simulate-thread.h"
+
+atomic_int atomi;
+
+/* Non-atomic. Use a type wide enough to possibly coerce GCC into
+ moving things around. */
+long double j;
+
+
+/* Test that an atomic store synchronizes with an atomic load.
+
+ In this case, test that the store to <j> happens-before the atomic
+ store to <atomi>. Make sure the compiler does not reorder the
+ stores. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ j = 13.0;
+ atomi.store(1);
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
+
+void simulate_thread_other_threads()
+{
+}
+
+/* Verify that side-effects before an atomic store are correctly
+ synchronized with the an atomic load to the same location. */
+int simulate_thread_step_verify()
+{
+ if (atomi.load() == 1 && j != 13.0)
+ {
+ printf ("FAIL: invalid synchronization for atomic load/store.\n");
+ return 1;
+ }
+ return 0;
+}
+
+
+int simulate_thread_final_verify()
+{
+ return simulate_thread_step_verify();
+}
diff --git a/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C b/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C
new file mode 100644
index 00000000000..077514a3ff5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C
@@ -0,0 +1,77 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+/* Test that setting <var.a> does not touch either <var.b> or <var.c>.
+ In the C++ memory model, non contiguous bitfields ("a" and "c"
+ here) should be considered as distinct memory locations, so we
+ can't use bit twiddling to set either one. */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+#define CONSTA 12
+
+static int global;
+struct S
+{
+ unsigned int a : 4;
+ unsigned char b;
+ unsigned int c : 6;
+} var;
+
+__attribute__((noinline))
+void set_a()
+{
+ var.a = CONSTA;
+}
+
+void simulate_thread_other_threads()
+{
+ ++global;
+ var.b = global;
+ var.c = global;
+}
+
+int simulate_thread_step_verify()
+{
+ int ret = 0;
+ if (var.b != global)
+ {
+ printf ("FAIL: Unexpected value: var.b is %d, should be %d\n",
+ var.b, global);
+ ret = 1;
+ }
+ if (var.c != global)
+ {
+ printf ("FAIL: Unexpected value: var.c is %d, should be %d\n",
+ var.c, global);
+ ret = 1;
+ }
+ return ret;
+}
+
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify();
+ if (var.a != CONSTA)
+ {
+ printf ("FAIL: Unexpected value: var.a is %d, should be %d\n",
+ var.a, CONSTA);
+ ret = 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ set_a();
+}
+
+int main()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/simulate-thread/bitfields.C b/gcc/testsuite/g++.dg/simulate-thread/bitfields.C
new file mode 100644
index 00000000000..3acf21f876f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/simulate-thread/bitfields.C
@@ -0,0 +1,80 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+/* Test that setting <var.a> does not touch either <var.b> or <var.c>.
+ In the C++ memory model, non contiguous bitfields ("a" and "c"
+ here) should be considered as distinct memory locations, so we
+ can't use bit twiddling to set either one. */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+#define CONSTA 12
+
+static int global;
+struct S
+{
+ /* On x86-64, the volatile causes us to access <a> with a 32-bit
+ access, and thus trigger this test. */
+ volatile unsigned int a : 4;
+
+ unsigned char b;
+ unsigned int c : 6;
+} var;
+
+__attribute__((noinline))
+void set_a()
+{
+ var.a = CONSTA;
+}
+
+void simulate_thread_other_threads()
+{
+ ++global;
+ var.b = global;
+ var.c = global;
+}
+
+int simulate_thread_step_verify()
+{
+ int ret = 0;
+ if (var.b != global)
+ {
+ printf ("FAIL: Unexpected value: var.b is %d, should be %d\n",
+ var.b, global);
+ ret = 1;
+ }
+ if (var.c != global)
+ {
+ printf ("FAIL: Unexpected value: var.c is %d, should be %d\n",
+ var.c, global);
+ ret = 1;
+ }
+ return ret;
+}
+
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify();
+ if (var.a != CONSTA)
+ {
+ printf ("FAIL: Unexpected value: var.a is %d, should be %d\n",
+ var.a, CONSTA);
+ ret = 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ set_a();
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wcast-qual2.C b/gcc/testsuite/g++.dg/warn/Wcast-qual2.C
new file mode 100644
index 00000000000..23dbb4d39b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wcast-qual2.C
@@ -0,0 +1,4 @@
+// PR c++/50956
+// { dg-options "-Wcast-qual" }
+
+void* p = (void*)"txt"; // { dg-warning "cast" }
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null-3.C b/gcc/testsuite/g++.dg/warn/Wconversion-null-3.C
new file mode 100644
index 00000000000..1942ee270bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-null-3.C
@@ -0,0 +1,8 @@
+// PR c++/48420
+
+void foo(int* p);
+
+void bar() {
+ const bool kDebugMode = false;
+ foo(kDebugMode); // { dg-warning "converting 'false'" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-1.C b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-1.C
new file mode 100644
index 00000000000..d0f62b212ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-1.C
@@ -0,0 +1,100 @@
+// { dg-options "-Wzero-as-null-pointer-constant" }
+
+struct A;
+
+typedef int (A::*pointmemfun) (int);
+typedef int (A::*pointdmem);
+typedef int (*pointfun) (int);
+
+pointmemfun pmfs;
+pointdmem pdms;
+pointfun pfs;
+int* ps;
+
+void f()
+{
+ pointmemfun pmf(0); // { dg-warning "zero as null pointer" }
+ pointdmem pdm(0); // { dg-warning "zero as null pointer" }
+ pointfun pf(0); // { dg-warning "zero as null pointer" }
+ int* p(0); // { dg-warning "zero as null pointer" }
+
+ pmf = 0; // { dg-warning "zero as null pointer" }
+
+ pdm = 0; // { dg-warning "zero as null pointer" }
+
+ pf = 0; // { dg-warning "zero as null pointer" }
+
+ p = 0; // { dg-warning "zero as null pointer" }
+
+ if (pmf)
+ ;
+
+ if (pdm)
+ ;
+
+ if (pf)
+ ;
+
+ if (p)
+ ;
+
+ if (!pmf)
+ ;
+
+ if (!pdm)
+ ;
+
+ if (!pf)
+ ;
+
+ if (!p)
+ ;
+
+ if (pmf == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pdm == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pf == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (p == 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pmf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pdm) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == pf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 == p) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pmf != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pdm != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (pf != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (p != 0) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pmf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pdm) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != pf) // { dg-warning "zero as null pointer" }
+ ;
+
+ if (0 != p) // { dg-warning "zero as null pointer" }
+ ;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
index 156fd7b0c61..fcf8c071246 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
@@ -28,6 +28,10 @@
/* Not all Linux kernels deal correctly the breakpoints generated by
MIPS16 divisions by zero. They show up as a SIGTRAP instead. */
# define DO_TEST 0
+#elif defined (__epiphany__)
+ /* Epiphany does not have hardware division, and the software implementation
+ has truly undefined behaviour for division by 0. */
+# define DO_TEST 0
#else
# define DO_TEST 1
#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
index 418526599d5..d090cbf610e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
@@ -1,3 +1,8 @@
+if [istarget "epiphany-*-*"] {
+ # The Epiphany single-precision floating point format does not
+ # support subnormals.
+ return 1
+}
if [istarget "mips-sgi-irix6*"] {
# IRIX 6 sets the MIPS IV flush to zero bit by default, so this test
# isn't expected to work for n32 and n64 on MIPS IV targets.
diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c
index 0b3178f28d7..6e568eddb90 100644
--- a/gcc/testsuite/gcc.dg/20020312-2.c
+++ b/gcc/testsuite/gcc.dg/20020312-2.c
@@ -20,6 +20,8 @@ extern void abort (void);
/* No pic register. */
#elif defined(__cris__)
# define PIC_REG "0"
+#elif defined(__epiphany__)
+#define PIC_REG "r28"
#elif defined(__fr30__)
/* No pic register. */
#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__)
diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c
new file mode 100644
index 00000000000..2ac54e80887
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c
@@ -0,0 +1,85 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for a char. */
+
+extern void abort(void);
+
+char v = 0;
+char expected = 0;
+char max = ~0;
+char desired = ~0;
+char zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c
new file mode 100644
index 00000000000..73b25977748
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c
@@ -0,0 +1,85 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for a short. */
+
+extern void abort(void);
+
+short v = 0;
+short expected = 0;
+short max = ~0;
+short desired = ~0;
+short zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c
new file mode 100644
index 00000000000..26097288c9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c
@@ -0,0 +1,85 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for an int. */
+
+extern void abort(void);
+
+int v = 0;
+int expected = 0;
+int max = ~0;
+int desired = ~0;
+int zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c
new file mode 100644
index 00000000000..d89e72f8171
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c
@@ -0,0 +1,86 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+
+/* Test the execution of __atomic_compare_exchange_n builtin for a long_long. */
+
+extern void abort(void);
+
+long long v = 0;
+long long expected = 0;
+long long max = ~0;
+long long desired = ~0;
+long long zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c
new file mode 100644
index 00000000000..e716dcb350c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c
@@ -0,0 +1,86 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* } } } */
+
+/* Test the execution of __atomic_compare_exchange_n builtin for an int_128. */
+
+extern void abort(void);
+
+__int128_t v = 0;
+__int128_t expected = 0;
+__int128_t max = ~0;
+__int128_t desired = ~0;
+__int128_t zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-1.c b/gcc/testsuite/gcc.dg/atomic-exchange-1.c
new file mode 100644
index 00000000000..fb78cdbca54
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-exchange-1.c
@@ -0,0 +1,62 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_exchange_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count, ret;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
+ abort ();
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-2.c b/gcc/testsuite/gcc.dg/atomic-exchange-2.c
new file mode 100644
index 00000000000..153771a2cdc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-exchange-2.c
@@ -0,0 +1,62 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_X builtin for a short. */
+
+extern void abort(void);
+
+short v, count, ret;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
+ abort ();
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-3.c b/gcc/testsuite/gcc.dg/atomic-exchange-3.c
new file mode 100644
index 00000000000..fbf8f6b966c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-exchange-3.c
@@ -0,0 +1,62 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_X builtin for an int. */
+
+extern void abort(void);
+
+int v, count, ret;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
+ abort ();
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-4.c b/gcc/testsuite/gcc.dg/atomic-exchange-4.c
new file mode 100644
index 00000000000..f0530fc462c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-exchange-4.c
@@ -0,0 +1,63 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+
+/* Test the execution of the __atomic_X builtin for a long_long. */
+
+extern void abort(void);
+
+long long v, count, ret;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
+ abort ();
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-5.c b/gcc/testsuite/gcc.dg/atomic-exchange-5.c
new file mode 100644
index 00000000000..13fd6d1b8ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-exchange-5.c
@@ -0,0 +1,63 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_X builtin for a 16 byte value. */
+
+extern void abort(void);
+
+__int128_t v, count, ret;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
+ abort ();
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
+ abort ();
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-fence.c b/gcc/testsuite/gcc.dg/atomic-fence.c
new file mode 100644
index 00000000000..1f6d1871a0b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-fence.c
@@ -0,0 +1,27 @@
+/* Test __atomic routines for existence and execution with each valid
+ memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test that __atomic_{thread,signal}_fence builtins execute. */
+
+main ()
+{
+ __atomic_thread_fence (__ATOMIC_RELAXED);
+ __atomic_thread_fence (__ATOMIC_CONSUME);
+ __atomic_thread_fence (__ATOMIC_ACQUIRE);
+ __atomic_thread_fence (__ATOMIC_RELEASE);
+ __atomic_thread_fence (__ATOMIC_ACQ_REL);
+ __atomic_thread_fence (__ATOMIC_SEQ_CST);
+
+ __atomic_signal_fence (__ATOMIC_RELAXED);
+ __atomic_signal_fence (__ATOMIC_CONSUME);
+ __atomic_signal_fence (__ATOMIC_ACQUIRE);
+ __atomic_signal_fence (__ATOMIC_RELEASE);
+ __atomic_signal_fence (__ATOMIC_ACQ_REL);
+ __atomic_signal_fence (__ATOMIC_SEQ_CST);
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-generic-aux.c b/gcc/testsuite/gcc.dg/atomic-generic-aux.c
new file mode 100644
index 00000000000..a6b552a5dfd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-generic-aux.c
@@ -0,0 +1,45 @@
+/* Supply a set of generic atomic functions to test the compiler make the
+ calls properly. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that the generic builtins make calls as expected. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+void
+__atomic_exchange (size_t size, void *obj, void *val, void *ret, int model)
+{
+ /* Copy old value into *ret. */
+ memcpy (ret, obj, size);
+ /* Copy val into object. */
+ memcpy (obj, val, size);
+}
+
+
+bool
+__atomic_compare_exchange (size_t size, void *obj, void *expected,
+ void *desired, int model1, int model2)
+{
+ if (!memcmp (obj, expected, size))
+ {
+ memcpy (obj, desired, size);
+ return true;
+ }
+ memcpy (expected, obj, size);
+ return false;
+}
+
+
+void __atomic_load (size_t size, void *obj, void *ret, int model)
+{
+ memcpy (ret, obj, size);
+}
+
+
+void __atomic_store (size_t size, void *obj, void *val, int model)
+{
+ memcpy (obj, val, size);
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-generic.c b/gcc/testsuite/gcc.dg/atomic-generic.c
new file mode 100644
index 00000000000..8a5528c3653
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-generic.c
@@ -0,0 +1,56 @@
+/* Test generic __atomic routines for proper function calling.
+ memory model. */
+/* { dg-options "-w" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-generic-aux.c" } */
+
+/* Test that the generioc atomic builtins execute as expected..
+ sync-mem-generic-aux.c supplies a functional external entry point for
+ the 4 generic functions. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+extern void abort();
+
+typedef struct test {
+ int array[10];
+} test_struct;
+
+test_struct zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+test_struct ones = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+test_struct a,b;
+
+int size = sizeof (test_struct);
+/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
+main ()
+{
+ test_struct c;
+
+ __atomic_store (&a, &zero, __ATOMIC_RELAXED);
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ __atomic_exchange (&a, &ones, &c, __ATOMIC_SEQ_CST);
+ if (memcmp (&c, &zero, size))
+ abort ();
+ if (memcmp (&a, &ones, size))
+ abort ();
+
+ __atomic_load (&a, &b, __ATOMIC_RELAXED);
+ if (memcmp (&b, &ones, size))
+ abort ();
+
+ if (!__atomic_compare_exchange (&a, &b, &zero, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort();
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ if (__atomic_compare_exchange (&a, &b, &ones, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort();
+ if (memcmp (&b, &zero, size))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-invalid.c b/gcc/testsuite/gcc.dg/atomic-invalid.c
new file mode 100644
index 00000000000..2b73c91e7c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-invalid.c
@@ -0,0 +1,29 @@
+/* Test __atomic routines for invalid memory model errors. This only needs
+ to be tested on a single size. */
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+
+#include <stddef.h>
+
+int i, e, b;
+size_t s;
+
+main ()
+{
+ __atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_RELAXED, __ATOMIC_SEQ_CST); /* { dg-error "failure memory model cannot be stronger" } */
+ __atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELEASE); /* { dg-error "invalid failure memory" } */
+ __atomic_compare_exchange_n (&i, &e, 1, 1, __ATOMIC_SEQ_CST, __ATOMIC_ACQ_REL); /* { dg-error "invalid failure memory" } */
+
+ __atomic_exchange_n (&i, 1, __ATOMIC_CONSUME); /* { dg-error "invalid memory model" } */
+
+ __atomic_load_n (&i, __ATOMIC_RELEASE); /* { dg-error "invalid memory model" } */
+ __atomic_load_n (&i, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
+
+ __atomic_store_n (&i, 1, __ATOMIC_ACQUIRE); /* { dg-error "invalid memory model" } */
+ __atomic_store_n (&i, 1, __ATOMIC_CONSUME); /* { dg-error "invalid memory model" } */
+ __atomic_store_n (&i, 1, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
+
+ i = __atomic_always_lock_free (s, NULL); /* { dg-error "non-constant argument" } */
+
+ __atomic_load_n (&i, 44); /* { dg-warning "invalid memory model" } */
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-load-1.c b/gcc/testsuite/gcc.dg/atomic-load-1.c
new file mode 100644
index 00000000000..928f9b0f10b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-load-1.c
@@ -0,0 +1,66 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_load_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-load-2.c b/gcc/testsuite/gcc.dg/atomic-load-2.c
new file mode 100644
index 00000000000..3d1df1cfffa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-load-2.c
@@ -0,0 +1,68 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_load_n builtin for a short. */
+
+extern void abort(void);
+
+short v, count;
+
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-load-3.c b/gcc/testsuite/gcc.dg/atomic-load-3.c
new file mode 100644
index 00000000000..ec238be9e51
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-load-3.c
@@ -0,0 +1,65 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+extern void abort(void);
+
+int v, count;
+
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-load-4.c b/gcc/testsuite/gcc.dg/atomic-load-4.c
new file mode 100644
index 00000000000..5cb7659da70
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-load-4.c
@@ -0,0 +1,65 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+
+extern void abort(void);
+
+long long v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-load-5.c b/gcc/testsuite/gcc.dg/atomic-load-5.c
new file mode 100644
index 00000000000..2991e4d6c7a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-load-5.c
@@ -0,0 +1,65 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* } } } */
+
+extern void abort(void);
+
+__int128_t v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c b/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c
new file mode 100644
index 00000000000..0ea872c302b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c
@@ -0,0 +1,17 @@
+/* Test supply a __atomic_is_lock_free routine for lock-free tests. */
+/* Just compile it on its own. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that __atomic_{is,always}_lock_free builtins execute. */
+
+#include <stdlib.h>
+
+/* Supply a builtin external function which returns a non-standard value so
+ it can be detected that it was called. */
+int
+__atomic_is_lock_free (size_t s, void *p)
+{
+ return 2;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-lockfree.c b/gcc/testsuite/gcc.dg/atomic-lockfree.c
new file mode 100644
index 00000000000..225428223ea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-lockfree.c
@@ -0,0 +1,120 @@
+/* Test __atomic routines for existence and execution with each valid
+ memory model. */
+/* { dg-options "-w" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-lockfree-aux.c" } */
+
+/* Test that __atomic_{is,always}_lock_free builtins execute.
+ sync-mem-lockfree-aux.c supplies and external entry point for
+ __atomic_is_lock_free which always returns a 2. We can detect the
+ external routine was called if 2 is returned since that is not a valid
+ result normally. */
+
+#include <stdlib.h>
+
+extern void abort();
+
+int r1, r2;
+
+/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
+main ()
+{
+
+ r1 = __atomic_always_lock_free (sizeof(char), 0);
+ r2 = __atomic_is_lock_free (sizeof(char), 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+ r1 = __atomic_always_lock_free (2, 0);
+ r2 = __atomic_is_lock_free (2, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (4, 0);
+ r2 = __atomic_is_lock_free (4, 0); /* Try passing in a variable. */
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (8, 0);
+ r2 = __atomic_is_lock_free (8, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (16, 0);
+ r2 = __atomic_is_lock_free (16, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (32, 0);
+ r2 = __atomic_is_lock_free (32, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-noinline-aux.c b/gcc/testsuite/gcc.dg/atomic-noinline-aux.c
new file mode 100644
index 00000000000..b92fcfcd60f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-noinline-aux.c
@@ -0,0 +1,51 @@
+/* Supply a set of generic atomic functions to test the compiler make the
+ calls properly. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that the generic builtins make calls as expected. This file provides
+ the exact entry points the test file will require. All these routines
+ simply set the first parameter to 1, and the caller will test for that. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+
+char
+__atomic_exchange_1 (char *p, char t, int i)
+{
+ *p = 1;
+}
+
+short
+__atomic_load_2 (short *p, int i)
+{
+ *p = 1;
+}
+
+void
+__atomic_store_1 (char *p, char v, int i)
+{
+ *p = 1;
+}
+
+int __atomic_compare_exchange_2 (short *p, short *a, short b, int x, int y, int z)
+{
+ *p = 1;
+}
+
+char __atomic_fetch_add_1 (char *p, char v, int i)
+{
+ *p = 1;
+}
+
+short __atomic_fetch_add_2 (short *p, short v, short i)
+{
+ *p = 1;
+}
+
+int __atomic_is_lock_free (int i, void *p)
+{
+ return 10;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-noinline.c b/gcc/testsuite/gcc.dg/atomic-noinline.c
new file mode 100644
index 00000000000..06a93e0058e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-noinline.c
@@ -0,0 +1,56 @@
+/* Test generic __atomic routines for proper function calling.
+ memory model. */
+/* { dg-options "-w -fno-inline-atomics" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-noinline-aux.c" } */
+
+/* Test that -fno-inline-atomics works as expected.
+ atomic-generic-aux provide the expected routines which simply set the
+ value of the first parameter to */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+extern void abort();
+
+short as,bs,cs;
+char ac,bc,cc;
+
+main ()
+{
+
+ ac = __atomic_exchange_n (&bc, cc, __ATOMIC_RELAXED);
+ if (bc != 1)
+ abort ();
+
+ as = __atomic_load_n (&bs, __ATOMIC_SEQ_CST);
+ if (bs != 1)
+ abort ();
+
+ __atomic_store_n (&ac, bc, __ATOMIC_RELAXED);
+ if (ac != 1)
+ abort ();
+
+ __atomic_compare_exchange_n (&as, &bs, cs, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+ if (as != 1)
+ abort ();
+
+ ac = __atomic_fetch_add (&cc, 15, __ATOMIC_SEQ_CST);
+ if (cc != 1)
+ abort ();
+
+ /* This should be translated to __atomic_fetch_add for the library */
+ as = __atomic_add_fetch (&cs, 10, __ATOMIC_RELAXED);
+
+ if (cs != 1)
+ abort ();
+
+ /* The fake external function should return 10. */
+ if (__atomic_is_lock_free (4, 0) != 10)
+ abort ();
+
+ return 0;
+}
+
+
+
diff --git a/gcc/testsuite/gcc.dg/atomic-op-1.c b/gcc/testsuite/gcc.dg/atomic-op-1.c
new file mode 100644
index 00000000000..bc1716f7799
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-1.c
@@ -0,0 +1,554 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_*OP builtin routines for a char. */
+
+extern void abort(void);
+
+char v, count, res;
+const char init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-op-2.c b/gcc/testsuite/gcc.dg/atomic-op-2.c
new file mode 100644
index 00000000000..8755340cca2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-2.c
@@ -0,0 +1,555 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_*OP builtin routines for a short. */
+
+extern void abort(void);
+
+short v, count, res;
+const short init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-op-3.c b/gcc/testsuite/gcc.dg/atomic-op-3.c
new file mode 100644
index 00000000000..69db4894b63
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-3.c
@@ -0,0 +1,554 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_*OP builtin routines for an int. */
+
+extern void abort(void);
+
+int v, count, res;
+const int init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-op-4.c b/gcc/testsuite/gcc.dg/atomic-op-4.c
new file mode 100644
index 00000000000..39650213edf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-4.c
@@ -0,0 +1,555 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+
+/* Test the execution of the __atomic_*OP builtin routines for long long. */
+
+extern void abort(void);
+
+long long v, count, res;
+const long long init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-op-5.c b/gcc/testsuite/gcc.dg/atomic-op-5.c
new file mode 100644
index 00000000000..2ca71adc8f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-5.c
@@ -0,0 +1,555 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_*OP builtin routines for an int_128. */
+
+extern void abort(void);
+
+__int128_t v, count, res;
+const __int128_t init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-param.c b/gcc/testsuite/gcc.dg/atomic-param.c
new file mode 100644
index 00000000000..a1bfc6be87c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-param.c
@@ -0,0 +1,13 @@
+/* Test __atomic routines for invalid memory model errors. This only needs
+ to be tested on a single size. */
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+
+int i;
+
+main ()
+{
+
+ __atomic_exchange_n (&i, 1); /* { dg-error "too few arguments" } */
+ __atomic_exchange_n (&i, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); /* { dg-error "too many arguments" } */
+}
diff --git a/gcc/testsuite/gcc.dg/atomic-store-1.c b/gcc/testsuite/gcc.dg/atomic-store-1.c
new file mode 100644
index 00000000000..f99eb9c844f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-store-1.c
@@ -0,0 +1,47 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_store_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-store-2.c b/gcc/testsuite/gcc.dg/atomic-store-2.c
new file mode 100644
index 00000000000..da346fd7de4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-store-2.c
@@ -0,0 +1,46 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_store_n builtin for a short. */
+
+extern void abort(void);
+
+short v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-store-3.c b/gcc/testsuite/gcc.dg/atomic-store-3.c
new file mode 100644
index 00000000000..b691da4592f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-store-3.c
@@ -0,0 +1,47 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_store_n builtin for an int. */
+
+extern void abort(void);
+
+int v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-store-4.c b/gcc/testsuite/gcc.dg/atomic-store-4.c
new file mode 100644
index 00000000000..f77e1831ad8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-store-4.c
@@ -0,0 +1,48 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+
+/* Test the execution of the __atomic_store_n builtin for a long long. */
+
+extern void abort(void);
+
+long long v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-store-5.c b/gcc/testsuite/gcc.dg/atomic-store-5.c
new file mode 100644
index 00000000000..f976a052c7c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-store-5.c
@@ -0,0 +1,48 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_store_n builtin for a 16 byte value. */
+
+extern void abort(void);
+
+__int128_t v, count;
+
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 047a1e85449..c5b841a8496 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -12,7 +12,7 @@
#define INTEGER_ARG 5
-#ifdef __ARM_PCS
+#if defined(__ARM_PCS) || defined(__epiphany__)
/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
E, F and G are passed on stack. So the size of the stack argument
data is 20. */
diff --git a/gcc/testsuite/gcc.dg/c1x-align-1.c b/gcc/testsuite/gcc.dg/c1x-align-1.c
new file mode 100644
index 00000000000..9fe5757bed0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c1x-align-1.c
@@ -0,0 +1,41 @@
+/* Test C1X alignment support. Test valid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c1x -pedantic-errors" } */
+
+#include <stddef.h>
+
+_Alignas (_Alignof (max_align_t)) char c;
+extern _Alignas (max_align_t) char c;
+extern char c;
+
+extern _Alignas (max_align_t) short s;
+_Alignas (max_align_t) short s;
+
+_Alignas (int) int i;
+extern int i;
+
+_Alignas (max_align_t) long l;
+
+_Alignas (max_align_t) long long ll;
+
+_Alignas (max_align_t) float f;
+
+_Alignas (max_align_t) double d;
+
+_Alignas (max_align_t) _Complex long double cld;
+
+_Alignas (0) _Alignas (int) _Alignas (char) char ca[10];
+
+_Alignas ((int) _Alignof (max_align_t) + 0) int x;
+
+enum e { E = _Alignof (max_align_t) };
+_Alignas (E) int y;
+
+void
+func (void)
+{
+ _Alignas (max_align_t) long long auto_ll;
+}
+
+/* Valid, but useless. */
+_Alignas (0) struct s; /* { dg-warning "useless" } */
diff --git a/gcc/testsuite/gcc.dg/c1x-align-2.c b/gcc/testsuite/gcc.dg/c1x-align-2.c
new file mode 100644
index 00000000000..19f7dd67214
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c1x-align-2.c
@@ -0,0 +1,92 @@
+/* Test C1X alignment support. Test valid code using stdalign.h. */
+/* { dg-do run } */
+/* { dg-options "-std=c1x -pedantic-errors" } */
+
+#include <stdalign.h>
+#include <stddef.h>
+
+extern int strcmp (const char *, const char *);
+
+extern void exit (int);
+extern void abort (void);
+
+alignas (alignof (max_align_t)) char c;
+extern alignas (max_align_t) char c;
+extern char c;
+
+extern alignas (max_align_t) short s;
+alignas (max_align_t) short s;
+
+alignas (int) int i;
+extern int i;
+
+alignas (max_align_t) long l;
+
+alignas (max_align_t) long long ll;
+
+alignas (max_align_t) float f;
+
+alignas (max_align_t) double d;
+
+alignas (max_align_t) _Complex long double cld;
+
+alignas (0) alignas (int) alignas (char) char ca[10];
+
+alignas ((int) alignof (max_align_t) + 0) int x;
+
+enum e { E = alignof (max_align_t) };
+alignas (E) int y;
+
+void
+func (void)
+{
+ alignas (max_align_t) long long auto_ll;
+}
+
+/* Valid, but useless. */
+alignas (0) struct s; /* { dg-warning "useless" } */
+
+#ifndef alignas
+#error "alignas not defined"
+#endif
+
+#ifndef alignof
+#error "alignof not defined"
+#endif
+
+#ifndef __alignas_is_defined
+#error "__alignas_is_defined not defined"
+#endif
+
+#if __alignas_is_defined != 1
+#error "__alignas_is_defined not 1"
+#endif
+
+#ifndef __alignof_is_defined
+#error "__alignof_is_defined not defined"
+#endif
+
+#if __alignof_is_defined != 1
+#error "__alignof_is_defined not 1"
+#endif
+
+#define str(x) #x
+#define xstr(x) str(x)
+
+const char *s1 = xstr(alignas);
+const char *s2 = xstr(alignof);
+const char *s3 = xstr(__alignas_is_defined);
+const char *s4 = xstr(__alignof_is_defined);
+
+int
+main (void)
+{
+ if (strcmp (s1, "_Alignas") != 0)
+ abort ();
+ if (strcmp (s2, "_Alignof") != 0)
+ abort ();
+ if (strcmp (s3, "1") != 0)
+ abort ();
+ if (strcmp (s4, "1") != 0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/c1x-align-3.c b/gcc/testsuite/gcc.dg/c1x-align-3.c
new file mode 100644
index 00000000000..0b2a77fa6fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c1x-align-3.c
@@ -0,0 +1,42 @@
+/* Test C1X alignment support. Test invalid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c1x -pedantic-errors" } */
+
+int a = _Alignof (void (void)); /* { dg-error "function" } */
+struct s;
+int b = _Alignof (struct s); /* { dg-error "incomplete" } */
+int c = _Alignof (void); /* { dg-error "void" } */
+int d = _Alignof (a); /* { dg-error "expression" } */
+
+_Alignas (void (void)) char e; /* { dg-error "function" } */
+_Alignas (struct s) char f; /* { dg-error "incomplete" } */
+_Alignas (void) char g; /* { dg-error "void" } */
+
+_Alignas (-__INT_MAX__-1) char h; /* { dg-error "too large|power of 2" } */
+_Alignas (-__INT_MAX__) char h2; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/2) char h3; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/4) char h4; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/8) char h5; /* { dg-error "too large|power of 2" } */
+_Alignas (-__LONG_LONG_MAX__-1) char i; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/2) char i2; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/4) char i3; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/8) char i4; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/16) char i5; /* { dg-error "too large|power of 2" } */
+_Alignas (-1) char j; /* { dg-error "power of 2" } */
+_Alignas (3) char k; /* { dg-error "power of 2" } */
+
+_Alignas ((void *) 1) char k; /* { dg-error "integer constant" } */
+int x;
+_Alignas (x) char l; /* { dg-error "integer constant" } */
+
+_Alignas (0) struct s; /* { dg-error "does not redeclare tag" } */
+
+_Alignas (0) typedef int T; /* { dg-error "alignment specified for typedef" } */
+void func (_Alignas (0) int); /* { dg-error "alignment specified for unnamed parameter" } */
+void f2 (_Alignas (0) int parm2) {} /* { dg-error "alignment specified for parameter" } */
+void
+f3 (void)
+{
+ register _Alignas (0) int reg; /* { dg-error "register" } */
+}
+_Alignas (0) void f4 (void); /* { dg-error "alignment specified for function" } */
diff --git a/gcc/testsuite/gcc.dg/c1x-align-4.c b/gcc/testsuite/gcc.dg/c1x-align-4.c
new file mode 100644
index 00000000000..432650cf5dd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c1x-align-4.c
@@ -0,0 +1,8 @@
+/* Test C1X alignment support. Test reducing alignment (assumes there
+ are at least some alignment constraints). */
+/* { dg-do compile } */
+/* { dg-options "-std=c1x -pedantic-errors" } */
+
+#include <stddef.h>
+
+_Alignas (_Alignof (char)) max_align_t x; /* { dg-error "reduce alignment" } */
diff --git a/gcc/testsuite/gcc.dg/c90-align-1.c b/gcc/testsuite/gcc.dg/c90-align-1.c
new file mode 100644
index 00000000000..77510f4e0d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c90-align-1.c
@@ -0,0 +1,6 @@
+/* Test _Alignof and _Alignas not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+int a = _Alignof (int); /* { dg-error "ISO C90 does not support '_Alignof'" } */
+_Alignas (int) int b; /* { dg-error "ISO C90 does not support '_Alignas'" } */
diff --git a/gcc/testsuite/gcc.dg/c99-align-1.c b/gcc/testsuite/gcc.dg/c99-align-1.c
new file mode 100644
index 00000000000..1fb2cb07110
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-align-1.c
@@ -0,0 +1,6 @@
+/* Test _Alignof and _Alignas not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int a = _Alignof (int); /* { dg-error "ISO C99 does not support '_Alignof'" } */
+_Alignas (int) int b; /* { dg-error "ISO C99 does not support '_Alignas'" } */
diff --git a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c
index 4fd6671a4db..0cc14da599a 100644
--- a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c
+++ b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c
@@ -23,7 +23,7 @@ f (void)
E5 = __imag__ 0,
/* __alignof__ always constant. */
E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */
- E7 = __alignof__ (a),
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
/* __extension__ ignored for constant expression purposes. */
E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
E9 = __extension__ 0,
diff --git a/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c
index 3f7f1af5de0..e052114622c 100644
--- a/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c
+++ b/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c
@@ -23,7 +23,7 @@ f (void)
E5 = __imag__ 0,
/* __alignof__ always constant. */
E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */
- E7 = __alignof__ (a),
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
/* __extension__ ignored for constant expression purposes. */
E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
E9 = __extension__ 0,
diff --git a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c
index 3f5f25e6d2e..da7076ff899 100644
--- a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c
+++ b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c
@@ -23,7 +23,7 @@ f (void)
E5 = __imag__ 0,
/* __alignof__ always constant. */
E6 = __alignof__ (int[n]),
- E7 = __alignof__ (a),
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
/* __extension__ ignored for constant expression purposes. */
E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
E9 = __extension__ 0,
diff --git a/gcc/testsuite/gcc.dg/gnu99-static-1.c b/gcc/testsuite/gcc.dg/gnu99-static-1.c
index b600a4b1201..3fece615e0e 100644
--- a/gcc/testsuite/gcc.dg/gnu99-static-1.c
+++ b/gcc/testsuite/gcc.dg/gnu99-static-1.c
@@ -11,7 +11,7 @@
/* __alignof__, OK. */
static int f0(void);
-void g0(void) { __alignof__(f0()); }
+void g0(void) { __alignof__(f0()); } /* { dg-error "__alignof__ \\(expression\\)" } */
/* __typeof__ not variably modified, OK. */
static int f1(void);
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-11.c b/gcc/testsuite/gcc.dg/gomp/atomic-11.c
deleted file mode 100644
index b5647b0bd81..00000000000
--- a/gcc/testsuite/gcc.dg/gomp/atomic-11.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* PR middle-end/36877 */
-/* { dg-do compile } */
-/* { dg-options "-fopenmp" } */
-/* { dg-options "-fopenmp -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-
-int i;
-float f;
-
-void foo (void)
-{
-#pragma omp atomic
- i++;
-#pragma omp atomic
- f += 1.0;
-}
-
-/* { dg-final { scan-assembler-not "__sync_(fetch|add|bool|val)" { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* s390*-*-* sparc*-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/gomp.exp b/gcc/testsuite/gcc.dg/gomp/gomp.exp
index e4f31cca924..4cb4cafa400 100644
--- a/gcc/testsuite/gcc.dg/gomp/gomp.exp
+++ b/gcc/testsuite/gcc.dg/gomp/gomp.exp
@@ -29,8 +29,7 @@ if ![check_effective_target_fopenmp] {
dg-init
# Main loop.
-dg-runtest [lsort [find $srcdir/$subdir *.c]] \
- "" "-fopenmp"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/gomp/*.c]] "" "-fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/pr50763-5.c b/gcc/testsuite/gcc.dg/pr50763-5.c
new file mode 100644
index 00000000000..e5952d09c86
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50763-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+struct inode
+{
+ unsigned short i_mode;
+ unsigned int i_flags;
+};
+
+static inline int
+is_sxid (unsigned int mode)
+{
+ return (mode & 0004000) || ((mode & 0002000) && (mode & 00010));
+};
+
+void
+gfs2_set_inode_flags (int ip, struct inode *inode)
+{
+ unsigned int flags = inode->i_flags;
+ if ((ip == 0) && !is_sxid (inode->i_mode))
+ inode->i_flags |= 4096;
+ inode->i_flags = flags;
+}
diff --git a/gcc/testsuite/gcc.dg/pr50908-2.c b/gcc/testsuite/gcc.dg/pr50908-2.c
new file mode 100644
index 00000000000..bffea335a70
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50908-2.c
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+typedef struct rtx_def *rtx;
+enum debug_info_levels
+{
+ ARM_FLOAT_ABI_SOFT, ARM_FLOAT_ABI_SOFTFP, ARM_FLOAT_ABI_HARD
+};
+struct gcc_options
+{
+ int x_target_flags;
+};
+extern struct gcc_options global_options;
+extern int arm_arch_thumb2;
+enum rtx_code
+{
+ UNSPEC, UNSPEC_VOLATILE, ADDR_VEC, SET, CLOBBER, CALL, RETURN,
+ SIMPLE_RETURN, EH_RETURN, TRAP_IF, CONST_INT, CONST_FIXED, CONST_DOUBLE,
+ CONST_VECTOR, CONST_STRING, CONST, PC, REG, SCRATCH, SUBREG,
+ STRICT_LOW_PART, CONCAT, CONCATN, MEM, LABEL_REF, SYMBOL_REF, CC0,
+ IF_THEN_ELSE, COMPARE, PLUS, MINUS, NEG, MULT, SS_MULT, US_MULT, DIV,
+ SS_DIV, US_DIV, MOD, UDIV, UMOD, AND, IOR, XOR, NOT, ASHIFT, ROTATE,
+ ASHIFTRT, LSHIFTRT, ROTATERT, PRE_DEC, PRE_INC, POST_DEC, POST_INC,
+ PRE_MODIFY, POST_MODIFY, NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU,
+ UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE, UNLT, LTGT, SIGN_EXTEND,
+ ZERO_EXTEND, TRUNCATE, FLOAT_EXTEND, FLOAT_TRUNCATE, FLOAT, FIX,
+ UNSIGNED_FLOAT, UNSIGNED_FIX, SIGN_EXTRACT, ZERO_EXTRACT, HIGH, LO_SUM,
+ VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_DUPLICATE, SS_PLUS, US_PLUS,
+ SS_MINUS, SS_NEG, US_NEG, SS_ABS, SS_ASHIFT, US_ASHIFT, US_MINUS,
+ SS_TRUNCATE, US_TRUNCATE, FMA, VAR_LOCATION, DEBUG_IMPLICIT_PTR,
+ ENTRY_VALUE, DEBUG_PARAMETER_REF, LAST_AND_UNUSED_RTX_CODE
+};
+union rtunion_def
+{
+};
+struct rtx_def
+{
+ enum rtx_code code:16;
+}
+builtin_info_type;
+enum constraint_num
+{
+ CONSTRAINT__UNKNOWN =
+ 0, CONSTRAINT_f, CONSTRAINT_t, CONSTRAINT_v, CONSTRAINT_w, CONSTRAINT_x,
+ CONSTRAINT_y, CONSTRAINT_z, CONSTRAINT_l, CONSTRAINT_h, CONSTRAINT_j,
+ CONSTRAINT_Pj, CONSTRAINT_PJ, CONSTRAINT_k, CONSTRAINT_b, CONSTRAINT_c,
+ CONSTRAINT_I, CONSTRAINT_J, CONSTRAINT_K, CONSTRAINT_L, CONSTRAINT_M,
+ CONSTRAINT_N, CONSTRAINT_O, CONSTRAINT_Pa, CONSTRAINT_Pb, CONSTRAINT_Pc,
+ CONSTRAINT_Pd, CONSTRAINT_Ps, CONSTRAINT_Pt, CONSTRAINT_Pu, CONSTRAINT_Pv,
+ CONSTRAINT_Pw, CONSTRAINT_Px, CONSTRAINT_Py, CONSTRAINT_G, CONSTRAINT_H,
+ CONSTRAINT_Dz, CONSTRAINT_Da, CONSTRAINT_Db, CONSTRAINT_Dc, CONSTRAINT_Di,
+ CONSTRAINT_Dn, CONSTRAINT_Dl, CONSTRAINT_DL, CONSTRAINT_Dv, CONSTRAINT_Dy,
+ CONSTRAINT_Ut, CONSTRAINT_Uv, CONSTRAINT_Uy, CONSTRAINT_Un, CONSTRAINT_Um,
+ CONSTRAINT_Us, CONSTRAINT_Uq, CONSTRAINT_Q, CONSTRAINT_Uu, CONSTRAINT_Uw,
+ CONSTRAINT__LIMIT
+};
+typedef struct VEC_char_base
+{
+}
+VEC_int_heap;
+static inline int
+satisfies_constraint_j (rtx op)
+{
+ long long ival = 0;
+ return ((((!((global_options.x_target_flags & (1 << 14)) != 0))
+ || arm_arch_thumb2) && arm_arch_thumb2))
+ && ((((enum rtx_code) (op)->code) == HIGH)
+ || ((((enum rtx_code) (op)->code) == CONST_INT)
+ && (((ival & 0xffff0000) == 0))));
+}
+
+int
+constraint_satisfied_p (rtx op, enum constraint_num c)
+{
+ switch (c)
+ {
+ case CONSTRAINT_j:
+ return satisfies_constraint_j (op);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr50908-3.c b/gcc/testsuite/gcc.dg/pr50908-3.c
new file mode 100644
index 00000000000..60db03dae85
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50908-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+extern int v1;
+extern int v2;
+
+void
+f ()
+{
+ if (v2 || v1)
+ (!(v1)) ? (void) 0 : (void) g ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr50908.c b/gcc/testsuite/gcc.dg/pr50908.c
new file mode 100644
index 00000000000..75341f8f105
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50908.c
@@ -0,0 +1,175 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+enum Lisp_Type
+{
+ Lisp_Int0 = 0, Lisp_Int1 = 4, Lisp_Symbol = 2, Lisp_Misc = 3, Lisp_String =
+ 1, Lisp_Vectorlike = 5, Lisp_Cons = 6, Lisp_Float = 7,
+};
+typedef long Lisp_Object;
+enum pvec_type
+{
+ PVEC_NORMAL_VECTOR = 0, PVEC_PROCESS = 0x200, PVEC_FRAME =
+ 0x400, PVEC_COMPILED = 0x800, PVEC_WINDOW =
+ 0x1000, PVEC_WINDOW_CONFIGURATION = 0x2000, PVEC_SUBR =
+ 0x4000, PVEC_CHAR_TABLE = 0x8000, PVEC_BOOL_VECTOR =
+ 0x10000, PVEC_BUFFER = 0x20000, PVEC_HASH_TABLE = 0x40000, PVEC_TERMINAL =
+ 0x80000, PVEC_SUB_CHAR_TABLE = 0x100000, PVEC_FONT =
+ 0x200000, PVEC_OTHER = 0x400000, PVEC_TYPE_MASK = 0x7ffe00
+};
+struct Lisp_Vector
+{
+ unsigned long size;
+};
+struct Lisp_Char_Table
+{
+ Lisp_Object defalt;
+ Lisp_Object ascii;
+};
+struct Lisp_Sub_Char_Table
+{
+ Lisp_Object contents[1];
+};
+extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
+struct buffer_text
+{
+ unsigned char *beg;
+ long gpt_byte;
+ long gap_size;
+};
+struct buffer
+{
+ struct buffer_text *text;
+ struct region_cache *width_run_cache;
+ Lisp_Object tab_width;
+ Lisp_Object ctl_arrow;
+};
+extern struct buffer *current_buffer;
+extern Lisp_Object Vchar_width_table;
+struct frame
+{
+ long text_lines, text_cols;
+};
+struct window
+{
+ Lisp_Object frame;
+};
+extern Lisp_Object Vtruncate_partial_width_windows;
+extern struct Lisp_Char_Table *window_display_table (struct window *);
+struct position *
+compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos,
+ width, hscroll, tab_offset, win)
+ long from, fromvpos, fromhpos, to, tovpos, tohpos;
+ struct window *win;
+{
+ register long hpos = fromhpos;
+ register long pos;
+ long pos_byte;
+ register int c = 0;
+ register struct Lisp_Char_Table *dp = window_display_table (win);
+ long wide_column_end_hpos = 0;
+ long continuation_glyph_width;
+ while (1)
+ {
+ if (hpos > width)
+ {
+ int total_width = width + continuation_glyph_width;
+ if (!((Vtruncate_partial_width_windows) == (Qnil))
+ && (total_width <
+ (((void) 0,
+ (struct frame
+ *) ((long) (((win)->frame) & ~((((long) 1) << 3) -
+ 1)))))->text_cols))
+ {
+ if (pos <= to)
+ {
+ pos = find_before_next_newline (pos, to, 1);
+ }
+ if (wide_column_end_hpos > width)
+ {
+ hpos -= width;
+ }
+ }
+ }
+ else
+ {
+ Lisp_Object charvec;
+ c =
+ *(((((pos_byte)) >=
+ (current_buffer->text->gpt_byte) ? (current_buffer->text->
+ gap_size) : 0) +
+ ((pos_byte)) + (current_buffer->text->beg) - ((1))));
+ if (current_buffer->width_run_cache)
+ {
+ if (((((enum Lisp_Type) (((unsigned long) ((charvec))) &
+ ((((long) 1) << 3) - 1))) ==
+ Lisp_Vectorlike)
+ &&
+ !(((void) 0,
+ (struct Lisp_Vector
+ *) ((long) ((charvec) & ~((((long) 1) << 3) - 1))))->
+ size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
+ {
+ unsigned char *ptr;
+ int bytes, width, wide_column;
+ do
+ {
+ if ((!((*ptr) & 0x80) ? 1 : !((*ptr) & 0x20) ? 2 :
+ !((*ptr) & 0x10) ? 3 : !((*ptr) & 0x08) ? 4 : 5) !=
+ bytes)
+ width = bytes * 4;
+ else
+ {
+ if (dp != 0
+ &&
+ ((((enum
+ Lisp_Type) (((unsigned
+ long) (((((unsigned) (c) <
+ 0x80)
+ ? ((((dp)->ascii) ==
+ (Qnil)) ? (dp)->
+ defalt
+ : (((((enum
+ Lisp_Type)
+ (((unsigned
+ long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && !(((void) 0, (struct Lisp_Vector *) ((long) (((((unsigned) (c) < 0x80) ? ((((dp)->ascii) == (Qnil)) ? (dp)->defalt : (((((enum Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
+ width =
+ ((void) 0,
+ (struct Lisp_Vector
+ *) ((long) (((((unsigned) (c) <
+ 0x80) ? ((((dp)->ascii) ==
+ (Qnil)) ? (dp)->
+ defalt
+ : (((((enum
+ Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size;
+ else
+ width =
+ (((unsigned) (c) < 0x80) ? (c <
+ 0x20 ? (c ==
+ '\t'
+ ? ((((long)
+ (current_buffer->
+ tab_width))
+ >> (3 -
+ 1)))
+ : (c ==
+ '\n' ? 0
+ : (((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2))) : (c < 0x7f ? 1 : ((((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2)))) : (((long) ((((unsigned) (c) < 0x80) ? (
+ {
+ Lisp_Object
+ _val;
+ _val;}
+ ): char_table_ref ((Vchar_width_table), (c))))) >> (3 - 1)));
+ if (width > 1)
+ wide_column = width;
+ }
+ }
+ while (0);
+ if (wide_column)
+ wide_column_end_hpos = hpos + wide_column;
+ }
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pragma-align-2.c b/gcc/testsuite/gcc.dg/pragma-align-2.c
index ac5858cab00..5cdaff9586f 100644
--- a/gcc/testsuite/gcc.dg/pragma-align-2.c
+++ b/gcc/testsuite/gcc.dg/pragma-align-2.c
@@ -1,4 +1,5 @@
/* { dg-do run { target *-*-solaris2.* } } */
+/* { dg-options "-std=gnu99" } */
void abort (void);
diff --git a/gcc/testsuite/gcc.dg/pragma-pack-3.c b/gcc/testsuite/gcc.dg/pragma-pack-3.c
index e276bd007fe..d3843149134 100644
--- a/gcc/testsuite/gcc.dg/pragma-pack-3.c
+++ b/gcc/testsuite/gcc.dg/pragma-pack-3.c
@@ -1,6 +1,7 @@
/* PR c++/25294 */
/* { dg-options "-std=gnu99" } */
-/* { dg-do run } */
+/* Epiphany makes struct S 8-byte aligned. */
+/* { dg-do run { target { ! epiphany-*-* } } } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/profile-dir-1.c b/gcc/testsuite/gcc.dg/profile-dir-1.c
index 97763721abc..fbe66ad22a8 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-1.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate=. -fdump-ipa-profile" } */
-/* { dg-final { scan-ipa-dump " ./profile-dir-1.gcda" "profile" } } */
+/* { dg-options "-O -fprofile-generate=. -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-1.gcda" "cgraph" } } */
int
main(void)
@@ -8,4 +8,4 @@ main(void)
return 0;
}
-/* { dg-final { cleanup-ipa-dump "profile" } } */
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc/testsuite/gcc.dg/profile-dir-2.c b/gcc/testsuite/gcc.dg/profile-dir-2.c
index d49dcc37605..1708f7b7275 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-2.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate -fdump-ipa-profile" } */
-/* { dg-final { scan-ipa-dump "/profile-dir-2.gcda" "profile" } } */
+/* { dg-options "-O -fprofile-generate -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump "/profile-dir-2.gcda" "cgraph" } } */
int
main(void)
@@ -8,4 +8,4 @@ main(void)
return 0;
}
-/* { dg-final { cleanup-ipa-dump "profile" } } */
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc/testsuite/gcc.dg/profile-dir-3.c b/gcc/testsuite/gcc.dg/profile-dir-3.c
index 0ae329d4698..ccedf0e7447 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-3.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-ipa-profile" } */
-/* { dg-final { scan-ipa-dump " ./profile-dir-3.gcda" "profile" } } */
+/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-3.gcda" "cgraph" } } */
int
main(void)
@@ -8,4 +8,4 @@ main(void)
return 0;
}
-/* { dg-final { cleanup-ipa-dump "profile" } } */
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c
new file mode 100644
index 00000000000..d03e8318108
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned int ret;
+unsigned int value = 0;
+unsigned int result = 0;
+unsigned int table[16] = {
+0x00000000,
+0x11111111,
+0x22222222,
+0x33333333,
+0x44444444,
+0x55555555,
+0x66666666,
+0x77777777,
+0x88888888,
+0x99999999,
+0xAAAAAAAA,
+0xBBBBBBBB,
+0xCCCCCCCC,
+0xDDDDDDDD,
+0xEEEEEEEE,
+0xFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c
new file mode 100644
index 00000000000..3ade0d6fad3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c
@@ -0,0 +1,132 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+__int128_t ret;
+__int128_t value = 0;
+__int128_t result = 0;
+__int128_t table[16] = {
+0x0000000000000000,
+0x1111111111111111,
+0x2222222222222222,
+0x3333333333333333,
+0x4444444444444444,
+0x5555555555555555,
+0x6666666666666666,
+0x7777777777777777,
+0x8888888888888888,
+0x9999999999999999,
+0xAAAAAAAAAAAAAAAA,
+0xBBBBBBBBBBBBBBBB,
+0xCCCCCCCCCCCCCCCC,
+0xDDDDDDDDDDDDDDDD,
+0xEEEEEEEEEEEEEEEE,
+0xFFFFFFFFFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Since we don't have 128 bit constants, we have to properly pad the table. */
+void fill_table()
+{
+ int x;
+ for (x = 0; x < 16; x++)
+ {
+ ret = table[x];
+ ret = (ret << 64) | ret;
+ table[x] = ret;
+ }
+}
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Make sure value starts with an atomic value now. */
+ __atomic_store_n (&value, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ fill_table ();
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c
new file mode 100644
index 00000000000..8bc2eaace65
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c
@@ -0,0 +1,117 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned long long ret;
+unsigned long long value = 0;
+unsigned long long result = 0;
+unsigned long long table[16] = {
+0x0000000000000000,
+0x1111111111111111,
+0x2222222222222222,
+0x3333333333333333,
+0x4444444444444444,
+0x5555555555555555,
+0x6666666666666666,
+0x7777777777777777,
+0x8888888888888888,
+0x9999999999999999,
+0xAAAAAAAAAAAAAAAA,
+0xBBBBBBBBBBBBBBBB,
+0xCCCCCCCCCCCCCCCC,
+0xDDDDDDDDDDDDDDDD,
+0xEEEEEEEEEEEEEEEE,
+0xFFFFFFFFFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c
new file mode 100644
index 00000000000..e7b54c46bef
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned short ret;
+unsigned short value = 0;
+unsigned short result = 0;
+unsigned short table[16] = {
+0x0000,
+0x1111,
+0x2222,
+0x3333,
+0x4444,
+0x5555,
+0x6666,
+0x7777,
+0x8888,
+0x9999,
+0xAAAA,
+0xBBBB,
+0xCCCC,
+0xDDDD,
+0xEEEE,
+0xFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c
new file mode 100644
index 00000000000..990310c0f0e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c
@@ -0,0 +1,118 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 4 byte values. */
+
+unsigned int zero = 0;
+unsigned int max = ~0;
+
+unsigned int changing_value = 0;
+unsigned int value = 0;
+unsigned int ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and
+ 'max'. Any other value detected by simulate_thread_step_verify()
+ between instructions would indicate that the value was only
+ partially written, and would thus fail this atomicity test.
+
+ This function tests each different __atomic routine once, with
+ the exception of the load instruction which requires special
+ testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c
new file mode 100644
index 00000000000..67f84a14a00
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_128 } */
+/* { dg-options "-mcx16" { target { x86_64-*-* i?86-*-*] } } } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 16 byte values. */
+
+__int128_t zero = 0;
+__int128_t max = ~0;
+__int128_t changing_value = 0;
+__int128_t value = 0;
+__int128_t ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and 'max'. Any other
+ value detected by simulate_thread_step_verify() between instructions would indicate
+ that the value was only partially written, and would thus fail this
+ atomicity test.
+
+ This function tests each different __atomic routine once, with the
+ exception of the load instruction which requires special testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c
new file mode 100644
index 00000000000..ac4330bd8a4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c
@@ -0,0 +1,117 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_long_long } */
+/* { dg-options "" } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 8 byte values. */
+
+unsigned long long zero = 0;
+unsigned long long max = ~0;
+
+unsigned long long changing_value = 0;
+unsigned long long value = 0;
+unsigned long long ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and 'max'. Any other
+ value detected by simulate_thread_step_verify() between instructions would indicate
+ that the value was only partially written, and would thus fail this
+ atomicity test.
+
+ This function tests each different __atomic routine once, with the
+ exception of the load instruction which requires special testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c
new file mode 100644
index 00000000000..d823e02fb47
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c
@@ -0,0 +1,117 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 2 byte values. */
+
+unsigned short zero = 0;
+unsigned short max = ~0;
+
+unsigned short changing_value = 0;
+unsigned short value = 0;
+unsigned short ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and
+ 'max'. Any other value detected by simulate_thread_step_verify()
+ between instructions would indicate that the value was only
+ partially written, and would thus fail this atomicity test.
+
+ This function tests each different __atomic routine once, with
+ the exception of the load instruction which requires special
+ testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c b/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c
new file mode 100644
index 00000000000..71d1cca9dda
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c
@@ -0,0 +1,57 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This file tests that speculative store movement out of a loop doesn't
+ happen. This is disallowed when --param allow-store-data-races is 0. */
+
+int global = 100;
+
+/* Other thread makes sure global is 100 before the next instruction is
+ * exceuted. */
+void simulate_thread_other_threads()
+{
+ global = 100;
+}
+
+int simulate_thread_step_verify()
+{
+ if (global != 100)
+ {
+ printf("FAIL: global variable was assigned to. \n");
+ return 1;
+ }
+}
+
+int simulate_thread_final_verify()
+{
+ return 0;
+}
+
+/* The variable global should never be assigned if func(0) is called.
+ This tests store movement out of loop thats never executed. */
+void test (int y)
+{
+ int x;
+ for (x=0; x< y; x++)
+ {
+ global = y; /* This should never speculatively execute. */
+ }
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ test(0);
+ simulate_thread_done();
+}
+
+__attribute__((noinline))
+int main()
+{
+ simulate_thread_main();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c b/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
new file mode 100644
index 00000000000..fdcd7f46af7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This test verifies writes to globals do not write to adjacent
+ globals. This mostly happens on strict-align targets that are not
+ byte addressable (old Alphas, etc). */
+
+char a = 0;
+char b = 77;
+
+void simulate_thread_other_threads()
+{
+}
+
+int simulate_thread_step_verify()
+{
+ if (b != 77)
+ {
+ printf("FAIL: Unexpected value. <b> is %d, should be 77\n", b);
+ return 1;
+ }
+ return 0;
+}
+
+/* Verify that every variable has the correct value. */
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify ();
+ if (a != 66)
+ {
+ printf("FAIL: Unexpected value. <a> is %d, should be 66\n", a);
+ return 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ a = 66;
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/simulate-thread/subfields.c b/gcc/testsuite/gcc.dg/simulate-thread/subfields.c
new file mode 100644
index 00000000000..2d931176e7d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/simulate-thread/subfields.c
@@ -0,0 +1,93 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This test verifies that data races aren't introduced by structure subfield
+ stores. */
+
+struct test_struct {
+ char a;
+ char b;
+ char c;
+ char d;
+} var = {0,0,0,0};
+
+
+/* This routine sets field a to 'x'. If executed properly, it will
+ not affect any of the other fields in the structure. An improper
+ implementation may load an entire word, change the 8 bits for field
+ 'a' and write the entire word back out. */
+__attribute__((noinline))
+void set_a(char x)
+{
+ var.a = x;
+}
+
+static int global = 0;
+
+/* The other thread increments the value of each of the other fields
+ in the structure every cycle. If the store to the 'a' field does
+ an incorrect full or partial word load, mask and store, it will
+ write back an incorrect value to one or more of the other
+ fields. */
+void simulate_thread_other_threads()
+{
+ global++;
+ var.b = global;
+ var.c = global;
+ var.d = global;
+}
+
+
+/* Make sure that none of the other fields have been changed. */
+int simulate_thread_step_verify()
+{
+ int ret = 0;
+ if (var.b != global)
+ {
+ printf("FAIL: Unexpected value. var.b is %d, should be %d\n",
+ var.b, global);
+ ret = 1;
+ }
+ if (var.c != global)
+ {
+ printf("FAIL: Unexpected value. var.c is %d, should be %d\n",
+ var.c, global);
+ ret = 1;
+ }
+ if (var.d != global)
+ {
+ printf("FAIL: Unexpected value. var.d is %d, should be %d\n",
+ var.d, global);
+ ret = 1;
+ }
+ return ret;
+}
+
+/* Verify that every variable has the correct value. */
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify();
+ if (var.a != 1)
+ {
+ printf("FAIL: Unexpected value. var.a is %d, should be %d\n", var.a, 1);
+ ret = 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ set_a(1);
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index f55168e9e44..77dd03852fb 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -52,6 +52,8 @@
# define SIZE 160 /* 256 - 96 bytes for register save area */
#elif defined (__SPU__)
# define SIZE 224
+#elif defined (__epiphany__)
+# define SIZE (256 - __EPIPHANY_STACK_OFFSET__)
#else
# define SIZE 256
#endif
diff --git a/gcc/testsuite/gcc.dg/strlenopt-22.c b/gcc/testsuite/gcc.dg/strlenopt-22.c
index 541bfdce467..d6fd4dfbd88 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-22.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-22.c
@@ -1,7 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
-#define USE_GNU
#include "strlenopt.h"
__attribute__((noinline, noclone)) size_t
@@ -32,10 +31,10 @@ main ()
return 0;
}
-/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
-/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
-/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } *
/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c
new file mode 100644
index 00000000000..45c6345fc8b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c
@@ -0,0 +1,14 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt-22.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/tls/thr-cse-1.c b/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
index 7542350d8da..87fdc64688d 100644
--- a/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
+++ b/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
@@ -1,5 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O1" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
/* { dg-require-effective-target tls_emulated } */
/* Test that we only get one call to emutls_get_address when CSE is
diff --git a/gcc/testsuite/gcc.dg/torture/pr50890.c b/gcc/testsuite/gcc.dg/torture/pr50890.c
new file mode 100644
index 00000000000..17240d4fb82
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr50890.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+static float make_insn_raw (void)
+{
+ return 0;
+}
+
+static int emit_pattern_after_noloc (int (make_raw) ())
+{
+ return make_raw ();
+}
+
+void emit_insn_after_noloc (void)
+{
+ emit_pattern_after_noloc ((void *) make_insn_raw);
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr50902.c b/gcc/testsuite/gcc.dg/torture/pr50902.c
new file mode 100644
index 00000000000..5b7275b839d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr50902.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+_Bool data[128];
+void foo (_Bool *init)
+{
+ int i;
+ for (i = 0; i < 128; i++)
+ data[i] = *init;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
index a1ba20fce53..89c71a99d5b 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -9,6 +9,15 @@
#define INTEGER_ARG 5
+#if defined(__ARM_PCS) || defined(__epiphany__)
+/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
+ E, F and G are passed on stack. So the size of the stack argument
+ data is 20. */
+#define STACK_ARGUMENTS_SIZE 20
+#else
+#define STACK_ARGUMENTS_SIZE 64
+#endif
+
extern void abort(void);
void foo(char *name, double d, double e, double f, int g)
@@ -19,7 +28,7 @@ void foo(char *name, double d, double e, double f, int g)
void bar(char *name, ...)
{
- __builtin_apply(foo, __builtin_apply_args(), 64);
+ __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
}
int main(void)
diff --git a/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c b/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c
new file mode 100644
index 00000000000..601f098889c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c
@@ -0,0 +1,211 @@
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+#define N 1024
+signed char sc[N];
+short ss[N];
+int si[N];
+long long sl[N];
+unsigned char uc[N];
+unsigned short us[N];
+unsigned int ui[N];
+unsigned long long ul[N];
+float f[N];
+double d[N];
+
+#define FN1(from, to) \
+__attribute__((noinline, noclone)) void \
+from##2##to (void) \
+{ \
+ int i; \
+ for (i = 0; i < N; i++) \
+ to[i] = from[i]; \
+}
+#define FN(intt, fltt) FN1 (intt, fltt) FN1 (fltt, intt)
+
+FN (sc, f)
+FN (ss, f)
+FN (si, f)
+FN (sl, f)
+FN (uc, f)
+FN (us, f)
+FN (ui, f)
+FN (ul, f)
+FN (sc, d)
+FN (ss, d)
+FN (si, d)
+FN (sl, d)
+FN (uc, d)
+FN (us, d)
+FN (ui, d)
+FN (ul, d)
+
+#define FLTTEST(min, max, intt) \
+__attribute__((noinline, noclone)) void \
+flttointtest##intt (void) \
+{ \
+ int i; \
+ volatile float fltmin, fltmax, vf, vf2; \
+ volatile double dblmin, dblmax, vd, vd2; \
+ if (min == 0) \
+ fltmin = 0.0f; \
+ else \
+ { \
+ vf2 = fltmin = min - 1.0f; \
+ for (vf = 1.0f; (fltmin = vf2 + vf) == vf2; vf = vf * 2.0f) \
+ ; \
+ } \
+ vf2 = fltmax = max + 1.0f; \
+ for (vf = 1.0f; (fltmax = vf2 - vf) == vf2; vf = vf * 2.0f) \
+ ; \
+ if (min == 0) \
+ dblmin = 0.0; \
+ else \
+ { \
+ vd2 = dblmin = min - 1.0; \
+ for (vd = 1.0; (dblmin = vd2 + vd) == vd2; vd = vd * 2.0) \
+ ; \
+ } \
+ vd2 = dblmax = max + 1.0; \
+ for (vd = 1.0; (dblmax = vd2 - vd) == vd2; vd = vd * 2.0) \
+ ; \
+ for (i = 0; i < N; i++) \
+ { \
+ asm (""); \
+ if (i == 0) \
+ f[i] = fltmin; \
+ else if (i < N / 4) \
+ f[i] = fltmin + i + 0.25f; \
+ else if (i < 3 * N / 4) \
+ f[i] = (fltmax + fltmin) / 2.0 - N * 8 + 16.0f * i; \
+ else \
+ f[i] = fltmax - N + 1 + i; \
+ if (f[i] < fltmin) f[i] = fltmin; \
+ if (f[i] > fltmax) f[i] = fltmax; \
+ if (i == 0) \
+ d[i] = dblmin; \
+ else if (i < N / 4) \
+ d[i] = dblmin + i + 0.25f; \
+ else if (i < 3 * N / 4) \
+ d[i] = (dblmax + dblmin) / 2.0 - N * 8 + 16.0f * i; \
+ else \
+ d[i] = dblmax - N + 1 + i; \
+ if (d[i] < dblmin) d[i] = dblmin; \
+ if (d[i] > dblmax) d[i] = dblmax; \
+ } \
+ f2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) f[i]) \
+ abort (); \
+ d2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) d[i]) \
+ abort (); \
+ for (i = 0; i < N; i++) \
+ { \
+ unsigned long long r = random (); \
+ r = (r << 21) ^ (unsigned) random (); \
+ r = (r << 21) ^ (unsigned) random (); \
+ asm (""); \
+ f[i] = (r >> 59) / 32.0f + (__typeof (intt[0])) r; \
+ if (f[i] < fltmin) f[i] = fltmin; \
+ if (f[i] > fltmax) f[i] = fltmax; \
+ d[i] = (r >> 59) / 32.0 + (__typeof (intt[0])) r; \
+ if (d[i] < dblmin) f[i] = dblmin; \
+ if (d[i] > dblmax) f[i] = dblmax; \
+ } \
+ f2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) f[i]) \
+ abort (); \
+ d2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) d[i]) \
+ abort (); \
+} \
+ \
+__attribute__((noinline, noclone)) void \
+inttoflttest##intt (void) \
+{ \
+ int i; \
+ volatile float vf; \
+ volatile double vd; \
+ for (i = 0; i < N; i++) \
+ { \
+ asm (""); \
+ if (i < N / 4) \
+ intt[i] = min + i; \
+ else if (i < 3 * N / 4) \
+ intt[i] = (max + min) / 2 - N * 8 + 16 * i; \
+ else \
+ intt[i] = max - N + 1 + i; \
+ } \
+ intt##2f (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vf = intt[i]; \
+ if (f[i] != vf) \
+ abort (); \
+ } \
+ intt##2d (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vd = intt[i]; \
+ if (d[i] != vd) \
+ abort (); \
+ } \
+ for (i = 0; i < N; i++) \
+ { \
+ unsigned long long r = random (); \
+ r = (r << 21) ^ (unsigned) random (); \
+ r = (r << 21) ^ (unsigned) random (); \
+ asm (""); \
+ intt[i] = r; \
+ } \
+ intt##2f (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vf = intt[i]; \
+ if (f[i] != vf) \
+ abort (); \
+ } \
+ intt##2d (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vd = intt[i]; \
+ if (d[i] != vd) \
+ abort (); \
+ } \
+}
+
+FLTTEST (- __SCHAR_MAX__ - 1, __SCHAR_MAX__, sc)
+FLTTEST (- __SHRT_MAX__ - 1, __SHRT_MAX__, ss)
+FLTTEST (- __INT_MAX__ - 1, __INT_MAX__, si)
+FLTTEST (- __LONG_LONG_MAX__ - 1LL, __LONG_LONG_MAX__, sl)
+FLTTEST (0, 2U * __SCHAR_MAX__ + 1, uc)
+FLTTEST (0, 2U * __SHRT_MAX__ + 1, us)
+FLTTEST (0, 2U * __INT_MAX__ + 1, ui)
+FLTTEST (0, 2ULL * __LONG_LONG_MAX__ + 1, ul)
+
+int
+main ()
+{
+ flttointtestsc ();
+ flttointtestss ();
+ flttointtestsi ();
+ flttointtestsl ();
+ flttointtestuc ();
+ flttointtestus ();
+ flttointtestui ();
+ flttointtestul ();
+ inttoflttestsc ();
+ inttoflttestss ();
+ inttoflttestsi ();
+ inttoflttestsl ();
+ inttoflttestuc ();
+ inttoflttestus ();
+ inttoflttestui ();
+ inttoflttestul ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
new file mode 100644
index 00000000000..ae833e53dc0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__((noinline, noclone)) void
+foo (int *a, int stride)
+{
+ int i;
+
+ for (i = 0; i < N/stride; i++, a += stride)
+ {
+ a[0] = a[0] ? 1 : 5;
+ a[1] = a[1] ? 2 : 6;
+ a[2] = a[2] ? 3 : 7;
+ a[3] = a[3] ? 4 : 8;
+ }
+}
+
+
+int a[N];
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+ foo (a, 4);
+
+ for (i = 1; i < N; i++)
+ if (a[i] != i%4 + 1)
+ abort ();
+
+ if (a[0] != 5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-cond-1.c b/gcc/testsuite/gcc.dg/vect/slp-cond-1.c
new file mode 100644
index 00000000000..4b8e3d3b6a3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-cond-1.c
@@ -0,0 +1,126 @@
+/* { dg-require-effective-target vect_condition } */
+#include "tree-vect.h"
+
+#define N 32
+int a[N], b[N];
+int d[N], e[N];
+int k[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N/4; i++)
+ {
+ k[4*i] = a[4*i] < b[4*i] ? 17 : 0;
+ k[4*i+1] = a[4*i+1] < b[4*i+1] ? 17 : 0;
+ k[4*i+2] = a[4*i+2] < b[4*i+2] ? 17 : 0;
+ k[4*i+3] = a[4*i+3] < b[4*i+3] ? 17 : 0;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 0 : 24;
+ k[2*i+1] = a[2*i+1] < b[2*i+1] ? 7 : 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 51 : 12;
+ k[2*i+1] = a[2*i+1] > b[2*i+1] ? 51 : 12;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ int d0 = d[2*i], e0 = e[2*i];
+ int d1 = d[2*i+1], e1 = e[2*i+1];
+ k[2*i] = a[2*i] >= b[2*i] ? d0 : e0;
+ k[2*i+1] = a[2*i+1] >= b[2*i+1] ? d1 : e1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+
+ f2 ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0:
+ case 6:
+ if (k[i] != ((i/9 % 2) == 0 ? 0 : 7))
+ abort ();
+ break;
+ case 1:
+ case 5:
+ case 7:
+ if (k[i] != ((i/9 % 2) == 0 ? 4 : 24))
+ abort ();
+ break;
+ case 2:
+ case 4:
+ case 8:
+ if (k[i] != ((i/9 % 2) == 0 ? 24 : 4))
+ abort ();
+ break;
+ case 3:
+ if (k[i] != ((i/9 % 2) == 0 ? 7 : 0))
+ abort ();
+ break;
+ }
+ }
+
+ f3 ();
+
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? e[i] : d[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-cond-2.c b/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
new file mode 100644
index 00000000000..c73933fce0f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
@@ -0,0 +1,127 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+#include "tree-vect.h"
+
+#define N 32
+int d[N], e[N], f[N];
+unsigned char k[N];
+float a[N], b[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N/4; i++)
+ {
+ k[4*i] = a[4*i] < b[4*i] ? 17 : 0;
+ k[4*i+1] = a[4*i+1] < b[4*i+1] ? 17 : 0;
+ k[4*i+2] = a[4*i+2] < b[4*i+2] ? 17 : 0;
+ k[4*i+3] = a[4*i+3] < b[4*i+3] ? 17 : 0;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 0 : 24;
+ k[2*i+1] = a[2*i+1] < b[2*i+1] ? 7 : 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 51 : 12;
+ k[2*i+1] = a[2*i+1] > b[2*i+1] ? 51 : 12;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ int d0 = d[2*i], e0 = e[2*i];
+ int d1 = d[2*i+1], e1 = e[2*i+1];
+ f[2*i] = a[2*i] >= b[2*i] ? d0 : e0;
+ f[2*i+1] = a[2*i+1] >= b[2*i+1] ? d1 : e1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+
+ f2 ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0:
+ case 6:
+ if (k[i] != ((i/9 % 2) == 0 ? 0 : 7))
+ abort ();
+ break;
+ case 1:
+ case 5:
+ case 7:
+ if (k[i] != ((i/9 % 2) == 0 ? 4 : 24))
+ abort ();
+ break;
+ case 2:
+ case 4:
+ case 8:
+ if (k[i] != ((i/9 % 2) == 0 ? 24 : 4))
+ abort ();
+ break;
+ case 3:
+ if (k[i] != ((i/9 % 2) == 0 ? 7 : 0))
+ abort ();
+ break;
+ }
+ }
+
+ f3 ();
+
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (f[i] != ((i % 3) == 0 ? e[i] : d[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index 63f427fc8c9..d13235fd972 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -5,6 +5,9 @@
/* { dg-require-weak "" } */
/* { dg-require-alias "" } */
/* { dg-options "-O2" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
extern int foo1 (int x) __asm ("baz1");
int bar1 (int x) { return x; }
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-12.c b/gcc/testsuite/gcc.misc-tests/gcov-12.c
new file mode 100644
index 00000000000..1898aadb4ce
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-12.c
@@ -0,0 +1,17 @@
+/* Test gcov weak ellision. */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-require-weak "" } */
+/* { dg-do run { target native } } */
+
+int __attribute__ ((weak)) weak ()
+{
+ return 0; /* count(1) */
+}
+
+int main ()
+{
+ return weak (); /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-12.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-13.c b/gcc/testsuite/gcc.misc-tests/gcov-13.c
new file mode 100644
index 00000000000..605d4d4b382
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-13.c
@@ -0,0 +1,18 @@
+/* Test gcov weak ellision. */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-require-weak "" } */
+/* { dg-do run { target native } } */
+/* { dg-additional-sources "gcovpart-13b.c" } */
+
+int __attribute__ ((weak)) weak ()
+{
+ return 1; /* count(-) */
+}
+
+int main ()
+{
+ return weak (); /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-13.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c
new file mode 100644
index 00000000000..0eaf284a9c4
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c
@@ -0,0 +1,24 @@
+/* Test gcov extern inline. */
+
+/* { dg-options "-O2 -fprofile-arcs -ftest-coverage" } */
+/* { dg-require-weak "" } */
+/* { dg-do run { target native } } */
+
+extern int __attribute__ ((weak)) Foo ();
+
+extern __inline int Foo ()
+{
+ return 0; /* count(-) */
+}
+
+int (* __attribute__ ((noinline)) Bar ()) ()
+{
+ return Foo; /* count(1) */
+}
+
+int main ()
+{
+ return Bar () != 0; /* count(1) */
+}
+
+/* { dg-final { run-gcov { -a gcov-14.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
index d433b996392..85a1c34abd9 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov.exp
+++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
@@ -33,7 +33,7 @@ if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
dg-init
# Delete old .gcda files.
-set files [glob -nocomplain gcov-*.gcda]
+set files [glob -nocomplain gcov*.gcda]
if { $files != "" } {
eval "remote_file build delete $files"
}
diff --git a/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c b/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c
new file mode 100644
index 00000000000..0900ab48021
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcovpart-13b.c
@@ -0,0 +1,4 @@
+int weak ()
+{
+ return 0; /* count(1) */
+}
diff --git a/gcc/testsuite/gcc.target/arm/stack-red-zone.c b/gcc/testsuite/gcc.target/arm/stack-red-zone.c
new file mode 100644
index 00000000000..b9f0f99371e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/stack-red-zone.c
@@ -0,0 +1,12 @@
+/* No stack red zone. PR38644. */
+/* { dg-options "-mthumb -O2" } */
+/* { dg-final { scan-assembler "ldrb\[^\n\]*\\n\[\t \]*add\[\t \]*sp" } } */
+
+extern int doStreamReadBlock (int *, char *, int size, int);
+
+char readStream (int *s)
+{
+ char c = 0;
+ doStreamReadBlock (s, &c, 1, *s);
+ return c;
+}
diff --git a/gcc/testsuite/gcc.target/arm/wmul-1.c b/gcc/testsuite/gcc.target/arm/wmul-1.c
index 426c9393f20..ddddd509fe6 100644
--- a/gcc/testsuite/gcc.target/arm/wmul-1.c
+++ b/gcc/testsuite/gcc.target/arm/wmul-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O1 -fexpensive-optimizations" } */
int mac(const short *a, const short *b, int sqr, int *sum)
{
diff --git a/gcc/testsuite/gcc.target/arm/wmul-2.c b/gcc/testsuite/gcc.target/arm/wmul-2.c
index 898b5f065cb..2ea55f9fbe1 100644
--- a/gcc/testsuite/gcc.target/arm/wmul-2.c
+++ b/gcc/testsuite/gcc.target/arm/wmul-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O1 -fexpensive-optimizations" } */
void vec_mpy(int y[], const short x[], short scaler)
{
diff --git a/gcc/testsuite/gcc.target/arm/wmul-3.c b/gcc/testsuite/gcc.target/arm/wmul-3.c
index 83f73fba727..144b553082e 100644
--- a/gcc/testsuite/gcc.target/arm/wmul-3.c
+++ b/gcc/testsuite/gcc.target/arm/wmul-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O1 -fexpensive-optimizations" } */
int mac(const short *a, const short *b, int sqr, int *sum)
{
diff --git a/gcc/testsuite/gcc.target/arm/wmul-4.c b/gcc/testsuite/gcc.target/arm/wmul-4.c
index a297bda2182..68f9866746d 100644
--- a/gcc/testsuite/gcc.target/arm/wmul-4.c
+++ b/gcc/testsuite/gcc.target/arm/wmul-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O1 -fexpensive-optimizations" } */
int mac(const int *a, const int *b, long long sqr, long long *sum)
{
diff --git a/gcc/testsuite/gcc.target/epiphany/epiphany.exp b/gcc/testsuite/gcc.target/epiphany/epiphany.exp
new file mode 100644
index 00000000000..dc9fecc728e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/epiphany.exp
@@ -0,0 +1,41 @@
+# Copyright (C) 2007, 2011 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 an epiphany target.
+if ![istarget epiphany*-*-*] 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 " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/epiphany/fmadd-1.c b/gcc/testsuite/gcc.target/epiphany/fmadd-1.c
new file mode 100644
index 00000000000..868d5bd0226
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/fmadd-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmadd\[ \ta-zA-Z0-9\]*," 2 } } */
+
+#include <epiphany_intrinsics.h>
+
+float
+f1 (float a, float b, float c)
+{
+ return __builtin_epiphany_fmadd (a, b, c);
+}
+
+float
+f2 (float a, float b, float c)
+{
+ return a + b * c;
+}
diff --git a/gcc/testsuite/gcc.target/epiphany/fmsub-1.c b/gcc/testsuite/gcc.target/epiphany/fmsub-1.c
new file mode 100644
index 00000000000..ff7fefa7f20
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/fmsub-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 2 } } */
+
+#include <epiphany_intrinsics.h>
+
+float
+f1 (float a, float b, float c)
+{
+ return __builtin_epiphany_fmsub (a, b, c);
+}
+
+float
+f2 (float a, float b, float c)
+{
+ return a - b * c;
+}
diff --git a/gcc/testsuite/gcc.target/epiphany/interrupt.c b/gcc/testsuite/gcc.target/epiphany/interrupt.c
new file mode 100644
index 00000000000..a44c79e432e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/interrupt.c
@@ -0,0 +1,14 @@
+void __attribute__((interrupt("dma0")))
+f (void)
+{
+}
+
+void __attribute__((interrupt("Vss")))
+g (void)
+{ /* { dg-warning "is not \"reset\"" } */
+}
+
+void __attribute__((interrupt(42)))
+h (void)
+{ /* { dg-warning "is not a string constant" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/47698.c b/gcc/testsuite/gcc.target/i386/47698.c
new file mode 100644
index 00000000000..2c751093ae3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/47698.c
@@ -0,0 +1,10 @@
+/* { dg-options "-Os" } */
+/* { dg-final { scan-assembler-not "cmov" } } */
+
+extern volatile unsigned long mmio;
+unsigned long foo(int cond)
+{
+ if (cond)
+ return mmio;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-cvt-2.c b/gcc/testsuite/gcc.target/i386/avx-cvt-2.c
index 78c6398f341..68206f5a0e7 100644
--- a/gcc/testsuite/gcc.target/i386/avx-cvt-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx-cvt-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -mavx -mno-avx2 -fdump-tree-vect-details" } */
+/* { dg-options "-O3 -mavx -mno-avx2 -mtune=generic -fdump-tree-vect-details" } */
#include "avx-cvt-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx2-cvt-2.c b/gcc/testsuite/gcc.target/i386/avx2-cvt-2.c
index 288e5601a46..4826e9b6d05 100644
--- a/gcc/testsuite/gcc.target/i386/avx2-cvt-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx2-cvt-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -mavx2 -fdump-tree-vect-details" } */
+/* { dg-options "-O3 -mavx2 -mtune=generic -fdump-tree-vect-details" } */
#include "avx2-cvt-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx2-gather-1.c b/gcc/testsuite/gcc.target/i386/avx2-gather-1.c
new file mode 100644
index 00000000000..7ed567dc491
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-gather-1.c
@@ -0,0 +1,215 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx2 } */
+/* { dg-options "-O3 -mavx2" } */
+
+#include "avx2-check.h"
+
+#define N 1024
+float vf1[N+16], vf2[N];
+double vd1[N+16], vd2[N];
+int k[N];
+long l[N];
+short n[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vf2[i] = vf1[k[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vf1[k[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f3 (int x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vf2[i] = vf1[k[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f4 (int x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vf1[k[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vd2[i] = vd1[k[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vd1[k[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f7 (int x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vd2[i] = vd1[k[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f8 (int x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vd1[k[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f9 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vf2[i] = vf1[l[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f10 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vf1[l[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f11 (long x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vf2[i] = vf1[l[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f12 (long x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vf1[l[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f13 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vd2[i] = vd1[l[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f14 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vd1[l[i]];
+}
+
+__attribute__((noinline, noclone)) void
+f15 (long x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ vd2[i] = vd1[l[i] + x];
+}
+
+__attribute__((noinline, noclone)) void
+f16 (long x)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ n[i] = (int) vd1[l[i] + x];
+}
+
+static void
+avx2_test (void)
+{
+ int i;
+
+ for (i = 0; i < N + 16; i++)
+ {
+ asm ("");
+ vf1[i] = 17.0f + i;
+ vd1[i] = 19.0 + i;
+ }
+ for (i = 0; i < N; i++)
+ {
+ asm ("");
+ k[i] = (i * 731) & (N - 1);
+ l[i] = (i * 657) & (N - 1);
+ }
+
+ f1 ();
+ f2 ();
+ for (i = 0; i < N; i++)
+ if (vf2[i] != ((i * 731) & (N - 1)) + 17
+ || n[i] != ((i * 731) & (N - 1)) + 17)
+ abort ();
+
+ f3 (12);
+ f4 (14);
+ for (i = 0; i < N; i++)
+ if (vf2[i] != ((i * 731) & (N - 1)) + 17 + 12
+ || n[i] != ((i * 731) & (N - 1)) + 17 + 14)
+ abort ();
+
+ f5 ();
+ f6 ();
+ for (i = 0; i < N; i++)
+ if (vd2[i] != ((i * 731) & (N - 1)) + 19
+ || n[i] != ((i * 731) & (N - 1)) + 19)
+ abort ();
+
+ f7 (7);
+ f8 (9);
+ for (i = 0; i < N; i++)
+ if (vd2[i] != ((i * 731) & (N - 1)) + 19 + 7
+ || n[i] != ((i * 731) & (N - 1)) + 19 + 9)
+ abort ();
+
+ f9 ();
+ f10 ();
+ for (i = 0; i < N; i++)
+ if (vf2[i] != ((i * 657) & (N - 1)) + 17
+ || n[i] != ((i * 657) & (N - 1)) + 17)
+ abort ();
+
+ f11 (2);
+ f12 (4);
+ for (i = 0; i < N; i++)
+ if (vf2[i] != ((i * 657) & (N - 1)) + 17 + 2
+ || n[i] != ((i * 657) & (N - 1)) + 17 + 4)
+ abort ();
+
+ f13 ();
+ f14 ();
+ for (i = 0; i < N; i++)
+ if (vd2[i] != ((i * 657) & (N - 1)) + 19
+ || n[i] != ((i * 657) & (N - 1)) + 19)
+ abort ();
+
+ f15 (13);
+ f16 (15);
+ for (i = 0; i < N; i++)
+ if (vd2[i] != ((i * 657) & (N - 1)) + 19 + 13
+ || n[i] != ((i * 657) & (N - 1)) + 19 + 15)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-gather-2.c b/gcc/testsuite/gcc.target/i386/avx2-gather-2.c
new file mode 100644
index 00000000000..8a7fe95a238
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-gather-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx2 -fdump-tree-vect-details" } */
+
+#include "avx2-gather-1.c"
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops in function" 16 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx2-gather-3.c b/gcc/testsuite/gcc.target/i386/avx2-gather-3.c
new file mode 100644
index 00000000000..fb6289c0e7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-gather-3.c
@@ -0,0 +1,167 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx2 } */
+/* { dg-options "-O3 -mavx2 -ffast-math" } */
+
+#include "avx2-check.h"
+
+#define N 1024
+float f[N];
+double d[N];
+int k[N];
+float *l[N];
+double *n[N];
+int **m[N];
+long **o[N];
+long q[N];
+long *r[N];
+int *s[N];
+
+__attribute__((noinline, noclone)) float
+f1 (void)
+{
+ int i;
+ float g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += f[k[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) float
+f2 (float *p)
+{
+ int i;
+ float g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += p[k[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) float
+f3 (void)
+{
+ int i;
+ float g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += *l[i];
+ return g;
+}
+
+__attribute__((noinline, noclone)) int
+f4 (void)
+{
+ int i;
+ int g = 0;
+ for (i = 0; i < N / 2; i++)
+ g += **m[i];
+ return g;
+}
+
+__attribute__((noinline, noclone)) double
+f5 (void)
+{
+ int i;
+ double g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += d[k[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) double
+f6 (double *p)
+{
+ int i;
+ double g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += p[k[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) double
+f7 (void)
+{
+ int i;
+ double g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += *n[i];
+ return g;
+}
+
+__attribute__((noinline, noclone)) int
+f8 (void)
+{
+ int i;
+ int g = 0;
+ for (i = 0; i < N / 2; i++)
+ g += **o[i];
+ return g;
+}
+
+__attribute__((noinline, noclone)) float
+f9 (void)
+{
+ int i;
+ float g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += f[q[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) float
+f10 (float *p)
+{
+ int i;
+ float g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += p[q[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) double
+f11 (void)
+{
+ int i;
+ double g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += d[q[i]];
+ return g;
+}
+
+__attribute__((noinline, noclone)) double
+f12 (double *p)
+{
+ int i;
+ double g = 0.0;
+ for (i = 0; i < N / 2; i++)
+ g += p[q[i]];
+ return g;
+}
+
+static void
+avx2_test (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ asm ("");
+ f[i] = -256.0f + i;
+ d[i] = -258.0 + i;
+ k[i] = (i * 731) & (N - 1);
+ q[i] = (i * 657) & (N - 1);
+ l[i] = &f[(i * 239) & (N - 1)];
+ n[i] = &d[(i * 271) & (N - 1)];
+ r[i] = &q[(i * 323) & (N - 1)];
+ s[i] = &k[(i * 565) & (N - 1)];
+ m[i] = &s[(i * 13) & (N - 1)];
+ o[i] = &r[(i * 19) & (N - 1)];
+ }
+
+ if (f1 () != 136448.0f || f2 (f) != 136448.0f || f3 () != 130304.0)
+ abort ();
+ if (f4 () != 261376 || f5 () != 135424.0 || f6 (d) != 135424.0)
+ abort ();
+ if (f7 () != 129280.0 || f8 () != 259840L || f9 () != 130816.0f)
+ abort ();
+ if (f10 (f) != 130816.0f || f11 () != 129792.0 || f12 (d) != 129792.0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-gather-4.c b/gcc/testsuite/gcc.target/i386/avx2-gather-4.c
new file mode 100644
index 00000000000..440a9c9b164
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-gather-4.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx2 } */
+/* { dg-options "-O3 -mavx2" } */
+
+#include "avx2-check.h"
+
+#define N 1024
+int a[N], b[N], c[N], d[N];
+
+__attribute__((noinline, noclone)) void
+foo (float *__restrict p, float *__restrict q, float *__restrict r,
+ long s1, long s2, long s3)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ p[i] = q[a[i] * s1 + b[i] * s2 + s3] * r[c[i] * s1 + d[i] * s2 + s3];
+}
+
+static void
+avx2_test (void)
+{
+ int i;
+ float e[N], f[N], g[N];
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (i * 7) & (N / 8 - 1);
+ b[i] = (i * 13) & (N / 8 - 1);
+ c[i] = (i * 23) & (N / 8 - 1);
+ d[i] = (i * 5) & (N / 8 - 1);
+ e[i] = 16.5 + i;
+ f[i] = 127.5 - i;
+ }
+ foo (g, e, f, 3, 2, 4);
+ for (i = 0; i < N; i++)
+ if (g[i] != (float) ((20.5 + a[i] * 3 + b[i] * 2)
+ * (123.5 - c[i] * 3 - d[i] * 2)))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr49781-1.c b/gcc/testsuite/gcc.target/i386/pr49781-1.c
index 80db03416e5..60f9d50d866 100644
--- a/gcc/testsuite/gcc.target/i386/pr49781-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr49781-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fpic" } */
+/* { dg-options "-O2 -fpic -mtune=generic" } */
/* { dg-require-effective-target fpic } */
static int heap[2*(256 +1+29)+1];
diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvt-2.c b/gcc/testsuite/gcc.target/i386/sse2-cvt-2.c
index 9c4519544ca..00f13254c22 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-cvt-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-cvt-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -msse2 -mno-sse3 -fdump-tree-vect-details" } */
+/* { dg-options "-O3 -msse2 -mno-sse3 -mtune=generic -fdump-tree-vect-details" } */
#include "sse2-cvt-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/vectorize4-avx.c b/gcc/testsuite/gcc.target/i386/vectorize4-avx.c
index 8e4a747a64b..33e99189373 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize4-avx.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize4-avx.c
@@ -11,4 +11,4 @@ calc_freq (int *dest)
dest[i] = sqrt (tmp_out[i]);
}
-/* { dg-final { scan-assembler "vsqrtpd\[ \\t\]+\[^\n\]*%ymm" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler "vsqrtpd\[ \\t\]+\[^\n\]*%ymm" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/20111102-1.c b/gcc/testsuite/gcc.target/sparc/20111102-1.c
new file mode 100644
index 00000000000..d33f103e377
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/20111102-1.c
@@ -0,0 +1,17 @@
+/* PR target/50945 */
+/* { dg-do compile } */
+/* { dg-options "-O -msoft-float" } */
+
+double
+__powidf2 (double x, int m)
+{
+ unsigned int n = m < 0 ? -m : m;
+ double y = n % 2 ? x : 1;
+ while (n >>= 1)
+ {
+ x = x * x;
+ if (n % 2)
+ y = y * x;
+ }
+ return m < 0 ? 1/y : y;
+}
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-1-vis1.c b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis1.c
new file mode 100644
index 00000000000..4202bfa6e72
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis1.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_hw } */
+/* { dg-options "-mcpu=ultrasparc -mvis -O2" } */
+
+#include "vec-init-1.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-1-vis2.c b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis2.c
new file mode 100644
index 00000000000..a5c21323936
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis2.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis2_hw } */
+/* { dg-options "-mcpu=ultrasparc3 -O2" } */
+
+#include "vec-init-1.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-1-vis3.c b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis3.c
new file mode 100644
index 00000000000..ab916e052cc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-1-vis3.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis3_hw } */
+/* { dg-options "-mcpu=niagara3 -O2" } */
+
+#include "vec-init-1.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-1.inc b/gcc/testsuite/gcc.target/sparc/vec-init-1.inc
new file mode 100644
index 00000000000..e27bb6e293b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-1.inc
@@ -0,0 +1,85 @@
+typedef int __v1si __attribute__ ((__vector_size__ (4)));
+typedef int __v2si __attribute__ ((__vector_size__ (8)));
+typedef short __v2hi __attribute__ ((__vector_size__ (4)));
+typedef short __v4hi __attribute__ ((__vector_size__ (8)));
+typedef unsigned char __v4qi __attribute__ ((__vector_size__ (4)));
+typedef unsigned char __v8qi __attribute__ ((__vector_size__ (8)));
+
+extern void abort (void);
+
+static void
+compare64 (void *p, unsigned long long val)
+{
+ if (*(unsigned long long *)p != val)
+ abort();
+}
+
+static void
+compare32 (void *p, unsigned int val)
+{
+ if (*(unsigned int *)p != val)
+ abort();
+}
+
+static void
+test_v8qi (unsigned char x)
+{
+ __v8qi v = { x, x, x, x, x, x, x, x };
+
+ compare64(&v, 0x4444444444444444ULL);
+}
+
+static void
+test_v4qi (unsigned char x)
+{
+ __v4qi v = { x, x, x, x };
+
+ compare32(&v, 0x44444444);
+}
+
+static void
+test_v4hi (unsigned short x)
+{
+ __v4hi v = { x, x, x, x, };
+
+ compare64(&v, 0x3344334433443344ULL);
+}
+
+static void
+test_v2hi (unsigned short x)
+{
+ __v2hi v = { x, x, };
+
+ compare32(&v, 0x33443344);
+}
+
+static void
+test_v2si (unsigned int x)
+{
+ __v2si v = { x, x, };
+
+ compare64(&v, 0x1122334411223344ULL);
+}
+
+static void
+test_v1si (unsigned int x)
+{
+ __v1si v = { x };
+
+ compare32(&v, 0x11223344);
+}
+
+unsigned char x8 = 0x44;
+unsigned short x16 = 0x3344;
+unsigned int x32 = 0x11223344;
+
+int main(void)
+{
+ test_v8qi (x8);
+ test_v4qi (x8);
+ test_v4hi (x16);
+ test_v2hi (x16);
+ test_v2si (x32);
+ test_v1si (x32);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-2-vis1.c b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis1.c
new file mode 100644
index 00000000000..efa08fa248c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis1.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_hw } */
+/* { dg-options "-mcpu=ultrasparc -mvis -O2" } */
+
+#include "vec-init-2.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-2-vis2.c b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis2.c
new file mode 100644
index 00000000000..3aa0f51595f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis2.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis2_hw } */
+/* { dg-options "-mcpu=ultrasparc3 -O2" } */
+
+#include "vec-init-2.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-2-vis3.c b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis3.c
new file mode 100644
index 00000000000..5f0c65860bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-2-vis3.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis3_hw } */
+/* { dg-options "-mcpu=niagara3 -O2" } */
+
+#include "vec-init-2.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-2.inc b/gcc/testsuite/gcc.target/sparc/vec-init-2.inc
new file mode 100644
index 00000000000..13685a1006e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-2.inc
@@ -0,0 +1,94 @@
+typedef short __v2hi __attribute__ ((__vector_size__ (4)));
+typedef short __v4hi __attribute__ ((__vector_size__ (8)));
+
+extern void abort (void);
+
+static void
+compare64 (int n, void *p, unsigned long long val)
+{
+ unsigned long long *x = (unsigned long long *) p;
+
+ if (*x != val)
+ abort();
+}
+
+static void
+compare32 (int n, void *p, unsigned int val)
+{
+ unsigned int *x = (unsigned int *) p;
+ if (*x != val)
+ abort();
+}
+
+#define V2HI_TEST(N, elt0, elt1) \
+static void \
+test_v2hi_##N (unsigned short x, unsigned short y) \
+{ \
+ __v2hi v = { (elt0), (elt1) }; \
+ compare32(N, &v, ((int)(elt0) << 16) | (elt1)); \
+}
+
+V2HI_TEST(1, x, y)
+V2HI_TEST(2, y, x)
+V2HI_TEST(3, x, x)
+V2HI_TEST(4, x, 0)
+V2HI_TEST(5, 0, x)
+V2HI_TEST(6, y, 1)
+V2HI_TEST(7, 1, y)
+V2HI_TEST(8, 2, 3)
+V2HI_TEST(9, 0x400, x)
+V2HI_TEST(10, y, 0x8000)
+
+#define V4HI_TEST(N, elt0, elt1, elt2, elt3) \
+static void \
+test_v4hi_##N (unsigned short a, unsigned short b, unsigned short c, unsigned short d) \
+{ \
+ __v4hi v = { (elt0), (elt1), (elt2), (elt3) }; \
+ compare64(N, &v, \
+ ((long long)(elt0) << 48) | \
+ ((long long)(elt1) << 32) | \
+ ((long long)(elt2) << 16) | \
+ ((long long)(elt3))); \
+}
+
+V4HI_TEST(1, a, a, a, a)
+V4HI_TEST(2, a, b, c, d)
+V4HI_TEST(3, a, a, b, b)
+V4HI_TEST(4, d, c, b, a)
+V4HI_TEST(5, a, 0, 0, 0)
+V4HI_TEST(6, a, 0, b, 0)
+V4HI_TEST(7, c, 5, 5, 5)
+V4HI_TEST(8, d, 6, a, 6)
+V4HI_TEST(9, 0x200, 0x300, 0x500, 0x8800)
+V4HI_TEST(10, 0x600, a, a, a)
+
+unsigned short a16 = 0x3344;
+unsigned short b16 = 0x5566;
+unsigned short c16 = 0x7788;
+unsigned short d16 = 0x9911;
+
+int main(void)
+{
+ test_v2hi_1 (a16, b16);
+ test_v2hi_2 (a16, b16);
+ test_v2hi_3 (a16, b16);
+ test_v2hi_4 (a16, b16);
+ test_v2hi_5 (a16, b16);
+ test_v2hi_6 (a16, b16);
+ test_v2hi_7 (a16, b16);
+ test_v2hi_8 (a16, b16);
+ test_v2hi_9 (a16, b16);
+ test_v2hi_10 (a16, b16);
+
+ test_v4hi_1 (a16, b16, c16, d16);
+ test_v4hi_2 (a16, b16, c16, d16);
+ test_v4hi_3 (a16, b16, c16, d16);
+ test_v4hi_4 (a16, b16, c16, d16);
+ test_v4hi_5 (a16, b16, c16, d16);
+ test_v4hi_6 (a16, b16, c16, d16);
+ test_v4hi_7 (a16, b16, c16, d16);
+ test_v4hi_8 (a16, b16, c16, d16);
+ test_v4hi_9 (a16, b16, c16, d16);
+ test_v4hi_10 (a16, b16, c16, d16);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-3-vis1.c b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis1.c
new file mode 100644
index 00000000000..6c826108c29
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis1.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_hw } */
+/* { dg-options "-mcpu=ultrasparc -mvis -O2" } */
+
+#include "vec-init-3.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-3-vis2.c b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis2.c
new file mode 100644
index 00000000000..6424e2f1592
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis2.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis2_hw } */
+/* { dg-options "-mcpu=ultrasparc3 -O2" } */
+
+#include "vec-init-3.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-3-vis3.c b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis3.c
new file mode 100644
index 00000000000..226c108c5e5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-3-vis3.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ultrasparc_vis3_hw } */
+/* { dg-options "-mcpu=niagara3 -O2" } */
+
+#include "vec-init-3.inc"
diff --git a/gcc/testsuite/gcc.target/sparc/vec-init-3.inc b/gcc/testsuite/gcc.target/sparc/vec-init-3.inc
new file mode 100644
index 00000000000..8a3db2600a6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vec-init-3.inc
@@ -0,0 +1,105 @@
+typedef unsigned char __v4qi __attribute__ ((__vector_size__ (4)));
+typedef unsigned char __v8qi __attribute__ ((__vector_size__ (8)));
+
+extern void abort (void);
+
+static void
+compare64 (int n, void *p, unsigned long long val)
+{
+ unsigned long long *x = (unsigned long long *) p;
+
+ if (*x != val)
+ abort();
+}
+
+static void
+compare32 (int n, void *p, unsigned int val)
+{
+ unsigned int *x = (unsigned int *) p;
+ if (*x != val)
+ abort();
+}
+
+#define V4QI_TEST(N, elt0, elt1, elt2, elt3) \
+static void \
+test_v4qi_##N (unsigned char a, unsigned char b, unsigned char c, unsigned char d) \
+{ \
+ __v4qi v = { (elt0), (elt1), (elt2), (elt3) }; \
+ compare32(N, &v, ((int)(elt0) << 24) | \
+ ((int)(elt1) << 16) | \
+ ((int)(elt2) << 8) | ((int)(elt3))); \
+}
+
+V4QI_TEST(1, a, a, a, a)
+V4QI_TEST(2, b, b, b, b)
+V4QI_TEST(3, a, b, c, d)
+V4QI_TEST(4, d, c, b, a)
+V4QI_TEST(5, a, 0, 0, 0)
+V4QI_TEST(6, b, 1, 1, b)
+V4QI_TEST(7, c, 5, d, 5)
+V4QI_TEST(8, 0x20, 0x30, b, a)
+V4QI_TEST(9, 0x40, 0x50, 0x60, 0x70)
+V4QI_TEST(10, 0x40, 0x50, 0x60, c)
+
+#define V8QI_TEST(N, elt0, elt1, elt2, elt3, elt4, elt5, elt6, elt7) \
+static void \
+test_v8qi_##N (unsigned char a, unsigned char b, unsigned char c, unsigned char d, \
+ unsigned char e, unsigned char f, unsigned char g, unsigned char h) \
+{ \
+ __v8qi v = { (elt0), (elt1), (elt2), (elt3), \
+ (elt4), (elt5), (elt6), (elt7) }; \
+ compare64(N, &v, ((long long)(elt0) << 56) | \
+ ((long long)(elt1) << 48) | \
+ ((long long)(elt2) << 40) | \
+ ((long long)(elt3) << 32) | \
+ ((long long)(elt4) << 24) | \
+ ((long long)(elt5) << 16) | \
+ ((long long)(elt6) << 8) | \
+ ((long long)(elt7) << 0)); \
+}
+
+V8QI_TEST(1, a, a, a, a, a, a, a, a)
+V8QI_TEST(2, a, b, c, d, e, f, g, h)
+V8QI_TEST(3, h, g, f, e, d, c, b, a)
+V8QI_TEST(4, a, b, a, b, a, b, a, b)
+V8QI_TEST(5, c, b, c, b, c, b, c, a)
+V8QI_TEST(6, a, 0, 0, 0, 0, 0, 0, 0)
+V8QI_TEST(7, b, 1, b, 1, b, 1, b, 1)
+V8QI_TEST(8, c, d, 0x20, a, 0x21, b, 0x23, c)
+V8QI_TEST(9, 1, 2, 3, 4, 5, 6, 7, 8)
+V8QI_TEST(10, a, a, b, b, c, c, d, d)
+
+unsigned char a8 = 0x33;
+unsigned char b8 = 0x55;
+unsigned char c8 = 0x77;
+unsigned char d8 = 0x99;
+unsigned char e8 = 0x11;
+unsigned char f8 = 0x22;
+unsigned char g8 = 0x44;
+unsigned char h8 = 0x66;
+
+int main(void)
+{
+ test_v4qi_1 (a8, b8, c8, d8);
+ test_v4qi_2 (a8, b8, c8, d8);
+ test_v4qi_3 (a8, b8, c8, d8);
+ test_v4qi_4 (a8, b8, c8, d8);
+ test_v4qi_5 (a8, b8, c8, d8);
+ test_v4qi_6 (a8, b8, c8, d8);
+ test_v4qi_7 (a8, b8, c8, d8);
+ test_v4qi_8 (a8, b8, c8, d8);
+ test_v4qi_9 (a8, b8, c8, d8);
+ test_v4qi_10 (a8, b8, c8, d8);
+
+ test_v8qi_1 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_2 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_3 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_4 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_5 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_6 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_7 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_8 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_9 (a8, b8, c8, d8, e8, f8, g8, h8);
+ test_v8qi_10 (a8, b8, c8, d8, e8, f8, g8, h8);
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/bind_c_dts_5.f90 b/gcc/testsuite/gfortran.dg/bind_c_dts_5.f90
new file mode 100644
index 00000000000..497c0501b11
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind_c_dts_5.f90
@@ -0,0 +1,54 @@
+! { dg-do compile }
+!
+! PR fortran/50933
+!
+! Check whether type-compatibility checks for BIND(C) work.
+!
+! Contributed by Richard Maine
+!
+
+MODULE liter_cb_mod
+USE ISO_C_BINDING
+CONTAINS
+ FUNCTION liter_cb(link_info) bind(C)
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+
+ INTEGER(c_int) liter_cb
+
+ TYPE, bind(C) :: info_t
+ INTEGER(c_int) :: type
+ END TYPE info_t
+
+ TYPE(info_t) :: link_info
+
+ liter_cb = 0
+
+ END FUNCTION liter_cb
+
+END MODULE liter_cb_mod
+
+PROGRAM main
+ USE ISO_C_BINDING
+ interface
+ FUNCTION liter_cb(link_info) bind(C)
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ INTEGER(c_int) liter_cb
+ TYPE, bind(C) :: info_t
+ INTEGER(c_int) :: type
+ END TYPE info_t
+ TYPE(info_t) :: link_info
+ END FUNCTION liter_cb
+ end interface
+
+ TYPE, bind(C) :: info_t
+ INTEGER(c_int) :: type
+ END TYPE info_t
+ type(info_t) :: link_info
+
+ write (*,*) liter_cb(link_info)
+
+END PROGRAM main
+
+! { dg-final { cleanup-modules "liter_cb_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/function_optimize_7.f90 b/gcc/testsuite/gfortran.dg/function_optimize_7.f90
index 212c8fbd491..e0c404b6a2a 100644
--- a/gcc/testsuite/gfortran.dg/function_optimize_7.f90
+++ b/gcc/testsuite/gfortran.dg/function_optimize_7.f90
@@ -12,6 +12,7 @@ subroutine xx(n, m, a, b, c, d, x, z, i, s_in, s_out)
real, intent(out) :: z
character(60) :: line
real, external :: ext_func
+ integer :: one = 1
interface
elemental function element(x)
real, intent(in) :: x
@@ -33,7 +34,7 @@ subroutine xx(n, m, a, b, c, d, x, z, i, s_in, s_out)
z = element(x) + element(x)
i = mypure(x) - mypure(x)
z = elem_impure(x) - elem_impure(x)
- s_out = sum(s_in,1) + 3.14 / sum(s_in,1) ! { dg-warning "Creating array temporary" }
+ s_out = sum(s_in,one) + 3.14 / sum(s_in,one) ! { dg-warning "Creating array temporary" }
end subroutine xx
! { dg-final { scan-tree-dump-times "matmul_r4" 1 "original" } }
! { dg-final { scan-tree-dump-times "__builtin_sinf" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/inline_product_1.f90 b/gcc/testsuite/gfortran.dg/inline_product_1.f90
new file mode 100644
index 00000000000..72c096bff4a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_product_1.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+! { dg-options "-Warray-temporaries -O -fdump-tree-original" }
+!
+! PR fortran/43829
+! Scalarization of reductions.
+! Test that product is properly inlined.
+
+! For more extended tests, see inline_sum_1.f90
+
+ implicit none
+
+
+ integer :: i
+
+ integer, parameter :: q = 2
+ integer, parameter :: nx=3, ny=2*q, nz=5
+ integer, parameter, dimension(nx,ny,nz) :: p = &
+ & reshape ((/ (i, i=1,size(p)) /), shape(p))
+
+
+ integer, dimension(nx,ny,nz) :: a
+ integer, dimension(nx, nz) :: ay
+
+ a = p
+
+ ay = product(a,2)
+
+end
+! { dg-final { scan-tree-dump-times "struct array._integer\\(kind=4\\) atmp" 0 "original" } }
+! { dg-final { scan-tree-dump-times "struct array\[^\\n\]*atmp" 0 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_product_" 0 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/inline_sum_1.f90 b/gcc/testsuite/gfortran.dg/inline_sum_1.f90
new file mode 100644
index 00000000000..4538e5e117f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_sum_1.f90
@@ -0,0 +1,194 @@
+! { dg-do compile }
+! { dg-options "-Warray-temporaries -O -fdump-tree-original" }
+!
+! PR fortran/43829
+! Scalarization of reductions.
+! Test that sum is properly inlined.
+
+! This is the compile time test only; for the runtime test see inline_sum_2.f90
+! We can't test for temporaries on the run time test directly, as it tries
+! several optimization options among which -Os, and sum inlining is disabled
+! at -Os.
+
+
+ implicit none
+
+
+ integer :: i, j, k
+
+ integer, parameter :: q = 2
+ integer, parameter :: nx=3, ny=2*q, nz=5
+ integer, parameter, dimension(nx,ny,nz) :: p = &
+ & reshape ((/ (i**2, i=1,size(p)) /), shape(p))
+
+ integer, parameter, dimension( ny,nz) :: px = &
+ & reshape ((/ (( &
+ & nx*( nx*j+nx*ny*k+1)*( nx*j+nx*ny*k+1+ (nx-1)) &
+ & + nx*(nx-1)*(2*nx-1)/6, &
+ & j=0,ny-1), k=0,nz-1) /), shape(px))
+
+ integer, parameter, dimension(nx, nz) :: py = &
+ & reshape ((/ (( &
+ & ny*(i +nx*ny*k+1)*(i +nx*ny*k+1+nx *(ny-1)) &
+ & +(nx )**2*ny*(ny-1)*(2*ny-1)/6, &
+ & i=0,nx-1), k=0,nz-1) /), shape(py))
+
+ integer, parameter, dimension(nx,ny ) :: pz = &
+ & reshape ((/ (( &
+ & nz*(i+nx*j +1)*(i+nx*j +1+nx*ny*(nz-1)) &
+ & +(nx*ny)**2*nz*(nz-1)*(2*nz-1)/6, &
+ & i=0,nx-1), j=0,ny-1) /), shape(pz))
+
+
+ integer, dimension(nx,ny,nz) :: a
+ integer, dimension( ny,nz) :: ax
+ integer, dimension(nx, nz) :: ay
+ integer, dimension(nx,ny ) :: az
+
+ logical, dimension(nx,ny,nz) :: m, true
+
+
+ integer, dimension(nx,ny) :: b
+
+ integer, dimension(nx,nx) :: onesx
+ integer, dimension(ny,ny) :: onesy
+ integer, dimension(nz,nz) :: onesz
+
+
+ a = p
+ m = reshape((/ ((/ .true., .false. /), i=1,size(m)/2) /), shape(m))
+ true = reshape((/ (.true., i=1,size(true)) /), shape(true))
+
+ onesx = reshape((/ ((1, j=1,i),(0,j=1,nx-i),i=1,size(onesx,2)) /), shape(onesx))
+ onesy = reshape((/ ((1, j=1,i),(0,j=1,ny-i),i=1,size(onesy,2)) /), shape(onesy))
+ onesz = reshape((/ ((1, j=1,i),(0,j=1,nz-i),i=1,size(onesz,2)) /), shape(onesz))
+
+ ! Correct results in simple cases
+ ax = sum(a,1)
+ if (any(ax /= px)) call abort
+
+ ay = sum(a,2)
+ if (any(ay /= py)) call abort
+
+ az = sum(a,3)
+ if (any(az /= pz)) call abort
+
+
+ ! Masks work
+ if (any(sum(a,1,.false.) /= 0)) call abort
+ if (any(sum(a,2,.true.) /= py)) call abort
+ if (any(sum(a,3,m) /= merge(pz,0,m(:,:,1)))) call abort
+ if (any(sum(a,2,m) /= merge(sum(a(:, ::2,:),2),&
+ sum(a(:,2::2,:),2),&
+ m(:,1,:)))) call abort
+
+
+ ! It works too with array constructors ...
+ if (any(sum( &
+ reshape((/ (i*i,i=1,size(a)) /), shape(a)), &
+ 1, &
+ true) /= ax)) call abort
+
+ ! ... and with vector subscripts
+ if (any(sum( &
+ a((/ (i,i=1,nx) /), &
+ (/ (i,i=1,ny) /), &
+ (/ (i,i=1,nz) /)), &
+ 1) /= ax)) call abort
+
+ if (any(sum( &
+ a(sum(onesx(:,:),1), & ! unnecessary { dg-warning "Creating array temporary" }
+ sum(onesy(:,:),1), & ! unnecessary { dg-warning "Creating array temporary" }
+ sum(onesz(:,:),1)), & ! unnecessary { dg-warning "Creating array temporary" }
+ 1) /= ax)) call abort
+
+
+ ! Nested sums work
+ if (sum(sum(sum(a,1),1),1) /= sum(a)) call abort
+ if (sum(sum(sum(a,1),2),1) /= sum(a)) call abort
+ if (sum(sum(sum(a,3),1),1) /= sum(a)) call abort
+ if (sum(sum(sum(a,3),2),1) /= sum(a)) call abort
+
+ if (any(sum(sum(a,1),1) /= sum(sum(a,2),1))) call abort
+ if (any(sum(sum(a,1),2) /= sum(sum(a,3),1))) call abort
+ if (any(sum(sum(a,2),2) /= sum(sum(a,3),2))) call abort
+
+
+ ! Temps are unavoidable here (function call's argument or result)
+ ax = sum(neid3(a),1) ! { dg-warning "Creating array temporary" }
+ ! Sums as part of a bigger expr work
+ if (any(1+sum(eid(a),1)+ax+sum( &
+ neid3(a), & ! { dg-warning "Creating array temporary" }
+ 1)+1 /= 3*ax+2)) call abort
+ if (any(1+eid(sum(a,2))+ay+ &
+ neid2( & ! { dg-warning "Creating array temporary" }
+ sum(a,2) & ! { dg-warning "Creating array temporary" }
+ )+1 /= 3*ay+2)) call abort
+ if (any(sum(eid(sum(a,3))+az+2* &
+ neid2(az) & ! { dg-warning "Creating array temporary" }
+ ,1)+1 /= 4*sum(az,1)+1)) call abort
+
+ if (any(sum(transpose(sum(a,1)),1)+sum(az,1) /= sum(ax,2)+sum(sum(a,3),1))) call abort
+
+
+ ! Creates a temp when needed.
+ a(1,:,:) = sum(a,1) ! unnecessary { dg-warning "Creating array temporary" }
+ if (any(a(1,:,:) /= ax)) call abort
+
+ b = p(:,:,1)
+ call set(b(2:,1), sum(b(:nx-1,:),2)) ! { dg-warning "Creating array temporary" }
+ if (any(b(2:,1) /= ay(1:nx-1,1))) call abort
+
+ b = p(:,:,1)
+ call set(b(:,1), sum(b,2)) ! unnecessary { dg-warning "Creating array temporary" }
+ if (any(b(:,1) /= ay(:,1))) call abort
+
+ b = p(:,:,1)
+ call tes(sum(eid(b(:nx-1,:)),2), b(2:,1)) ! { dg-warning "Creating array temporary" }
+ if (any(b(2:,1) /= ay(1:nx-1,1))) call abort
+
+ b = p(:,:,1)
+ call tes(eid(sum(b,2)), b(:,1)) ! unnecessary { dg-warning "Creating array temporary" }
+ if (any(b(:,1) /= ay(:,1))) call abort
+
+contains
+
+ elemental function eid (x)
+ integer, intent(in) :: x
+ integer :: eid
+
+ eid = x
+ end function eid
+
+ function neid2 (x)
+ integer, intent(in) :: x(:,:)
+ integer :: neid2(size(x,1),size(x,2))
+
+ neid2 = x
+ end function neid2
+
+ function neid3 (x)
+ integer, intent(in) :: x(:,:,:)
+ integer :: neid3(size(x,1),size(x,2),size(x,3))
+
+ neid3 = x
+ end function neid3
+
+ elemental subroutine set (o, i)
+ integer, intent(in) :: i
+ integer, intent(out) :: o
+
+ o = i
+ end subroutine set
+
+ elemental subroutine tes (i, o)
+ integer, intent(in) :: i
+ integer, intent(out) :: o
+
+ o = i
+ end subroutine tes
+end
+! { dg-final { scan-tree-dump-times "struct array._integer\\(kind=4\\) atmp" 13 "original" } }
+! { dg-final { scan-tree-dump-times "struct array\[^\\n\]*atmp" 13 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_sum_" 0 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/inline_sum_2.f90 b/gcc/testsuite/gfortran.dg/inline_sum_2.f90
new file mode 100644
index 00000000000..0b7c60ad9e9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_sum_2.f90
@@ -0,0 +1,12 @@
+! { dg-do run }
+
+! PR fortran/43829
+! Scalarization of reductions.
+! Test that inlined sum is correct.
+
+! We can't check for the absence of temporary arrays generated on the run-time
+! testcase, as inlining is disabled at -Os, so it will fail in that case.
+! Thus, the test is splitted into two independant files, one checking for
+! the absence of temporaries, and one (this one) checking that the code
+! generated remains valid at all optimization levels.
+include 'inline_sum_1.f90'
diff --git a/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_1.f90 b/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_1.f90
new file mode 100644
index 00000000000..39984683d4b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_1.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+
+ integer, parameter :: nx = 3, ny = 4
+
+ integer :: i, j, too_big
+
+ integer, parameter, dimension(nx,ny) :: p = &
+ reshape((/ (i*i, i=1,size(p)) /), shape(p))
+
+ integer, dimension(nx,ny) :: a
+
+ integer, dimension(:), allocatable :: b
+
+ allocate(b(nx))
+
+ a = p
+ too_big = ny + 1
+
+ b = sum(a(:,1:too_big),2)
+ end
+! { dg-shouldfail "outside of expected range" }
diff --git a/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_2.f90 b/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_2.f90
new file mode 100644
index 00000000000..8de80fdc9f6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_sum_bounds_check_2.f90
@@ -0,0 +1,23 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+
+ integer, parameter :: nx = 3, ny = 4
+
+ integer :: i, j, too_big
+
+ integer, parameter, dimension(nx,ny) :: p = &
+ reshape((/ (i*i, i=1,size(p)) /), shape(p))
+
+ integer, dimension(nx,ny) :: a
+
+ integer, dimension(:), allocatable :: c
+
+
+ allocate(c(ny))
+
+ a = p
+ too_big = nx + 1
+
+ c = sum(a(1:too_big,:),2)
+ end
+! { dg-shouldfail "outside of expected range" }
diff --git a/gcc/testsuite/gfortran.dg/module_parameter_array_refs_2.f90 b/gcc/testsuite/gfortran.dg/module_parameter_array_refs_2.f90
new file mode 100644
index 00000000000..385761d1d17
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_parameter_array_refs_2.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-O" }
+! { dg-final { scan-assembler-not "i_am_optimized_away" } }
+!
+! PR fortran/50960
+!
+! PARAMETER arrays and derived types exists as static variables.
+! Check that the their read-only nature is taken into account
+! when optimizations are done.
+!
+
+module m
+ integer, parameter :: PARA(*) = [1,2,3,4,5,6,7,8,9,10]
+end module m
+
+subroutine test()
+use m
+integer :: i
+i = 1
+if (para(i) /= 1) call i_am_optimized_away()
+end
+
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/open_dev_null.f90 b/gcc/testsuite/gfortran.dg/open_dev_null.f90
deleted file mode 100644
index 00394cb55a6..00000000000
--- a/gcc/testsuite/gfortran.dg/open_dev_null.f90
+++ /dev/null
@@ -1,9 +0,0 @@
-! { dg-do run }
-! PR45723 opening /dev/null for appending writes fails
-logical :: thefile
-inquire(file="/dev/null",exist=thefile)
-if (thefile) then
- open(unit=7,file="/dev/null",position="append")
- close(7)
-endif
-end
diff --git a/gcc/testsuite/gfortran.dg/pr50769.f90 b/gcc/testsuite/gfortran.dg/pr50769.f90
new file mode 100644
index 00000000000..3a98543e3a6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr50769.f90
@@ -0,0 +1,30 @@
+! { dg-do compile }
+! { dg-options "-O2 -ftree-tail-merge -fno-delete-null-pointer-checks -fno-guess-branch-probability" }
+!
+! based on testsuite/gfortran.dg/alloc_comp_optional_1.f90,
+! which was contributed by David Kinniburgh <davidkinniburgh@yahoo.co.uk>
+!
+program test_iso
+ type ivs
+ character(LEN=1), dimension(:), allocatable :: chars
+ end type ivs
+ type(ivs) :: v_str
+ integer :: i
+ call foo(v_str, i)
+ if (v_str%chars(1) .ne. "a") call abort
+ if (i .ne. 0) call abort
+ call foo(flag = i)
+ if (i .ne. 1) call abort
+contains
+ subroutine foo (arg, flag)
+ type(ivs), optional, intent(out) :: arg
+ integer :: flag
+ if (present(arg)) then
+ arg = ivs([(char(i+96), i = 1,10)])
+ flag = 0
+ else
+ flag = 1
+ end if
+ end subroutine
+end
+
diff --git a/gcc/testsuite/gfortran.dg/quad_2.f90 b/gcc/testsuite/gfortran.dg/quad_2.f90
new file mode 100644
index 00000000000..c1334db9cd4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/quad_2.f90
@@ -0,0 +1,63 @@
+! { dg-do run }
+!
+! This test checks whether the largest possible
+! floating-point number works.
+!
+! This is a run-time check. Depending on the architecture,
+! this tests REAL(8), REAL(10) or REAL(16) and REAL(16)
+! might be a hardware or libquadmath 128bit number.
+!
+program test_qp
+ use iso_fortran_env, only: real_kinds
+ implicit none
+ integer, parameter :: QP = real_kinds(ubound(real_kinds,dim=1))
+ real(qp) :: fp1, fp2, fp3, fp4
+ character(len=80) :: str1, str2, str3, str4
+ fp1 = 1
+ fp2 = sqrt (2.0_qp)
+ write (str1,*) fp1
+ write (str2,'(g0)') fp1
+ write (str3,*) fp2
+ write (str4,'(g0)') fp2
+
+! print '(3a)', '>',trim(str1),'<'
+! print '(3a)', '>',trim(str2),'<'
+! print '(3a)', '>',trim(str3),'<'
+! print '(3a)', '>',trim(str4),'<'
+
+ read (str1, *) fp3
+ if (fp1 /= fp3) call abort()
+ read (str2, *) fp3
+ if (fp1 /= fp3) call abort()
+ read (str3, *) fp4
+ if (fp2 /= fp4) call abort()
+ read (str4, *) fp4
+ if (fp2 /= fp4) call abort()
+
+ select case (qp)
+ case (8)
+ if (str1 /= " 1.0000000000000000") call abort()
+ if (str2 /= "1.0000000000000000") call abort()
+ if (str3 /= " 1.4142135623730951") call abort()
+ if (str4 /= "1.4142135623730951") call abort()
+ case (10)
+ if (str1 /= " 1.00000000000000000000") call abort()
+ if (str2 /= "1.00000000000000000000") call abort()
+ if (str3 /= " 1.41421356237309504876") call abort()
+ if (str4 /= "1.41421356237309504876") call abort()
+ case (16)
+ if (str1 /= " 1.00000000000000000000000000000000000") call abort()
+ if (str2 /= "1.00000000000000000000000000000000000") call abort()
+ if (str3 /= " 1.41421356237309504880168872420969798") call abort()
+ if (str4 /= "1.41421356237309504880168872420969798") call abort()
+ block
+ real(qp), volatile :: fp2a
+ fp2a = 2.0_qp
+ fp2a = sqrt (fp2a)
+ if (abs (fp2a - fp2) > sqrt(2.0_qp)-nearest(sqrt(2.0_qp),-1.0_qp)) call abort()
+ end block
+ case default
+ call abort()
+ end select
+
+end program test_qp
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_21.f03 b/gcc/testsuite/gfortran.dg/typebound_call_21.f03
new file mode 100644
index 00000000000..5f7d67283c4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_21.f03
@@ -0,0 +1,39 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 50919: [OOP] Don't use vtable for NON_OVERRIDABLE TBP
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module m
+
+type t
+contains
+ procedure, nopass, NON_OVERRIDABLE :: testsub
+ procedure, nopass, NON_OVERRIDABLE :: testfun
+end type t
+
+contains
+
+ subroutine testsub()
+ print *, "t's test"
+ end subroutine
+
+ integer function testfun()
+ testfun = 1
+ end function
+
+end module m
+
+
+ use m
+ class(t), allocatable :: x
+ allocate(x)
+ call x%testsub()
+ print *,x%testfun()
+end
+
+! { dg-final { scan-tree-dump-times "_vptr->" 0 "original" } }
+
+! { dg-final { cleanup-modules "m" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gnat.dg/loop_optimization10.adb b/gcc/testsuite/gnat.dg/loop_optimization10.adb
new file mode 100644
index 00000000000..3b8e8949e1a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization10.adb
@@ -0,0 +1,18 @@
+-- { dg-do compile }
+-- { dg-options "-O3" }
+-- { dg-options "-O3 -msse2" { target i?86-*-* x86_64-*-* } }
+
+package body Loop_Optimization10 is
+
+ function F (Low, High : in Array_Real_Type) return Array_Limit_Type is
+ Result : Array_Limit_Type;
+ begin
+ for I in Result'Range
+ loop
+ Result (I) := F (Low (I), High (I));
+ end loop;
+ return Result;
+ end;
+
+end Loop_Optimization10;
+
diff --git a/gcc/testsuite/gnat.dg/loop_optimization10.ads b/gcc/testsuite/gnat.dg/loop_optimization10.ads
new file mode 100644
index 00000000000..2f4872d1b5a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization10.ads
@@ -0,0 +1,11 @@
+with Loop_Optimization10_Pkg; use Loop_Optimization10_Pkg;
+package Loop_Optimization10 is
+
+ type Dual_Axis_Type is (One, Two);
+
+ type Array_Real_Type is array (Dual_Axis_Type) of Float;
+ type Array_Limit_Type is array (Dual_Axis_Type) of Limit_Type;
+
+ function F (Low, High : in Array_Real_Type) return Array_Limit_Type;
+
+end Loop_Optimization10;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization10_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization10_pkg.ads
new file mode 100644
index 00000000000..6fce4df8a3e
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization10_pkg.ads
@@ -0,0 +1,12 @@
+package Loop_Optimization10_Pkg is
+
+ pragma Pure (Loop_Optimization10_Pkg);
+
+ type Limit_Type is record
+ Low : Float;
+ High : Float;
+ end record;
+
+ function F (Low, High : in Float) return Limit_Type;
+
+end Loop_Optimization10_Pkg;
diff --git a/gcc/testsuite/gnat.dg/specs/private1-sub.ads b/gcc/testsuite/gnat.dg/specs/private1-sub.ads
new file mode 100644
index 00000000000..0dcbbd0569c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/private1-sub.ads
@@ -0,0 +1,13 @@
+-- { dg-do compile }
+-- { dg-options "-gnatct" }
+
+package Private1.Sub is
+
+ package Nested is
+ type T is limited private;
+ function "=" (X, Y : T) return Boolean;
+ private
+ type T is new Private1.T;
+ end Nested;
+
+end Private1.Sub;
diff --git a/gcc/testsuite/gnat.dg/specs/private1.ads b/gcc/testsuite/gnat.dg/specs/private1.ads
new file mode 100644
index 00000000000..4ef06004352
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/private1.ads
@@ -0,0 +1,5 @@
+package Private1 is
+ type T is private;
+private
+ type T is new Boolean;
+end Private1;
diff --git a/gcc/testsuite/go.test/test/closedchan.go b/gcc/testsuite/go.test/test/closedchan.go
index 95314b3345e..c2bbec59d95 100644
--- a/gcc/testsuite/go.test/test/closedchan.go
+++ b/gcc/testsuite/go.test/test/closedchan.go
@@ -11,6 +11,10 @@
package main
+import "os"
+
+var failed bool
+
type Chan interface {
Send(int)
Nbsend(int) bool
@@ -225,19 +229,23 @@ func test1(c Chan) {
// recv a close signal (a zero value)
if x := c.Recv(); x != 0 {
println("test1: recv on closed:", x, c.Impl())
+ failed = true
}
if x, ok := c.Recv2(); x != 0 || ok {
println("test1: recv2 on closed:", x, ok, c.Impl())
+ failed = true
}
// should work with select: received a value without blocking, so selected == true.
x, selected := c.Nbrecv()
if x != 0 || !selected {
println("test1: recv on closed nb:", x, selected, c.Impl())
+ failed = true
}
x, ok, selected := c.Nbrecv2()
if x != 0 || ok || !selected {
println("test1: recv2 on closed nb:", x, ok, selected, c.Impl())
+ failed = true
}
}
@@ -247,12 +255,14 @@ func test1(c Chan) {
// the value should have been discarded.
if x := c.Recv(); x != 0 {
println("test1: recv on closed got non-zero after send on closed:", x, c.Impl())
+ failed = true
}
// similarly Send.
shouldPanic(func() { c.Send(2) })
if x := c.Recv(); x != 0 {
println("test1: recv on closed got non-zero after send on closed:", x, c.Impl())
+ failed = true
}
}
@@ -260,6 +270,7 @@ func testasync1(c Chan) {
// should be able to get the last value via Recv
if x := c.Recv(); x != 1 {
println("testasync1: Recv did not get 1:", x, c.Impl())
+ failed = true
}
test1(c)
@@ -269,6 +280,7 @@ func testasync2(c Chan) {
// should be able to get the last value via Recv2
if x, ok := c.Recv2(); x != 1 || !ok {
println("testasync1: Recv did not get 1, true:", x, ok, c.Impl())
+ failed = true
}
test1(c)
@@ -278,6 +290,7 @@ func testasync3(c Chan) {
// should be able to get the last value via Nbrecv
if x, selected := c.Nbrecv(); x != 1 || !selected {
println("testasync2: Nbrecv did not get 1, true:", x, selected, c.Impl())
+ failed = true
}
test1(c)
@@ -287,6 +300,7 @@ func testasync4(c Chan) {
// should be able to get the last value via Nbrecv2
if x, ok, selected := c.Nbrecv2(); x != 1 || !ok || !selected {
println("testasync2: Nbrecv did not get 1, true, true:", x, ok, selected, c.Impl())
+ failed = true
}
test1(c)
}
@@ -327,4 +341,19 @@ func main() {
testclosed(mk(closedasync()))
}
}
+
+ var ch chan int
+ shouldPanic(func() {
+ close(ch)
+ })
+
+ ch = make(chan int)
+ close(ch)
+ shouldPanic(func() {
+ close(ch)
+ })
+
+ if failed {
+ os.Exit(1)
+ }
}
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index caa057f0746..d0b679d7ad6 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -73,6 +73,13 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
}
set LTO_TORTURE_OPTIONS ""
+
+# Some torture-options cause intermediate code output, unusable for
+# testing using e.g. scan-assembler. In this variable are the options
+# how to force it, when needed.
+global gcc_force_conventional_output
+set gcc_force_conventional_output ""
+
if [check_effective_target_lto] {
# When having plugin test both slim and fat LTO and plugin/nonplugin
# path.
@@ -81,6 +88,7 @@ if [check_effective_target_lto] {
{ -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
{ -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
]
+ set gcc_force_conventional_output "-ffat-lto-objects"
} else {
set LTO_TORTURE_OPTIONS [list \
{ -O2 -flto -flto-partition=none } \
@@ -156,6 +164,19 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
}
}
+ # Let { dg-final { action } } force options as returned by an
+ # optional proc ${action}_required_options.
+ upvar 2 dg-final-code finalcode
+ foreach x [split $finalcode "\n"] {
+ set finalcmd [lindex $x 0]
+ if { [info procs ${finalcmd}_required_options] != "" } {
+ set req [${finalcmd}_required_options]
+ if { $req != "" } {
+ lappend extra_tool_flags $req
+ }
+ }
+ }
+
if { $extra_tool_flags != "" } {
lappend options "additional_flags=$extra_tool_flags"
}
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 6574ab13a35..3ba22f9dad7 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -85,6 +85,11 @@ proc scan-assembler { args } {
dg-scan "scan-assembler" 1 $testcase $output_file $args
}
+proc scan-assembler_required_options { args } {
+ global gcc_force_conventional_output
+ return $gcc_force_conventional_output
+}
+
# Check that a pattern is not present in the .s file produced by the
# compiler. See dg-scan for details.
@@ -96,6 +101,11 @@ proc scan-assembler-not { args } {
dg-scan "scan-assembler-not" 0 $testcase $output_file $args
}
+proc scan-assembler-not_required_options { args } {
+ global gcc_force_conventional_output
+ return $gcc_force_conventional_output
+}
+
# Return the scan for the assembly for hidden visibility.
proc hidden-scan-for { symbol } {
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f19c3c566c6..fd6b2691a97 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -655,6 +655,28 @@ proc check_effective_target_tls_runtime {} {
} [add_options_for_tls ""]]
}
+# Return 1 if atomic compare-and-swap is supported on 'int'
+
+proc check_effective_target_cas_char {} {
+ return [check_no_compiler_messages cas_char assembly {
+ #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+ #error unsupported
+ #endif
+ } ""]
+}
+
+proc check_effective_target_cas_int {} {
+ return [check_no_compiler_messages cas_int assembly {
+ #if __INT_MAX__ == 0x7fff && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+ /* ok */
+ #elif __INT_MAX__ == 0x7fffffff && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+ /* ok */
+ #else
+ #error unsupported
+ #endif
+ } ""]
+}
+
# Return 1 if -ffunction-sections is supported, 0 otherwise.
proc check_effective_target_function_sections {} {
@@ -2449,6 +2471,24 @@ proc check_effective_target_ultrasparc_hw { } {
} "-mcpu=ultrasparc"]
}
+# Return 1 if the test environment supports executing UltraSPARC VIS2
+# instructions. We check this by attempting: "bmask %g0, %g0, %g0"
+
+proc check_effective_target_ultrasparc_vis2_hw { } {
+ return [check_runtime ultrasparc_hw {
+ int main() { __asm__(".word 0x81b00320"); return 0; }
+ } "-mcpu=ultrasparc3"]
+}
+
+# Return 1 if the test environment supports executing UltraSPARC VIS3
+# instructions. We check this by attempting: "addxc %g0, %g0, %g0"
+
+proc check_effective_target_ultrasparc_vis3_hw { } {
+ return [check_runtime ultrasparc_hw {
+ int main() { __asm__(".word 0x81b00220"); return 0; }
+ } "-mcpu=niagara3"]
+}
+
# Return 1 if the target supports hardware vector shift operation.
proc check_effective_target_vect_shift { } {
@@ -3499,6 +3539,28 @@ proc check_effective_target_section_anchors { } {
return $et_section_anchors_saved
}
+# Return 1 if the target supports atomic operations on "int_128" values.
+
+proc check_effective_target_sync_int_128 { } {
+ if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
+ && ![is-effective-target ia32] } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+# Return 1 if the target supports atomic operations on "long long".
+
+proc check_effective_target_sync_long_long { } {
+ if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
+ && ![is-effective-target ia32] } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
# Return 1 if the target supports atomic operations on "int" and "long".
proc check_effective_target_sync_int_long { } {
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 7cb4a3dfb49..d81cc670bf4 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1488,8 +1488,8 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
break;
lab = gimple_label_label (stmt);
- /* Do not remove user labels. */
- if (!DECL_ARTIFICIAL (lab))
+ /* Do not remove user forced labels or for -O0 any user labels. */
+ if (!DECL_ARTIFICIAL (lab) && (!optimize || FORCED_LABEL (lab)))
return false;
}
@@ -1735,6 +1735,15 @@ gimple_merge_blocks (basic_block a, basic_block b)
gimple_stmt_iterator dest_gsi = gsi_start_bb (a);
gsi_insert_before (&dest_gsi, stmt, GSI_NEW_STMT);
}
+ /* Other user labels keep around in a form of a debug stmt. */
+ else if (!DECL_ARTIFICIAL (label) && MAY_HAVE_DEBUG_STMTS)
+ {
+ gimple dbg = gimple_build_debug_bind (label,
+ integer_zero_node,
+ stmt);
+ gimple_debug_bind_reset_value (dbg);
+ gsi_insert_before (&gsi, dbg, GSI_SAME_STMT);
+ }
lp_nr = EH_LANDING_PAD_NR (label);
if (lp_nr)
@@ -5282,6 +5291,12 @@ gimple_duplicate_bb (basic_block bb)
if (gimple_code (stmt) == GIMPLE_LABEL)
continue;
+ /* Don't duplicate label debug stmts. */
+ if (gimple_debug_bind_p (stmt)
+ && TREE_CODE (gimple_debug_bind_get_var (stmt))
+ == LABEL_DECL)
+ continue;
+
/* Create a new copy of STMT and duplicate STMT's virtual
operands. */
copy = gimple_copy (stmt);
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 4e0de052c15..89d123d65e9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1351,13 +1351,11 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b,
return refs_may_alias_p (addr_a, addr_b);
}
-static void compute_self_dependence (struct data_dependence_relation *);
-
/* Initialize a data dependence relation between data accesses A and
B. NB_LOOPS is the number of loops surrounding the references: the
size of the classic distance/direction vectors. */
-static struct data_dependence_relation *
+struct data_dependence_relation *
initialize_data_dependence_relation (struct data_reference *a,
struct data_reference *b,
VEC (loop_p, heap) *loop_nest)
@@ -4121,7 +4119,7 @@ compute_affine_dependence (struct data_dependence_relation *ddr,
/* This computes the dependence relation for the same data
reference into DDR. */
-static void
+void
compute_self_dependence (struct data_dependence_relation *ddr)
{
unsigned int i;
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index c55bd48a81e..0f12962fc93 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -1,5 +1,5 @@
/* Data references and dependences detectors.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Sebastian Pop <pop@cri.ensmp.fr>
@@ -423,6 +423,9 @@ extern bool graphite_find_data_references_in_stmt (loop_p, loop_p, gimple,
VEC (data_reference_p, heap) **);
struct data_reference *create_data_ref (loop_p, loop_p, tree, gimple, bool);
extern bool find_loop_nest (struct loop *, VEC (loop_p, heap) **);
+extern struct data_dependence_relation *initialize_data_dependence_relation
+ (struct data_reference *, struct data_reference *, VEC (loop_p, heap) *);
+extern void compute_self_dependence (struct data_dependence_relation *);
extern void compute_all_dependences (VEC (data_reference_p, heap) *,
VEC (ddr_p, heap) **, VEC (loop_p, heap) *,
bool);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index a239216cf2d..0ff8ee83d40 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2497,6 +2497,199 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
return true;
}
+/* Check whether a non-affine read in stmt is suitable for gather load
+ and if so, return a builtin decl for that operation. */
+
+tree
+vect_check_gather (gimple stmt, loop_vec_info loop_vinfo, tree *basep,
+ tree *offp, int *scalep)
+{
+ HOST_WIDE_INT scale = 1, pbitpos, pbitsize;
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
+ tree offtype = NULL_TREE;
+ tree decl, base, off;
+ enum machine_mode pmode;
+ int punsignedp, pvolatilep;
+
+ /* The gather builtins need address of the form
+ loop_invariant + vector * {1, 2, 4, 8}
+ or
+ loop_invariant + sign_extend (vector) * { 1, 2, 4, 8 }.
+ Unfortunately DR_BASE_ADDRESS/DR_OFFSET can be a mixture
+ of loop invariants/SSA_NAMEs defined in the loop, with casts,
+ multiplications and additions in it. To get a vector, we need
+ a single SSA_NAME that will be defined in the loop and will
+ contain everything that is not loop invariant and that can be
+ vectorized. The following code attempts to find such a preexistng
+ SSA_NAME OFF and put the loop invariants into a tree BASE
+ that can be gimplified before the loop. */
+ base = get_inner_reference (DR_REF (dr), &pbitsize, &pbitpos, &off,
+ &pmode, &punsignedp, &pvolatilep, false);
+ gcc_assert (base != NULL_TREE && (pbitpos % BITS_PER_UNIT) == 0);
+
+ if (TREE_CODE (base) == MEM_REF)
+ {
+ if (!integer_zerop (TREE_OPERAND (base, 1)))
+ {
+ if (off == NULL_TREE)
+ {
+ double_int moff = mem_ref_offset (base);
+ off = double_int_to_tree (sizetype, moff);
+ }
+ else
+ off = size_binop (PLUS_EXPR, off,
+ fold_convert (sizetype, TREE_OPERAND (base, 1)));
+ }
+ base = TREE_OPERAND (base, 0);
+ }
+ else
+ base = build_fold_addr_expr (base);
+
+ if (off == NULL_TREE)
+ off = size_zero_node;
+
+ /* If base is not loop invariant, either off is 0, then we start with just
+ the constant offset in the loop invariant BASE and continue with base
+ as OFF, otherwise give up.
+ We could handle that case by gimplifying the addition of base + off
+ into some SSA_NAME and use that as off, but for now punt. */
+ if (!expr_invariant_in_loop_p (loop, base))
+ {
+ if (!integer_zerop (off))
+ return NULL_TREE;
+ off = base;
+ base = size_int (pbitpos / BITS_PER_UNIT);
+ }
+ /* Otherwise put base + constant offset into the loop invariant BASE
+ and continue with OFF. */
+ else
+ {
+ base = fold_convert (sizetype, base);
+ base = size_binop (PLUS_EXPR, base, size_int (pbitpos / BITS_PER_UNIT));
+ }
+
+ /* OFF at this point may be either a SSA_NAME or some tree expression
+ from get_inner_reference. Try to peel off loop invariants from it
+ into BASE as long as possible. */
+ STRIP_NOPS (off);
+ while (offtype == NULL_TREE)
+ {
+ enum tree_code code;
+ tree op0, op1, add = NULL_TREE;
+
+ if (TREE_CODE (off) == SSA_NAME)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (off);
+
+ if (expr_invariant_in_loop_p (loop, off))
+ return NULL_TREE;
+
+ if (gimple_code (def_stmt) != GIMPLE_ASSIGN)
+ break;
+
+ op0 = gimple_assign_rhs1 (def_stmt);
+ code = gimple_assign_rhs_code (def_stmt);
+ op1 = gimple_assign_rhs2 (def_stmt);
+ }
+ else
+ {
+ if (get_gimple_rhs_class (TREE_CODE (off)) == GIMPLE_TERNARY_RHS)
+ return NULL_TREE;
+ code = TREE_CODE (off);
+ extract_ops_from_tree (off, &code, &op0, &op1);
+ }
+ switch (code)
+ {
+ case POINTER_PLUS_EXPR:
+ case PLUS_EXPR:
+ if (expr_invariant_in_loop_p (loop, op0))
+ {
+ add = op0;
+ off = op1;
+ do_add:
+ add = fold_convert (sizetype, add);
+ if (scale != 1)
+ add = size_binop (MULT_EXPR, add, size_int (scale));
+ base = size_binop (PLUS_EXPR, base, add);
+ continue;
+ }
+ if (expr_invariant_in_loop_p (loop, op1))
+ {
+ add = op1;
+ off = op0;
+ goto do_add;
+ }
+ break;
+ case MINUS_EXPR:
+ if (expr_invariant_in_loop_p (loop, op1))
+ {
+ add = fold_convert (sizetype, op1);
+ add = size_binop (MINUS_EXPR, size_zero_node, add);
+ off = op0;
+ goto do_add;
+ }
+ break;
+ case MULT_EXPR:
+ if (scale == 1 && host_integerp (op1, 0))
+ {
+ scale = tree_low_cst (op1, 0);
+ off = op0;
+ continue;
+ }
+ break;
+ case SSA_NAME:
+ off = op0;
+ continue;
+ CASE_CONVERT:
+ if (!POINTER_TYPE_P (TREE_TYPE (op0))
+ && !INTEGRAL_TYPE_P (TREE_TYPE (op0)))
+ break;
+ if (TYPE_PRECISION (TREE_TYPE (op0))
+ == TYPE_PRECISION (TREE_TYPE (off)))
+ {
+ off = op0;
+ continue;
+ }
+ if (TYPE_PRECISION (TREE_TYPE (op0))
+ < TYPE_PRECISION (TREE_TYPE (off)))
+ {
+ off = op0;
+ offtype = TREE_TYPE (off);
+ STRIP_NOPS (off);
+ continue;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+
+ /* If at the end OFF still isn't a SSA_NAME or isn't
+ defined in the loop, punt. */
+ if (TREE_CODE (off) != SSA_NAME
+ || expr_invariant_in_loop_p (loop, off))
+ return NULL_TREE;
+
+ if (offtype == NULL_TREE)
+ offtype = TREE_TYPE (off);
+
+ decl = targetm.vectorize.builtin_gather (STMT_VINFO_VECTYPE (stmt_info),
+ offtype, scale);
+ if (decl == NULL_TREE)
+ return NULL_TREE;
+
+ if (basep)
+ *basep = base;
+ if (offp)
+ *offp = off;
+ if (scalep)
+ *scalep = scale;
+ return decl;
+}
+
/* Function vect_analyze_data_refs.
@@ -2573,6 +2766,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
gimple stmt;
stmt_vec_info stmt_info;
tree base, offset, init;
+ bool gather = false;
int vf;
if (!dr || !DR_REF (dr))
@@ -2594,22 +2788,51 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
/* Check that analysis of the data-ref succeeded. */
if (!DR_BASE_ADDRESS (dr) || !DR_OFFSET (dr) || !DR_INIT (dr)
- || !DR_STEP (dr))
+ || !DR_STEP (dr))
{
- if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
- {
- fprintf (vect_dump, "not vectorized: data ref analysis failed ");
- print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
- }
+ /* If target supports vector gather loads, see if they can't
+ be used. */
+ if (loop_vinfo
+ && DR_IS_READ (dr)
+ && !TREE_THIS_VOLATILE (DR_REF (dr))
+ && targetm.vectorize.builtin_gather != NULL
+ && !nested_in_vect_loop_p (loop, stmt))
+ {
+ struct data_reference *newdr
+ = create_data_ref (NULL, loop_containing_stmt (stmt),
+ DR_REF (dr), stmt, true);
+ gcc_assert (newdr != NULL && DR_REF (newdr));
+ if (DR_BASE_ADDRESS (newdr)
+ && DR_OFFSET (newdr)
+ && DR_INIT (newdr)
+ && DR_STEP (newdr)
+ && integer_zerop (DR_STEP (newdr)))
+ {
+ dr = newdr;
+ gather = true;
+ }
+ else
+ free_data_ref (newdr);
+ }
- if (bb_vinfo)
- {
- STMT_VINFO_VECTORIZABLE (stmt_info) = false;
- stop_bb_analysis = true;
- continue;
- }
+ if (!gather)
+ {
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+ {
+ fprintf (vect_dump, "not vectorized: data ref analysis "
+ "failed ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
- return false;
+ if (bb_vinfo)
+ {
+ STMT_VINFO_VECTORIZABLE (stmt_info) = false;
+ stop_bb_analysis = true;
+ continue;
+ }
+
+ return false;
+ }
}
if (TREE_CODE (DR_BASE_ADDRESS (dr)) == INTEGER_CST)
@@ -2625,7 +2848,9 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
continue;
}
- return false;
+ if (gather)
+ free_data_ref (dr);
+ return false;
}
if (TREE_THIS_VOLATILE (DR_REF (dr)))
@@ -2666,6 +2891,8 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
continue;
}
+ if (gather)
+ free_data_ref (dr);
return false;
}
@@ -2791,6 +3018,8 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
continue;
}
+ if (gather)
+ free_data_ref (dr);
return false;
}
@@ -2818,8 +3047,13 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
stop_bb_analysis = true;
continue;
}
- else
- return false;
+
+ if (gather)
+ {
+ STMT_VINFO_DATA_REF (stmt_info) = NULL;
+ free_data_ref (dr);
+ }
+ return false;
}
/* Adjust the minimal vectorization factor according to the
@@ -2827,6 +3061,86 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
vf = TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info));
if (vf > *min_vf)
*min_vf = vf;
+
+ if (gather)
+ {
+ unsigned int j, k, n;
+ struct data_reference *olddr
+ = VEC_index (data_reference_p, datarefs, i);
+ VEC (ddr_p, heap) *ddrs = LOOP_VINFO_DDRS (loop_vinfo);
+ struct data_dependence_relation *ddr, *newddr;
+ bool bad = false;
+ tree off;
+ VEC (loop_p, heap) *nest = LOOP_VINFO_LOOP_NEST (loop_vinfo);
+
+ if (!vect_check_gather (stmt, loop_vinfo, NULL, &off, NULL)
+ || get_vectype_for_scalar_type (TREE_TYPE (off)) == NULL_TREE)
+ {
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+ {
+ fprintf (vect_dump,
+ "not vectorized: not suitable for gather ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+ return false;
+ }
+
+ n = VEC_length (data_reference_p, datarefs) - 1;
+ for (j = 0, k = i - 1; j < i; j++)
+ {
+ ddr = VEC_index (ddr_p, ddrs, k);
+ gcc_assert (DDR_B (ddr) == olddr);
+ newddr = initialize_data_dependence_relation (DDR_A (ddr), dr,
+ nest);
+ VEC_replace (ddr_p, ddrs, k, newddr);
+ free_dependence_relation (ddr);
+ if (!bad
+ && DR_IS_WRITE (DDR_A (newddr))
+ && DDR_ARE_DEPENDENT (newddr) != chrec_known)
+ bad = true;
+ k += --n;
+ }
+
+ k++;
+ n = k + VEC_length (data_reference_p, datarefs) - i - 1;
+ for (; k < n; k++)
+ {
+ ddr = VEC_index (ddr_p, ddrs, k);
+ gcc_assert (DDR_A (ddr) == olddr);
+ newddr = initialize_data_dependence_relation (dr, DDR_B (ddr),
+ nest);
+ VEC_replace (ddr_p, ddrs, k, newddr);
+ free_dependence_relation (ddr);
+ if (!bad
+ && DR_IS_WRITE (DDR_B (newddr))
+ && DDR_ARE_DEPENDENT (newddr) != chrec_known)
+ bad = true;
+ }
+
+ k = VEC_length (ddr_p, ddrs)
+ - VEC_length (data_reference_p, datarefs) + i;
+ ddr = VEC_index (ddr_p, ddrs, k);
+ gcc_assert (DDR_A (ddr) == olddr && DDR_B (ddr) == olddr);
+ newddr = initialize_data_dependence_relation (dr, dr, nest);
+ compute_self_dependence (newddr);
+ VEC_replace (ddr_p, ddrs, k, newddr);
+ free_dependence_relation (ddr);
+ VEC_replace (data_reference_p, datarefs, i, dr);
+
+ if (bad)
+ {
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+ {
+ fprintf (vect_dump,
+ "not vectorized: data dependence conflict"
+ " prevents gather");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+ return false;
+ }
+
+ STMT_VINFO_GATHER_P (stmt_info) = true;
+ }
}
return true;
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index a04099fc06a..a209b4bb14d 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3537,8 +3537,8 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
/* Get the loop-entry arguments. */
if (slp_node)
- vect_get_slp_defs (reduction_op, NULL_TREE, slp_node, &vec_initial_defs,
- NULL, reduc_index);
+ vect_get_vec_defs (reduction_op, NULL_TREE, stmt, &vec_initial_defs,
+ NULL, slp_node, reduc_index);
else
{
vec_initial_defs = VEC_alloc (tree, heap, 1);
@@ -4416,6 +4416,9 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
gcc_unreachable ();
}
+ if (code == COND_EXPR && slp_node)
+ return false;
+
scalar_dest = gimple_assign_lhs (stmt);
scalar_type = TREE_TYPE (scalar_dest);
if (!POINTER_TYPE_P (scalar_type) && !INTEGRAL_TYPE_P (scalar_type)
@@ -4502,7 +4505,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
if (code == COND_EXPR)
{
- if (!vectorizable_condition (stmt, gsi, NULL, ops[reduc_index], 0))
+ if (!vectorizable_condition (stmt, gsi, NULL, ops[reduc_index], 0, NULL))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "unsupported condition in reduction");
@@ -4774,7 +4777,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
gcc_assert (!slp_node);
vectorizable_condition (stmt, gsi, vec_stmt,
PHI_RESULT (VEC_index (gimple, phis, 0)),
- reduc_index);
+ reduc_index, NULL);
/* Multiple types are not supported for condition. */
break;
}
@@ -4792,8 +4795,8 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
}
if (slp_node)
- vect_get_slp_defs (op0, op1, slp_node, &vec_oprnds0, &vec_oprnds1,
- -1);
+ vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
+ slp_node, -1);
else
{
loop_vec_def0 = vect_get_vec_def_for_operand (ops[!reduc_index],
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 790f2dd0a75..6628a6fd66d 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -68,14 +68,14 @@ find_bb_location (basic_block bb)
static void
vect_free_slp_tree (slp_tree node)
{
+ int i;
+ slp_void_p child;
+
if (!node)
return;
- if (SLP_TREE_LEFT (node))
- vect_free_slp_tree (SLP_TREE_LEFT (node));
-
- if (SLP_TREE_RIGHT (node))
- vect_free_slp_tree (SLP_TREE_RIGHT (node));
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_free_slp_tree ((slp_tree)child);
VEC_free (gimple, heap, SLP_TREE_SCALAR_STMTS (node));
@@ -97,48 +97,142 @@ vect_free_slp_instance (slp_instance instance)
}
-/* Get the defs for the rhs of STMT (collect them in DEF_STMTS0/1), check that
- they are of a legal type and that they match the defs of the first stmt of
- the SLP group (stored in FIRST_STMT_...). */
+/* Create an SLP node for SCALAR_STMTS. */
+
+static slp_tree
+vect_create_new_slp_node (VEC (gimple, heap) *scalar_stmts)
+{
+ slp_tree node = XNEW (struct _slp_tree);
+ gimple stmt = VEC_index (gimple, scalar_stmts, 0);
+ unsigned int nops;
+
+ if (is_gimple_call (stmt))
+ nops = gimple_call_num_args (stmt);
+ else if (is_gimple_assign (stmt))
+ {
+ nops = gimple_num_ops (stmt) - 1;
+ if (gimple_assign_rhs_code (stmt) == COND_EXPR)
+ nops++;
+ }
+ else
+ return NULL;
+
+ SLP_TREE_SCALAR_STMTS (node) = scalar_stmts;
+ SLP_TREE_VEC_STMTS (node) = NULL;
+ SLP_TREE_CHILDREN (node) = VEC_alloc (slp_void_p, heap, nops);
+ SLP_TREE_OUTSIDE_OF_LOOP_COST (node) = 0;
+ SLP_TREE_INSIDE_OF_LOOP_COST (node) = 0;
+
+ return node;
+}
+
+
+/* Allocate operands info for NOPS operands, and GROUP_SIZE def-stmts for each
+ operand. */
+static VEC (slp_oprnd_info, heap) *
+vect_create_oprnd_info (int nops, int group_size)
+{
+ int i;
+ slp_oprnd_info oprnd_info;
+ VEC (slp_oprnd_info, heap) *oprnds_info;
+
+ oprnds_info = VEC_alloc (slp_oprnd_info, heap, nops);
+ for (i = 0; i < nops; i++)
+ {
+ oprnd_info = XNEW (struct _slp_oprnd_info);
+ oprnd_info->def_stmts = VEC_alloc (gimple, heap, group_size);
+ oprnd_info->first_dt = vect_uninitialized_def;
+ oprnd_info->first_def_type = NULL_TREE;
+ oprnd_info->first_const_oprnd = NULL_TREE;
+ oprnd_info->first_pattern = false;
+ VEC_quick_push (slp_oprnd_info, oprnds_info, oprnd_info);
+ }
+
+ return oprnds_info;
+}
+
+
+/* Free operands info. Free def-stmts in FREE_DEF_STMTS is true.
+ (FREE_DEF_STMTS is true when the SLP analysis fails, and false when it
+ succeds. In the later case we don't need the operands info that we used to
+ check isomorphism of the stmts, but we still need the def-stmts - they are
+ used as scalar stmts in SLP nodes. */
+static void
+vect_free_oprnd_info (VEC (slp_oprnd_info, heap) **oprnds_info,
+ bool free_def_stmts)
+{
+ int i;
+ slp_oprnd_info oprnd_info;
+
+ if (free_def_stmts)
+ FOR_EACH_VEC_ELT (slp_oprnd_info, *oprnds_info, i, oprnd_info)
+ VEC_free (gimple, heap, oprnd_info->def_stmts);
+
+ VEC_free (slp_oprnd_info, heap, *oprnds_info);
+}
+
+
+/* Get the defs for the rhs of STMT (collect them in OPRNDS_INFO), check that
+ they are of a valid type and that they match the defs of the first stmt of
+ the SLP group (stored in OPRNDS_INFO). */
static bool
vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
slp_tree slp_node, gimple stmt,
- VEC (gimple, heap) **def_stmts0,
- VEC (gimple, heap) **def_stmts1,
- enum vect_def_type *first_stmt_dt0,
- enum vect_def_type *first_stmt_dt1,
- tree *first_stmt_def0_type,
- tree *first_stmt_def1_type,
- tree *first_stmt_const_oprnd,
- int ncopies_for_cost,
- bool *pattern0, bool *pattern1)
+ int ncopies_for_cost, bool first,
+ VEC (slp_oprnd_info, heap) **oprnds_info)
{
tree oprnd;
unsigned int i, number_of_oprnds;
- tree def[2];
+ tree def, def_op0 = NULL_TREE;
gimple def_stmt;
- enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- stmt_vec_info stmt_info =
- vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0));
- enum gimple_rhs_class rhs_class;
+ enum vect_def_type dt = vect_uninitialized_def;
+ enum vect_def_type dt_op0 = vect_uninitialized_def;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ tree lhs = gimple_get_lhs (stmt);
struct loop *loop = NULL;
enum tree_code rhs_code;
bool different_types = false;
+ bool pattern = false;
+ slp_oprnd_info oprnd_info, oprnd0_info, oprnd1_info;
+ int op_idx = 1;
+ tree compare_rhs = NULL_TREE;
if (loop_vinfo)
loop = LOOP_VINFO_LOOP (loop_vinfo);
- rhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (stmt));
- number_of_oprnds = gimple_num_ops (stmt) - 1; /* RHS only */
+ if (is_gimple_call (stmt))
+ number_of_oprnds = gimple_call_num_args (stmt);
+ else if (is_gimple_assign (stmt))
+ {
+ number_of_oprnds = gimple_num_ops (stmt) - 1;
+ if (gimple_assign_rhs_code (stmt) == COND_EXPR)
+ number_of_oprnds++;
+ }
+ else
+ return false;
for (i = 0; i < number_of_oprnds; i++)
{
- oprnd = gimple_op (stmt, i + 1);
+ if (compare_rhs)
+ {
+ oprnd = compare_rhs;
+ compare_rhs = NULL_TREE;
+ }
+ else
+ oprnd = gimple_op (stmt, op_idx++);
+
+ oprnd_info = VEC_index (slp_oprnd_info, *oprnds_info, i);
+
+ if (COMPARISON_CLASS_P (oprnd))
+ {
+ compare_rhs = TREE_OPERAND (oprnd, 1);
+ oprnd = TREE_OPERAND (oprnd, 0);
+ }
- if (!vect_is_simple_use (oprnd, loop_vinfo, bb_vinfo, &def_stmt, &def[i],
- &dt[i])
- || (!def_stmt && dt[i] != vect_constant_def))
+ if (!vect_is_simple_use (oprnd, loop_vinfo, bb_vinfo, &def_stmt, &def,
+ &dt)
+ || (!def_stmt && dt != vect_constant_def))
{
if (vect_print_dump_info (REPORT_SLP))
{
@@ -159,29 +253,23 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
&& !STMT_VINFO_RELEVANT (vinfo_for_stmt (def_stmt))
&& !STMT_VINFO_LIVE_P (vinfo_for_stmt (def_stmt)))
{
- if (!*first_stmt_dt0)
- *pattern0 = true;
- else
- {
- if (i == 1 && !*first_stmt_dt1)
- *pattern1 = true;
- else if ((i == 0 && !*pattern0) || (i == 1 && !*pattern1))
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "Build SLP failed: some of the stmts"
- " are in a pattern, and others are not ");
- print_generic_expr (vect_dump, oprnd, TDF_SLIM);
- }
+ pattern = true;
+ if (!first && !oprnd_info->first_pattern)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "Build SLP failed: some of the stmts"
+ " are in a pattern, and others are not ");
+ print_generic_expr (vect_dump, oprnd, TDF_SLIM);
+ }
- return false;
- }
+ return false;
}
def_stmt = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt));
- dt[i] = STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt));
+ dt = STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt));
- if (*dt == vect_unknown_def_type)
+ if (dt == vect_unknown_def_type)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "Unsupported pattern.");
@@ -191,11 +279,11 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
switch (gimple_code (def_stmt))
{
case GIMPLE_PHI:
- def[i] = gimple_phi_result (def_stmt);
+ def = gimple_phi_result (def_stmt);
break;
case GIMPLE_ASSIGN:
- def[i] = gimple_assign_lhs (def_stmt);
+ def = gimple_assign_lhs (def_stmt);
break;
default:
@@ -205,125 +293,125 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
}
- if (!*first_stmt_dt0)
+ if (first)
{
- /* op0 of the first stmt of the group - store its info. */
- *first_stmt_dt0 = dt[i];
- if (def[i])
- *first_stmt_def0_type = TREE_TYPE (def[i]);
+ oprnd_info->first_dt = dt;
+ oprnd_info->first_pattern = pattern;
+ if (def)
+ {
+ oprnd_info->first_def_type = TREE_TYPE (def);
+ oprnd_info->first_const_oprnd = NULL_TREE;
+ }
else
- *first_stmt_const_oprnd = oprnd;
+ {
+ oprnd_info->first_def_type = NULL_TREE;
+ oprnd_info->first_const_oprnd = oprnd;
+ }
- /* Analyze costs (for the first stmt of the group only). */
- if (rhs_class != GIMPLE_SINGLE_RHS)
- /* Not memory operation (we don't call this functions for loads). */
- vect_model_simple_cost (stmt_info, ncopies_for_cost, dt, slp_node);
- else
- /* Store. */
- vect_model_store_cost (stmt_info, ncopies_for_cost, false,
- dt[0], slp_node);
+ if (i == 0)
+ {
+ def_op0 = def;
+ dt_op0 = dt;
+ /* Analyze costs (for the first stmt of the group only). */
+ if (REFERENCE_CLASS_P (lhs))
+ /* Store. */
+ vect_model_store_cost (stmt_info, ncopies_for_cost, false,
+ dt, slp_node);
+ else
+ /* Not memory operation (we don't call this function for
+ loads). */
+ vect_model_simple_cost (stmt_info, ncopies_for_cost, &dt,
+ slp_node);
+ }
}
-
else
{
- if (!*first_stmt_dt1 && i == 1)
+ /* Not first stmt of the group, check that the def-stmt/s match
+ the def-stmt/s of the first stmt. Allow different definition
+ types for reduction chains: the first stmt must be a
+ vect_reduction_def (a phi node), and the rest
+ vect_internal_def. */
+ if (((oprnd_info->first_dt != dt
+ && !(oprnd_info->first_dt == vect_reduction_def
+ && dt == vect_internal_def))
+ || (oprnd_info->first_def_type != NULL_TREE
+ && def
+ && !types_compatible_p (oprnd_info->first_def_type,
+ TREE_TYPE (def))))
+ || (!def
+ && !types_compatible_p (TREE_TYPE (oprnd_info->first_const_oprnd),
+ TREE_TYPE (oprnd)))
+ || different_types)
{
- /* op1 of the first stmt of the group - store its info. */
- *first_stmt_dt1 = dt[i];
- if (def[i])
- *first_stmt_def1_type = TREE_TYPE (def[i]);
- else
+ if (number_of_oprnds != 2)
{
- /* We assume that the stmt contains only one constant
- operand. We fail otherwise, to be on the safe side. */
- if (*first_stmt_const_oprnd)
- {
- if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump, "Build SLP failed: two constant "
- "oprnds in stmt");
- return false;
- }
- *first_stmt_const_oprnd = oprnd;
- }
- }
- else
- {
- /* Not first stmt of the group, check that the def-stmt/s match
- the def-stmt/s of the first stmt. Allow different definition
- types for reduction chains: the first stmt must be a
- vect_reduction_def (a phi node), and the rest
- vect_internal_def. */
- if ((i == 0
- && ((*first_stmt_dt0 != dt[i]
- && !(*first_stmt_dt0 == vect_reduction_def
- && dt[i] == vect_internal_def))
- || (*first_stmt_def0_type && def[0]
- && !types_compatible_p (*first_stmt_def0_type,
- TREE_TYPE (def[0])))))
- || (i == 1
- && ((*first_stmt_dt1 != dt[i]
- && !(*first_stmt_dt1 == vect_reduction_def
- && dt[i] == vect_internal_def))
- || (*first_stmt_def1_type && def[1]
- && !types_compatible_p (*first_stmt_def1_type,
- TREE_TYPE (def[1])))))
- || (!def[i]
- && !types_compatible_p (TREE_TYPE (*first_stmt_const_oprnd),
- TREE_TYPE (oprnd)))
- || different_types)
+ if (vect_print_dump_info (REPORT_SLP))
+ fprintf (vect_dump, "Build SLP failed: different types ");
+
+ return false;
+ }
+
+ /* Try to swap operands in case of binary operation. */
+ if (i == 0)
+ different_types = true;
+ else
{
- if (i != number_of_oprnds - 1)
- different_types = true;
- else
- {
- if (is_gimple_assign (stmt)
- && (rhs_code = gimple_assign_rhs_code (stmt))
- && TREE_CODE_CLASS (rhs_code) == tcc_binary
- && commutative_tree_code (rhs_code)
- && *first_stmt_dt0 == dt[1]
- && *first_stmt_dt1 == dt[0]
- && def[0] && def[1]
- && !(*first_stmt_def0_type
- && !types_compatible_p (*first_stmt_def0_type,
- TREE_TYPE (def[1])))
- && !(*first_stmt_def1_type
- && !types_compatible_p (*first_stmt_def1_type,
- TREE_TYPE (def[0]))))
- {
- if (vect_print_dump_info (REPORT_SLP))
- {
- fprintf (vect_dump, "Swapping operands of ");
- print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
- }
-
- swap_tree_operands (stmt, gimple_assign_rhs1_ptr (stmt),
- gimple_assign_rhs2_ptr (stmt));
+ oprnd0_info = VEC_index (slp_oprnd_info, *oprnds_info, 0);
+ if (is_gimple_assign (stmt)
+ && (rhs_code = gimple_assign_rhs_code (stmt))
+ && TREE_CODE_CLASS (rhs_code) == tcc_binary
+ && commutative_tree_code (rhs_code)
+ && oprnd0_info->first_dt == dt
+ && oprnd_info->first_dt == dt_op0
+ && def_op0 && def
+ && !(oprnd0_info->first_def_type
+ && !types_compatible_p (oprnd0_info->first_def_type,
+ TREE_TYPE (def)))
+ && !(oprnd_info->first_def_type
+ && !types_compatible_p (oprnd_info->first_def_type,
+ TREE_TYPE (def_op0))))
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Swapping operands of ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
- else
- {
- if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump, "Build SLP failed: different types ");
- return false;
- }
+ swap_tree_operands (stmt, gimple_assign_rhs1_ptr (stmt),
+ gimple_assign_rhs2_ptr (stmt));
+ }
+ else
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ fprintf (vect_dump, "Build SLP failed: different types ");
+
+ return false;
}
}
}
}
/* Check the types of the definitions. */
- switch (dt[i])
+ switch (dt)
{
case vect_constant_def:
case vect_external_def:
+ case vect_reduction_def:
break;
case vect_internal_def:
- case vect_reduction_def:
- if ((i == 0 && !different_types) || (i == 1 && different_types))
- VEC_safe_push (gimple, heap, *def_stmts0, def_stmt);
+ if (different_types)
+ {
+ oprnd0_info = VEC_index (slp_oprnd_info, *oprnds_info, 0);
+ oprnd1_info = VEC_index (slp_oprnd_info, *oprnds_info, 0);
+ if (i == 0)
+ VEC_quick_push (gimple, oprnd1_info->def_stmts, def_stmt);
+ else
+ VEC_quick_push (gimple, oprnd0_info->def_stmts, def_stmt);
+ }
else
- VEC_safe_push (gimple, heap, *def_stmts1, def_stmt);
+ VEC_quick_push (gimple, oprnd_info->def_stmts, def_stmt);
+
break;
default:
@@ -331,7 +419,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: illegal type of def ");
- print_generic_expr (vect_dump, def[i], TDF_SLIM);
+ print_generic_expr (vect_dump, def, TDF_SLIM);
}
return false;
@@ -356,15 +444,11 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
VEC (slp_tree, heap) **loads,
unsigned int vectorization_factor, bool *loads_permuted)
{
- VEC (gimple, heap) *def_stmts0 = VEC_alloc (gimple, heap, group_size);
- VEC (gimple, heap) *def_stmts1 = VEC_alloc (gimple, heap, group_size);
unsigned int i;
VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (*node);
gimple stmt = VEC_index (gimple, stmts, 0);
- enum vect_def_type first_stmt_dt0 = vect_uninitialized_def;
- enum vect_def_type first_stmt_dt1 = vect_uninitialized_def;
enum tree_code first_stmt_code = ERROR_MARK, rhs_code = ERROR_MARK;
- tree first_stmt_def1_type = NULL_TREE, first_stmt_def0_type = NULL_TREE;
+ enum tree_code first_cond_code = ERROR_MARK;
tree lhs;
bool stop_recursion = false, need_same_oprnds = false;
tree vectype, scalar_type, first_op1 = NULL_TREE;
@@ -373,13 +457,28 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
int icode;
enum machine_mode optab_op2_mode;
enum machine_mode vec_mode;
- tree first_stmt_const_oprnd = NULL_TREE;
struct data_reference *first_dr;
- bool pattern0 = false, pattern1 = false;
HOST_WIDE_INT dummy;
bool permutation = false;
unsigned int load_place;
gimple first_load, prev_first_load = NULL;
+ VEC (slp_oprnd_info, heap) *oprnds_info;
+ unsigned int nops;
+ slp_oprnd_info oprnd_info;
+ tree cond;
+
+ if (is_gimple_call (stmt))
+ nops = gimple_call_num_args (stmt);
+ else if (is_gimple_assign (stmt))
+ {
+ nops = gimple_num_ops (stmt) - 1;
+ if (gimple_assign_rhs_code (stmt) == COND_EXPR)
+ nops++;
+ }
+ else
+ return false;
+
+ oprnds_info = vect_create_oprnd_info (nops, group_size);
/* For every stmt in NODE find its def stmt/s. */
FOR_EACH_VEC_ELT (gimple, stmts, i, stmt)
@@ -400,6 +499,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -409,13 +509,30 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump,
- "Build SLP failed: not GIMPLE_ASSIGN nor GIMPLE_CALL");
+ "Build SLP failed: not GIMPLE_ASSIGN nor GIMPLE_CALL ");
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == COND_EXPR
+ && (cond = gimple_assign_rhs1 (stmt))
+ && !COMPARISON_CLASS_P (cond))
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump,
+ "Build SLP failed: condition is not comparison ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ vect_free_oprnd_info (&oprnds_info, true);
+ return false;
+ }
+
scalar_type = vect_get_smallest_scalar_type (stmt, &dummy, &dummy);
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
@@ -425,6 +542,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
fprintf (vect_dump, "Build SLP failed: unsupported data-type ");
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
}
+
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -471,6 +590,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
{
if (vect_print_dump_info (REPORT_SLP))
fprintf (vect_dump, "Build SLP failed: no optab.");
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
icode = (int) optab_handler (optab, vec_mode);
@@ -479,6 +599,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (vect_print_dump_info (REPORT_SLP))
fprintf (vect_dump, "Build SLP failed: "
"op not supported by target.");
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
optab_op2_mode = insn_data[icode].operand[2].mode;
@@ -515,6 +636,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -528,6 +650,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
}
@@ -539,15 +662,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
{
/* Store. */
if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo, *node,
- stmt, &def_stmts0, &def_stmts1,
- &first_stmt_dt0,
- &first_stmt_dt1,
- &first_stmt_def0_type,
- &first_stmt_def1_type,
- &first_stmt_const_oprnd,
- ncopies_for_cost,
- &pattern0, &pattern1))
- return false;
+ stmt, ncopies_for_cost,
+ (i == 0), &oprnds_info))
+ {
+ vect_free_oprnd_info (&oprnds_info, true);
+ return false;
+ }
}
else
{
@@ -565,6 +685,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -581,6 +702,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -601,6 +723,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
}
@@ -620,6 +743,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
@@ -647,7 +771,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
{
if (TREE_CODE_CLASS (rhs_code) == tcc_reference)
{
- /* Not strided load. */
+ /* Not strided load. */
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: not strided load ");
@@ -655,12 +779,14 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
/* FORNOW: Not strided loads are not supported. */
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
/* Not memory operation. */
if (TREE_CODE_CLASS (rhs_code) != tcc_binary
- && TREE_CODE_CLASS (rhs_code) != tcc_unary)
+ && TREE_CODE_CLASS (rhs_code) != tcc_unary
+ && rhs_code != COND_EXPR)
{
if (vect_print_dump_info (REPORT_SLP))
{
@@ -669,19 +795,38 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
+ vect_free_oprnd_info (&oprnds_info, true);
return false;
}
+ if (rhs_code == COND_EXPR)
+ {
+ tree cond_expr = gimple_assign_rhs1 (stmt);
+
+ if (i == 0)
+ first_cond_code = TREE_CODE (cond_expr);
+ else if (first_cond_code != TREE_CODE (cond_expr))
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Build SLP failed: different"
+ " operation");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ vect_free_oprnd_info (&oprnds_info, true);
+ return false;
+ }
+ }
+
/* Find the def-stmts. */
if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo, *node, stmt,
- &def_stmts0, &def_stmts1,
- &first_stmt_dt0, &first_stmt_dt1,
- &first_stmt_def0_type,
- &first_stmt_def1_type,
- &first_stmt_const_oprnd,
- ncopies_for_cost,
- &pattern0, &pattern1))
- return false;
+ ncopies_for_cost, (i == 0),
+ &oprnds_info))
+ {
+ vect_free_oprnd_info (&oprnds_info, true);
+ return false;
+ }
}
}
@@ -714,42 +859,29 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
/* Create SLP_TREE nodes for the definition node/s. */
- if (first_stmt_dt0 == vect_internal_def)
- {
- slp_tree left_node = XNEW (struct _slp_tree);
- SLP_TREE_SCALAR_STMTS (left_node) = def_stmts0;
- SLP_TREE_VEC_STMTS (left_node) = NULL;
- SLP_TREE_LEFT (left_node) = NULL;
- SLP_TREE_RIGHT (left_node) = NULL;
- SLP_TREE_OUTSIDE_OF_LOOP_COST (left_node) = 0;
- SLP_TREE_INSIDE_OF_LOOP_COST (left_node) = 0;
- if (!vect_build_slp_tree (loop_vinfo, bb_vinfo, &left_node, group_size,
- inside_cost, outside_cost, ncopies_for_cost,
- max_nunits, load_permutation, loads,
- vectorization_factor, loads_permuted))
- return false;
+ FOR_EACH_VEC_ELT (slp_oprnd_info, oprnds_info, i, oprnd_info)
+ {
+ slp_tree child;
- SLP_TREE_LEFT (*node) = left_node;
- }
+ if (oprnd_info->first_dt != vect_internal_def)
+ continue;
- if (first_stmt_dt1 == vect_internal_def)
- {
- slp_tree right_node = XNEW (struct _slp_tree);
- SLP_TREE_SCALAR_STMTS (right_node) = def_stmts1;
- SLP_TREE_VEC_STMTS (right_node) = NULL;
- SLP_TREE_LEFT (right_node) = NULL;
- SLP_TREE_RIGHT (right_node) = NULL;
- SLP_TREE_OUTSIDE_OF_LOOP_COST (right_node) = 0;
- SLP_TREE_INSIDE_OF_LOOP_COST (right_node) = 0;
- if (!vect_build_slp_tree (loop_vinfo, bb_vinfo, &right_node, group_size,
+ child = vect_create_new_slp_node (oprnd_info->def_stmts);
+ if (!child
+ || !vect_build_slp_tree (loop_vinfo, bb_vinfo, &child, group_size,
inside_cost, outside_cost, ncopies_for_cost,
max_nunits, load_permutation, loads,
vectorization_factor, loads_permuted))
- return false;
+ {
+ free (child);
+ vect_free_oprnd_info (&oprnds_info, true);
+ return false;
+ }
- SLP_TREE_RIGHT (*node) = right_node;
+ VEC_quick_push (slp_void_p, SLP_TREE_CHILDREN (*node), child);
}
+ vect_free_oprnd_info (&oprnds_info, false);
return true;
}
@@ -759,6 +891,7 @@ vect_print_slp_tree (slp_tree node)
{
int i;
gimple stmt;
+ slp_void_p child;
if (!node)
return;
@@ -771,8 +904,8 @@ vect_print_slp_tree (slp_tree node)
}
fprintf (vect_dump, "\n");
- vect_print_slp_tree (SLP_TREE_LEFT (node));
- vect_print_slp_tree (SLP_TREE_RIGHT (node));
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_print_slp_tree ((slp_tree) child);
}
@@ -786,6 +919,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
{
int i;
gimple stmt;
+ slp_void_p child;
if (!node)
return;
@@ -794,8 +928,8 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
if (j < 0 || i == j)
STMT_SLP_TYPE (vinfo_for_stmt (stmt)) = mark;
- vect_mark_slp_stmts (SLP_TREE_LEFT (node), mark, j);
- vect_mark_slp_stmts (SLP_TREE_RIGHT (node), mark, j);
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_mark_slp_stmts ((slp_tree) child, mark, j);
}
@@ -807,6 +941,7 @@ vect_mark_slp_stmts_relevant (slp_tree node)
int i;
gimple stmt;
stmt_vec_info stmt_info;
+ slp_void_p child;
if (!node)
return;
@@ -819,8 +954,8 @@ vect_mark_slp_stmts_relevant (slp_tree node)
STMT_VINFO_RELEVANT (stmt_info) = vect_used_in_scope;
}
- vect_mark_slp_stmts_relevant (SLP_TREE_LEFT (node));
- vect_mark_slp_stmts_relevant (SLP_TREE_RIGHT (node));
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_mark_slp_stmts_relevant ((slp_tree) child);
}
@@ -893,12 +1028,13 @@ vect_slp_rearrange_stmts (slp_tree node, unsigned int group_size,
gimple stmt;
VEC (gimple, heap) *tmp_stmts;
unsigned int index, i;
+ slp_void_p child;
if (!node)
return;
- vect_slp_rearrange_stmts (SLP_TREE_LEFT (node), group_size, permutation);
- vect_slp_rearrange_stmts (SLP_TREE_RIGHT (node), group_size, permutation);
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_slp_rearrange_stmts ((slp_tree) child, group_size, permutation);
gcc_assert (group_size == VEC_length (gimple, SLP_TREE_SCALAR_STMTS (node)));
tmp_stmts = VEC_alloc (gimple, heap, group_size);
@@ -1263,7 +1399,7 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
gimple stmt)
{
slp_instance new_instance;
- slp_tree node = XNEW (struct _slp_tree);
+ slp_tree node;
unsigned int group_size = GROUP_SIZE (vinfo_for_stmt (stmt));
unsigned int unrolling_factor = 1, nunits;
tree vectype, scalar_type = NULL_TREE;
@@ -1275,6 +1411,7 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
VEC (slp_tree, heap) *loads;
struct data_reference *dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
bool loads_permuted = false;
+ VEC (gimple, heap) *scalar_stmts;
if (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
{
@@ -1327,32 +1464,31 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
/* Create a node (a root of the SLP tree) for the packed strided stores. */
- SLP_TREE_SCALAR_STMTS (node) = VEC_alloc (gimple, heap, group_size);
+ scalar_stmts = VEC_alloc (gimple, heap, group_size);
next = stmt;
if (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
{
/* Collect the stores and store them in SLP_TREE_SCALAR_STMTS. */
while (next)
{
- VEC_safe_push (gimple, heap, SLP_TREE_SCALAR_STMTS (node), next);
+ if (STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (next))
+ && STMT_VINFO_RELATED_STMT (vinfo_for_stmt (next)))
+ VEC_safe_push (gimple, heap, scalar_stmts,
+ STMT_VINFO_RELATED_STMT (vinfo_for_stmt (next)));
+ else
+ VEC_safe_push (gimple, heap, scalar_stmts, next);
next = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next));
}
}
else
{
/* Collect reduction statements. */
- for (i = 0; VEC_iterate (gimple, LOOP_VINFO_REDUCTIONS (loop_vinfo), i,
- next);
- i++)
- VEC_safe_push (gimple, heap, SLP_TREE_SCALAR_STMTS (node), next);
+ VEC (gimple, heap) *reductions = LOOP_VINFO_REDUCTIONS (loop_vinfo);
+ for (i = 0; VEC_iterate (gimple, reductions, i, next); i++)
+ VEC_safe_push (gimple, heap, scalar_stmts, next);
}
- SLP_TREE_VEC_STMTS (node) = NULL;
- SLP_TREE_NUMBER_OF_VEC_STMTS (node) = 0;
- SLP_TREE_LEFT (node) = NULL;
- SLP_TREE_RIGHT (node) = NULL;
- SLP_TREE_OUTSIDE_OF_LOOP_COST (node) = 0;
- SLP_TREE_INSIDE_OF_LOOP_COST (node) = 0;
+ node = vect_create_new_slp_node (scalar_stmts);
/* Calculate the number of vector stmts to create based on the unrolling
factor (number of vectors is 1 if NUNITS >= GROUP_SIZE, and is
@@ -1548,6 +1684,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node)
imm_use_iterator imm_iter;
gimple use_stmt;
stmt_vec_info stmt_vinfo;
+ slp_void_p child;
if (!node)
return;
@@ -1565,8 +1702,8 @@ vect_detect_hybrid_slp_stmts (slp_tree node)
== vect_reduction_def))
vect_mark_slp_stmts (node, hybrid, i);
- vect_detect_hybrid_slp_stmts (SLP_TREE_LEFT (node));
- vect_detect_hybrid_slp_stmts (SLP_TREE_RIGHT (node));
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_detect_hybrid_slp_stmts ((slp_tree) child);
}
@@ -1656,13 +1793,14 @@ vect_slp_analyze_node_operations (bb_vec_info bb_vinfo, slp_tree node)
bool dummy;
int i;
gimple stmt;
+ slp_void_p child;
if (!node)
return true;
- if (!vect_slp_analyze_node_operations (bb_vinfo, SLP_TREE_LEFT (node))
- || !vect_slp_analyze_node_operations (bb_vinfo, SLP_TREE_RIGHT (node)))
- return false;
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ if (!vect_slp_analyze_node_operations (bb_vinfo, (slp_tree) child))
+ return false;
FOR_EACH_VEC_ELT (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt)
{
@@ -2086,15 +2224,15 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
For example, we have two scalar operands, s1 and s2 (e.g., group of
strided accesses of size two), while NUNITS is four (i.e., four scalars
- of this type can be packed in a vector). The output vector will contain
- two copies of each scalar operand: {s1, s2, s1, s2}. (NUMBER_OF_COPIES
+ of this type can be packed in a vector). The output vector will contain
+ two copies of each scalar operand: {s1, s2, s1, s2}. (NUMBER_OF_COPIES
will be 2).
If GROUP_SIZE > NUNITS, the scalars will be split into several vectors
containing the operands.
For example, NUNITS is four as before, and the group size is 8
- (s1, s2, ..., s8). We will create two vectors {s1, s2, s3, s4} and
+ (s1, s2, ..., s8). We will create two vectors {s1, s2, s3, s4} and
{s5, s6, s7, s8}. */
number_of_copies = least_common_multiple (nunits, group_size) / group_size;
@@ -2106,8 +2244,23 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
{
if (is_store)
op = gimple_assign_rhs1 (stmt);
- else
+ else if (gimple_assign_rhs_code (stmt) != COND_EXPR)
op = gimple_op (stmt, op_num + 1);
+ else
+ {
+ if (op_num == 0 || op_num == 1)
+ {
+ tree cond = gimple_assign_rhs1 (stmt);
+ op = TREE_OPERAND (cond, op_num);
+ }
+ else
+ {
+ if (op_num == 2)
+ op = gimple_assign_rhs2 (stmt);
+ else
+ op = gimple_assign_rhs3 (stmt);
+ }
+ }
if (reduc_index != -1)
{
@@ -2208,85 +2361,100 @@ vect_get_slp_vect_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds)
If the scalar definitions are loop invariants or constants, collect them and
call vect_get_constant_vectors() to create vector stmts.
Otherwise, the def-stmts must be already vectorized and the vectorized stmts
- must be stored in the LEFT/RIGHT node of SLP_NODE, and we call
- vect_get_slp_vect_defs() to retrieve them.
- If VEC_OPRNDS1 is NULL, don't get vector defs for the second operand (from
- the right node. This is used when the second operand must remain scalar. */
+ must be stored in the corresponding child of SLP_NODE, and we call
+ vect_get_slp_vect_defs () to retrieve them. */
void
-vect_get_slp_defs (tree op0, tree op1, slp_tree slp_node,
- VEC (tree,heap) **vec_oprnds0,
- VEC (tree,heap) **vec_oprnds1, int reduc_index)
+vect_get_slp_defs (VEC (tree, heap) *ops, slp_tree slp_node,
+ VEC (slp_void_p, heap) **vec_oprnds, int reduc_index)
{
- gimple first_stmt;
- enum tree_code code;
- int number_of_vects;
+ gimple first_stmt, first_def;
+ int number_of_vects = 0, i;
+ unsigned int child_index = 0;
HOST_WIDE_INT lhs_size_unit, rhs_size_unit;
+ slp_tree child = NULL;
+ VEC (tree, heap) *vec_defs;
+ tree oprnd, def_lhs;
+ bool vectorized_defs;
first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
- /* The number of vector defs is determined by the number of vector statements
- in the node from which we get those statements. */
- if (SLP_TREE_LEFT (slp_node))
- number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (SLP_TREE_LEFT (slp_node));
- else
- {
- number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
- /* Number of vector stmts was calculated according to LHS in
- vect_schedule_slp_instance(), fix it by replacing LHS with RHS, if
- necessary. See vect_get_smallest_scalar_type () for details. */
- vect_get_smallest_scalar_type (first_stmt, &lhs_size_unit,
- &rhs_size_unit);
- if (rhs_size_unit != lhs_size_unit)
+ FOR_EACH_VEC_ELT (tree, ops, i, oprnd)
+ {
+ /* For each operand we check if it has vectorized definitions in a child
+ node or we need to create them (for invariants and constants). We
+ check if the LHS of the first stmt of the next child matches OPRND.
+ If it does, we found the correct child. Otherwise, we call
+ vect_get_constant_vectors (), and not advance CHILD_INDEX in order
+ to check this child node for the next operand. */
+ vectorized_defs = false;
+ if (VEC_length (slp_void_p, SLP_TREE_CHILDREN (slp_node)) > child_index)
{
- number_of_vects *= rhs_size_unit;
- number_of_vects /= lhs_size_unit;
- }
- }
-
- /* Allocate memory for vectorized defs. */
- *vec_oprnds0 = VEC_alloc (tree, heap, number_of_vects);
-
- /* SLP_NODE corresponds either to a group of stores or to a group of
- unary/binary operations. We don't call this function for loads.
- For reduction defs we call vect_get_constant_vectors(), since we are
- looking for initial loop invariant values. */
- if (SLP_TREE_LEFT (slp_node) && reduc_index == -1)
- /* The defs are already vectorized. */
- vect_get_slp_vect_defs (SLP_TREE_LEFT (slp_node), vec_oprnds0);
- else
- /* Build vectors from scalar defs. */
- vect_get_constant_vectors (op0, slp_node, vec_oprnds0, 0, number_of_vects,
- reduc_index);
+ child = (slp_tree) VEC_index (slp_void_p,
+ SLP_TREE_CHILDREN (slp_node),
+ child_index);
+ first_def = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (child), 0);
+
+ /* In the end of a pattern sequence we have a use of the original stmt,
+ so we need to compare OPRND with the original def. */
+ if (is_pattern_stmt_p (vinfo_for_stmt (first_def))
+ && !STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (first_stmt))
+ && !is_pattern_stmt_p (vinfo_for_stmt (first_stmt)))
+ first_def = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (first_def));
+
+ if (is_gimple_call (first_def))
+ def_lhs = gimple_call_lhs (first_def);
+ else
+ def_lhs = gimple_assign_lhs (first_def);
- if (STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt)))
- /* Since we don't call this function with loads, this is a group of
- stores. */
- return;
+ if (operand_equal_p (oprnd, def_lhs, 0))
+ {
+ /* The number of vector defs is determined by the number of
+ vector statements in the node from which we get those
+ statements. */
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (child);
+ vectorized_defs = true;
+ child_index++;
+ }
+ }
- /* For reductions, we only need initial values. */
- if (reduc_index != -1)
- return;
+ if (!vectorized_defs)
+ {
+ if (i == 0)
+ {
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+ /* Number of vector stmts was calculated according to LHS in
+ vect_schedule_slp_instance (), fix it by replacing LHS with
+ RHS, if necessary. See vect_get_smallest_scalar_type () for
+ details. */
+ vect_get_smallest_scalar_type (first_stmt, &lhs_size_unit,
+ &rhs_size_unit);
+ if (rhs_size_unit != lhs_size_unit)
+ {
+ number_of_vects *= rhs_size_unit;
+ number_of_vects /= lhs_size_unit;
+ }
+ }
+ }
- code = gimple_assign_rhs_code (first_stmt);
- if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1 || !op1)
- return;
+ /* Allocate memory for vectorized defs. */
+ vec_defs = VEC_alloc (tree, heap, number_of_vects);
- /* The number of vector defs is determined by the number of vector statements
- in the node from which we get those statements. */
- if (SLP_TREE_RIGHT (slp_node))
- number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (SLP_TREE_RIGHT (slp_node));
- else
- number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+ /* For reduction defs we call vect_get_constant_vectors (), since we are
+ looking for initial loop invariant values. */
+ if (vectorized_defs && reduc_index == -1)
+ /* The defs are already vectorized. */
+ vect_get_slp_vect_defs (child, &vec_defs);
+ else
+ /* Build vectors from scalar defs. */
+ vect_get_constant_vectors (oprnd, slp_node, &vec_defs, i,
+ number_of_vects, reduc_index);
- *vec_oprnds1 = VEC_alloc (tree, heap, number_of_vects);
+ VEC_quick_push (slp_void_p, *vec_oprnds, (slp_void_p) vec_defs);
- if (SLP_TREE_RIGHT (slp_node))
- /* The defs are already vectorized. */
- vect_get_slp_vect_defs (SLP_TREE_RIGHT (slp_node), vec_oprnds1);
- else
- /* Build vectors from scalar defs. */
- vect_get_constant_vectors (op1, slp_node, vec_oprnds1, 1, number_of_vects,
- -1);
+ /* For reductions, we only need initial values. */
+ if (reduc_index != -1)
+ return;
+ }
}
@@ -2593,14 +2761,14 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance,
tree vectype;
int i;
slp_tree loads_node;
+ slp_void_p child;
if (!node)
return false;
- vect_schedule_slp_instance (SLP_TREE_LEFT (node), instance,
- vectorization_factor);
- vect_schedule_slp_instance (SLP_TREE_RIGHT (node), instance,
- vectorization_factor);
+ FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
+ vect_schedule_slp_instance ((slp_tree) child, instance,
+ vectorization_factor);
stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (node), 0);
stmt_info = vinfo_for_stmt (stmt);
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index c6df30e9310..8b9a2cfa3c7 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -332,6 +332,8 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
- LIVE_P, RELEVANT - enum values to be set in the STMT_VINFO of the stmt
that defined USE. This is done by calling mark_relevant and passing it
the WORKLIST (to add DEF_STMT to the WORKLIST in case it is relevant).
+ - FORCE is true if exist_non_indexing_operands_for_use_p check shouldn't
+ be performed.
Outputs:
Generally, LIVE_P and RELEVANT are used to define the liveness and
@@ -351,7 +353,8 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
static bool
process_use (gimple stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
- enum vect_relevant relevant, VEC(gimple,heap) **worklist)
+ enum vect_relevant relevant, VEC(gimple,heap) **worklist,
+ bool force)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
@@ -363,7 +366,7 @@ process_use (gimple stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
/* case 1: we are only interested in uses that need to be vectorized. Uses
that are used for address computation are not considered relevant. */
- if (!exist_non_indexing_operands_for_use_p (use, stmt))
+ if (!force && !exist_non_indexing_operands_for_use_p (use, stmt))
return true;
if (!vect_is_simple_use (use, loop_vinfo, NULL, &def_stmt, &def, &dt))
@@ -646,7 +649,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
break;
}
- if (is_pattern_stmt_p (vinfo_for_stmt (stmt)))
+ if (is_pattern_stmt_p (stmt_vinfo))
{
/* Pattern statements are not inserted into the code, so
FOR_EACH_PHI_OR_STMT_USE optimizes their operands out, and we
@@ -660,9 +663,9 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
if (rhs_code == COND_EXPR && COMPARISON_CLASS_P (op))
{
if (!process_use (stmt, TREE_OPERAND (op, 0), loop_vinfo,
- live_p, relevant, &worklist)
+ live_p, relevant, &worklist, false)
|| !process_use (stmt, TREE_OPERAND (op, 1), loop_vinfo,
- live_p, relevant, &worklist))
+ live_p, relevant, &worklist, false))
{
VEC_free (gimple, heap, worklist);
return false;
@@ -673,7 +676,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
{
op = gimple_op (stmt, i);
if (!process_use (stmt, op, loop_vinfo, live_p, relevant,
- &worklist))
+ &worklist, false))
{
VEC_free (gimple, heap, worklist);
return false;
@@ -686,7 +689,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
{
tree arg = gimple_call_arg (stmt, i);
if (!process_use (stmt, arg, loop_vinfo, live_p, relevant,
- &worklist))
+ &worklist, false))
{
VEC_free (gimple, heap, worklist);
return false;
@@ -699,12 +702,25 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
{
tree op = USE_FROM_PTR (use_p);
if (!process_use (stmt, op, loop_vinfo, live_p, relevant,
- &worklist))
+ &worklist, false))
{
VEC_free (gimple, heap, worklist);
return false;
}
}
+
+ if (STMT_VINFO_GATHER_P (stmt_vinfo))
+ {
+ tree off;
+ tree decl = vect_check_gather (stmt, loop_vinfo, NULL, &off, NULL);
+ gcc_assert (decl);
+ if (!process_use (stmt, off, loop_vinfo, live_p, relevant,
+ &worklist, true))
+ {
+ VEC_free (gimple, heap, worklist);
+ return false;
+ }
+ }
} /* while worklist */
VEC_free (gimple, heap, worklist);
@@ -1399,16 +1415,35 @@ vect_get_vec_defs_for_stmt_copy (enum vect_def_type *dt,
}
-/* Get vectorized definitions for OP0 and OP1, or SLP_NODE if it is not
- NULL. */
+/* Get vectorized definitions for OP0 and OP1.
+ REDUC_INDEX is the index of reduction operand in case of reduction,
+ and -1 otherwise. */
-static void
+void
vect_get_vec_defs (tree op0, tree op1, gimple stmt,
- VEC(tree,heap) **vec_oprnds0, VEC(tree,heap) **vec_oprnds1,
- slp_tree slp_node)
+ VEC (tree, heap) **vec_oprnds0,
+ VEC (tree, heap) **vec_oprnds1,
+ slp_tree slp_node, int reduc_index)
{
if (slp_node)
- vect_get_slp_defs (op0, op1, slp_node, vec_oprnds0, vec_oprnds1, -1);
+ {
+ int nops = (op1 == NULL_TREE) ? 1 : 2;
+ VEC (tree, heap) *ops = VEC_alloc (tree, heap, nops);
+ VEC (slp_void_p, heap) *vec_defs = VEC_alloc (slp_void_p, heap, nops);
+
+ VEC_quick_push (tree, ops, op0);
+ if (op1)
+ VEC_quick_push (tree, ops, op1);
+
+ vect_get_slp_defs (ops, slp_node, &vec_defs, reduc_index);
+
+ *vec_oprnds0 = (VEC (tree, heap) *) VEC_index (slp_void_p, vec_defs, 0);
+ if (op1)
+ *vec_oprnds1 = (VEC (tree, heap) *) VEC_index (slp_void_p, vec_defs, 1);
+
+ VEC_free (tree, heap, ops);
+ VEC_free (slp_void_p, heap, vec_defs);
+ }
else
{
tree vec_oprnd;
@@ -1824,9 +1859,168 @@ vect_gen_widened_results_half (enum tree_code code,
return new_stmt;
}
+
+/* Get vectorized definitions for loop-based vectorization. For the first
+ operand we call vect_get_vec_def_for_operand() (with OPRND containing
+ scalar operand), and for the rest we get a copy with
+ vect_get_vec_def_for_stmt_copy() using the previous vector definition
+ (stored in OPRND). See vect_get_vec_def_for_stmt_copy() for details.
+ The vectors are collected into VEC_OPRNDS. */
+
+static void
+vect_get_loop_based_defs (tree *oprnd, gimple stmt, enum vect_def_type dt,
+ VEC (tree, heap) **vec_oprnds, int multi_step_cvt)
+{
+ tree vec_oprnd;
+
+ /* Get first vector operand. */
+ /* All the vector operands except the very first one (that is scalar oprnd)
+ are stmt copies. */
+ if (TREE_CODE (TREE_TYPE (*oprnd)) != VECTOR_TYPE)
+ vec_oprnd = vect_get_vec_def_for_operand (*oprnd, stmt, NULL);
+ else
+ vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, *oprnd);
+
+ VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
+
+ /* Get second vector operand. */
+ vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, vec_oprnd);
+ VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
+
+ *oprnd = vec_oprnd;
+
+ /* For conversion in multiple steps, continue to get operands
+ recursively. */
+ if (multi_step_cvt)
+ vect_get_loop_based_defs (oprnd, stmt, dt, vec_oprnds, multi_step_cvt - 1);
+}
+
+
+/* Create vectorized demotion statements for vector operands from VEC_OPRNDS.
+ For multi-step conversions store the resulting vectors and call the function
+ recursively. */
+
+static void
+vect_create_vectorized_demotion_stmts (VEC (tree, heap) **vec_oprnds,
+ int multi_step_cvt, gimple stmt,
+ VEC (tree, heap) *vec_dsts,
+ gimple_stmt_iterator *gsi,
+ slp_tree slp_node, enum tree_code code,
+ stmt_vec_info *prev_stmt_info)
+{
+ unsigned int i;
+ tree vop0, vop1, new_tmp, vec_dest;
+ gimple new_stmt;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
+ vec_dest = VEC_pop (tree, vec_dsts);
+
+ for (i = 0; i < VEC_length (tree, *vec_oprnds); i += 2)
+ {
+ /* Create demotion operation. */
+ vop0 = VEC_index (tree, *vec_oprnds, i);
+ vop1 = VEC_index (tree, *vec_oprnds, i + 1);
+ new_stmt = gimple_build_assign_with_ops (code, vec_dest, vop0, vop1);
+ new_tmp = make_ssa_name (vec_dest, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_tmp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+
+ if (multi_step_cvt)
+ /* Store the resulting vector for next recursive call. */
+ VEC_replace (tree, *vec_oprnds, i/2, new_tmp);
+ else
+ {
+ /* This is the last step of the conversion sequence. Store the
+ vectors in SLP_NODE or in vector info of the scalar statement
+ (or in STMT_VINFO_RELATED_STMT chain). */
+ if (slp_node)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ else
+ {
+ if (!*prev_stmt_info)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt;
+
+ *prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ }
+ }
+
+ /* For multi-step demotion operations we first generate demotion operations
+ from the source type to the intermediate types, and then combine the
+ results (stored in VEC_OPRNDS) in demotion operation to the destination
+ type. */
+ if (multi_step_cvt)
+ {
+ /* At each level of recursion we have half of the operands we had at the
+ previous level. */
+ VEC_truncate (tree, *vec_oprnds, (i+1)/2);
+ vect_create_vectorized_demotion_stmts (vec_oprnds, multi_step_cvt - 1,
+ stmt, vec_dsts, gsi, slp_node,
+ VEC_PACK_TRUNC_EXPR,
+ prev_stmt_info);
+ }
+
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+}
+
+
+/* Create vectorized promotion statements for vector operands from VEC_OPRNDS0
+ and VEC_OPRNDS1 (for binary operations). For multi-step conversions store
+ the resulting vectors and call the function recursively. */
+
+static void
+vect_create_vectorized_promotion_stmts (VEC (tree, heap) **vec_oprnds0,
+ VEC (tree, heap) **vec_oprnds1,
+ gimple stmt, tree vec_dest,
+ gimple_stmt_iterator *gsi,
+ enum tree_code code1,
+ enum tree_code code2, tree decl1,
+ tree decl2, int op_type)
+{
+ int i;
+ tree vop0, vop1, new_tmp1, new_tmp2;
+ gimple new_stmt1, new_stmt2;
+ VEC (tree, heap) *vec_tmp = NULL;
+
+ vec_tmp = VEC_alloc (tree, heap, VEC_length (tree, *vec_oprnds0) * 2);
+ FOR_EACH_VEC_ELT (tree, *vec_oprnds0, i, vop0)
+ {
+ if (op_type == binary_op)
+ vop1 = VEC_index (tree, *vec_oprnds1, i);
+ else
+ vop1 = NULL_TREE;
+
+ /* Generate the two halves of promotion operation. */
+ new_stmt1 = vect_gen_widened_results_half (code1, decl1, vop0, vop1,
+ op_type, vec_dest, gsi, stmt);
+ new_stmt2 = vect_gen_widened_results_half (code2, decl2, vop0, vop1,
+ op_type, vec_dest, gsi, stmt);
+ if (is_gimple_call (new_stmt1))
+ {
+ new_tmp1 = gimple_call_lhs (new_stmt1);
+ new_tmp2 = gimple_call_lhs (new_stmt2);
+ }
+ else
+ {
+ new_tmp1 = gimple_assign_lhs (new_stmt1);
+ new_tmp2 = gimple_assign_lhs (new_stmt2);
+ }
+
+ /* Store the results for the next step. */
+ VEC_quick_push (tree, vec_tmp, new_tmp1);
+ VEC_quick_push (tree, vec_tmp, new_tmp2);
+ }
+
+ VEC_free (tree, heap, *vec_oprnds0);
+ *vec_oprnds0 = vec_tmp;
+}
+
+
/* Check if STMT performs a conversion operation, that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
+ stmt to replace it, put it in VEC_STMT, and insert it at GSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
@@ -1835,11 +2029,12 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
{
tree vec_dest;
tree scalar_dest;
- tree op0;
+ tree op0, op1 = NULL_TREE;
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK;
+ enum tree_code codecvt1 = ERROR_MARK, codecvt2 = ERROR_MARK;
tree decl1 = NULL_TREE, decl2 = NULL_TREE;
tree new_temp;
tree def;
@@ -1850,21 +2045,22 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
int nunits_in;
int nunits_out;
tree vectype_out, vectype_in;
- int ncopies, j;
- tree rhs_type;
+ int ncopies, i, j;
+ tree lhs_type, rhs_type;
enum { NARROW, NONE, WIDEN } modifier;
- int i;
- VEC(tree,heap) *vec_oprnds0 = NULL;
+ VEC (tree,heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
tree vop0;
- VEC(tree,heap) *dummy = NULL;
- int dummy_int;
+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
+ int multi_step_cvt = 0;
+ VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL;
+ tree last_oprnd, intermediate_type, cvt_type = NULL_TREE;
+ int op_type;
+ enum machine_mode rhs_mode;
+ unsigned short fltsz;
/* Is STMT a vectorizable conversion? */
- /* FORNOW: unsupported in basic block SLP. */
- gcc_assert (loop_vinfo);
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
@@ -1877,23 +2073,74 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
return false;
code = gimple_assign_rhs_code (stmt);
- if (code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
+ if (!CONVERT_EXPR_CODE_P (code)
+ && code != FIX_TRUNC_EXPR
+ && code != FLOAT_EXPR
+ && code != WIDEN_MULT_EXPR
+ && code != WIDEN_LSHIFT_EXPR)
return false;
+ op_type = TREE_CODE_LENGTH (code);
+
/* Check types of lhs and rhs. */
scalar_dest = gimple_assign_lhs (stmt);
+ lhs_type = TREE_TYPE (scalar_dest);
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
op0 = gimple_assign_rhs1 (stmt);
rhs_type = TREE_TYPE (op0);
+
+ if ((code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
+ && !((INTEGRAL_TYPE_P (lhs_type)
+ && INTEGRAL_TYPE_P (rhs_type))
+ || (SCALAR_FLOAT_TYPE_P (lhs_type)
+ && SCALAR_FLOAT_TYPE_P (rhs_type))))
+ return false;
+
+ if ((INTEGRAL_TYPE_P (lhs_type)
+ && (TYPE_PRECISION (lhs_type)
+ != GET_MODE_PRECISION (TYPE_MODE (lhs_type))))
+ || (INTEGRAL_TYPE_P (rhs_type)
+ && (TYPE_PRECISION (rhs_type)
+ != GET_MODE_PRECISION (TYPE_MODE (rhs_type)))))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump,
+ "type conversion to/from bit-precision unsupported.");
+ return false;
+ }
+
/* Check the operands of the operation. */
- if (!vect_is_simple_use_1 (op0, loop_vinfo, NULL,
+ if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
&def_stmt, &def, &dt[0], &vectype_in))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "use not simple.");
return false;
}
+ if (op_type == binary_op)
+ {
+ bool ok;
+
+ op1 = gimple_assign_rhs2 (stmt);
+ gcc_assert (code == WIDEN_MULT_EXPR || code == WIDEN_LSHIFT_EXPR);
+ /* For WIDEN_MULT_EXPR, if OP0 is a constant, use the type of
+ OP1. */
+ if (CONSTANT_CLASS_P (op0))
+ ok = vect_is_simple_use_1 (op1, loop_vinfo, NULL,
+ &def_stmt, &def, &dt[1], &vectype_in);
+ else
+ ok = vect_is_simple_use (op1, loop_vinfo, NULL, &def_stmt, &def,
+ &dt[1]);
+
+ if (!ok)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "use not simple.");
+ return false;
+ }
+ }
+
/* If op0 is an external or constant defs use a vector type of
the same size as the output vector type. */
if (!vectype_in)
@@ -1903,82 +2150,222 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
if (!vectype_in)
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "no vectype for scalar type ");
- print_generic_expr (vect_dump, rhs_type, TDF_SLIM);
- }
+ {
+ fprintf (vect_dump, "no vectype for scalar type ");
+ print_generic_expr (vect_dump, rhs_type, TDF_SLIM);
+ }
return false;
}
- /* FORNOW */
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- if (nunits_in == nunits_out / 2)
+ if (nunits_in < nunits_out)
modifier = NARROW;
else if (nunits_out == nunits_in)
modifier = NONE;
- else if (nunits_out == nunits_in / 2)
- modifier = WIDEN;
else
- return false;
-
- if (modifier == NARROW)
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
- else
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+ modifier = WIDEN;
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
if (slp_node || PURE_SLP_STMT (stmt_info))
ncopies = 1;
+ else if (modifier == NARROW)
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
gcc_assert (ncopies >= 1);
/* Supportable by target? */
- if ((modifier == NONE
- && !supportable_convert_operation (code, vectype_out, vectype_in, &decl1, &code1))
- || (modifier == WIDEN
- && !supportable_widening_operation (code, stmt,
- vectype_out, vectype_in,
- &decl1, &decl2,
- &code1, &code2,
- &dummy_int, &dummy))
- || (modifier == NARROW
- && !supportable_narrowing_operation (code, vectype_out, vectype_in,
- &code1, &dummy_int, &dummy)))
+ switch (modifier)
{
+ case NONE:
+ if (code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
+ return false;
+ if (supportable_convert_operation (code, vectype_out, vectype_in,
+ &decl1, &code1))
+ break;
+ /* FALLTHRU */
+ unsupported:
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "conversion not supported by target.");
+ fprintf (vect_dump, "conversion not supported by target.");
return false;
- }
- if (modifier != NONE)
- {
- /* FORNOW: SLP not supported. */
- if (STMT_SLP_TYPE (stmt_info))
- return false;
+ case WIDEN:
+ if (supportable_widening_operation (code, stmt, vectype_out, vectype_in,
+ &decl1, &decl2, &code1, &code2,
+ &multi_step_cvt, &interm_types))
+ {
+ /* Binary widening operation can only be supported directly by the
+ architecture. */
+ gcc_assert (!(multi_step_cvt && op_type == binary_op));
+ break;
+ }
+
+ if (code != FLOAT_EXPR
+ || (GET_MODE_SIZE (TYPE_MODE (lhs_type))
+ <= GET_MODE_SIZE (TYPE_MODE (rhs_type))))
+ goto unsupported;
+
+ rhs_mode = TYPE_MODE (rhs_type);
+ fltsz = GET_MODE_SIZE (TYPE_MODE (lhs_type));
+ for (rhs_mode = GET_MODE_2XWIDER_MODE (TYPE_MODE (rhs_type));
+ rhs_mode != VOIDmode && GET_MODE_SIZE (rhs_mode) <= fltsz;
+ rhs_mode = GET_MODE_2XWIDER_MODE (rhs_mode))
+ {
+ cvt_type
+ = build_nonstandard_integer_type (GET_MODE_BITSIZE (rhs_mode), 0);
+ cvt_type = get_same_sized_vectype (cvt_type, vectype_in);
+ if (cvt_type == NULL_TREE)
+ goto unsupported;
+
+ if (GET_MODE_SIZE (rhs_mode) == fltsz)
+ {
+ if (!supportable_convert_operation (code, vectype_out,
+ cvt_type, &decl1, &codecvt1))
+ goto unsupported;
+ }
+ else if (!supportable_widening_operation (code, stmt, vectype_out,
+ cvt_type, &decl1, &decl2,
+ &codecvt1, &codecvt2,
+ &multi_step_cvt,
+ &interm_types))
+ continue;
+ else
+ gcc_assert (multi_step_cvt == 0);
+
+ if (supportable_widening_operation (NOP_EXPR, stmt, cvt_type,
+ vectype_in, NULL, NULL, &code1,
+ &code2, &multi_step_cvt,
+ &interm_types))
+ break;
+ }
+
+ if (rhs_mode == VOIDmode || GET_MODE_SIZE (rhs_mode) > fltsz)
+ goto unsupported;
+
+ if (GET_MODE_SIZE (rhs_mode) == fltsz)
+ codecvt2 = ERROR_MARK;
+ else
+ {
+ multi_step_cvt++;
+ VEC_safe_push (tree, heap, interm_types, cvt_type);
+ cvt_type = NULL_TREE;
+ }
+ break;
+
+ case NARROW:
+ gcc_assert (op_type == unary_op);
+ if (supportable_narrowing_operation (code, vectype_out, vectype_in,
+ &code1, &multi_step_cvt,
+ &interm_types))
+ break;
+
+ if (code != FIX_TRUNC_EXPR
+ || (GET_MODE_SIZE (TYPE_MODE (lhs_type))
+ >= GET_MODE_SIZE (TYPE_MODE (rhs_type))))
+ goto unsupported;
+
+ rhs_mode = TYPE_MODE (rhs_type);
+ cvt_type
+ = build_nonstandard_integer_type (GET_MODE_BITSIZE (rhs_mode), 0);
+ cvt_type = get_same_sized_vectype (cvt_type, vectype_in);
+ if (cvt_type == NULL_TREE)
+ goto unsupported;
+ if (!supportable_convert_operation (code, cvt_type, vectype_in,
+ &decl1, &codecvt1))
+ goto unsupported;
+ if (supportable_narrowing_operation (NOP_EXPR, vectype_out, cvt_type,
+ &code1, &multi_step_cvt,
+ &interm_types))
+ break;
+ goto unsupported;
+
+ default:
+ gcc_unreachable ();
}
if (!vec_stmt) /* transformation not required. */
{
- STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "=== vectorizable_conversion ===");
+ if (code == FIX_TRUNC_EXPR || code == FLOAT_EXPR)
+ STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
+ else if (modifier == NARROW)
+ {
+ STMT_VINFO_TYPE (stmt_info) = type_demotion_vec_info_type;
+ vect_model_simple_cost (stmt_info, ncopies, dt, NULL);
+ }
+ else
+ {
+ STMT_VINFO_TYPE (stmt_info) = type_promotion_vec_info_type;
+ vect_model_simple_cost (stmt_info, 2 * ncopies, dt, NULL);
+ }
+ VEC_free (tree, heap, interm_types);
return true;
}
/** Transform. **/
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "transform conversion.");
+ fprintf (vect_dump, "transform conversion. ncopies = %d.", ncopies);
- /* Handle def. */
+ if (op_type == binary_op)
+ {
+ if (CONSTANT_CLASS_P (op0))
+ op0 = fold_convert (TREE_TYPE (op1), op0);
+ else if (CONSTANT_CLASS_P (op1))
+ op1 = fold_convert (TREE_TYPE (op0), op1);
+ }
+
+ /* In case of multi-step conversion, we first generate conversion operations
+ to the intermediate types, and then from that types to the final one.
+ We create vector destinations for the intermediate type (TYPES) received
+ from supportable_*_operation, and store them in the correct order
+ for future use in vect_create_vectorized_*_stmts (). */
+ vec_dsts = VEC_alloc (tree, heap, multi_step_cvt + 1);
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
+ VEC_quick_push (tree, vec_dsts, vec_dest);
- if (modifier == NONE && !slp_node)
- vec_oprnds0 = VEC_alloc (tree, heap, 1);
+ if (multi_step_cvt)
+ {
+ for (i = VEC_length (tree, interm_types) - 1;
+ VEC_iterate (tree, interm_types, i, intermediate_type); i--)
+ {
+ vec_dest = vect_create_destination_var (scalar_dest,
+ intermediate_type);
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+ }
+ }
+
+ if (cvt_type)
+ vec_dest = vect_create_destination_var (scalar_dest, cvt_type);
+
+ if (!slp_node)
+ {
+ if (modifier == NONE)
+ vec_oprnds0 = VEC_alloc (tree, heap, 1);
+ else if (modifier == WIDEN)
+ {
+ vec_oprnds0 = VEC_alloc (tree, heap,
+ (multi_step_cvt
+ ? vect_pow2 (multi_step_cvt) : 1));
+ if (op_type == binary_op)
+ vec_oprnds1 = VEC_alloc (tree, heap, 1);
+ }
+ else
+ vec_oprnds0 = VEC_alloc (tree, heap,
+ 2 * (multi_step_cvt
+ ? vect_pow2 (multi_step_cvt) : 1));
+ }
+ else if (code == WIDEN_LSHIFT_EXPR)
+ vec_oprnds1 = VEC_alloc (tree, heap, slp_node->vec_stmts_size);
+ last_oprnd = op0;
prev_stmt_info = NULL;
switch (modifier)
{
@@ -1986,32 +2373,34 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
for (j = 0; j < ncopies; j++)
{
if (j == 0)
- vect_get_vec_defs (op0, NULL, stmt, &vec_oprnds0, NULL, slp_node);
+ vect_get_vec_defs (op0, NULL, stmt, &vec_oprnds0, NULL, slp_node,
+ -1);
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, NULL);
FOR_EACH_VEC_ELT (tree, vec_oprnds0, i, vop0)
- {
- /* Arguments are ready, create the new vector stmt. */
- if (code1 == CALL_EXPR)
- {
- new_stmt = gimple_build_call (decl1, 1, vop0);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- gimple_call_set_lhs (new_stmt, new_temp);
- }
- else
- {
- gcc_assert (TREE_CODE_LENGTH (code) == unary_op);
- new_stmt = gimple_build_assign_with_ops (code, vec_dest, vop0,
- NULL);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- gimple_assign_set_lhs (new_stmt, new_temp);
- }
+ {
+ /* Arguments are ready, create the new vector stmt. */
+ if (code1 == CALL_EXPR)
+ {
+ new_stmt = gimple_build_call (decl1, 1, vop0);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_call_set_lhs (new_stmt, new_temp);
+ }
+ else
+ {
+ gcc_assert (TREE_CODE_LENGTH (code1) == unary_op);
+ new_stmt = gimple_build_assign_with_ops (code1, vec_dest,
+ vop0, NULL);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ }
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
- if (slp_node)
- VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
- }
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ if (slp_node)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node),
+ new_stmt);
+ }
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
@@ -2028,30 +2417,117 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
the vector stmt by a factor VF/nunits. */
for (j = 0; j < ncopies; j++)
{
+ /* Handle uses. */
if (j == 0)
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- else
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
+ {
+ if (slp_node)
+ {
+ if (code == WIDEN_LSHIFT_EXPR)
+ {
+ unsigned int k;
- /* Generate first half of the widened result: */
- new_stmt
- = vect_gen_widened_results_half (code1, decl1,
- vec_oprnd0, vec_oprnd1,
- unary_op, vec_dest, gsi, stmt);
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ vec_oprnd1 = op1;
+ /* Store vec_oprnd1 for every vector stmt to be created
+ for SLP_NODE. We check during the analysis that all
+ the shift arguments are the same. */
+ for (k = 0; k < slp_node->vec_stmts_size - 1; k++)
+ VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+
+ vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
+ slp_node, -1);
+ }
+ else
+ vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0,
+ &vec_oprnds1, slp_node, -1);
+ }
+ else
+ {
+ vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
+ VEC_quick_push (tree, vec_oprnds0, vec_oprnd0);
+ if (op_type == binary_op)
+ {
+ if (code == WIDEN_LSHIFT_EXPR)
+ vec_oprnd1 = op1;
+ else
+ vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt,
+ NULL);
+ VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+ }
+ }
+ }
else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ {
+ vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
+ VEC_truncate (tree, vec_oprnds0, 0);
+ VEC_quick_push (tree, vec_oprnds0, vec_oprnd0);
+ if (op_type == binary_op)
+ {
+ if (code == WIDEN_LSHIFT_EXPR)
+ vec_oprnd1 = op1;
+ else
+ vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[1],
+ vec_oprnd1);
+ VEC_truncate (tree, vec_oprnds1, 0);
+ VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+ }
+ }
- /* Generate second half of the widened result: */
- new_stmt
- = vect_gen_widened_results_half (code2, decl2,
- vec_oprnd0, vec_oprnd1,
- unary_op, vec_dest, gsi, stmt);
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ /* Arguments are ready. Create the new vector stmts. */
+ for (i = multi_step_cvt; i >= 0; i--)
+ {
+ tree this_dest = VEC_index (tree, vec_dsts, i);
+ enum tree_code c1 = code1, c2 = code2;
+ if (i == 0 && codecvt2 != ERROR_MARK)
+ {
+ c1 = codecvt1;
+ c2 = codecvt2;
+ }
+ vect_create_vectorized_promotion_stmts (&vec_oprnds0,
+ &vec_oprnds1,
+ stmt, this_dest, gsi,
+ c1, c2, decl1, decl2,
+ op_type);
+ }
+
+ FOR_EACH_VEC_ELT (tree, vec_oprnds0, i, vop0)
+ {
+ if (cvt_type)
+ {
+ if (codecvt1 == CALL_EXPR)
+ {
+ new_stmt = gimple_build_call (decl1, 1, vop0);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_call_set_lhs (new_stmt, new_temp);
+ }
+ else
+ {
+ gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op);
+ new_temp = make_ssa_name (vec_dest, NULL);
+ new_stmt = gimple_build_assign_with_ops (codecvt1,
+ new_temp,
+ vop0, NULL);
+ }
+
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ }
+ else
+ new_stmt = SSA_NAME_DEF_STMT (vop0);
+
+ if (slp_node)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node),
+ new_stmt);
+ else
+ {
+ if (!prev_stmt_info)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ }
}
+
+ *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
break;
case NARROW:
@@ -2062,37 +2538,52 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
for (j = 0; j < ncopies; j++)
{
/* Handle uses. */
- if (j == 0)
- {
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
- }
+ if (slp_node)
+ vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
+ slp_node, -1);
else
{
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd1);
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
+ VEC_truncate (tree, vec_oprnds0, 0);
+ vect_get_loop_based_defs (&last_oprnd, stmt, dt[0], &vec_oprnds0,
+ vect_pow2 (multi_step_cvt) - 1);
}
- /* Arguments are ready. Create the new vector stmt. */
- new_stmt = gimple_build_assign_with_ops (code1, vec_dest, vec_oprnd0,
- vec_oprnd1);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- gimple_assign_set_lhs (new_stmt, new_temp);
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ /* Arguments are ready. Create the new vector stmts. */
+ if (cvt_type)
+ FOR_EACH_VEC_ELT (tree, vec_oprnds0, i, vop0)
+ {
+ if (codecvt1 == CALL_EXPR)
+ {
+ new_stmt = gimple_build_call (decl1, 1, vop0);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_call_set_lhs (new_stmt, new_temp);
+ }
+ else
+ {
+ gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op);
+ new_temp = make_ssa_name (vec_dest, NULL);
+ new_stmt = gimple_build_assign_with_ops (codecvt1, new_temp,
+ vop0, NULL);
+ }
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ VEC_replace (tree, vec_oprnds0, i, new_temp);
+ }
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ vect_create_vectorized_demotion_stmts (&vec_oprnds0, multi_step_cvt,
+ stmt, vec_dsts, gsi,
+ slp_node, code1,
+ &prev_stmt_info);
}
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
+ break;
}
- if (vec_oprnds0)
- VEC_free (tree, heap, vec_oprnds0);
+ VEC_free (tree, heap, vec_oprnds0);
+ VEC_free (tree, heap, vec_oprnds1);
+ VEC_free (tree, heap, vec_dsts);
+ VEC_free (tree, heap, interm_types);
return true;
}
@@ -2223,7 +2714,7 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
{
/* Handle uses. */
if (j == 0)
- vect_get_vec_defs (op, NULL, stmt, &vec_oprnds, NULL, slp_node);
+ vect_get_vec_defs (op, NULL, stmt, &vec_oprnds, NULL, slp_node, -1);
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds, NULL);
@@ -2617,10 +3108,10 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
operand 1 should be of a vector type (the usual case). */
if (vec_oprnd1)
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
- slp_node);
+ slp_node, -1);
else
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
- slp_node);
+ slp_node, -1);
}
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, &vec_oprnds1);
@@ -2942,10 +3433,10 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
{
if (op_type == binary_op || op_type == ternary_op)
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
- slp_node);
+ slp_node, -1);
else
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
- slp_node);
+ slp_node, -1);
if (op_type == ternary_op)
{
vec_oprnds2 = VEC_alloc (tree, heap, 1);
@@ -3001,688 +3492,6 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
}
-/* Get vectorized definitions for loop-based vectorization. For the first
- operand we call vect_get_vec_def_for_operand() (with OPRND containing
- scalar operand), and for the rest we get a copy with
- vect_get_vec_def_for_stmt_copy() using the previous vector definition
- (stored in OPRND). See vect_get_vec_def_for_stmt_copy() for details.
- The vectors are collected into VEC_OPRNDS. */
-
-static void
-vect_get_loop_based_defs (tree *oprnd, gimple stmt, enum vect_def_type dt,
- VEC (tree, heap) **vec_oprnds, int multi_step_cvt)
-{
- tree vec_oprnd;
-
- /* Get first vector operand. */
- /* All the vector operands except the very first one (that is scalar oprnd)
- are stmt copies. */
- if (TREE_CODE (TREE_TYPE (*oprnd)) != VECTOR_TYPE)
- vec_oprnd = vect_get_vec_def_for_operand (*oprnd, stmt, NULL);
- else
- vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, *oprnd);
-
- VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
-
- /* Get second vector operand. */
- vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, vec_oprnd);
- VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
-
- *oprnd = vec_oprnd;
-
- /* For conversion in multiple steps, continue to get operands
- recursively. */
- if (multi_step_cvt)
- vect_get_loop_based_defs (oprnd, stmt, dt, vec_oprnds, multi_step_cvt - 1);
-}
-
-
-/* Create vectorized demotion statements for vector operands from VEC_OPRNDS.
- For multi-step conversions store the resulting vectors and call the function
- recursively. */
-
-static void
-vect_create_vectorized_demotion_stmts (VEC (tree, heap) **vec_oprnds,
- int multi_step_cvt, gimple stmt,
- VEC (tree, heap) *vec_dsts,
- gimple_stmt_iterator *gsi,
- slp_tree slp_node, enum tree_code code,
- stmt_vec_info *prev_stmt_info)
-{
- unsigned int i;
- tree vop0, vop1, new_tmp, vec_dest;
- gimple new_stmt;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
-
- vec_dest = VEC_pop (tree, vec_dsts);
-
- for (i = 0; i < VEC_length (tree, *vec_oprnds); i += 2)
- {
- /* Create demotion operation. */
- vop0 = VEC_index (tree, *vec_oprnds, i);
- vop1 = VEC_index (tree, *vec_oprnds, i + 1);
- new_stmt = gimple_build_assign_with_ops (code, vec_dest, vop0, vop1);
- new_tmp = make_ssa_name (vec_dest, new_stmt);
- gimple_assign_set_lhs (new_stmt, new_tmp);
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
-
- if (multi_step_cvt)
- /* Store the resulting vector for next recursive call. */
- VEC_replace (tree, *vec_oprnds, i/2, new_tmp);
- else
- {
- /* This is the last step of the conversion sequence. Store the
- vectors in SLP_NODE or in vector info of the scalar statement
- (or in STMT_VINFO_RELATED_STMT chain). */
- if (slp_node)
- VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
- else
- {
- if (!*prev_stmt_info)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt;
-
- *prev_stmt_info = vinfo_for_stmt (new_stmt);
- }
- }
- }
-
- /* For multi-step demotion operations we first generate demotion operations
- from the source type to the intermediate types, and then combine the
- results (stored in VEC_OPRNDS) in demotion operation to the destination
- type. */
- if (multi_step_cvt)
- {
- /* At each level of recursion we have have of the operands we had at the
- previous level. */
- VEC_truncate (tree, *vec_oprnds, (i+1)/2);
- vect_create_vectorized_demotion_stmts (vec_oprnds, multi_step_cvt - 1,
- stmt, vec_dsts, gsi, slp_node,
- code, prev_stmt_info);
- }
-}
-
-
-/* Function vectorizable_type_demotion
-
- Check if STMT performs a binary or unary operation that involves
- type demotion, and if it can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
- gimple *vec_stmt, slp_tree slp_node)
-{
- tree vec_dest;
- tree scalar_dest;
- tree op0;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- enum tree_code code, code1 = ERROR_MARK;
- tree def;
- gimple def_stmt;
- enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- stmt_vec_info prev_stmt_info;
- int nunits_in;
- int nunits_out;
- tree vectype_out;
- int ncopies;
- int j, i;
- tree vectype_in;
- int multi_step_cvt = 0;
- VEC (tree, heap) *vec_oprnds0 = NULL;
- VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
- tree last_oprnd, intermediate_type;
- bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
- return false;
-
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
- return false;
-
- /* Is STMT a vectorizable type-demotion operation? */
- if (!is_gimple_assign (stmt))
- return false;
-
- if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
- return false;
-
- code = gimple_assign_rhs_code (stmt);
- if (!CONVERT_EXPR_CODE_P (code))
- return false;
-
- scalar_dest = gimple_assign_lhs (stmt);
- vectype_out = STMT_VINFO_VECTYPE (stmt_info);
-
- /* Check the operands of the operation. */
- op0 = gimple_assign_rhs1 (stmt);
- if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
- && INTEGRAL_TYPE_P (TREE_TYPE (op0)))
- || (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))
- && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0)))))
- return false;
-
- if (INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
- && ((TYPE_PRECISION (TREE_TYPE (scalar_dest))
- != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (scalar_dest))))
- || ((TYPE_PRECISION (TREE_TYPE (op0))
- != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (op0)))))))
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "type demotion to/from bit-precision unsupported.");
- return false;
- }
-
- if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
- &def_stmt, &def, &dt[0], &vectype_in))
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "use not simple.");
- return false;
- }
- /* If op0 is an external def use a vector type with the
- same size as the output vector type if possible. */
- if (!vectype_in)
- vectype_in = get_same_sized_vectype (TREE_TYPE (op0), vectype_out);
- if (vec_stmt)
- gcc_assert (vectype_in);
- if (!vectype_in)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "no vectype for scalar type ");
- print_generic_expr (vect_dump, TREE_TYPE (op0), TDF_SLIM);
- }
-
- return false;
- }
-
- nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- if (nunits_in >= nunits_out)
- return false;
-
- /* Multiple types in SLP are handled by creating the appropriate number of
- vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
- case of SLP. */
- if (slp_node || PURE_SLP_STMT (stmt_info))
- ncopies = 1;
- else
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
- gcc_assert (ncopies >= 1);
-
- /* Supportable by target? */
- if (!supportable_narrowing_operation (code, vectype_out, vectype_in,
- &code1, &multi_step_cvt, &interm_types))
- return false;
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = type_demotion_vec_info_type;
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "=== vectorizable_demotion ===");
- vect_model_simple_cost (stmt_info, ncopies, dt, NULL);
- return true;
- }
-
- /** Transform. **/
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "transform type demotion operation. ncopies = %d.",
- ncopies);
-
- /* In case of multi-step demotion, we first generate demotion operations to
- the intermediate types, and then from that types to the final one.
- We create vector destinations for the intermediate type (TYPES) received
- from supportable_narrowing_operation, and store them in the correct order
- for future use in vect_create_vectorized_demotion_stmts(). */
- if (multi_step_cvt)
- vec_dsts = VEC_alloc (tree, heap, multi_step_cvt + 1);
- else
- vec_dsts = VEC_alloc (tree, heap, 1);
-
- vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
- VEC_quick_push (tree, vec_dsts, vec_dest);
-
- if (multi_step_cvt)
- {
- for (i = VEC_length (tree, interm_types) - 1;
- VEC_iterate (tree, interm_types, i, intermediate_type); i--)
- {
- vec_dest = vect_create_destination_var (scalar_dest,
- intermediate_type);
- VEC_quick_push (tree, vec_dsts, vec_dest);
- }
- }
-
- /* In case the vectorization factor (VF) is bigger than the number
- of elements that we can fit in a vectype (nunits), we have to generate
- more than one vector stmt - i.e - we need to "unroll" the
- vector stmt by a factor VF/nunits. */
- last_oprnd = op0;
- prev_stmt_info = NULL;
- for (j = 0; j < ncopies; j++)
- {
- /* Handle uses. */
- if (slp_node)
- vect_get_slp_defs (op0, NULL_TREE, slp_node, &vec_oprnds0, NULL, -1);
- else
- {
- VEC_free (tree, heap, vec_oprnds0);
- vec_oprnds0 = VEC_alloc (tree, heap,
- (multi_step_cvt ? vect_pow2 (multi_step_cvt) * 2 : 2));
- vect_get_loop_based_defs (&last_oprnd, stmt, dt[0], &vec_oprnds0,
- vect_pow2 (multi_step_cvt) - 1);
- }
-
- /* Arguments are ready. Create the new vector stmts. */
- tmp_vec_dsts = VEC_copy (tree, heap, vec_dsts);
- vect_create_vectorized_demotion_stmts (&vec_oprnds0,
- multi_step_cvt, stmt, tmp_vec_dsts,
- gsi, slp_node, code1,
- &prev_stmt_info);
- }
-
- VEC_free (tree, heap, vec_oprnds0);
- VEC_free (tree, heap, vec_dsts);
- VEC_free (tree, heap, tmp_vec_dsts);
- VEC_free (tree, heap, interm_types);
-
- *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
- return true;
-}
-
-
-/* Create vectorized promotion statements for vector operands from VEC_OPRNDS0
- and VEC_OPRNDS1 (for binary operations). For multi-step conversions store
- the resulting vectors and call the function recursively. */
-
-static void
-vect_create_vectorized_promotion_stmts (VEC (tree, heap) **vec_oprnds0,
- VEC (tree, heap) **vec_oprnds1,
- int multi_step_cvt, gimple stmt,
- VEC (tree, heap) *vec_dsts,
- gimple_stmt_iterator *gsi,
- slp_tree slp_node, enum tree_code code1,
- enum tree_code code2, tree decl1,
- tree decl2, int op_type,
- stmt_vec_info *prev_stmt_info)
-{
- int i;
- tree vop0, vop1, new_tmp1, new_tmp2, vec_dest;
- gimple new_stmt1, new_stmt2;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- VEC (tree, heap) *vec_tmp;
-
- vec_dest = VEC_pop (tree, vec_dsts);
- vec_tmp = VEC_alloc (tree, heap, VEC_length (tree, *vec_oprnds0) * 2);
-
- FOR_EACH_VEC_ELT (tree, *vec_oprnds0, i, vop0)
- {
- if (op_type == binary_op)
- vop1 = VEC_index (tree, *vec_oprnds1, i);
- else
- vop1 = NULL_TREE;
-
- /* Generate the two halves of promotion operation. */
- new_stmt1 = vect_gen_widened_results_half (code1, decl1, vop0, vop1,
- op_type, vec_dest, gsi, stmt);
- new_stmt2 = vect_gen_widened_results_half (code2, decl2, vop0, vop1,
- op_type, vec_dest, gsi, stmt);
- if (is_gimple_call (new_stmt1))
- {
- new_tmp1 = gimple_call_lhs (new_stmt1);
- new_tmp2 = gimple_call_lhs (new_stmt2);
- }
- else
- {
- new_tmp1 = gimple_assign_lhs (new_stmt1);
- new_tmp2 = gimple_assign_lhs (new_stmt2);
- }
-
- if (multi_step_cvt)
- {
- /* Store the results for the recursive call. */
- VEC_quick_push (tree, vec_tmp, new_tmp1);
- VEC_quick_push (tree, vec_tmp, new_tmp2);
- }
- else
- {
- /* Last step of promotion sequience - store the results. */
- if (slp_node)
- {
- VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt1);
- VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt2);
- }
- else
- {
- if (!*prev_stmt_info)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt1;
- else
- STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt1;
-
- *prev_stmt_info = vinfo_for_stmt (new_stmt1);
- STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt2;
- *prev_stmt_info = vinfo_for_stmt (new_stmt2);
- }
- }
- }
-
- if (multi_step_cvt)
- {
- /* For multi-step promotion operation we first generate we call the
- function recurcively for every stage. We start from the input type,
- create promotion operations to the intermediate types, and then
- create promotions to the output type. */
- *vec_oprnds0 = VEC_copy (tree, heap, vec_tmp);
- vect_create_vectorized_promotion_stmts (vec_oprnds0, vec_oprnds1,
- multi_step_cvt - 1, stmt,
- vec_dsts, gsi, slp_node, code1,
- code2, decl2, decl2, op_type,
- prev_stmt_info);
- }
-
- VEC_free (tree, heap, vec_tmp);
-}
-
-
-/* Function vectorizable_type_promotion
-
- Check if STMT performs a binary or unary operation that involves
- type promotion, and if it can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
- gimple *vec_stmt, slp_tree slp_node)
-{
- tree vec_dest;
- tree scalar_dest;
- tree op0, op1 = NULL;
- tree vec_oprnd0=NULL, vec_oprnd1=NULL;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK;
- tree decl1 = NULL_TREE, decl2 = NULL_TREE;
- int op_type;
- tree def;
- gimple def_stmt;
- enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- stmt_vec_info prev_stmt_info;
- int nunits_in;
- int nunits_out;
- tree vectype_out;
- int ncopies;
- int j, i;
- tree vectype_in;
- tree intermediate_type = NULL_TREE;
- int multi_step_cvt = 0;
- VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
- VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
- bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
- unsigned int k;
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
- return false;
-
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
- return false;
-
- /* Is STMT a vectorizable type-promotion operation? */
- if (!is_gimple_assign (stmt))
- return false;
-
- if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
- return false;
-
- code = gimple_assign_rhs_code (stmt);
- if (!CONVERT_EXPR_CODE_P (code)
- && code != WIDEN_MULT_EXPR
- && code != WIDEN_LSHIFT_EXPR)
- return false;
-
- scalar_dest = gimple_assign_lhs (stmt);
- vectype_out = STMT_VINFO_VECTYPE (stmt_info);
-
- /* Check the operands of the operation. */
- op0 = gimple_assign_rhs1 (stmt);
- if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
- && INTEGRAL_TYPE_P (TREE_TYPE (op0)))
- || (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))
- && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
- && CONVERT_EXPR_CODE_P (code))))
- return false;
-
- if (INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
- && ((TYPE_PRECISION (TREE_TYPE (scalar_dest))
- != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (scalar_dest))))
- || ((TYPE_PRECISION (TREE_TYPE (op0))
- != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (op0)))))))
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "type promotion to/from bit-precision "
- "unsupported.");
- return false;
- }
-
- if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
- &def_stmt, &def, &dt[0], &vectype_in))
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "use not simple.");
- return false;
- }
-
- op_type = TREE_CODE_LENGTH (code);
- if (op_type == binary_op)
- {
- bool ok;
-
- op1 = gimple_assign_rhs2 (stmt);
- if (code == WIDEN_MULT_EXPR || code == WIDEN_LSHIFT_EXPR)
- {
- /* For WIDEN_MULT_EXPR, if OP0 is a constant, use the type of
- OP1. */
- if (CONSTANT_CLASS_P (op0))
- ok = vect_is_simple_use_1 (op1, loop_vinfo, NULL,
- &def_stmt, &def, &dt[1], &vectype_in);
- else
- ok = vect_is_simple_use (op1, loop_vinfo, NULL, &def_stmt, &def,
- &dt[1]);
-
- if (!ok)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "use not simple.");
- return false;
- }
- }
- }
-
- /* If op0 is an external or constant def use a vector type with
- the same size as the output vector type. */
- if (!vectype_in)
- vectype_in = get_same_sized_vectype (TREE_TYPE (op0), vectype_out);
- if (vec_stmt)
- gcc_assert (vectype_in);
- if (!vectype_in)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "no vectype for scalar type ");
- print_generic_expr (vect_dump, TREE_TYPE (op0), TDF_SLIM);
- }
-
- return false;
- }
-
- nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- if (nunits_in <= nunits_out)
- return false;
-
- /* Multiple types in SLP are handled by creating the appropriate number of
- vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
- case of SLP. */
- if (slp_node || PURE_SLP_STMT (stmt_info))
- ncopies = 1;
- else
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
-
- gcc_assert (ncopies >= 1);
-
- /* Supportable by target? */
- if (!supportable_widening_operation (code, stmt, vectype_out, vectype_in,
- &decl1, &decl2, &code1, &code2,
- &multi_step_cvt, &interm_types))
- return false;
-
- /* Binary widening operation can only be supported directly by the
- architecture. */
- gcc_assert (!(multi_step_cvt && op_type == binary_op));
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = type_promotion_vec_info_type;
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "=== vectorizable_promotion ===");
- vect_model_simple_cost (stmt_info, 2*ncopies, dt, NULL);
- return true;
- }
-
- /** Transform. **/
-
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "transform type promotion operation. ncopies = %d.",
- ncopies);
-
- if (code == WIDEN_MULT_EXPR || code == WIDEN_LSHIFT_EXPR)
- {
- if (CONSTANT_CLASS_P (op0))
- op0 = fold_convert (TREE_TYPE (op1), op0);
- else if (CONSTANT_CLASS_P (op1))
- op1 = fold_convert (TREE_TYPE (op0), op1);
- }
-
- /* Handle def. */
- /* In case of multi-step promotion, we first generate promotion operations
- to the intermediate types, and then from that types to the final one.
- We store vector destination in VEC_DSTS in the correct order for
- recursive creation of promotion operations in
- vect_create_vectorized_promotion_stmts(). Vector destinations are created
- according to TYPES recieved from supportable_widening_operation(). */
- if (multi_step_cvt)
- vec_dsts = VEC_alloc (tree, heap, multi_step_cvt + 1);
- else
- vec_dsts = VEC_alloc (tree, heap, 1);
-
- vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
- VEC_quick_push (tree, vec_dsts, vec_dest);
-
- if (multi_step_cvt)
- {
- for (i = VEC_length (tree, interm_types) - 1;
- VEC_iterate (tree, interm_types, i, intermediate_type); i--)
- {
- vec_dest = vect_create_destination_var (scalar_dest,
- intermediate_type);
- VEC_quick_push (tree, vec_dsts, vec_dest);
- }
- }
-
- if (!slp_node)
- {
- vec_oprnds0 = VEC_alloc (tree, heap,
- (multi_step_cvt ? vect_pow2 (multi_step_cvt) : 1));
- if (op_type == binary_op)
- vec_oprnds1 = VEC_alloc (tree, heap, 1);
- }
- else if (code == WIDEN_LSHIFT_EXPR)
- vec_oprnds1 = VEC_alloc (tree, heap, slp_node->vec_stmts_size);
-
- /* In case the vectorization factor (VF) is bigger than the number
- of elements that we can fit in a vectype (nunits), we have to generate
- more than one vector stmt - i.e - we need to "unroll" the
- vector stmt by a factor VF/nunits. */
-
- prev_stmt_info = NULL;
- for (j = 0; j < ncopies; j++)
- {
- /* Handle uses. */
- if (j == 0)
- {
- if (slp_node)
- {
- if (code == WIDEN_LSHIFT_EXPR)
- {
- vec_oprnd1 = op1;
- /* Store vec_oprnd1 for every vector stmt to be created
- for SLP_NODE. We check during the analysis that all
- the shift arguments are the same. */
- for (k = 0; k < slp_node->vec_stmts_size - 1; k++)
- VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
-
- vect_get_slp_defs (op0, NULL_TREE, slp_node, &vec_oprnds0, NULL,
- -1);
- }
- else
- vect_get_slp_defs (op0, op1, slp_node, &vec_oprnds0,
- &vec_oprnds1, -1);
- }
- else
- {
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- VEC_quick_push (tree, vec_oprnds0, vec_oprnd0);
- if (op_type == binary_op)
- {
- if (code == WIDEN_LSHIFT_EXPR)
- vec_oprnd1 = op1;
- else
- vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt, NULL);
- VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
- }
- }
- }
- else
- {
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
- VEC_replace (tree, vec_oprnds0, 0, vec_oprnd0);
- if (op_type == binary_op)
- {
- if (code == WIDEN_LSHIFT_EXPR)
- vec_oprnd1 = op1;
- else
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd1);
- VEC_replace (tree, vec_oprnds1, 0, vec_oprnd1);
- }
- }
-
- /* Arguments are ready. Create the new vector stmts. */
- tmp_vec_dsts = VEC_copy (tree, heap, vec_dsts);
- vect_create_vectorized_promotion_stmts (&vec_oprnds0, &vec_oprnds1,
- multi_step_cvt, stmt,
- tmp_vec_dsts,
- gsi, slp_node, code1, code2,
- decl1, decl2, op_type,
- &prev_stmt_info);
- }
-
- VEC_free (tree, heap, vec_dsts);
- VEC_free (tree, heap, tmp_vec_dsts);
- VEC_free (tree, heap, interm_types);
- VEC_free (tree, heap, vec_oprnds0);
- VEC_free (tree, heap, vec_oprnds1);
-
- *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
- return true;
-}
-
-
/* Function vectorizable_store.
Check if STMT defines a non scalar data-ref (array/pointer/structure) that
@@ -3870,6 +3679,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
+ op = gimple_assign_rhs1 (first_stmt);
}
else
/* VEC_NUM is the number of vect stmts to be created for this
@@ -3952,8 +3762,8 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
if (slp)
{
/* Get vectorized arguments for SLP_NODE. */
- vect_get_slp_defs (NULL_TREE, NULL_TREE, slp_node, &vec_oprnds,
- NULL, -1);
+ vect_get_vec_defs (op, NULL_TREE, stmt, &vec_oprnds,
+ NULL, slp_node, -1);
vec_oprnd = VEC_index (tree, vec_oprnds, 0);
}
@@ -4120,23 +3930,17 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
return true;
}
-/* Given a vector type VECTYPE returns a builtin DECL to be used
- for vector permutation and returns the mask that implements
- reversal of the vector elements. If that is impossible to do,
- returns NULL. */
+/* Given a vector type VECTYPE and permutation SEL returns
+ the VECTOR_CST mask that implements the permutation of the
+ vector elements. If that is impossible to do, returns NULL. */
static tree
-perm_mask_for_reverse (tree vectype)
+gen_perm_mask (tree vectype, unsigned char *sel)
{
tree mask_elt_type, mask_type, mask_vec;
int i, nunits;
- unsigned char *sel;
nunits = TYPE_VECTOR_SUBPARTS (vectype);
- sel = XALLOCAVEC (unsigned char, nunits);
-
- for (i = 0; i < nunits; ++i)
- sel[i] = nunits - 1 - i;
if (!can_vec_perm_p (TYPE_MODE (vectype), false, sel))
return NULL;
@@ -4147,33 +3951,52 @@ perm_mask_for_reverse (tree vectype)
mask_type = get_vectype_for_scalar_type (mask_elt_type);
mask_vec = NULL;
- for (i = 0; i < nunits; i++)
- mask_vec = tree_cons (NULL, build_int_cst (mask_elt_type, i), mask_vec);
+ for (i = nunits - 1; i >= 0; i--)
+ mask_vec = tree_cons (NULL, build_int_cst (mask_elt_type, sel[i]),
+ mask_vec);
mask_vec = build_vector (mask_type, mask_vec);
return mask_vec;
}
-/* Given a vector variable X, that was generated for the scalar LHS of
- STMT, generate instructions to reverse the vector elements of X,
- insert them a *GSI and return the permuted vector variable. */
+/* Given a vector type VECTYPE returns the VECTOR_CST mask that implements
+ reversal of the vector elements. If that is impossible to do,
+ returns NULL. */
static tree
-reverse_vec_elements (tree x, gimple stmt, gimple_stmt_iterator *gsi)
+perm_mask_for_reverse (tree vectype)
+{
+ int i, nunits;
+ unsigned char *sel;
+
+ nunits = TYPE_VECTOR_SUBPARTS (vectype);
+ sel = XALLOCAVEC (unsigned char, nunits);
+
+ for (i = 0; i < nunits; ++i)
+ sel[i] = nunits - 1 - i;
+
+ return gen_perm_mask (vectype, sel);
+}
+
+/* Given a vector variable X and Y, that was generated for the scalar
+ STMT, generate instructions to permute the vector elements of X and Y
+ using permutation mask MASK_VEC, insert them at *GSI and return the
+ permuted vector variable. */
+
+static tree
+permute_vec_elements (tree x, tree y, tree mask_vec, gimple stmt,
+ gimple_stmt_iterator *gsi)
{
tree vectype = TREE_TYPE (x);
- tree mask_vec, perm_dest, data_ref;
+ tree perm_dest, data_ref;
gimple perm_stmt;
- mask_vec = perm_mask_for_reverse (vectype);
-
perm_dest = vect_create_destination_var (gimple_assign_lhs (stmt), vectype);
+ data_ref = make_ssa_name (perm_dest, NULL);
/* Generate the permute statement. */
- perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
- x, x, mask_vec);
- data_ref = make_ssa_name (perm_dest, perm_stmt);
- gimple_set_lhs (perm_stmt, data_ref);
+ perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
+ x, y, mask_vec);
vect_finish_stmt_generation (stmt, perm_stmt, gsi);
return data_ref;
@@ -4232,6 +4055,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
int vf;
tree aggr_type;
+ tree gather_base = NULL_TREE, gather_off = NULL_TREE;
+ tree gather_off_vectype = NULL_TREE, gather_decl = NULL_TREE;
+ int gather_scale = 1;
+ enum vect_def_type gather_dt = vect_unknown_def_type;
if (loop_vinfo)
{
@@ -4312,7 +4139,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{
strided_load = true;
/* FORNOW */
- gcc_assert (! nested_in_vect_loop);
+ gcc_assert (! nested_in_vect_loop && !STMT_VINFO_GATHER_P (stmt_info));
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
if (!slp && !PURE_SLP_STMT (stmt_info))
@@ -4327,7 +4154,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
if (negative)
{
- gcc_assert (!strided_load);
+ gcc_assert (!strided_load && !STMT_VINFO_GATHER_P (stmt_info));
alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
if (alignment_support_scheme != dr_aligned
&& alignment_support_scheme != dr_unaligned_supported)
@@ -4344,6 +4171,23 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
}
+ if (STMT_VINFO_GATHER_P (stmt_info))
+ {
+ gimple def_stmt;
+ tree def;
+ gather_decl = vect_check_gather (stmt, loop_vinfo, &gather_base,
+ &gather_off, &gather_scale);
+ gcc_assert (gather_decl);
+ if (!vect_is_simple_use_1 (gather_off, loop_vinfo, bb_vinfo,
+ &def_stmt, &def, &gather_dt,
+ &gather_off_vectype))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "gather index use not simple.");
+ return false;
+ }
+ }
+
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = load_vec_info_type;
@@ -4356,6 +4200,161 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
/** Transform. **/
+ if (STMT_VINFO_GATHER_P (stmt_info))
+ {
+ tree vec_oprnd0 = NULL_TREE, op;
+ tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gather_decl));
+ tree rettype, srctype, ptrtype, idxtype, masktype, scaletype;
+ tree ptr, mask, var, scale, perm_mask = NULL_TREE, prev_res = NULL_TREE;
+ edge pe = loop_preheader_edge (loop);
+ gimple_seq seq;
+ basic_block new_bb;
+ enum { NARROW, NONE, WIDEN } modifier;
+ int gather_off_nunits = TYPE_VECTOR_SUBPARTS (gather_off_vectype);
+
+ if (nunits == gather_off_nunits)
+ modifier = NONE;
+ else if (nunits == gather_off_nunits / 2)
+ {
+ unsigned char *sel = XALLOCAVEC (unsigned char, gather_off_nunits);
+ modifier = WIDEN;
+
+ for (i = 0; i < gather_off_nunits; ++i)
+ sel[i] = i | nunits;
+
+ perm_mask = gen_perm_mask (gather_off_vectype, sel);
+ gcc_assert (perm_mask != NULL_TREE);
+ }
+ else if (nunits == gather_off_nunits * 2)
+ {
+ unsigned char *sel = XALLOCAVEC (unsigned char, nunits);
+ modifier = NARROW;
+
+ for (i = 0; i < nunits; ++i)
+ sel[i] = i < gather_off_nunits
+ ? i : i + nunits - gather_off_nunits;
+
+ perm_mask = gen_perm_mask (vectype, sel);
+ gcc_assert (perm_mask != NULL_TREE);
+ ncopies *= 2;
+ }
+ else
+ gcc_unreachable ();
+
+ rettype = TREE_TYPE (TREE_TYPE (gather_decl));
+ srctype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ ptrtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ idxtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ masktype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ scaletype = TREE_VALUE (arglist);
+ gcc_checking_assert (types_compatible_p (srctype, rettype)
+ && types_compatible_p (srctype, masktype));
+
+ vec_dest = vect_create_destination_var (scalar_dest, vectype);
+
+ ptr = fold_convert (ptrtype, gather_base);
+ if (!is_gimple_min_invariant (ptr))
+ {
+ ptr = force_gimple_operand (ptr, &seq, true, NULL_TREE);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, seq);
+ gcc_assert (!new_bb);
+ }
+
+ /* Currently we support only unconditional gather loads,
+ so mask should be all ones. */
+ if (TREE_CODE (TREE_TYPE (masktype)) == INTEGER_TYPE)
+ mask = build_int_cst (TREE_TYPE (masktype), -1);
+ else if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (masktype)))
+ {
+ REAL_VALUE_TYPE r;
+ long tmp[6];
+ for (j = 0; j < 6; ++j)
+ tmp[j] = -1;
+ real_from_target (&r, tmp, TYPE_MODE (TREE_TYPE (masktype)));
+ mask = build_real (TREE_TYPE (masktype), r);
+ }
+ else
+ gcc_unreachable ();
+ mask = build_vector_from_val (masktype, mask);
+ mask = vect_init_vector (stmt, mask, masktype, NULL);
+
+ scale = build_int_cst (scaletype, gather_scale);
+
+ prev_stmt_info = NULL;
+ for (j = 0; j < ncopies; ++j)
+ {
+ if (modifier == WIDEN && (j & 1))
+ op = permute_vec_elements (vec_oprnd0, vec_oprnd0,
+ perm_mask, stmt, gsi);
+ else if (j == 0)
+ op = vec_oprnd0
+ = vect_get_vec_def_for_operand (gather_off, stmt, NULL);
+ else
+ op = vec_oprnd0
+ = vect_get_vec_def_for_stmt_copy (gather_dt, vec_oprnd0);
+
+ if (!useless_type_conversion_p (idxtype, TREE_TYPE (op)))
+ {
+ gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (op))
+ == TYPE_VECTOR_SUBPARTS (idxtype));
+ var = vect_get_new_vect_var (idxtype, vect_simple_var, NULL);
+ add_referenced_var (var);
+ var = make_ssa_name (var, NULL);
+ op = build1 (VIEW_CONVERT_EXPR, idxtype, op);
+ new_stmt
+ = gimple_build_assign_with_ops (VIEW_CONVERT_EXPR, var,
+ op, NULL_TREE);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ op = var;
+ }
+
+ new_stmt
+ = gimple_build_call (gather_decl, 5, mask, ptr, op, mask, scale);
+
+ if (!useless_type_conversion_p (vectype, rettype))
+ {
+ gcc_assert (TYPE_VECTOR_SUBPARTS (vectype)
+ == TYPE_VECTOR_SUBPARTS (rettype));
+ var = vect_get_new_vect_var (rettype, vect_simple_var, NULL);
+ add_referenced_var (var);
+ op = make_ssa_name (var, new_stmt);
+ gimple_call_set_lhs (new_stmt, op);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ var = make_ssa_name (vec_dest, NULL);
+ op = build1 (VIEW_CONVERT_EXPR, vectype, op);
+ new_stmt
+ = gimple_build_assign_with_ops (VIEW_CONVERT_EXPR, var, op,
+ NULL_TREE);
+ }
+ else
+ {
+ var = make_ssa_name (vec_dest, new_stmt);
+ gimple_call_set_lhs (new_stmt, var);
+ }
+
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+
+ if (modifier == NARROW)
+ {
+ if ((j & 1) == 0)
+ {
+ prev_res = var;
+ continue;
+ }
+ var = permute_vec_elements (prev_res, var,
+ perm_mask, stmt, gsi);
+ new_stmt = SSA_NAME_DEF_STMT (var);
+ }
+
+ if (prev_stmt_info == NULL)
+ STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ return true;
+ }
+
if (strided_load)
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
@@ -4726,11 +4725,20 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
/* 4. Handle invariant-load. */
if (inv_p && !bb_vinfo)
{
- tree vec_inv;
+ tree tem, vec_inv;
gimple_stmt_iterator gsi2 = *gsi;
gcc_assert (!strided_load);
gsi_next (&gsi2);
- vec_inv = build_vector_from_val (vectype, scalar_dest);
+ tem = scalar_dest;
+ if (!useless_type_conversion_p (TREE_TYPE (vectype),
+ TREE_TYPE (tem)))
+ {
+ tem = fold_convert (TREE_TYPE (vectype), tem);
+ tem = force_gimple_operand_gsi (&gsi2, tem, true,
+ NULL_TREE, true,
+ GSI_SAME_STMT);
+ }
+ vec_inv = build_vector_from_val (vectype, tem);
new_temp = vect_init_vector (stmt, vec_inv,
vectype, &gsi2);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
@@ -4738,7 +4746,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
if (negative)
{
- new_temp = reverse_vec_elements (new_temp, stmt, gsi);
+ tree perm_mask = perm_mask_for_reverse (vectype);
+ new_temp = permute_vec_elements (new_temp, new_temp,
+ perm_mask, stmt, gsi);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
@@ -4803,7 +4813,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
condition operands are supportable using vec_is_simple_use. */
static bool
-vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, tree *comp_vectype)
+vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
+ tree *comp_vectype)
{
tree lhs, rhs;
tree def;
@@ -4819,7 +4830,7 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, tree *comp_vectype)
if (TREE_CODE (lhs) == SSA_NAME)
{
gimple lhs_def_stmt = SSA_NAME_DEF_STMT (lhs);
- if (!vect_is_simple_use_1 (lhs, loop_vinfo, NULL, &lhs_def_stmt, &def,
+ if (!vect_is_simple_use_1 (lhs, loop_vinfo, bb_vinfo, &lhs_def_stmt, &def,
&dt, &vectype1))
return false;
}
@@ -4830,11 +4841,11 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, tree *comp_vectype)
if (TREE_CODE (rhs) == SSA_NAME)
{
gimple rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
- if (!vect_is_simple_use_1 (rhs, loop_vinfo, NULL, &rhs_def_stmt, &def,
+ if (!vect_is_simple_use_1 (rhs, loop_vinfo, bb_vinfo, &rhs_def_stmt, &def,
&dt, &vectype2))
return false;
}
- else if (TREE_CODE (rhs) != INTEGER_CST && TREE_CODE (rhs) != REAL_CST
+ else if (TREE_CODE (rhs) != INTEGER_CST && TREE_CODE (rhs) != REAL_CST
&& TREE_CODE (rhs) != FIXED_CST)
return false;
@@ -4857,7 +4868,8 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, tree *comp_vectype)
bool
vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
- gimple *vec_stmt, tree reduc_def, int reduc_index)
+ gimple *vec_stmt, tree reduc_def, int reduc_index,
+ slp_tree slp_node)
{
tree scalar_dest = NULL_TREE;
tree vec_dest = NULL_TREE;
@@ -4873,23 +4885,27 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
tree def;
enum vect_def_type dt, dts[4];
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
+ int ncopies;
enum tree_code code;
stmt_vec_info prev_stmt_info = NULL;
- int j;
-
- /* FORNOW: unsupported in basic block SLP. */
- gcc_assert (loop_vinfo);
+ int i, j;
+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
+ VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
+ VEC (tree, heap) *vec_oprnds2 = NULL, *vec_oprnds3 = NULL;
- /* FORNOW: SLP not supported. */
- if (STMT_SLP_TYPE (stmt_info))
- return false;
+ if (slp_node || PURE_SLP_STMT (stmt_info))
+ ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (reduc_index && ncopies > 1)
return false; /* FORNOW */
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
+ if (reduc_index && STMT_SLP_TYPE (stmt_info))
+ return false;
+
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
@@ -4918,14 +4934,14 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
then_clause = gimple_assign_rhs2 (stmt);
else_clause = gimple_assign_rhs3 (stmt);
- if (!vect_is_simple_cond (cond_expr, loop_vinfo, &comp_vectype)
+ if (!vect_is_simple_cond (cond_expr, loop_vinfo, bb_vinfo, &comp_vectype)
|| !comp_vectype)
return false;
if (TREE_CODE (then_clause) == SSA_NAME)
{
gimple then_def_stmt = SSA_NAME_DEF_STMT (then_clause);
- if (!vect_is_simple_use (then_clause, loop_vinfo, NULL,
+ if (!vect_is_simple_use (then_clause, loop_vinfo, bb_vinfo,
&then_def_stmt, &def, &dt))
return false;
}
@@ -4937,7 +4953,7 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
if (TREE_CODE (else_clause) == SSA_NAME)
{
gimple else_def_stmt = SSA_NAME_DEF_STMT (else_clause);
- if (!vect_is_simple_use (else_clause, loop_vinfo, NULL,
+ if (!vect_is_simple_use (else_clause, loop_vinfo, bb_vinfo,
&else_def_stmt, &def, &dt))
return false;
}
@@ -4952,7 +4968,15 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
return expand_vec_cond_expr_p (vectype, comp_vectype);
}
- /* Transform */
+ /* Transform. */
+
+ if (!slp_node)
+ {
+ vec_oprnds0 = VEC_alloc (tree, heap, 1);
+ vec_oprnds1 = VEC_alloc (tree, heap, 1);
+ vec_oprnds2 = VEC_alloc (tree, heap, 1);
+ vec_oprnds3 = VEC_alloc (tree, heap, 1);
+ }
/* Handle def. */
scalar_dest = gimple_assign_lhs (stmt);
@@ -4961,67 +4985,118 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
/* Handle cond expr. */
for (j = 0; j < ncopies; j++)
{
- gimple new_stmt;
+ gimple new_stmt = NULL;
if (j == 0)
{
- gimple gtemp;
- vec_cond_lhs =
+ if (slp_node)
+ {
+ VEC (tree, heap) *ops = VEC_alloc (tree, heap, 4);
+ VEC (slp_void_p, heap) *vec_defs;
+
+ vec_defs = VEC_alloc (slp_void_p, heap, 4);
+ VEC_safe_push (tree, heap, ops, TREE_OPERAND (cond_expr, 0));
+ VEC_safe_push (tree, heap, ops, TREE_OPERAND (cond_expr, 1));
+ VEC_safe_push (tree, heap, ops, then_clause);
+ VEC_safe_push (tree, heap, ops, else_clause);
+ vect_get_slp_defs (ops, slp_node, &vec_defs, -1);
+ vec_oprnds3 = (VEC (tree, heap) *) VEC_pop (slp_void_p, vec_defs);
+ vec_oprnds2 = (VEC (tree, heap) *) VEC_pop (slp_void_p, vec_defs);
+ vec_oprnds1 = (VEC (tree, heap) *) VEC_pop (slp_void_p, vec_defs);
+ vec_oprnds0 = (VEC (tree, heap) *) VEC_pop (slp_void_p, vec_defs);
+
+ VEC_free (tree, heap, ops);
+ VEC_free (slp_void_p, heap, vec_defs);
+ }
+ else
+ {
+ gimple gtemp;
+ vec_cond_lhs =
vect_get_vec_def_for_operand (TREE_OPERAND (cond_expr, 0),
stmt, NULL);
- vect_is_simple_use (TREE_OPERAND (cond_expr, 0), loop_vinfo,
+ vect_is_simple_use (TREE_OPERAND (cond_expr, 0), loop_vinfo,
NULL, &gtemp, &def, &dts[0]);
- vec_cond_rhs =
- vect_get_vec_def_for_operand (TREE_OPERAND (cond_expr, 1),
- stmt, NULL);
- vect_is_simple_use (TREE_OPERAND (cond_expr, 1), loop_vinfo,
- NULL, &gtemp, &def, &dts[1]);
- if (reduc_index == 1)
- vec_then_clause = reduc_def;
- else
- {
- vec_then_clause = vect_get_vec_def_for_operand (then_clause,
- stmt, NULL);
- vect_is_simple_use (then_clause, loop_vinfo,
- NULL, &gtemp, &def, &dts[2]);
- }
- if (reduc_index == 2)
- vec_else_clause = reduc_def;
- else
- {
- vec_else_clause = vect_get_vec_def_for_operand (else_clause,
+
+ vec_cond_rhs =
+ vect_get_vec_def_for_operand (TREE_OPERAND (cond_expr, 1),
+ stmt, NULL);
+ vect_is_simple_use (TREE_OPERAND (cond_expr, 1), loop_vinfo,
+ NULL, &gtemp, &def, &dts[1]);
+ if (reduc_index == 1)
+ vec_then_clause = reduc_def;
+ else
+ {
+ vec_then_clause = vect_get_vec_def_for_operand (then_clause,
+ stmt, NULL);
+ vect_is_simple_use (then_clause, loop_vinfo,
+ NULL, &gtemp, &def, &dts[2]);
+ }
+ if (reduc_index == 2)
+ vec_else_clause = reduc_def;
+ else
+ {
+ vec_else_clause = vect_get_vec_def_for_operand (else_clause,
stmt, NULL);
- vect_is_simple_use (else_clause, loop_vinfo,
+ vect_is_simple_use (else_clause, loop_vinfo,
NULL, &gtemp, &def, &dts[3]);
+ }
}
}
else
{
- vec_cond_lhs = vect_get_vec_def_for_stmt_copy (dts[0], vec_cond_lhs);
- vec_cond_rhs = vect_get_vec_def_for_stmt_copy (dts[1], vec_cond_rhs);
+ vec_cond_lhs = vect_get_vec_def_for_stmt_copy (dts[0],
+ VEC_pop (tree, vec_oprnds0));
+ vec_cond_rhs = vect_get_vec_def_for_stmt_copy (dts[1],
+ VEC_pop (tree, vec_oprnds1));
vec_then_clause = vect_get_vec_def_for_stmt_copy (dts[2],
- vec_then_clause);
+ VEC_pop (tree, vec_oprnds2));
vec_else_clause = vect_get_vec_def_for_stmt_copy (dts[3],
- vec_else_clause);
+ VEC_pop (tree, vec_oprnds3));
+ }
+
+ if (!slp_node)
+ {
+ VEC_quick_push (tree, vec_oprnds0, vec_cond_lhs);
+ VEC_quick_push (tree, vec_oprnds1, vec_cond_rhs);
+ VEC_quick_push (tree, vec_oprnds2, vec_then_clause);
+ VEC_quick_push (tree, vec_oprnds3, vec_else_clause);
}
/* Arguments are ready. Create the new vector stmt. */
- vec_compare = build2 (TREE_CODE (cond_expr), vectype,
- vec_cond_lhs, vec_cond_rhs);
- vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
- vec_compare, vec_then_clause, vec_else_clause);
+ FOR_EACH_VEC_ELT (tree, vec_oprnds0, i, vec_cond_lhs)
+ {
+ vec_cond_rhs = VEC_index (tree, vec_oprnds1, i);
+ vec_then_clause = VEC_index (tree, vec_oprnds2, i);
+ vec_else_clause = VEC_index (tree, vec_oprnds3, i);
- new_stmt = gimple_build_assign (vec_dest, vec_cond_expr);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- gimple_assign_set_lhs (new_stmt, new_temp);
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ vec_compare = build2 (TREE_CODE (cond_expr), vectype,
+ vec_cond_lhs, vec_cond_rhs);
+ vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
+ vec_compare, vec_then_clause, vec_else_clause);
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ new_stmt = gimple_build_assign (vec_dest, vec_cond_expr);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ if (slp_node)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ }
+
+ if (slp_node)
+ continue;
+
+ if (j == 0)
+ STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
}
+ VEC_free (tree, heap, vec_oprnds0);
+ VEC_free (tree, heap, vec_oprnds1);
+ VEC_free (tree, heap, vec_oprnds2);
+ VEC_free (tree, heap, vec_oprnds3);
+
return true;
}
@@ -5060,7 +5135,7 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
In basic blocks we only analyze statements that are a part of some SLP
instance, therefore, all the statements are relevant.
- Pattern statement need to be analyzed instead of the original statement
+ Pattern statement needs to be analyzed instead of the original statement
if the original statement is not relevant. Otherwise, we analyze both
statements. */
@@ -5185,9 +5260,7 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
if (!bb_vinfo
&& (STMT_VINFO_RELEVANT_P (stmt_info)
|| STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def))
- ok = (vectorizable_type_promotion (stmt, NULL, NULL, NULL)
- || vectorizable_type_demotion (stmt, NULL, NULL, NULL)
- || vectorizable_conversion (stmt, NULL, NULL, NULL)
+ ok = (vectorizable_conversion (stmt, NULL, NULL, NULL)
|| vectorizable_shift (stmt, NULL, NULL, NULL)
|| vectorizable_operation (stmt, NULL, NULL, NULL)
|| vectorizable_assignment (stmt, NULL, NULL, NULL)
@@ -5195,17 +5268,17 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
|| vectorizable_call (stmt, NULL, NULL)
|| vectorizable_store (stmt, NULL, NULL, NULL)
|| vectorizable_reduction (stmt, NULL, NULL, NULL)
- || vectorizable_condition (stmt, NULL, NULL, NULL, 0));
+ || vectorizable_condition (stmt, NULL, NULL, NULL, 0, NULL));
else
{
if (bb_vinfo)
- ok = (vectorizable_type_promotion (stmt, NULL, NULL, node)
- || vectorizable_type_demotion (stmt, NULL, NULL, node)
- || vectorizable_shift (stmt, NULL, NULL, node)
+ ok = (vectorizable_conversion (stmt, NULL, NULL, node)
+ || vectorizable_shift (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node)
|| vectorizable_assignment (stmt, NULL, NULL, node)
|| vectorizable_load (stmt, NULL, NULL, node, NULL)
- || vectorizable_store (stmt, NULL, NULL, node));
+ || vectorizable_store (stmt, NULL, NULL, node)
+ || vectorizable_condition (stmt, NULL, NULL, NULL, 0, node));
}
if (!ok)
@@ -5262,15 +5335,7 @@ vect_transform_stmt (gimple stmt, gimple_stmt_iterator *gsi,
switch (STMT_VINFO_TYPE (stmt_info))
{
case type_demotion_vec_info_type:
- done = vectorizable_type_demotion (stmt, gsi, &vec_stmt, slp_node);
- gcc_assert (done);
- break;
-
case type_promotion_vec_info_type:
- done = vectorizable_type_promotion (stmt, gsi, &vec_stmt, slp_node);
- gcc_assert (done);
- break;
-
case type_conversion_vec_info_type:
done = vectorizable_conversion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
@@ -5321,8 +5386,7 @@ vect_transform_stmt (gimple stmt, gimple_stmt_iterator *gsi,
break;
case condition_vec_info_type:
- gcc_assert (!slp_node);
- done = vectorizable_condition (stmt, gsi, &vec_stmt, NULL, 0);
+ done = vectorizable_condition (stmt, gsi, &vec_stmt, NULL, 0, slp_node);
gcc_assert (done);
break;
@@ -5846,12 +5910,17 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
tree vectype = vectype_in;
tree wide_vectype = vectype_out;
enum tree_code c1, c2;
+ int i;
+ tree prev_type, intermediate_type;
+ enum machine_mode intermediate_mode, prev_mode;
+ optab optab3, optab4;
+ *multi_step_cvt = 0;
if (loop_info)
vect_loop = LOOP_VINFO_LOOP (loop_info);
/* The result of a vectorized widening operation usually requires two vectors
- (because the widened results do not fit int one vector). The generated
+ (because the widened results do not fit into one vector). The generated
vector results would normally be expected to be generated in the same
order as in the original scalar computation, i.e. if 8 results are
generated in each vector iteration, they are to be organized as follows:
@@ -5896,55 +5965,23 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
switch (code)
{
case WIDEN_MULT_EXPR:
- if (BYTES_BIG_ENDIAN)
- {
- c1 = VEC_WIDEN_MULT_HI_EXPR;
- c2 = VEC_WIDEN_MULT_LO_EXPR;
- }
- else
- {
- c2 = VEC_WIDEN_MULT_HI_EXPR;
- c1 = VEC_WIDEN_MULT_LO_EXPR;
- }
+ c1 = VEC_WIDEN_MULT_LO_EXPR;
+ c2 = VEC_WIDEN_MULT_HI_EXPR;
break;
case WIDEN_LSHIFT_EXPR:
- if (BYTES_BIG_ENDIAN)
- {
- c1 = VEC_WIDEN_LSHIFT_HI_EXPR;
- c2 = VEC_WIDEN_LSHIFT_LO_EXPR;
- }
- else
- {
- c2 = VEC_WIDEN_LSHIFT_HI_EXPR;
- c1 = VEC_WIDEN_LSHIFT_LO_EXPR;
- }
+ c1 = VEC_WIDEN_LSHIFT_LO_EXPR;
+ c2 = VEC_WIDEN_LSHIFT_HI_EXPR;
break;
CASE_CONVERT:
- if (BYTES_BIG_ENDIAN)
- {
- c1 = VEC_UNPACK_HI_EXPR;
- c2 = VEC_UNPACK_LO_EXPR;
- }
- else
- {
- c2 = VEC_UNPACK_HI_EXPR;
- c1 = VEC_UNPACK_LO_EXPR;
- }
+ c1 = VEC_UNPACK_LO_EXPR;
+ c2 = VEC_UNPACK_HI_EXPR;
break;
case FLOAT_EXPR:
- if (BYTES_BIG_ENDIAN)
- {
- c1 = VEC_UNPACK_FLOAT_HI_EXPR;
- c2 = VEC_UNPACK_FLOAT_LO_EXPR;
- }
- else
- {
- c2 = VEC_UNPACK_FLOAT_HI_EXPR;
- c1 = VEC_UNPACK_FLOAT_LO_EXPR;
- }
+ c1 = VEC_UNPACK_FLOAT_LO_EXPR;
+ c2 = VEC_UNPACK_FLOAT_HI_EXPR;
break;
case FIX_TRUNC_EXPR:
@@ -5957,6 +5994,13 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
gcc_unreachable ();
}
+ if (BYTES_BIG_ENDIAN)
+ {
+ enum tree_code ctmp = c1;
+ c1 = c2;
+ c2 = ctmp;
+ }
+
if (code == FIX_TRUNC_EXPR)
{
/* The signedness is determined from output operand. */
@@ -5977,65 +6021,60 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
|| (icode2 = optab_handler (optab2, vec_mode)) == CODE_FOR_nothing)
return false;
+ *code1 = c1;
+ *code2 = c2;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
+ && insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
+ return true;
+
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
- if (insn_data[icode1].operand[0].mode != TYPE_MODE (wide_vectype)
- || insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
- {
- int i;
- tree prev_type = vectype, intermediate_type;
- enum machine_mode intermediate_mode, prev_mode = vec_mode;
- optab optab3, optab4;
- if (!CONVERT_EXPR_CODE_P (code))
- return false;
+ prev_type = vectype;
+ prev_mode = vec_mode;
- *code1 = c1;
- *code2 = c2;
+ if (!CONVERT_EXPR_CODE_P (code))
+ return false;
- /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
- intermediate steps in promotion sequence. We try
- MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do
- not. */
- *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
- for (i = 0; i < 3; i++)
- {
- intermediate_mode = insn_data[icode1].operand[0].mode;
- intermediate_type = lang_hooks.types.type_for_mode (intermediate_mode,
- TYPE_UNSIGNED (prev_type));
- optab3 = optab_for_tree_code (c1, intermediate_type, optab_default);
- optab4 = optab_for_tree_code (c2, intermediate_type, optab_default);
-
- if (!optab3 || !optab4
- || ((icode1 = optab_handler (optab1, prev_mode))
- == CODE_FOR_nothing)
- || insn_data[icode1].operand[0].mode != intermediate_mode
- || ((icode2 = optab_handler (optab2, prev_mode))
- == CODE_FOR_nothing)
- || insn_data[icode2].operand[0].mode != intermediate_mode
- || ((icode1 = optab_handler (optab3, intermediate_mode))
- == CODE_FOR_nothing)
- || ((icode2 = optab_handler (optab4, intermediate_mode))
- == CODE_FOR_nothing))
- return false;
-
- VEC_quick_push (tree, *interm_types, intermediate_type);
- (*multi_step_cvt)++;
-
- if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
- && insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
-
- prev_type = intermediate_type;
- prev_mode = intermediate_mode;
- }
+ /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
+ intermediate steps in promotion sequence. We try
+ MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do
+ not. */
+ *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
+ for (i = 0; i < MAX_INTERM_CVT_STEPS; i++)
+ {
+ intermediate_mode = insn_data[icode1].operand[0].mode;
+ intermediate_type
+ = lang_hooks.types.type_for_mode (intermediate_mode,
+ TYPE_UNSIGNED (prev_type));
+ optab3 = optab_for_tree_code (c1, intermediate_type, optab_default);
+ optab4 = optab_for_tree_code (c2, intermediate_type, optab_default);
+
+ if (!optab3 || !optab4
+ || (icode1 = optab_handler (optab1, prev_mode)) == CODE_FOR_nothing
+ || insn_data[icode1].operand[0].mode != intermediate_mode
+ || (icode2 = optab_handler (optab2, prev_mode)) == CODE_FOR_nothing
+ || insn_data[icode2].operand[0].mode != intermediate_mode
+ || ((icode1 = optab_handler (optab3, intermediate_mode))
+ == CODE_FOR_nothing)
+ || ((icode2 = optab_handler (optab4, intermediate_mode))
+ == CODE_FOR_nothing))
+ break;
- return false;
+ VEC_quick_push (tree, *interm_types, intermediate_type);
+ (*multi_step_cvt)++;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
+ && insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
+ return true;
+
+ prev_type = intermediate_type;
+ prev_mode = intermediate_mode;
}
- *code1 = c1;
- *code2 = c2;
- return true;
+ VEC_free (tree, heap, *interm_types);
+ return false;
}
@@ -6071,9 +6110,12 @@ supportable_narrowing_operation (enum tree_code code,
tree vectype = vectype_in;
tree narrow_vectype = vectype_out;
enum tree_code c1;
- tree intermediate_type, prev_type;
+ tree intermediate_type;
+ enum machine_mode intermediate_mode, prev_mode;
int i;
+ bool uns;
+ *multi_step_cvt = 0;
switch (code)
{
CASE_CONVERT:
@@ -6106,47 +6148,70 @@ supportable_narrowing_operation (enum tree_code code,
if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing)
return false;
+ *code1 = c1;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
+ return true;
+
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
- if (insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
- {
- enum machine_mode intermediate_mode, prev_mode = vec_mode;
-
- *code1 = c1;
- prev_type = vectype;
- /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
- intermediate steps in promotion sequence. We try
- MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do
- not. */
- *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
- for (i = 0; i < 3; i++)
- {
- intermediate_mode = insn_data[icode1].operand[0].mode;
- intermediate_type = lang_hooks.types.type_for_mode (intermediate_mode,
- TYPE_UNSIGNED (prev_type));
- interm_optab = optab_for_tree_code (c1, intermediate_type,
- optab_default);
- if (!interm_optab
- || ((icode1 = optab_handler (optab1, prev_mode))
- == CODE_FOR_nothing)
- || insn_data[icode1].operand[0].mode != intermediate_mode
- || ((icode1 = optab_handler (interm_optab, intermediate_mode))
- == CODE_FOR_nothing))
- return false;
-
- VEC_quick_push (tree, *interm_types, intermediate_type);
- (*multi_step_cvt)++;
-
- if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
-
- prev_type = intermediate_type;
- prev_mode = intermediate_mode;
- }
+ prev_mode = vec_mode;
+ if (code == FIX_TRUNC_EXPR)
+ uns = TYPE_UNSIGNED (vectype_out);
+ else
+ uns = TYPE_UNSIGNED (vectype);
+
+ /* For multi-step FIX_TRUNC_EXPR prefer signed floating to integer
+ conversion over unsigned, as unsigned FIX_TRUNC_EXPR is often more
+ costly than signed. */
+ if (code == FIX_TRUNC_EXPR && uns)
+ {
+ enum insn_code icode2;
+
+ intermediate_type
+ = lang_hooks.types.type_for_mode (TYPE_MODE (vectype_out), 0);
+ interm_optab
+ = optab_for_tree_code (c1, intermediate_type, optab_default);
+ if (interm_optab != NULL
+ && (icode2 = optab_handler (optab1, vec_mode)) != CODE_FOR_nothing
+ && insn_data[icode1].operand[0].mode
+ == insn_data[icode2].operand[0].mode)
+ {
+ uns = false;
+ optab1 = interm_optab;
+ icode1 = icode2;
+ }
+ }
- return false;
+ /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
+ intermediate steps in promotion sequence. We try
+ MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do not. */
+ *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
+ for (i = 0; i < MAX_INTERM_CVT_STEPS; i++)
+ {
+ intermediate_mode = insn_data[icode1].operand[0].mode;
+ intermediate_type
+ = lang_hooks.types.type_for_mode (intermediate_mode, uns);
+ interm_optab
+ = optab_for_tree_code (VEC_PACK_TRUNC_EXPR, intermediate_type,
+ optab_default);
+ if (!interm_optab
+ || ((icode1 = optab_handler (optab1, prev_mode)) == CODE_FOR_nothing)
+ || insn_data[icode1].operand[0].mode != intermediate_mode
+ || ((icode1 = optab_handler (interm_optab, intermediate_mode))
+ == CODE_FOR_nothing))
+ break;
+
+ VEC_quick_push (tree, *interm_types, intermediate_type);
+ (*multi_step_cvt)++;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
+ return true;
+
+ prev_mode = intermediate_mode;
+ optab1 = interm_optab;
}
- *code1 = c1;
- return true;
+ VEC_free (tree, heap, *interm_types);
+ return false;
}
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 6703edb5ee0..927c0bd8cb5 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -73,15 +73,15 @@ enum vect_def_type {
/************************************************************************
SLP
************************************************************************/
+typedef void *slp_void_p;
+DEF_VEC_P (slp_void_p);
+DEF_VEC_ALLOC_P (slp_void_p, heap);
-/* A computation tree of an SLP instance. Each node corresponds to a group of
+/* A computation tree of an SLP instance. Each node corresponds to a group of
stmts to be packed in a SIMD stmt. */
typedef struct _slp_tree {
- /* Only binary and unary operations are supported. LEFT child corresponds to
- the first operand and RIGHT child to the second if the operation is
- binary. */
- struct _slp_tree *left;
- struct _slp_tree *right;
+ /* Nodes that contain def-stmts of this node statements operands. */
+ VEC (slp_void_p, heap) *children;
/* A group of scalar stmts to be vectorized together. */
VEC (gimple, heap) *stmts;
/* Vectorized stmt/s. */
@@ -146,14 +146,32 @@ DEF_VEC_ALLOC_P(slp_instance, heap);
#define SLP_INSTANCE_LOADS(S) (S)->loads
#define SLP_INSTANCE_FIRST_LOAD_STMT(S) (S)->first_load
-#define SLP_TREE_LEFT(S) (S)->left
-#define SLP_TREE_RIGHT(S) (S)->right
+#define SLP_TREE_CHILDREN(S) (S)->children
#define SLP_TREE_SCALAR_STMTS(S) (S)->stmts
#define SLP_TREE_VEC_STMTS(S) (S)->vec_stmts
#define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size
#define SLP_TREE_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop
#define SLP_TREE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop
+/* This structure is used in creation of an SLP tree. Each instance
+ corresponds to the same operand in a group of scalar stmts in an SLP
+ node. */
+typedef struct _slp_oprnd_info
+{
+ /* Def-stmts for the operands. */
+ VEC (gimple, heap) *def_stmts;
+ /* Information about the first statement, its vector def-type, type, the
+ operand itself in case it's constant, and an indication if it's a pattern
+ stmt. */
+ enum vect_def_type first_dt;
+ tree first_def_type;
+ tree first_const_oprnd;
+ bool first_pattern;
+} *slp_oprnd_info;
+
+DEF_VEC_P(slp_oprnd_info);
+DEF_VEC_ALLOC_P(slp_oprnd_info, heap);
+
typedef struct _vect_peel_info
{
@@ -517,6 +535,9 @@ typedef struct _stmt_vec_info {
/* Is this statement vectorizable or should it be skipped in (partial)
vectorization. */
bool vectorizable;
+
+ /* For loads only, true if this is a gather load. */
+ bool gather_p;
} *stmt_vec_info;
/* Access Functions. */
@@ -530,6 +551,7 @@ typedef struct _stmt_vec_info {
#define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
#define STMT_VINFO_VECTORIZABLE(S) (S)->vectorizable
#define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
+#define STMT_VINFO_GATHER_P(S) (S)->gather_p
#define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_base_address
#define STMT_VINFO_DR_INIT(S) (S)->dr_init
@@ -819,11 +841,13 @@ extern bool vect_transform_stmt (gimple, gimple_stmt_iterator *,
extern void vect_remove_stores (gimple);
extern bool vect_analyze_stmt (gimple, bool *, slp_tree);
extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *,
- tree, int);
+ tree, int, slp_tree);
extern void vect_get_load_cost (struct data_reference *, int, bool,
unsigned int *, unsigned int *);
extern void vect_get_store_cost (struct data_reference *, int, unsigned int *);
extern bool vect_supportable_shift (enum tree_code, tree);
+extern void vect_get_vec_defs (tree, tree, gimple, VEC (tree, heap) **,
+ VEC (tree, heap) **, slp_tree, int);
/* In tree-vect-data-refs.c. */
extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
@@ -838,6 +862,8 @@ extern bool vect_analyze_data_refs_alignment (loop_vec_info, bb_vec_info);
extern bool vect_verify_datarefs_alignment (loop_vec_info, bb_vec_info);
extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info);
extern bool vect_prune_runtime_alias_test_list (loop_vec_info);
+extern tree vect_check_gather (gimple, loop_vec_info, tree *, tree *,
+ int *);
extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
tree *, gimple_stmt_iterator *,
@@ -891,8 +917,9 @@ extern void vect_update_slp_costs_according_to_vf (loop_vec_info);
extern bool vect_analyze_slp (loop_vec_info, bb_vec_info);
extern bool vect_make_slp_decision (loop_vec_info);
extern void vect_detect_hybrid_slp (loop_vec_info);
-extern void vect_get_slp_defs (tree, tree, slp_tree, VEC (tree,heap) **,
- VEC (tree,heap) **, int);
+extern void vect_get_slp_defs (VEC (tree, heap) *, slp_tree,
+ VEC (slp_void_p, heap) **, int);
+
extern LOC find_bb_location (basic_block);
extern bb_vec_info vect_slp_analyze_bb (basic_block);
extern void vect_slp_transform_bb (basic_block);
diff --git a/gcc/tree.h b/gcc/tree.h
index 23108018236..3e1e225bd4e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1527,6 +1527,7 @@ struct GTY(()) tree_fixed_cst {
};
/* In a STRING_CST */
+/* In C terms, this is sizeof, not strlen. */
#define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
#define TREE_STRING_POINTER(NODE) \
((const char *)(STRING_CST_CHECK (NODE)->string.str))
@@ -2699,7 +2700,9 @@ struct function;
nodes, this points to either the FUNCTION_DECL for the containing
function, the RECORD_TYPE or UNION_TYPE for the containing type, or
NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
- scope". */
+ scope". In particular, for VAR_DECLs which are virtual table pointers
+ (they have DECL_VIRTUAL set), we use DECL_CONTEXT to determine the type
+ they belong to. */
#define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
#define DECL_FIELD_CONTEXT(NODE) \
(FIELD_DECL_CHECK (NODE)->decl_minimal.context)
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 11d4efdcdc2..95bc02b183c 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -9517,6 +9517,12 @@ vt_initialize (void)
return true;
}
+/* This is *not* reset after each function. It gives each
+ NOTE_INSN_DELETED_DEBUG_LABEL in the entire compilation
+ a unique label number. */
+
+static int debug_label_num = 1;
+
/* Get rid of all debug insns from the insn stream. */
static void
@@ -9532,7 +9538,22 @@ delete_debug_insns (void)
{
FOR_BB_INSNS_SAFE (bb, insn, next)
if (DEBUG_INSN_P (insn))
- delete_insn (insn);
+ {
+ tree decl = INSN_VAR_LOCATION_DECL (insn);
+ if (TREE_CODE (decl) == LABEL_DECL
+ && DECL_NAME (decl)
+ && !DECL_RTL_SET_P (decl))
+ {
+ PUT_CODE (insn, NOTE);
+ NOTE_KIND (insn) = NOTE_INSN_DELETED_DEBUG_LABEL;
+ NOTE_DELETED_LABEL_NAME (insn)
+ = IDENTIFIER_POINTER (DECL_NAME (decl));
+ SET_DECL_RTL (decl, insn);
+ CODE_LABEL_NUMBER (insn) = debug_label_num++;
+ }
+ else
+ delete_insn (insn);
+ }
}
}
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 64ed4683669..8f7d494fc91 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,20 @@
+2011-11-03 Michael Matz <matz@suse.de>
+
+ PR bootstrap/50857
+ * configure.ac: Check for -fno-exceptions -fno-rtti.
+ * configure: Regenerate.
+ * Makefile.in (NOEXCEPTION_FLAGS): New flag.
+ (ALL_CXXFLAGS): Use it.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
+
+2011-11-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/50810
+ * configure.ac: Add -Wno-narrowing to warning options.
+
2011-10-31 Jason Merrill <jason@redhat.com>
PR libstdc++/1773
diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
index 33c44b542df..d6df46d62c9 100644
--- a/libcpp/Makefile.in
+++ b/libcpp/Makefile.in
@@ -56,6 +56,7 @@ XGETTEXT = @XGETTEXT@
CCDEPMODE = @CCDEPMODE@
CXXDEPMODE = @CXXDEPMODE@
DEPDIR = @DEPDIR@
+NOEXCEPTION_FLAGS = @noexception_flags@
datarootdir = @datarootdir@
datadir = @datadir@
@@ -72,7 +73,8 @@ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
-I$(srcdir)/include
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
-ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(INCLUDES) $(CPPFLAGS)
+ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
+ $(CPPFLAGS)
# The name of the compiler to use.
ENABLE_BUILD_WITH_CXX = @ENABLE_BUILD_WITH_CXX@
diff --git a/libcpp/configure b/libcpp/configure
index c400d23a93d..803daae2b2e 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -616,6 +616,7 @@ CCDEPMODE
DEPDIR
am__leading_dot
WERROR
+noexception_flags
WARN_PEDANTIC
c_warn
warn
@@ -4687,7 +4688,7 @@ test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader"
warn=
save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wwrite-strings \
+for option in -W -Wall -Wno-narrowing -Wwrite-strings \
-Wmissing-format-attribute; do
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
@@ -4802,6 +4803,47 @@ fi
fi
+# Disable exceptions and RTTI if building with g++
+noexception_flags=
+save_CFLAGS="$CFLAGS"
+for option in -fno-exceptions -fno-rtti; do
+ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
+$as_echo_n "checking whether $CC supports $option... " >&6; }
+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ CFLAGS="$option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_acx_Woption=yes"
+else
+ eval "$as_acx_Woption=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$$as_acx_Woption
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
+ noexception_flags="$noexception_flags${noexception_flags:+ }$option"
+fi
+ done
+CFLAGS="$save_CFLAGS"
+
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
WERROR=
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index e1d88511c78..83d5bb6e827 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -33,12 +33,16 @@ AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
-ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings \
+ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
-Wmissing-format-attribute], [warn])
ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
-Wold-style-definition -Wc++-compat], [c_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
+# Disable exceptions and RTTI if building with g++
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
diff --git a/libcpp/internal.h b/libcpp/internal.h
index e60330df490..b3dc2df10bf 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -739,8 +739,8 @@ static inline int ustrcmp (const unsigned char *, const unsigned char *);
static inline int ustrncmp (const unsigned char *, const unsigned char *,
size_t);
static inline size_t ustrlen (const unsigned char *);
-static inline unsigned char *uxstrdup (const unsigned char *);
-static inline unsigned char *ustrchr (const unsigned char *, int);
+static inline const unsigned char *uxstrdup (const unsigned char *);
+static inline const unsigned char *ustrchr (const unsigned char *, int);
static inline int ufputs (const unsigned char *, FILE *);
/* Use a const char for the second parameter since it is usually a literal. */
@@ -770,16 +770,16 @@ ustrlen (const unsigned char *s1)
return strlen ((const char *)s1);
}
-static inline unsigned char *
+static inline const unsigned char *
uxstrdup (const unsigned char *s1)
{
- return (unsigned char *) xstrdup ((const char *)s1);
+ return (const unsigned char *) xstrdup ((const char *)s1);
}
-static inline unsigned char *
+static inline const unsigned char *
ustrchr (const unsigned char *s1, int c)
{
- return (unsigned char *) strchr ((const char *)s1, c);
+ return (const unsigned char *) strchr ((const char *)s1, c);
}
static inline int
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index a261e7524cd..1f2070b03d7 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,1029 @@
+2011-11-07 Nathan Sidwell <nathan@acm.org>
+
+ * libgcov.c (struct gcov_fn_buffer): New struct.
+ (buffer_fn_data): New helper.
+ (gcov_exit): Rework for new gcov data structures.
+
+2011-11-07 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/49313
+ * config/avr/lib1funcs.S (__divmodhi4, __divmodsi4): Tweak speed.
+
+2011-11-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.host (tmake_file): Correct comment.
+ (bfin*-elf*): Remove bfin/t-elf from tmake_file, add
+ t-libgcc-pic.
+ (bfin*-uclinux*): Likewise.
+ (bfin*-linux-uclibc*): Likewise.
+ (xstormy16-*-elf): Add stormy16/t-stormy16 to tmake_file.
+
+ * config/arm/t-elf (HOST_LIBGCC2_CFLAGS): Append instead of
+ assigning.
+ * config/arm/t-strongarm-elf (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/avr/t-avr (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/c6x/t-elf (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/h8300/t-h8300 (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/lm32/t-elf (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/m32r/t-m32r (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/mcore/t-mcore (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/mips/t-elf (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/mmix/t-mmix (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/pdp11/t-pdp11 (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/picochip/t-picochip (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/stormy16/t-stormy16 (HOST_LIBGCC2_CFLAGS): Likewise.
+ * config/t-openbsd-thread (HOST_LIBGCC2_CFLAGS): Likewise.
+
+ * config/bfin/t-elf: Remove.
+ * config/t-vxworks (HOST_LIBGCC2_CFLAGS): Remove.
+
+2011-11-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.host (*-*-rtems*): Add t-rtems to tmake_file.
+ (i[34567]86-*-rtems*): Remove t-rtems from tmake_file.
+ (lm32-*-elf*, lm32-*-rtems*): Split into ...
+ (lm32-*-elf*): ... this.
+ (lm32-*-rtems*): ... and this.
+ Add to tmake_file.
+ (m32r-*-rtems*): Add to tmake_file.
+ (moxie-*-rtems*): Likewise.
+ (sparc-*-rtems*): Likewise.
+ Remove t-rtems from tmake_file.
+ (sparc64-*-rtems*): Likewise.
+ * config/t-rtems (HOST_LIBGCC2_CFLAGS): Use LIBGCC2_INCLUDES
+ instead.
+
+2011-11-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR bootstrap/50982
+ * config/gthr-posix.h: Move ...
+ * gthr-posix.h: ... here.
+ * config/gthr-lynx.h: Reflect this.
+ * config/gthr-vxworks.h: Likewise.
+ * config/rs6000/gthr-aix.h: Likewise.
+ * configure.ac (target_thread_file): Likewise.
+ * configure: Regenerate.
+
+2011-11-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config.host (arm*-*-rtemseabi*): New target.
+
+2011-11-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR other/50991
+ * Makefile.in: Make EXTRA_PARTS depend on libgcc_tm.h instead of
+ extra-parts.
+
+2011-11-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * config.host (epiphany-*-elf*): New configuration.
+ * config/epiphany: New Directory.
+
+2011-11-05 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config.host (avr-*-rtems*): Add config/avr/t-rtems.
+ * config/avr/t-rtems: New.
+ Filter out _exit from LIB1ASMFUNCS.
+
+2011-11-04 David S. Miller <davem@davemloft.net>
+
+ * configure.ac: Test for 64-bit addresses on !x86 using __LP64__.
+ * configure: Rebuild.
+
+2011-11-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/t-crtstuff: Add -fPIC to CRTSTUFF_T_CFLAGS_S
+ variable.
+
+2011-11-04 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50931
+ * config/t-avr (LIB1ASMFUNCS): Add _divmodpsi4, _udivmodpsi4.
+ * config/lib1funcs.S (__udivmodpsi4, __divmodpsi4): New functions.
+
+2011-11-04 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ PR target/50989
+ * config.host (sparc-*-rtems*): Add sparc/t-softmul.
+
+2011-11-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/c6x/t-elf (LIB2ADDEH): Set.
+ * config/c6x/t-c6x-elf: Remove.
+
+2011-11-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/i386/sol2-ci.S: Rename to ...
+ * config/i386/crti.S: ... this.
+ * config/i386/sol2-cn.S: Rename to ...
+ * config/i386/crtn.S: ... this.
+ * config/sparc/sol2-ci.S: Rename to ...
+ * config/sparc/crti.S: ... this.
+ * config/sparc/sol2-cn.S: Rename to ...
+ * config/sparc/crtn.S: ... this.
+ * config/t-sol2 (CUSTOM_CRTIN): Remove.
+ (crti.o, crtn.o): Remove.
+
+2011-11-04 Tristan Gingold <gingold@adacore.com>
+
+ * config/ia64/fde-vms.c: Do not include md-unwind-support.h
+
+2011-11-04 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/t-sh: Use $(gcc_compile) instead of $(compile).
+
+2011-11-03 Hans-Peter Nilsson <hp@axis.com>
+
+ * config.host (crisv32-*-none, cris-*-none): Remove.
+ (crisv32-*-elf): Append to tmake_file, don't just set it.
+ (cris-*-elf): Add missing t-fdpbit to tmake_file.
+
+2011-11-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/rs6000/t-ppccomm (ecrti$(objext)): Use $<.
+ (ecrtn$(objext)): Likewise.
+ (ncrti$(objext)): Likewise.
+ (ncrtn$(objext)): Likewise.
+
+2011-11-03 Andreas Schwab <schwab@redhat.com>
+
+ * config/ia64/t-ia64 (crtbeginS.o): Fix whitespace damage.
+
+2011-11-02 David S. Miller <davem@davemloft.net>
+
+ * configure.ac: Set host_address on sparc too.
+ * configure: Regenerate.
+ * config.host: Add sparc/t-linux64 and sparc/t-softmul conditionally
+ based upon host_address.
+ * config/sparc/t-linux64: Set CRTSTUFF_T_CFLAGS unconditionally.
+
+2011-11-02 Jason Merrill <jason@redhat.com>
+
+ * config/rs6000/t-ppccomm: Add missing \.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gthr-single.h, gthr.h: New files.
+ * config/gthr-lynx.h, config/gthr-posix.h., config/gthr-rtems.h,
+ config/gthr-vxworks.h, config/i386/gthr-win32.h,
+ config/mips/gthr-mipssde.h, config/pa/gthr-dce.h,
+ config/rs6000/gthr-aix.h, config/s390/gthr-tpf.h: New files.
+ * config/i386/gthr-win32.c: Include "gthr-win32.h".
+ * configure.ac (thread_header): New variable.
+ Set it depending on target_thread_file.
+ (gthr-default.h): Link from $thread_header.
+ * configure: Regenerate.
+ * Makefile.in (LIBGCC2_CFLAGS): Remove $(GTHREAD_FLAGS).
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (tm_file_): New variable.
+ Determine from tm_file.
+ (tm_file, tm_defines): Substitute.
+ * configure: Regenerate.
+ * mkheader.sh: New file.
+ * Makefile.in (clean): Remove libgcc_tm.h.
+ ($(objects)): Depend on libgcc_tm.h.
+ (libgcc_tm_defines, libgcc_tm_file): New variables.
+ (libgcc_tm.h, libgcc_tm.stamp): New targets.
+ ($(libgcc-objects), $(libgcc-s-objects), $(libgcc-eh-objects))
+ ($(libgcov-objects), $(libunwind-objects), $(libunwind-s-objects))
+ ($(extra-parts)): Depend on libgcc_tm.h.
+ * config.host (tm_defines, tm_file): New variable.
+ (arm*-*-linux*): Set tm_file for arm*-*-linux-*eabi.
+ (arm*-*-uclinux*): Set tm_file for arm*-*-uclinux*eabi.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Set tm_file.
+ (avr-*-rtems*): Likewise.
+ (avr-*-*): Likewise.
+ (frv-*-elf): Likewise.
+ (frv-*-*linux*): Likewise.
+ (h8300-*-rtems*): Likewise.
+ (h8300-*-elf*): Likewise.
+ (i[34567]86-*-darwin*): Likewise.
+ (x86_64-*-darwin*): Likewise.
+ (rx-*-elf): Likewise.
+ (tic6x-*-uclinux): Likewise.
+ (tic6x-*-elf): Likewise.
+ (i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
+ * config/alpha/gthr-posix.c: Include libgcc_tm.h.
+ * config/i386/cygming-crtbegin.c: Likewise.
+ * config/i386/cygming-crtend.c: Likewise.
+ * config/ia64/fde-vms.c: Likewise.
+ * config/ia64/unwind-ia64.c: Likewise.
+ * config/libbid/bid_gcc_intrinsics.h: Likewise.
+ * config/rs6000/darwin-fallback.c: Likewise.
+ * config/stormy16/lib2funcs.c: Likewise.
+ * config/xtensa/unwind-dw2-xtensa.c: Likewise.
+ * crtstuff.c: Likewise.
+ * dfp-bit.h: Likewise.
+ * emutls.c: Likewise.
+ * fixed-bit.c: Likewise.
+ * fp-bit.c: Likewise.
+ * generic-morestack-thread.c: Likewise.
+ * generic-morestack.c: Likewise.
+ * libgcc2.c: Likewise.
+ * libgcov.c: Likewise.
+ * unwind-dw2-fde-dip.c: Likewise.
+ * unwind-dw2-fde.c: Likewise.
+ * unwind-dw2.c: Likewise.
+ * unwind-sjlj.c: Likewise.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Include ../config/picflag.m4.
+ (GCC_PICFLAG): Call it.
+ Substitute.
+ * configure: Regenerate.
+ * Makefile.in (gcc_srcdir): Remove.
+ (LIBGCC2_DEBUG_CFLAGS, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES)
+ (HOST_LIBGCC2_CFLAGS, PICFLAG, LIB2FUNCS_ST, LIB2FUNCS_EXCLUDE)
+ (LIB2_DIVMOD_FUNCS, LIB2ADD, LIB2ADD_ST): Set.
+ ($(lib2funcs-o), $(lib2funcs-s-o), $(lib2-divmod-o))
+ ($(lib2-divmod-s-o)): Use $(srcdir) to refer to libgcc2.c.
+ Use $<.
+ Remove comment.
+ * libgcc2.c, libgcc2.h, gbl-ctors.h, longlong.h: New files.
+ * siditi-object.mk ($o$(objext), $(o)_s$(objext)): Use $(srcdir)
+ to refer to libgcc2.c.
+ Use $<.
+ * config/darwin-64.c: New file.
+ * config/darwin-crt3.c: Remove comment.
+ * config/divmod.c, config/floatunsidf.c, config/floatunsisf.c,
+ config/floatunsitf.c, config/floatunsixf.c, config/udivmod.c,
+ config/udivmodsi4.c: New files.
+ * config/memcmp.c, config/memcpy.c, config/memmove.c,
+ config/memset.c: New files.
+ * config/t-crtstuff-pic (CRTSTUFF_T_CFLAGS_S): Use $(PICFLAG).
+ * config/t-darwin (HOST_LIBGCC2_CFLAGS): Set.
+ * config/t-freebsd-thread, config/t-libgcc-pic: New files.
+ * config/t-libunwind (HOST_LIBGCC2_CFLAGS): Set.
+ * config/t-openbsd-thread: New file.
+ * config/t-sol2 (HOST_LIBGCC2_CFLAGS): Remove.
+ * config/t-vxworks, config/vxlib-tls.c, config/vxlib.c: New files.
+ * config/alpha/gthr-posix.c, config/alpha/qrnnd.S: New files.
+ * config/alpha/t-alpha (LIB2ADD): Use $(srcdir) to refer to
+ qrnnd.S.
+ Adapt filename.
+ * config/alpha/t-osf-pthread (LIB2ADD): Use $(srcdir)/config/alpha
+ to refer to gthr-posix.c.
+ * config/alpha/t-vms (LIB2ADD): Set.
+ * config/alpha/vms-gcc_shell_handler.c: New file.
+ * config/arm/bpabi.c, config/arm/fp16.c,
+ config/arm/linux-atomic.c, config/arm/linux-atomic-64bit.c,
+ config/arm/unaligned-funcs.c: New files.
+ * config/arm/t-bpabi (LIB2ADD, LIB2ADD_ST): Set.
+ * config/arm/t-elf (HOST_LIBGCC2_CFLAGS): Set.
+ * config/arm/t-linux: Likewise.
+ * config/arm/t-linux-eabi (LIB2ADD_ST): Add.
+ * config/arm/t-netbsd: New file.
+ * config/arm/t-strongarm-elf (HOST_LIBGCC2_CFLAGS): Set.
+ * config/arm/t-symbian (LIB2ADD_ST): Set.
+ * config/avr/t-avr (LIB2FUNCS_EXCLUDE, HOST_LIBGCC2_CFLAGS): Set.
+ * config/bfin/t-crtstuff (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/bfin/t-elf: New file.
+ * config/c6x/eqd.c, config/c6x/eqf.c, config/c6x/ged.c,
+ config/c6x/gef.c, config/c6x/gtd.c, config/c6x/gtf.c,
+ config/c6x/led.c, config/c6x/lef.c, config/c6x/ltd.c,
+ config/c6x/ltf.c: New files.
+ * config/c6x/t-elf (LIB2FUNCS_EXCLUDE, LIB2ADD)
+ (HOST_LIBGCC2_CFLAGS): Set.
+ * config/c6x/t-uclinux (HOST_LIBGCC2_CFLAGS): Set.
+ (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/cris/arit.c, config/cris/mulsi3.S, config/cris/t-cris:
+ New files.
+ * config/cris/t-elfmulti (LIB2ADD_ST): Set.
+ * config/cris/t-linux (HOST_LIBGCC2_CFLAGS): Remove.
+ * config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c,
+ config/frv/modi.c, config/frv/uitod.c, config/frv/uitof.c,
+ config/frv/ulltod.c, config/frv/ulltof.c, config/frv/umodi.c: New
+ files.
+ * config/frv/t-frv (LIB2ADD): Set.
+ * config/frv/t-linux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/h8300/clzhi2.c, config/h8300/ctzhi2.c,
+ config/h8300/fixunssfsi.c, config/h8300/parityhi2.c,
+ config/h8300/popcounthi2.c: New files.
+ * config/h8300/t-h8300 (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set.
+ * config/i386/gthr-win32.c: New file.
+ * config/i386/t-cygming (LIBGCC2_INCLUDES): Set.
+ * config/i386/t-cygwin: Likewise.
+ * config/i386/t-darwin, config/i386/t-darwin64,
+ config/i386/t-gthr-win32, config/i386/t-interix: New files.
+ * config/i386/t-nto (HOST_LIBGCC2_CFLAGS): Set.
+ (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/i386/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/ia64/quadlib.c: New file.
+ * config/ia64/t-hpux (LIB2ADD): Set.
+ * config/ia64/t-ia64: Add comment.
+ * config/iq2000/lib2funcs.c, config/iq2000/t-iq2000: New files.
+ * config/lm32/t-uclinux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ (HOST_LIBGCC2_CFLAGS): Append, remove -fPIC.
+ * config/m32c/lib2funcs.c, config/m32c/trapv.c: New files.
+ * config/m32c/t-m32c (LIB2ADD): Set.
+ * config/m32r/t-linux (HOST_LIBGCC2_CFLAGS): Set.
+ * config/m32r/t-m32r: Likewise.
+ * config/m68k/fpgnulib.c: New file.
+ * config/m68k/t-floatlib (LIB2ADD): Set.
+ (xfgnulib.c): New target.
+ * config/mcore/t-mcore (HOST_LIBGCC2_CFLAGS): Set.
+ * config/mep/lib2funcs.c, config/mep/tramp.c: New files.
+ * config/mep/t-mep (LIB2ADD): Set.
+ * config/microblaze/divsi3.asm: Rename to divsi3.S.
+ * config/microblaze/moddi3.asm: Rename to moddi3.S.
+ * config/microblaze/modsi3.asm: Rename to modsi3.S.
+ * config/microblaze/muldi3_hard.asm: Rename to hard.S.
+ * config/microblaze/mulsi3.asm: Rename to mulsi3.S.
+ * config/microblaze/stack_overflow_exit.asm: Rename to exit.S.
+ * config/microblaze/udivsi3.asm: Rename to udivsi3.S.
+ * config/microblaze/umodsi3.asm: Rename to umodsi3.S.
+ * config/microblaze/t-microblaze (LIB2ADD): Reflect this.
+ * config/mips/t-elf, config/mips/t-vr, config/mips/vr4120-div.S:
+ New files.
+ * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Set.
+ * config/mmix/t-mmix (HOST_LIBGCC2_CFLAGS): Set.
+ * config/pa/fptr.c, config/pa/lib2funcs.S,
+ config/pa/linux-atomic.c, config/pa/quadlib.c: New files.
+ * config/pa/t-linux (HOST_LIBGCC2_CFLAGS): Set.
+ (LIB2ADD, LIB2ADD_ST): Set.
+ * config/pa/t-hpux, config/pa/t-hpux10, config/pa/t-pa64: New files.
+ * config/pa/t-linux (HOST_LIBGCC2_CFLAGS, LIB2ADD, LIB2ADD_ST):
+ Set.
+ * config/pa/t-linux64 (LIB2ADD_ST, HOST_LIBGCC2_CFLAGS): Set.
+ * config/pdp11/t-pdp11: New file.
+ * config/picochip/libgccExtras/adddi3.S,
+ config/picochip/libgccExtras/ashlsi3.S,
+ config/picochip/libgccExtras/ashrsi3.S,
+ config/picochip/libgccExtras/clzsi2.S,
+ config/picochip/libgccExtras/cmpsi2.S,
+ config/picochip/libgccExtras/divmod15.S,
+ config/picochip/libgccExtras/divmodhi4.S,
+ config/picochip/libgccExtras/divmodsi4.S,
+ config/picochip/libgccExtras/lshrsi3.S,
+ config/picochip/libgccExtras/parityhi2.S,
+ config/picochip/libgccExtras/popcounthi2.S,
+ config/picochip/libgccExtras/subdi3.S,
+ config/picochip/libgccExtras/ucmpsi2.S,
+ config/picochip/libgccExtras/udivmodhi4.S,
+ config/picochip/libgccExtras/udivmodsi4.S: New files.
+ * config/picochip/t-picochip (LIB2ADD, HOST_LIBGCC2_CFLAGS)
+ (LIBGCC2_DEBUG_CFLAGS, RANLIB_FOR_TARGET): Set.
+ * config/rs6000/crtresfpr.S, config/rs6000/crtresgpr.S,
+ config/rs6000/crtresxfpr.S, config/rs6000/crtresxgpr.S,
+ config/rs6000/crtsavfpr.S, config/rs6000/crtsavgpr.S)
+ config/rs6000/darwin-asm.h, config/rs6000/darwin-fpsave.S,
+ config/rs6000/darwin-gpsave.S, config/rs6000/darwin-tramp.S,
+ config/rs6000/darwin-vecsave.S, config/rs6000/darwin-world.S: New
+ files.
+ * config/rs6000/t-darwin (LIB2ADD, LIB2ADD_ST)
+ (HOST_LIBGCC2_CFLAGS): Set.
+ * config/rs6000/t-darwin64: New file.
+ * config/rs6000/t-linux64 (HOST_LIBGCC2_CFLAGS): Set.
+ * config/rs6000/t-lynx, config/rs6000/t-netbsd: New files.
+ * config/rs6000/t-ppccomm (LIB2ADD): Add
+ $(srcdir)/config/rs6000/tramp.S.
+ (LIB2ADD_ST): Use $(srcdir)/config/rs6000 to refer to sources.
+ Add $(srcdir)/config/rs6000/eabi.S.
+ (crtsavfpr.S, crtresfpr.S, crtsavgpr.S, crtresgpr.S, crtresxfpr.S)
+ (crtresxgpr.S, e500crtres32gpr.S, e500crtres64gpr.S)
+ (e500crtres64gprctr.S, e500crtrest32gpr.S, e500crtrest64gpr.S)
+ (e500crtresx32gpr.S, e500crtresx64gpr.S, e500crtsav32gpr.S)
+ (e500crtsav64gpr.S, e500crtsav64gprctr.S, e500crtsavg32gpr.S)
+ (e500crtsavg64gpr.S, e500crtsavg64gprctr.S): Remove.
+ * config/rs6000/tramp.S: New file.
+ * config/s390/t-tpf: Remove.
+ * config/sh/linux-atomic.S: New file.
+ * config/sh/t-linux (LIB2ADD): Set.
+ (HOST_LIBGCC2_CFLAGS): Append, remove -fpic.
+ * config/sh/t-netbsd (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set.
+ * config/sh/t-sh (unwind-dw2-Os-4-200.o): Use $(srcdir) to refer
+ to unwind-dw2.c.
+ (HOST_LIBGCC2_CFLAGS): Set.
+ * config/sparc/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
+ * config/spu/divmodti4.c, config/spu/divv2df3.c,
+ config/spu/float_disf.c, config/spu/float_unsdidf.c,
+ config/spu/float_unsdisf.c, config/spu/float_unssidf.c,
+ config/spu/mfc_multi_tag_release.c,
+ config/spu/mfc_multi_tag_reserve.c, config/spu/mfc_tag_release.c,
+ config/spu/mfc_tag_reserve.c, config/spu/mfc_tag_table.c,
+ config/spu/multi3.c: New files.
+ * config/spu/t-elf (LIB2ADD, LIB2ADD_ST, LIB2_SIDITI_CONV_FUNCS)
+ (HOST_LIBGCC2_CFLAGS): Set.
+ * config/stormy16/ashlsi3.c, config/stormy16/ashrsi3.c,
+ config/stormy16/clzhi2.c, config/stormy16/cmpsi2.c,
+ config/stormy16/ctzhi2.c, config/stormy16/divsi3.c,
+ config/stormy16/ffshi2.c, config/stormy16/lib2.c,
+ config/stormy16/lshrsi3.c, config/stormy16/modsi3.c,
+ config/stormy16/parityhi2.c, config/stormy16/popcounthi2.c,
+ config/stormy16/t-stormy16, config/stormy16/ucmpsi2.c,
+ config/stormy16/udivmodsi4.c, config/stormy16/udivsi3.c,
+ config/stormy16/umodsi3.c: New files.
+ * config/xtensa/lib2funcs.S: New file.
+ * config/xtensa/t-elf (HOST_LIBGCC2_CFLAGS): Set.
+ * config/xtensa/t-xtensa (LIB2ADD): Set.
+ * config.host (*-*-darwin*): Add t-libgcc-pic to tmake_file.
+ (*-*-freebsd*): Add t-freebsd, t-libgcc-pic to tmake_file.
+ Add t-freebsd-thread to tmake_file for posix threads.
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu)
+ (*-*-gnu*, *-*-kopensolaris*-gnu): Add t-libgcc-pic to tmake_file.
+ (*-*-lynxos*): Likewise.
+ (*-*-netbsd*): Likewise.
+ (*-*-openbsd*): Likewise.
+ Add t-openbsd-thread to tmake_file for posix threads.
+ (*-*-solaris2*): Add t-libgcc-pic to tmake_file.
+ (*-*-vxworks*): Set tmake_file.
+ (alpha*-*-linux*): Add alpha/t-alpha, alpha/t-ieee to tmake_file.
+ (alpha*-*-freebsd*): Likewise.
+ (alpha*-*-netbsd*): Likewise.
+ (alpha*-*-openbsd*): Likewise.
+ (alpha*-dec-osf5.1*): Remove qrnnd.o, gthr-posix.o from extra_parts.
+ (alpha64-dec-*vms*): Add alpha/t-alpha, alpha/t-ieee to tmake_file.
+ (alpha*-dec-*vms*): Likewise.
+ (arm*-*-netbsdelf*): Add arm/t-netbsd to tmake_file.
+ (bfin*-elf*): Add bfin/t-elf to tmake_file.
+ (bfin*-uclinux*): Likewise.
+ (bfin*-linux-uclibc*): Likewise.
+ (crisv32-*-elf): Add cris/t-cris to tmake_file.
+ (crisv32-*-none): Likewise.
+ (cris-*-elf): Likewise.
+ (cris-*-none): Likewise.
+ (cris-*-linux*, crisv32-*-linux*): Likewise.
+ (hppa[12]*-*-hpux10*): Add pa/t-hpux pa/t-hpux10, t-libgcc-pic to
+ tmake_file.
+ (hppa*64*-*-hpux11*): Add pa/t-hpux, pa/t-pa64, t-libgcc-pic to
+ tmake_file.
+ (hppa[12]*-*-hpux11*): Add pa/t-hpux, t-libgcc-pic to tmake_file.
+ (i[34567]86-*-elf*): Add t-libgcc-pic to tmake_file.
+ (x86_64-*-elf*): Likewise.
+ (i[34567]86-*-nto-qnx*): Likewise.
+ (i[34567]86-*-mingw*): Add i386/t-gthr-win32 to tmake_file for
+ win32 threads.
+ (x86_64-*-mingw*): Likewise.
+ (i[34567]86-*-interix3*): Add i386/t-interix to tmake_file.
+ (lm32-*-uclinux*): Add t-libgcc-pic to tmake_file.
+ (mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*)
+ (mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*)
+ (mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add mips/t-elf to
+ tmake_file.
+ (mipsisa64sr71k-*-elf*): Likewise.
+ (mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*): Likewise.
+ (mips-*-elf*, mipsel-*-elf*): Likewise.
+ (mips64-*-elf*, mips64el-*-elf*): Likewise.
+ (mips64orion-*-elf*, mips64orionel-*-elf*): Likewise.
+ (mips*-*-rtems*): Likewise.
+ (mips64vr-*-elf*, mips64vrel-*-elf*): Add mips/t-elf, mips/t-vr
+ to tmake_file.
+ (pdp11-*-*): Add pdp11/t-pdp11 to tmake_file.
+ (powerpc64-*-darwin*): Add rs6000/t-darwin64 to tmake_file.
+ (s390x-ibm-tpf*): Add t-libgcc-pic to tmake_file.
+ (spu-*-elf*): Likewise.
+ (tic6x-*-uclinux): Add t-libgcc-pic to tmake_file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.in ($(lib1asmfuncs-o), $(lib1asmfuncs-s-o)): Use
+ $(srcdir) to refer to $(LIB1ASMSRC).
+ Use $<.
+ * config/arm/bpabi-v6m.S, config/arm/bpabi.S,
+ config/arm/ieee754-df.S, config/arm/ieee754-sf.S,
+ config/arm/lib1funcs.S: New files.
+ * config/arm/libunwind.S [!__symbian__]: Use lib1funcs.S.
+ * config/arm/t-arm: New file.
+ * config/arm/t-bpabi (LIB1ASMFUNCS): Set.
+ * config/arm/t-elf, config/arm/t-linux, config/arm/t-linux-eabi,
+ config/arm/t-strongarm-elf: New files.
+ * config/arm/t-symbian (LIB1ASMFUNCS): Set.
+ * config/arm/t-vxworks, config/arm/t-wince-pe: New files.
+ * config/avr/lib1funcs.S: New file.
+ * config/avr/t-avr (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/bfin/lib1funcs.S, config/bfin/t-bfin: New files.
+ * config/c6x/lib1funcs.S: New file.
+ * config/c6x/t-elf (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/fr30/lib1funcs.S, config/fr30/t-fr30: New files.
+ * config/frv/lib1funcs.S: New file.
+ * config/frv/t-frv (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/h8300/lib1funcs.S, config/h8300/t-h8300: New files.
+ * config/i386/cygwin.S, config/i386/t-chkstk: New files.
+ * config/ia64/__divxf3.asm: Rename to ...
+ * config/ia64/__divxf3.S: ... this.
+ Adapt lib1funcs.asm filename.
+ * config/ia64/_fixtfdi.asm: Rename to ...
+ * config/ia64/_fixtfdi.S: ... this.
+ Adapt lib1funcs.asm filename.
+ * config/ia64/_fixunstfdi.asm: Rename to ...
+ * config/ia64/_fixunstfdi.S: ... this.
+ Adapt lib1funcs.asm filename.
+ * config/ia64/_floatditf.asm: Rename to ...
+ * config/ia64/_floatditf.S: ... this.
+ Adapt lib1funcs.asm filename.
+ * config/ia64/lib1funcs.S: New file.
+ * config/ia64/t-hpux (LIB1ASMFUNCS): Set.
+ * config/ia64/t-ia64 (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/ia64/t-softfp-compat (libgcc1-tf-compats): Adapt suffix.
+ * config/m32c/lib1funcs.S, config/m32c/t-m32c: New files.
+ * config/m68k/lb1sf68.S, config/m68k/t-floatlib: New files.
+ * config/mcore/lib1funcs.S, config/mcore/t-mcore: New files.
+ * config/mep/lib1funcs.S: New file.
+ * config/mep/t-mep (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/mips/mips16.S: New file.
+ * config/mips/t-mips16 (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/pa/milli64.S: New file.
+ * config/pa/t-linux, config/pa/t-linux64: New files.
+ * config/picochip/lib1funcs.S: New file.
+ * config/picochip/t-picochip (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config/sh/lib1funcs.S, config/sh/lib1funcs.h: New files.
+ * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Set.
+ * config/sh/t-netbsd: New file.
+ * config/sh/t-sh (LIB1ASMSRC, LIB1ASMFUNCS, LIB1ASMFUNCS_CACHE): Set.
+ Use $(srcdir) to refer to lib1funcs.S, adapt filename.
+ * config/sh/t-sh64: New file.
+ * config/sparc/lb1spc.S: New file.
+ * config/sparc/t-softmul (LIB1ASMSRC): Adapt sparc/lb1spc.asm
+ filename.
+ * config/v850/lib1funcs.S, config/v850/t-v850: New files.
+ * config/vax/lib1funcs.S, config/vax/t-linux: New files.
+ * config/xtensa/ieee754-df.S, config/xtensa/ieee754-sf.S,
+ config/xtensa/lib1funcs.S: New files.
+ * config/xtensa/t-xtensa (LIB1ASMSRC, LIB1ASMFUNCS): Set.
+ * config.host (arm-wrs-vxworks): Add arm/t-arm, arm/t-vxworks to
+ tmake_file.
+ (arm*-*-freebsd*): Add arm/t-arm, arm/t-strongarm-elf to tmake_file.
+ (arm*-*-netbsdelf*): Add arm/t-arm to tmake_file.
+ (arm*-*-linux*): Likewise.
+ Add arm/t-elf, arm/t-bpabi, arm/t-linux-eabi to tmake_file for
+ arm*-*-linux-*eabi, add arm/t-linux otherwise.
+ (arm*-*-uclinux*): Add arm/t-arm, arm/t-elf to tmake_file.
+ (arm*-*-ecos-elf): Likewise.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Likewise.
+ (arm*-*-rtems*): Likewise.
+ (arm*-*-elf): Likewise.
+ (arm*-wince-pe*): Add arm/t-arm, arm/t-wince-pe to tmake_file.
+ (avr-*-rtems*): Add to tmake_file, add avr/t-avr.
+ (bfin*-elf*): Add bfin/t-bfin to tmake_file.
+ (bfin*-uclinux*): Likewise.
+ (bfin*-linux-uclibc*): Likewise.
+ (bfin*-rtems*): Likewise.
+ (bfin*-*): Likewise.
+ (fido-*-elf): Merge into m68k-*-elf*.
+ (fr30-*-elf)): Add fr30/t-fr30 to tmake_file.
+ (frv-*-*linux*): Add frv/t-frv to tmake_file.
+ (h8300-*-rtems*): Add h8300/t-h8300 to tmake_file.
+ (h8300-*-elf*): Likewise.
+ (hppa*64*-*-linux*): Add pa/t-linux, pa/t-linux64 to tmake_file.
+ (hppa*-*-linux*): Add pa/t-linux to tmake_file.
+ (i[34567]86-*-cygwin*): Add i386/t-chkstk to tmake_file.
+ (i[34567]86-*-mingw*): Likewise.
+ (x86_64-*-mingw*): Likewise.
+ (i[34567]86-*-interix3*): Likewise.
+ (ia64*-*-hpux*): Add ia64/t-ia64, ia64/t-hpux to tmake_file.
+ (ia64-hp-*vms*): Add ia64/t-ia64 to tmake_file.
+ (m68k-*-elf*): Also handle fido-*-elf.
+ Add m68k/t-floatlib to tmake_file.
+ (m68k-*-uclinux*): Add m68k/t-floatlib to tmake_file.
+ (m68k-*-linux*): Likewise.
+ (m68k-*-rtems*): Likewise.
+ (mcore-*-elf): Add mcore/t-mcore to tmake_file.
+ (sh-*-elf*, sh[12346l]*-*-elf*): Add sh/t-sh64 to tmake_file for
+ sh64*-*-*.
+ (sh-*-linux*, sh[2346lbe]*-*-linux*): Add sh/t-sh to tmake_file.
+ Add sh/t-sh64 to tmake_file for sh64*-*-linux*.
+ (sh-*-netbsdelf*, shl*-*-netbsdelf*, sh5-*-netbsd*)
+ (sh5l*-*-netbsd*, sh64-*-netbsd*, sh64l*-*-netbsd*): Add sh/t-sh,
+ sh/t-netbsd to tmake_file.
+ Add sh/t-sh64 to tmake_file for sh5*-*-netbsd*, sh64*-netbsd*.
+ (sh-*-rtems*): Add sh/t-sh to tmake_file.
+ (sh-wrs-vxworks): Likewise.
+ (sparc-*-linux*): Add sparc/t-softmul to tmake_file except for
+ *-leon[3-9]*.
+ (v850*-*-*): Add v850/t-v850 to tmake_file.
+ (vax-*-linux*): Add vax/t-linux to tmake_file.
+ (m32c-*-elf*, m32c-*-rtems*): Add m32c/t-m32c to tmake_file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * crtstuff.c: New file.
+ * Makefile.in (CRTSTUFF_CFLAGS): Define.
+ (CRTSTUFF_T_CFLAGS): Define.
+ (extra-parts, INSTALL_PARTS): Remove conditional assignments.
+ (crtbegin$(objext), crtend$(objext), crtbeginS$(objext))
+ (crtendS$(objext), crtbeginT.o): Use $(srcdir) to refer to
+ crtstuff.c.
+ Use $<.
+ (crtbeginT.o): Use $(objext).
+ [!CUSTOM_CRTIN] (crti$(objext), crtn$(objext)): New rules.
+ (libgcc-extra-parts): Don't compare EXTRA_PARTS, GCC_EXTRA_PARTS.
+ (gcc-extra-parts): Remove.
+ * config.host (*-*-freebsd*): Add t-crtstuff-pic to tmake_file.
+ Set extra_parts.
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
+ *-*-gnu*): Also handle *-*-kopensolaris*-gnu.
+ Add t-crtstuff-pic to tmake_file.
+ (*-*-lynxos*): New case.
+ Set tmake_file, extra_parts.
+ (*-*-netbsd*): Add t-crtstuff-pic to tmake_file.
+ Set extra_parts for *-*-netbsd*1.[7-9]*, *-*-netbsd[2-9]*,
+ *-*-netbsdelf[2-9]*.
+ (*-*-openbsd*): Add t-crtstuff-pic to tmake_file.
+ (*-*-rtems*): Set extra_parts.
+ (*-*-solaris2*): Remove t-crtin from tmake_file for Solaris < 10.
+ (*-*-uclinux*): New case.
+ Set extra_parts.
+ (*-*-vms*): New case.
+ Set tmake_file, extra_parts.
+ (*-*-elf): Set extra_parts.
+ (alpha*-*-freebsd*): Add crtbeginT.o to extra_parts.
+ (alpha64-dec-*vms*): Append to tmake_file, remove vms/t-vms,
+ vms/t-vms64.
+ Set extra_parts.
+ (alpha*-dec-*vms*): Append to tmake_file, remove vms/t-vms.
+ Set extra_parts.
+ (arm*-*-freebsd*): Add t-crtin to tmake_file.
+ Add crtbegin.o, crtend.o, crti.o, crtn.o to extra_parts.
+ (arm-wrs-vxworks): Append to tmake_file.
+ Set extra_parts.
+ (arm*-*-uclinux*): Set extra_parts.
+ (arm*-*-ecos-elf): Likewise.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Set extra_parts for
+ arm*-*-eabi*.
+ (arm*-*-rtems*): Set extra_parts.
+ (arm*-*-elf): Likewise.
+ (avr-*-rtems*): Clear extra_parts.
+ (bfin*-elf*): Add bfin/t-crtlibid, bfin/t-crtstuff to extra_parts.
+ Set extra_parts.
+ (bfin*-uclinux*): Likewise.
+ (bfin*-linux-uclibc*): Add bfin/t-crtstuff to tmake_file.
+ (bfin*-rtems*): Append to tmake_file.
+ Set extra_parts.
+ (bfin*-*): Likewise.
+ (crisv32-*-elf, crisv32-*-none, cris-*-elf, cris-*-none): Split into ...
+ (crisv32-*-elf): ... this.
+ (crisv32-*-none): ... this.
+ (cris-*-elf, cris-*-none): New cases.
+ Add cris/t-elfmulti to tmake_file.
+ (fr30-*-elf): Append to tmake_file.
+ Set extra_parts.
+ (frv-*-elf): Append to tmake_file, add frv/t-frv.
+ Set extra_parts.
+ (h8300-*-rtems*): Append to tmake_file.
+ Set extra_parts.
+ (h8300-*-elf*): Likewise.
+ (hppa*64*-*-hpux11*): Add pa/t-stublib, pa/t-stublib64 to tmake_file.
+ Set extra_parts.
+ (hppa[12]*-*-hpux11*): Add pa/t-stublib to tmake_file.
+ Set extra_parts.
+ (i[34567]86-*-elf*): Add i386/t-crtstuff, t-crtstuff-pic to tmake_file.
+ (x86_64-*-elf*): Likewise.
+ (i[34567]86-*-freebsd*): Add i386/t-crtstuff to tmake_file.
+ (x86_64-*-freebsd*): Likewise.
+ (x86_64-*-netbsd*): Likewise.
+ (i[34567]86-*-linux*): Likewise.
+ (i[34567]86-*-kfreebsd*-gnu, i[34567]86-*-knetbsd*-gnu)
+ (i[34567]86-*-gnu*, i[34567]86-*-kopensolaris*-gnu): Likewise.
+ (x86_64-*-linux*): Likewise.
+ (x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu): Likewise.
+ (i[34567]86-*-lynxos*): Add t-crtstuff-pic, i386/t-crtstuff to
+ tmake_file.
+ Set extra_parts.
+ (i[34567]86-*-nto-qnx*): Set tmake_file, extra_parts.
+ (i[34567]86-*-rtems*): Append to tmake_file, remove t-crtin.
+ Append to extra_parts, remove crtbegin.o, crtend.o.
+ (ia64*-*-elf*): Append to extra_parts, remove crtbegin.o, crtend.o.
+ (ia64*-*-freebsd*): Append to extra_parts, remove crtbegin.o,
+ crtend.o, crtbeginS.o, crtendS.o.
+ (ia64*-*-linux*): Comment extra_parts.
+ (ia64-hp-*vms*): Append to tmake_file, remove vms/t-vms, vms/t-vms64.
+ Set extra_parts.
+ (iq2000*-*-elf*): Clear extra_parts.
+ (lm32-*-elf*, lm32-*-rtems*): Add t-crtin to tmake_file.
+ (lm32-*-uclinux*): Add to extra_parts, remove crtbegin.o, crtend.o
+ (m32r-*-elf*, m32r-*-rtems*): Split off ...
+ (m32r-*-rtems*): ... this.
+ Add m32r/t-m32r to tmake_file.
+ (m68k-*-elf*): Add t-crtin to tmake_file.
+ (m68k-*-rtems*): Add crti.o, crtn.o to extra_parts.
+ (mcore-*-elf): Likewise.
+ (microblaze*-*-*): Set extra_parts.
+ (mips*-sde-elf*): New case.
+ Set tmake_file, extra_parts.
+ (mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*)
+ (mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*)
+ (mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add mips/t-crtstuff to
+ tmake_file.
+ Set extra_parts.
+ (mipsisa64sr71k-*-elf*): Likewise.
+ (mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*): Likewise.
+ (mips-*-elf*, mipsel-*-elf*): Likewise.
+ (mips64-*-elf*, mips64el-*-elf*): Likewise.
+ (mips64vr-*-elf*, mips64vrel-*-elf*): Likewise.
+ (mips64orion-*-elf*, mips64orionel-*-elf*): Likewise.
+ (mips*-*-rtems*): Likewise.
+ (mipstx39-*-elf*, mipstx39el-*-elf*): Likewise.
+ (moxie-*-*): Split into ...
+ (moxie-*-elf, moxie-*-uclinux*): ... this.
+ Add to extra_parts, remove crtbegin.o, crtend.o.
+ (moxie-*-rtems*): New case.
+ Set tmake_file.
+ Clear extra_parts.
+ (powerpc-*-freebsd*): Add rs6000/t-crtstuff to tmake_file.
+ Set extra_parts.
+ (powerpc-*-netbsd*): Add rs6000/t-netbsd to tmake_file.
+ (powerpc-*-eabispe*): Add rs6000/t-crtstuff, t-crtstuff-pic to
+ tmake_file.
+ Set extra_parts.
+ (powerpc-*-eabisimaltivec*): Add to tmake_file, add rs6000/t-ppccomm,
+ rs6000/t-crtstuff, t-crtstuff-pic to tmake_file.
+ Set extra_parts.
+ (powerpc-*-eabisim*): Likewise.
+ (powerpc-*-elf*): Likewise.
+ (powerpc-*-eabialtivec*): Likewise.
+ (powerpc-xilinx-eabi*): Likewise.
+ (powerpc-*-eabi*): Likewise.
+ (powerpc-*-rtems*): Likewise.
+ (powerpc-*-linux*, powerpc64-*-linux*): Add rs6000/t-crtstuff to
+ tmake_file.
+ Set extra_parts.
+ (powerpc-*-lynxos*): Add to tmake_file.
+ (powerpcle-*-elf*): Add to tmake_file, add rs6000/t-ppccomm,
+ rs6000/t-crtstuff, t-crtstuff-pic.
+ Set extra_parts.
+ (powerpcle-*-eabisim*): Likewise.
+ (powerpcle-*-eabi*): Likewise.
+ (rx-*-elf): Remove extra_parts.
+ (s390x-ibm-tpf*): Set extra_parts.
+ (score-*-elf): Set extra_parts.
+ (sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*)
+ (sh[2346lbe]*-*-linux*, sh-*-netbsdelf*, shl*-*-netbsdelf*)
+ (sh5-*-netbsd*, sh5l*-*-netbsd*, sh64-*-netbsd*)
+ (sh64l*-*-netbsd*): Split into ...
+ (sh-*-elf*, sh[12346l]*-*-elf*): ... this.
+ Add t-crtstuff-pic to tmake_file.
+ Set extra_parts.
+ (sh-*-rtems*): Add to tmake_file, add t-crtstuff-pic.
+ Set extra_parts.
+ (sh-wrs-vxworks): Add to tmake_file, add t-crtstuff-pic.
+ (sparc-*-elf*): Remove t-crtin from tmake_file.
+ Add to extra_parts, remove crtbegin.o, crtend.o.
+ (sparc-*-linux*): Add sparc/t-linux64 to tmake_file.
+ (sparc64-*-linux*): Likewise.
+ (sparc-*-rtems*): Remove sparc/t-elf from tmake_file.
+ Add to extra_parts, remove crtbegin.o, crtend.o.
+ (sparc64-*-elf*): Remove t-crtin from tmake_file.
+ Add to extra_parts, remove crtbegin.o, crtend.o.
+ (sparc64-*-rtems*): Remove t-crtin from tmake_file.
+ Add to extra_parts, remove crtbegin.o, crtend.o.
+ (sparc64-*-freebsd*, ultrasparc-*-freebsd*): Add to extra_parts.
+ (sparc64-*-linux*): Add sparc/t-linux64 to tmake_file.
+ (spu-*-elf*): Add to tmake_file, add spu/t-elf.
+ Set extra_parts.
+ (tic6x-*-uclinux): Add c6x/t-uxlinux, t-crtstuff-pic to tmake_file.
+ Set extra_parts.
+ (tic6x-*-*): Change to ...
+ (tic6x-*-elf): ... this.
+ Set extra_parts.
+ (xtensa*-*-elf*): Add to tmake_file, add xtensa/t-elf.
+ Set extra_parts.
+ (am33_2.0-*-linux*): Add comment.
+ (mep*-*-*): Add mep/t-mep to tmake_file.
+ Set extra_parts.
+ * config/alpha/t-vms: New file.
+ * config/alpha/vms-dwarf2.S, config/alpha/vms-dwarf2eh.S: New files.
+ * config/arm/crti.S, config/arm/crtn.S: New files.
+ * config/bfin/crti.S, config/bfin/crtn.S: New files.
+ * config/bfin/crtlibid.S: New file.
+ * config/bfin/t-crtlibid, config/bfin/t-crtstuff: New files.
+ * config/c6x/crti.S, config/c6x/crtn.S: New files.
+ * config/c6x/t-elf (CUSTOM_CRTIN): Set.
+ (crti.o, crtin.o): New rules.
+ (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Set.
+ * config/c6x/t-uclinux: New file.
+ * config/cris/t-elfmulti: New file.
+ * config/cris/t-linux (CRTSTUFF_T_CFLAGS_S): Set.
+ * config/fr30/crti.S, config/fr30/crtn.S: New files.
+ * config/frv/frvbegin.c, config/frv/frvend.c: New files.
+ * config/frv/t-frv: New file.
+ * config/frv/t-linux (CRTSTUFF_T_CFLAGS): Set.
+ * config/h8300/crti.S, config/h8300/crtn.S: New files.
+ * config/i386/cygming-crtbegin.c, config/i386/cygming-crtend.c:
+ New files.
+ * config/i386/t-cygming (crtbegin.o, crtend.o): Use $(srcdir) to
+ refer to cygming-crtbegin.c, cygming-crtend.c.
+ Use $<.
+ * config/i386/t-nto: New file.
+ * config/ia64/crtbegin.S, config/ia64/crtend.S: New files.
+ * config/ia64/crti.S, config/ia64/crtn.S: New files.
+ * config/ia64/t-ia64 (crtbegin.o, crtend.o, crtbeginS.o,
+ crtendS.o): Use $(srcdir) to refer to crtbegin.S, crtend.S.
+ Use .S extension.
+ Use $<.
+ * config/ia64/t-vms (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Set.
+ (crtinitS.o): New rule.
+ * config/ia64/vms-crtinit.S: New file.
+ * config/lm32/t-elf ($(T)crti.o, $(T)crtn.o): Remove.
+ * config/m32r/initfini.c: New file.
+ * config/m32r/t-linux, config/m32r/t-m32r: New files.
+ * config/m68k/crti.S, config/m68k/crtn.S: New files.
+ * config/mcore/crti.S, config/mcore/crtn.S: New files.
+ * config/mep/t-mep: New file.
+ * config/microblaze/crti.S, config/microblaze/crtn.S: New files.
+ * config/microblaze/t-microblaze (MULTILIB_OPTIONS): Remove.
+ * config/mips/crti.S, config/mips/crtn.S: New files.
+ * config/mips/t-crtstuff: New file.
+ * config/mmix/crti.S, config/mmix/crtn.S: New files.
+ * config/mmix/t-mmix (CRTSTUFF_T_CFLAGS): Set.
+ (CUSTOM_CRTIN): Set.
+ ($(T)crti.o, $(T)crtn.o): Remove $(T),
+ dependencies.
+ Use $(srcdir) to refer to crti.S, crtn.S.
+ Use .S extension, $<.
+ * config/moxie/crti.asm: Rename to ...
+ * config/moxie/crti.S: ... this.
+ * config/moxie/crtn.asm: Rename to ...
+ * config/moxie/crtn.S: ... this.
+ * config/moxie/t-moxie: Remove.
+ * config/pa/stublib.c: New file.
+ * config/pa/t-stublib, config/pa/t-stublib64: New files.
+ * config/rs6000/eabi-ci.S, config/rs6000/eabi-cn.S: New files.
+ * config/rs6000/sol-ci.S, config/rs6000/sol-cn.S: New files.
+ * config/rs6000/t-crtstuff: New file.
+ * config/rs6000/t-ppccomm (EXTRA_PARTS): Remove.
+ (ecrti.S, ecrtn.S, ncrti.S, ncrtn.S): Remove.
+ (ecrti$(objext)): Depend on $(srcdir)/config/rs6000/eabi-ci.S.
+ Make output file explicit.
+ (ecrtn$(objext)): Depend on $(srcdir)/config/rs6000/eabi-cn.S.
+ Make output file explicit.
+ (ncrti$(objext): Depend on $(srcdir)/config/rs6000/sol-ci.S.
+ Make output file explicit.
+ (ncrtn$(objext)): Depend on $(srcdir)/config/rs6000/sol-cn.S.
+ Make output file explicit.
+ * config/score/crti.S, config/score/crtn.S: New files.
+ * config/sh/crt1.S, config/sh/crti.S, config/sh/crtn.S: New files.
+ * config/sh/lib1funcs-4-300.S, config/sh/lib1funcs-Os-4-200.S: New
+ files.
+ * config/sh/t-sh, config/sh/t-superh: New files.
+ * config/sparc/t-linux64: New file.
+ * config/spu/cache.S, config/spu/cachemgr.c: New files.
+ * config/spu/t-elf (CRTSTUFF_T_CFLAGS): Set.
+ (cachemgr.o, cachemgr_nonatomic.o, libgcc_%.a, cache8k.o)
+ (cache16k.o, cache32k.o, cache64k.o, cache128k.o): New rules.
+ * config/t-crtin: Remove.
+ * config/t-crtstuff-pic: New file.
+ * config/t-sol2 (CUSTOM_CRTIN): Set.
+ (crti.o, crtn.o): New rules.
+ * config/vms/t-vms: New file.
+ * config/vms/vms-ucrt0.c: New file.
+ * config/xtensa/t-elf: New file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.in (SHLIB_NM_FLAGS): Set.
+ * mkmap-flat.awk, mkmap-symver.awk: New files.
+ * configure.ac (libgcc_cv_lib_sjlj_exceptions): Check for SjLj
+ exceptions.
+ * configure: Regenerate.
+ * config/libgcc-glibc.ver: New file.
+ * config/libgcc-libsystem.ver: New file.
+ * config/t-libunwind (SHLIB_LC): Set.
+ * config/t-linux: New file.
+ * config/t-slibgcc (INSTALL_SHLIB): New.
+ (SHLIB_INSTALL): Use it.
+ * config/t-slibgcc-darwin (SHLIB_MKMAP): Use $(srcdir) to refer
+ to mkmap-symver.awk.
+ (SHLIB_MAPFILES): Don't append, adapt pathname.
+ (SHLIB_VERPFX): Set.
+ * config/t-slibgcc-elf-ver (SHLIB_MKMAP): Use $(srcdir) to refer
+ to mkmap-symver.awk.
+ * config/t-slibgcc-gld-nover, config/t-slibgcc-hpux,
+ config/t-slibgcc-libgcc, config/t-slibgcc-vms: New files.
+ * config/alpha/libgcc-alpha-ldbl.ver, config/alpha/t-linux: New files.
+ * config/alpha/t-slibgcc-osf (SHLIB_MKMAP): Use $(srcdir) to refer
+ to mkmap-flat.awk.
+ * config/arm/t-bpabi (SHLIB_MAPFILES): Set.
+ * config/bfin/libgcc-glibc.ver, config/bfin/t-linux: New files.
+ * config/c6x/libgcc-eabi.ver, config/c6x/t-elf: New files.
+ * config/cris/libgcc-glibc.ver, config/cris/t-linux: New files.
+ * config/frv/libgcc-frv.ver, config/frv/t-linux: New files.
+ * config/i386/libgcc-darwin.10.4.ver,
+ config/i386/libgcc-darwin.10.5.ver, config/i386/libgcc-glibc.ver:
+ New files.
+ * config/i386/t-darwin: Remove.
+ * config/i386/t-darwin64: Likewise.
+ * config/i386/t-dw2-eh, config/i386/t-sjlj-eh: New files.
+ * config/i386/t-slibgcc-cygming, config/i386/t-cygwin,
+ config/i386/t-dlldir, config/i386/t-dlldir-x: New files.
+ * config/i386/t-linux: New file.
+ * config/i386/t-mingw32: New file.
+ * config/ia64/libgcc-glibc.ver, config/ia64/libgcc-ia64.ver: New files.
+ * config/ia64/t-glibc: Rename to ...
+ * config/ia64/t-linux: ... this.
+ (SHLIB_MAPFILES): Set.
+ * config/ia64/t-glibc-libunwind: Rename to ...
+ * config/ia64/t-linux-libunwind: ... this.
+ * config/ia64/t-ia64 (SHLIB_MAPFILES): Set.
+ * config/ia64/t-slibgcc-hpux: New file.
+ * config/m32r/libgcc-glibc.ver, config/m32r/t-linux: New files.
+ * config/m68k/t-slibgcc-elf-ver: New file.
+ * config/mips/t-mips16 (SHLIB_MAPFILES): Set.
+ * config/mips/t-slibgcc-irix (SHLIB_MKMAP): Use $(srcdir) to refer
+ to mkmap-flat.awk.
+ * config/pa/t-slibgcc-hpux: New file.
+ * config/pa/t-slibgcc-dwarf-ver, config/pa/t-slibgcc-sjsj-ver: New
+ files.
+ * config/rs6000/libgcc-darwin.10.4.ver,
+ config/rs6000/libgcc-darwin.10.5.ver: New files.
+ * config/rs6000/libgcc-ppc-glibc.ver: Rename to
+ config/rs6000/libgcc-glibc.ver.
+ * config/rs6000/libgcc-ppc64.ver: Rename to
+ config/rs6000/libgcc-ibm-ldouble.ver.
+ * config/rs6000/t-darwin (SHLIB_VERPFX): Remove.
+ * config/rs6000/t-ibm-ldouble (SHLIB_MAPFILES): Adapt filename.
+ * config/rs6000/t-ldbl128: Rename to ...
+ * config/rs6000/t-linux: ... this.
+ (SHLIB_MAPFILES): Adapt filename.
+ * config/rs6000/t-slibgcc-aix: New file.
+ * config/sh/libgcc-excl.ver, config/sh/libgcc-glibc.ver: New files.
+ * config/sh/t-linux (SHLIB_MAPFILES): Use $(srcdir) to refer to
+ libgcc-excl.ver, libgcc-glibc.ver.
+ (SHLIB_LINK, SHLIB_INSTALL): Remove.
+ * config/sparc/libgcc-glibc.ver: New file.
+ * config/sparc/t-linux: New file.
+ * config/xtensa/libgcc-glibc.ver, config/xtensa/t-linux: New files.
+ * config.host (*-*-freebsd*): Add t-slibgcc, t-slibgcc-gld,
+ t-slibgcc-elf-ver to tmake_file.
+ Add t-slibgcc-nolc-override to tmake_file for posix threads on
+ *-*-freebsd[34].
+ (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
+ *-*-gnu*, *-*-kopensolaris*-gnu): Add t-slibgcc, t-slibgcc-gld,
+ t-slibgcc-elf-ver, t-linux to tmake_file.
+ (*-*-netbsd*): Add t-slibgcc, t-slibgcc-gld, t-slibgcc-elf-ver to
+ tmake_file.
+ (alpha*-*-linux*): Add alpha/t-linux to tmake_file.
+ (alpha64-dec-*vms*): Add t-slibgcc-vms to tmake_file.
+ (alpha*-dec-*vms*): Likewise.
+ (arm*-*-freebsd*): Append to tmake_file.
+ (arm*-*-netbsdelf*): Add t-slibgcc-gld-nover to tmake_file.
+ (arm*-*-linux*): Add t-slibgcc-libgcc to tmake_file for
+ arm*-*-linux-*eabi.
+ (arm*-*-eabi*, arm*-*-symbianelf*): Add t-slibgcc-nolc-override to
+ tmake_file for arm*-*-symbianelf*.
+ (bfin*-linux-uclibc*): Append to tmake_file, add bfin/t-linux.
+ (cris-*-linux*, crisv32-*-linux*): Append to tmake_file, add
+ cris/t-linux.
+ (frv-*-*linux*): Append to tmake_file, add frv/t-linux.
+ (hppa*-*-linux*): Add t-slibgcc-libgcc, pa/t-slibgcc-sjlj-ver,
+ pa/t-slibgcc-dwarf-ver to tmake_file.
+ (hppa[12]*-*-hpux10*): Add t-slibgcc, pa/t-slibgcc-sjlj-ver,
+ pa/t-slibgcc-dwarf-ver, t-slibgcc-hpux, pa/t-slibgcc-hpux to tmake_file.
+ (hppa*64*-*-hpux11*): Likewise.
+ (hppa[12]*-*-hpux11*): Likewise.
+ (x86_64-*-darwin*): Don't override tmake_file, but only keep
+ i386/t-crtpc, i386/t-crtfm.
+ (i[34567]86-*-cygwin*): Set tmake_eh_file, tmake_dlldir_file.
+ Prepend $tmake_eh_file, $tmake_dlldir_file, i386/t-slibgcc-cygming
+ to tmake_file.
+ Add i386/t-cygwin to tmake_file.
+ Prepent i386/t-mingw-pthread to tmake_file for posix threads.
+ (i[34567]86-*-mingw*): Set tmake_eh_file, tmake_dlldir_file.
+ Prepend $tmake_eh_file, $tmake_dlldir_file, i386/t-slibgcc-cygming
+ to tmake_file.
+ Add i386/t-mingw32 to tmake_file.
+ (x86_64-*-mingw*): Likewise.
+ (ia64*-*-freebsd*): Append to tmake_file.
+ (ia64*-*-linux*): Append to tmake_file.
+ Replace ia64/t-glibc by ia64/t-linux.
+ Replace ia64/t-glibc-libunwind by ia64/t-linux-libunwind if using
+ system libunwind.
+ (ia64*-*-hpux*): Add t-slibgcc, ia64/t-slibgcc-hpux,
+ t-slibgcc-hpux to tmake_file.
+ (ia64-hp-*vms*): Add t-slibgcc-vms to tmake_file.
+ (m32r-*-linux*): Append to tmake_file, add m32r/t-linux.
+ (m32rle-*-linux*): Likewise.
+ (m68k-*-linux*)): Add m68k/t-slibgcc-elf-ver to tmake_file unless
+ sjlj exceptions.
+ (microblaze*-linux*): New case.
+ Append to tmake_file, add t-slibgcc-nolc-override.
+ (powerpc-*-freebsd*): Add t-slibgcc-libgcc to tmake_file.
+ (powerpc-*-linux*, powerpc64-*-linux*): Likewise.
+ Replace rs6000/t-ldbl128 by rs6000/t-linux in tmake_file.
+ (rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*): Add
+ rs6000/t-slibgcc-aix to tmake_file.
+ (rs6000-ibm-aix5.1.*, powerpc-ibm-aix5.1.*): Likewise.
+ (rs6000-ibm-aix[56789].*, powerpc-ibm-aix[56789].*): Likewise.
+ (sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*)
+ (sh[2346lbe]*-*-linux*, sh-*-netbsdelf*, shl*-*-netbsdelf*)
+ (sh5-*-netbsd*, sh5l*-*-netbsd*, sh64-*-netbsd*)
+ (sh64l*-*-netbsd*): Add t-slibgcc-libgcc to tmake_file for
+ sh*-*-linux*.
+ (sparc-*-linux*): Append to tmake_file for *-leon*.
+ Add sparc/t-linux to tmake_file for non-Leon targets.
+ (sparc64-*-linux*): Add sparc/t-linux to tmake_file.
+ (tic6x-*-uclinux): New case.
+ Add t-slibgcc, t-slibgcc-gld, t-slibgcc-elf-ver to tmake_file.
+ (tic6x-*-*): Add c6x/t-elf to tmake_file.
+ (xtensa*-*-linux*): Append to tmake_file, add xtensa/t-linux.
+ (am33_2.0-*-linux*): Append to tmake_file.
+ (i[34567]86-*-linux*, x86_64-*-linux*, i[34567]86-*-kfreebsd*-gnu)
+ (i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*): Also handle
+ x86_64-*-kfreebsd*-gnu.
+ Add i386/t-linux to tmake_file.
+
2011-10-28 Ian Lance Taylor <iant@google.com>
* config/i386/morestack.S: Correct CFI information to do proper
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index e9f2fa2f2b8..3a8509d118c 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -22,7 +22,6 @@
libgcc_topdir = @libgcc_topdir@
host_subdir = @host_subdir@
-gcc_srcdir = $(libgcc_topdir)/gcc
gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
srcdir = @srcdir@
@@ -50,6 +49,8 @@ target_noncanonical = @target_noncanonical@
# The rules for compiling them should be in the t-* file for the machine.
EXTRA_PARTS = @extra_parts@
+extra-parts = libgcc-extra-parts
+
# Multilib support variables.
MULTISRCTOP =
MULTIBUILDTOP =
@@ -62,6 +63,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs
+INSTALL_PARTS = $(EXTRA_PARTS)
objext = .o
@@ -119,7 +121,7 @@ installcheck:
.PHONY: all clean
clean:
- -rm -f config.h stamp-h stmp-ldirs libgcc.map
+ -rm -f config.h libgcc_tm.h stamp-h stmp-ldirs libgcc.map
-rm -f *$(objext)
-rm -f *.dep
-rm -f *.a
@@ -217,6 +219,41 @@ else
DECNUMINC =
endif
+# Options to use when compiling libgcc2.a.
+#
+LIBGCC2_DEBUG_CFLAGS = -g
+LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
+ $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
+ -fbuilding-libgcc -fno-stack-protector \
+ $(INHIBIT_LIBC_CFLAGS)
+
+# Additional options to use when compiling libgcc2.a.
+# Some targets override this to -isystem include
+LIBGCC2_INCLUDES =
+
+# Additional target-dependent options for compiling libgcc2.a.
+HOST_LIBGCC2_CFLAGS =
+
+PICFLAG = @PICFLAG@
+
+# Defined in libgcc2.c, included only in the static library.
+LIB2FUNCS_ST = _eprintf __gcc_bcmp
+
+# List of functions not to build from libgcc2.c.
+LIB2FUNCS_EXCLUDE =
+
+# These might cause a divide overflow trap and so are compiled with
+# unwinder info.
+LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
+
+# List of extra C and assembler files to add to static and shared libgcc2.
+# Assembler files should have names ending in `.S'.
+LIB2ADD =
+
+# List of extra C and assembler files to add to static libgcc2.
+# Assembler files should have names ending in `.S'.
+LIB2ADD_ST =
+
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that *config.h will be found in the compilation
@@ -238,6 +275,16 @@ override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS))
INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
$(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
+# Options to use when compiling crtbegin/end.
+CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+ -finhibit-size-directive -fno-inline -fno-exceptions \
+ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
+ -fno-stack-protector \
+ $(INHIBIT_LIBC_CFLAGS)
+
+# Extra flags to use when compiling crt{begin,end}.o.
+CRTSTUFF_T_CFLAGS =
+
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
@@ -279,6 +326,9 @@ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
LIB2ADDEHSTATIC = $(LIB2ADDEH)
LIB2ADDEHSHARED = $(LIB2ADDEH)
+# nm flags to list global symbols in libgcc object files.
+SHLIB_NM_FLAGS = -pg
+
# Don't build libunwind by default.
LIBUNWIND =
SHLIBUNWIND_LINK =
@@ -287,6 +337,16 @@ SHLIBUNWIND_INSTALL =
tmake_file = @tmake_file@
include $(srcdir)/empty.mk $(tmake_file)
+# Collect target defines and headers from config.host.
+libgcc_tm_defines = @tm_defines@
+libgcc_tm_file = @tm_file@
+libgcc_tm.h: libgcc_tm.stamp; @true
+libgcc_tm.stamp:
+ DEFINES='$(libgcc_tm_defines)' HEADERS='$(libgcc_tm_file)' \
+ $(srcdir)/mkheader.sh > tmp-libgcc_tm.h
+ $(SHELL) $(srcdir)/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
+ echo timestamp > $@
+
# Only handle shared libraries if both:
# - the user requested them
# - we know how to build them
@@ -332,16 +392,6 @@ vis_hide =
gen-hide-list = echo > \$@
endif
-ifneq ($(EXTRA_PARTS),)
- extra-parts = libgcc-extra-parts
- INSTALL_PARTS = $(EXTRA_PARTS)
-else
-ifneq ($(GCC_EXTRA_PARTS),)
- extra-parts = gcc-extra-parts
- INSTALL_PARTS = $(GCC_EXTRA_PARTS)
-endif
-endif
-
LIB2ADD += enable-execute-stack.c
LIB2ADDEH += $(srcdir)/emutls.c
@@ -388,40 +438,36 @@ LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
ifeq ($(enable_shared),yes)
lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
-$(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC) %.vis
- $(gcc_compile) -DL$* -xassembler-with-cpp \
- -c $(gcc_srcdir)/config/$(LIB1ASMSRC) -include $*.vis
+$(lib1asmfuncs-o): %$(objext): $(srcdir)/config/$(LIB1ASMSRC) %.vis
+ $(gcc_compile) -DL$* -xassembler-with-cpp -c $< -include $*.vis
$(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext)
$(gen-hide-list)
libgcc-objects += $(lib1asmfuncs-o)
lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
-$(lib1asmfuncs-s-o): %_s$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC)
- $(gcc_s_compile) -DL$* -xassembler-with-cpp \
- -c $(gcc_srcdir)/config/$(LIB1ASMSRC)
+$(lib1asmfuncs-s-o): %_s$(objext): $(srcdir)/config/$(LIB1ASMSRC)
+ $(gcc_s_compile) -DL$* -xassembler-with-cpp -c $<
libgcc-s-objects += $(lib1asmfuncs-s-o)
else
lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
-$(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC)
- $(gcc_compile) -DL$* -xassembler-with-cpp \
- -c $(gcc_srcdir)/config/$(LIB1ASMSRC)
+$(lib1asmfuncs-o): %$(objext): $(srcdir)/config/$(LIB1ASMSRC)
+ $(gcc_compile) -DL$* -xassembler-with-cpp -c $<
libgcc-objects += $(lib1asmfuncs-o)
endif
# Build lib2funcs. For the static library also include LIB2FUNCS_ST.
lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
-$(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
- $(vis_hide)
+$(lib2funcs-o): %$(objext): $(srcdir)/libgcc2.c
+ $(gcc_compile) -DL$* -c $< $(vis_hide)
libgcc-objects += $(lib2funcs-o)
ifeq ($(enable_shared),yes)
lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs))
-$(lib2funcs-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c
+$(lib2funcs-s-o): %_s$(objext): $(srcdir)/libgcc2.c
+ $(gcc_s_compile) -DL$* -c $<
libgcc-s-objects += $(lib2funcs-s-o)
endif
@@ -449,15 +495,15 @@ endif
# Build LIB2_DIVMOD_FUNCS.
lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
-$(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
+$(lib2-divmod-o): %$(objext): $(srcdir)/libgcc2.c
+ $(gcc_compile) -DL$* -c $< \
-fexceptions -fnon-call-exceptions $(vis_hide)
libgcc-objects += $(lib2-divmod-o)
ifeq ($(enable_shared),yes)
lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
-$(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
+$(lib2-divmod-s-o): %_s$(objext): $(srcdir)/libgcc2.c
+ $(gcc_s_compile) -DL$* -c $< \
-fexceptions -fnon-call-exceptions
libgcc-s-objects += $(lib2-divmod-s-o)
endif
@@ -897,45 +943,39 @@ ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CFLAGS) $(INCLUDES)
crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps)
ifeq ($(CUSTOM_CRTSTUFF),)
-crtbegin$(objext): $(gcc_srcdir)/crtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
- -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN
+# Compile two additional files that are linked with every program
+# linked using GCC on systems using COFF or ELF, for the sake of C++
+# constructors.
+crtbegin$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
-crtend$(objext): $(gcc_srcdir)/crtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
- -c $(gcc_srcdir)/crtstuff.c -DCRT_END
+crtend$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
# These are versions of crtbegin and crtend for shared libraries.
-crtbeginS$(objext): $(gcc_srcdir)/crtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
- -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O
+crtbeginS$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_BEGIN -DCRTSTUFFS_O
-crtendS$(objext): $(gcc_srcdir)/crtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
- -c $(gcc_srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O
+crtendS$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_END -DCRTSTUFFS_O
# This is a version of crtbegin for -static links.
-crtbeginT.o: $(gcc_srcdir)/crtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
- -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
+crtbeginT$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
+endif
+
+ifeq ($(CUSTOM_CRTIN),)
+# -x assembler-with-cpp is only needed on case-insensitive filesystem.
+crti$(objext): $(srcdir)/config/$(cpu_type)/crti.S
+ $(crt_compile) -c -x assembler-with-cpp $<
+
+crtn$(objext): $(srcdir)/config/$(cpu_type)/crtn.S
+ $(crt_compile) -c -x assembler-with-cpp $<
endif
# Build extra startfiles in the libgcc directory.
.PHONY: libgcc-extra-parts
libgcc-extra-parts: $(EXTRA_PARTS)
-ifneq ($(GCC_EXTRA_PARTS),)
-ifneq ($(sort $(EXTRA_PARTS)),$(GCC_EXTRA_PARTS))
- # If the gcc directory specifies which extra parts to
- # build for this target, and the libgcc configuration also
- # specifies, make sure they match. This can be removed
- # when the gcc directory no longer holds libgcc configuration;
- # it is useful when migrating a target.
- @echo "Configuration mismatch!"
- @echo "Extra parts from gcc directory: $(GCC_EXTRA_PARTS)"
- @echo "Extra parts from libgcc: $(EXTRA_PARTS)"
- exit 1
-endif
-endif
# Early copyback; see "all" above for the rationale. The
# early copy is necessary so that the gcc -B options find
@@ -951,45 +991,13 @@ endif
esac; \
done
-# Build extra startfiles in the gcc directory, for unconverted
-# targets.
-.PHONY: gcc-extra-parts
-gcc-extra-parts:
- # Recursively invoke make in the GCC directory to build any
- # startfiles (for now). We must do this just once, passing
- # it all the GCC_EXTRA_PARTS as simultaneous goal targets,
- # so that rules which cannot execute simultaneously are properly
- # serialized. We indirect through T_TARGET in case any multilib
- # directories contain an equals sign, to prevent make from
- # interpreting any of the goals as variable assignments.
-
- # We must use cd && make rather than make -C, or else the stage
- # number will be embedded in debug information.
-
- T=`$(PWD_COMMAND)`/ \
- && cd $(gcc_objdir) \
- && $(MAKE) GCC_FOR_TARGET="$(CC)" \
- MULTILIB_CFLAGS="$(CFLAGS)" \
- T=$$T \
- T_TARGET="$(patsubst %,$${T}%,$(GCC_EXTRA_PARTS))" \
- T_TARGET
-
- # Early copyback; see "all" above for the rationale. The
- # early copy is necessary so that the gcc -B options find
- # the right startup files when linking shared libgcc.
- $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
- parts="$(GCC_EXTRA_PARTS)"; \
- for file in $$parts; do \
- rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
- $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
- case $$file in \
- *.a) \
- $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
- esac; \
- done
-
all: $(extra-parts)
+$(libgcc-objects) $(libgcc-s-objects) $(libgcc-eh-objects) \
+ $(libgcov-objects) \
+ $(libunwind-objects) $(libunwind-s-objects) \
+ $(EXTRA_PARTS): libgcc_tm.h
+
install-unwind_h:
dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \
cp unwind.h $$dest; \
@@ -1067,11 +1075,3 @@ install-strip: install
.NOEXPORT:
include $(srcdir)/empty.mk $(wildcard *.dep)
-
-# TODO QUEUE:
-# Garbage collect in gcc/:
-# $(LIBGCC) settings in t-* are now unused
-#
-# Remove use of $(gcc_srcdir). Source files referenced using $(gcc_srcdir)
-# should move into the libgcc directory.
-
diff --git a/libgcc/config.host b/libgcc/config.host
index 08c00a37f97..8af99f57987 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -58,8 +58,12 @@
# Defaults to "$cpu_type/sfp-machine.h" if it exists,
# no-sfp-machine.h otherwise.
# tmake_file A list of machine-description-specific
-# makefile-fragments, if different from
-# "$cpu_type/t-$cpu_type".
+# makefile fragments.
+# tm_defines List of target macros to define for all compilations.
+# tm_file A list of target macro files used only for code
+# built for the target, not the host. These files
+# are relative to $srcdir/config and must not have
+# the same names as files in $srcdir/../gcc/config.
# unwind_header The name of the header file declaring the unwind
# runtime interface routines.
@@ -67,6 +71,8 @@ asm_hidden_op=.hidden
enable_execute_stack=
extra_parts=
tmake_file=
+tm_file=
+tm_define=
md_unwind_header=no-unwind.h
unwind_header=unwind-generic.h
@@ -163,7 +169,7 @@ esac
case ${host} in
*-*-darwin*)
asm_hidden_op=.private_extern
- tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-slibgcc-darwin"
+ tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin"
extra_parts=crt3.o
;;
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
@@ -179,22 +185,56 @@ case ${host} in
# This is the generic ELF configuration of FreeBSD. Later
# machine-specific sections may refine and add to this
# configuration.
- tmake_file="$tmake_file t-eh-dw2-dip"
+ tmake_file="$tmake_file t-freebsd t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ case ${target_thread_file} in
+ posix)
+ tmake_file="${tmake_file} t-freebsd-thread"
+ # Before 5.0, FreeBSD can't bind shared libraries to -lc
+ # when "optionally" threaded via weak pthread_* checks.
+ case ${host} in
+ *-*-freebsd[34] | *-*-freebsd[34].*)
+ tmake_file="${tmake_file} t-slibgcc-nolc-override"
+ ;;
+ esac
+ ;;
+ esac
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
- tmake_file="$tmake_file t-eh-dw2-dip"
+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
;;
+*-*-lynxos*)
+ tmake_file="$tmake_file t-lynx $cpu_type/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ ;;
*-*-netbsd*)
+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+ # NetBSD 1.7 and later are set up to use GCC's crtstuff for
+ # ELF configurations. We will clear extra_parts in the
+ # a.out configurations.
+ case ${host} in
+ *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+ ;;
+ esac
;;
*-*-openbsd*)
+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic"
+ case ${target_thread_file} in
+ posix)
+ tmake_file="$tmake_file t-openbsd-thread"
+ ;;
+ esac
;;
*-*-rtems*)
+ tmake_file="$tmake_file t-rtems"
+ extra_parts="crtbegin.o crtend.o"
;;
*-*-solaris2*)
# Unless linker support and dl_iterate_phdr are present,
# unwind-dw2-fde-dip.c automatically falls back to unwind-dw2-fde.c.
- tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-slibgcc t-slibgcc-elf-ver"
+ tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-libgcc-pic t-slibgcc t-slibgcc-elf-ver"
if test $with_gnu_ld = yes; then
tmake_file="$tmake_file t-slibgcc-gld"
else
@@ -213,14 +253,22 @@ case ${host} in
extra_parts="$extra_parts crt1.o gcrt1.o"
;;
*)
- tmake_file="$tmake_file t-crtin"
extra_parts="$extra_parts crt1.o crti.o crtn.o gcrt1.o"
;;
esac
;;
+*-*-uclinux*)
+ extra_parts="crtbegin.o crtend.o"
+ ;;
+*-*-*vms*)
+ tmake_file="vms/t-vms"
+ extra_parts="vcrt0.o pcrt0.o crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ ;;
*-*-vxworks*)
+ tmake_file=t-vxworks
;;
*-*-elf)
+ extra_parts="crtbegin.o crtend.o"
;;
esac
@@ -239,17 +287,19 @@ esac
case ${host} in
alpha*-*-linux*)
- tmake_file="${tmake_file} t-crtfm"
+ tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm alpha/t-linux"
extra_parts="$extra_parts crtfastmath.o"
md_unwind_header=alpha/linux-unwind.h
;;
alpha*-*-freebsd*)
- tmake_file="${tmake_file} t-crtfm"
- extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm"
+ extra_parts="$extra_parts crtbeginT.o crtfastmath.o"
;;
alpha*-*-netbsd*)
+ tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
;;
alpha*-*-openbsd*)
+ tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
;;
alpha*-dec-osf5.1*)
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm t-slibgcc alpha/t-slibgcc-osf"
@@ -258,32 +308,40 @@ alpha*-dec-osf5.1*)
tmake_file="${tmake_file} alpha/t-osf-pthread"
;;
esac
- extra_parts="${extra_parts} qrnnd.o crtfastmath.o gthr-posix.o"
+ extra_parts="${extra_parts} crtfastmath.o"
md_unwind_header=alpha/osf5-unwind.h
;;
alpha64-dec-*vms*)
- tmake_file="vms/t-vms vms/t-vms64 alpha/t-vms"
+ tmake_file="$tmake_file alpha/t-alpha alpha/t-ieee alpha/t-vms t-slibgcc-vms"
+ extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
md_unwind_header=alpha/vms-unwind.h
;;
alpha*-dec-*vms*)
- tmake_file="vms/t-vms alpha/t-vms"
+ tmake_file="$tmake_file alpha/t-alpha alpha/t-ieee alpha/t-vms t-slibgcc-vms"
+ extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
md_unwind_header=alpha/vms-unwind.h
;;
arm-wrs-vxworks)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-freebsd*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file arm/t-arm arm/t-strongarm-elf t-fdpbit"
;;
arm*-*-netbsdelf*)
+ tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
- tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
+ tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
case ${host} in
arm*-*-linux-*eabi)
- tmake_file="${tmake_file} arm/t-bpabi"
+ tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
+ tm_file="$tm_file arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
;;
+ *)
+ tmake_file="$tmake_file arm/t-linux"
+ ;;
esac
tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
;;
@@ -292,121 +350,192 @@ arm*-*-uclinux*) # ARM ucLinux
case ${host} in
arm*-*-uclinux*eabi)
tmake_file="${tmake_file} arm/t-bpabi"
+ tm_file="$tm_file arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
;;
esac
- tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-ecos-elf)
- tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
-arm*-*-eabi* | arm*-*-symbianelf* )
- tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
+arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtemseabi*)
+ tmake_file="${tmake_file} arm/t-arm arm/t-elf t-fixedpoint-gnu-prefix"
+ tm_file="$tm_file arm/bpabi-lib.h"
case ${host} in
- arm*-*-eabi*)
+ arm*-*-eabi* | arm*-*-rtemseabi*)
tmake_file="${tmake_file} arm/t-bpabi"
+ extra_parts="crtbegin.o crtend.o crti.o crtn.o"
;;
arm*-*-symbianelf*)
- tmake_file="${tmake_file} arm/t-symbian"
+ tmake_file="${tmake_file} arm/t-symbian t-slibgcc-nolc-override"
+ tm_file="$tm_file arm/symbian-lib.h"
+ # Symbian OS provides its own startup code.
;;
esac
tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
unwind_header=config/arm/unwind-arm.h
;;
arm*-*-rtems*)
- tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-elf)
- tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-wince-pe*)
+ tmake_file="$tmake_file arm/t-arm arm/t-wince-pe"
;;
avr-*-rtems*)
- tmake_file=t-fpbit
+ tmake_file="$tmake_file avr/t-avr avr/t-rtems t-fpbit"
+ tm_file="$tm_file avr/avr-lib.h"
+ # Don't use default.
+ extra_parts=
;;
avr-*-*)
# Make HImode functions for AVR
tmake_file="${cpu_type}/t-avr t-fpbit"
+ tm_file="$tm_file avr/avr-lib.h"
;;
bfin*-elf*)
- tmke_file=t-fdpbit
+ tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-libgcc-pic t-fdpbit"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o"
;;
bfin*-uclinux*)
- tmake_file=t-fdpbit
+ tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-libgcc-pic t-fdpbit"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtlibid.o"
md_unwind_header=bfin/linux-unwind.h
;;
bfin*-linux-uclibc*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file bfin/t-bfin bfin/t-crtstuff t-libgcc-pic t-fdpbit bfin/t-linux"
# No need to build crtbeginT.o on uClibc systems. Should probably
# be moved to the OS specific section above.
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
md_unwind_header=bfin/linux-unwind.h
;;
bfin*-rtems*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file bfin/t-bfin t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
bfin*-*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file bfin/t-bfin t-fdpbit"
+ extra_parts="crtbegin.o crtend.o crti.o crtn.o"
;;
-crisv32-*-elf | crisv32-*-none | cris-*-elf | cris-*-none)
- tmake_file=t-fdpbit
- extra_parts="crtbegin.o crtend.o"
+crisv32-*-elf)
+ tmake_file="$tmake_file cris/t-cris t-fdpbit"
+ ;;
+cris-*-elf)
+ tmake_file="$tmake_file cris/t-cris t-fdpbit cris/t-elfmulti"
;;
cris-*-linux* | crisv32-*-linux*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file cris/t-cris t-fdpbit cris/t-linux"
;;
-fido-*-elf)
+epiphany-*-elf*)
+ tmake_file="epiphany/t-epiphany t-fdpbit epiphany/t-custom-eqsf"
+ extra_parts="$extra_parts crti.o crtint.o crtrunc.o crtm1reg-r43.o crtm1reg-r63.o crtn.o"
;;
fr30-*-elf)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file fr30/t-fr30 t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
frv-*-elf)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file frv/t-frv t-fdpbit"
+ tm_file="$tm_file frv/frv-abi.h"
+ # Don't use crtbegin.o, crtend.o.
+ extra_parts="frvbegin.o frvend.o"
;;
frv-*-*linux*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file frv/t-frv frv/t-linux t-fdpbit"
+ tm_file="$tm_file frv/frv-abi.h"
;;
h8300-*-rtems*)
- tmake_file=t-fpbit
+ tmake_file="$tmake_file h8300/t-h8300 t-fpbit"
+ tm_file="$tm_file h8300/h8300-lib.h"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
h8300-*-elf*)
- tmake_file=t-fpbit
+ tmake_file="$tmake_file h8300/t-h8300 t-fpbit"
+ tm_file="$tm_file h8300/h8300-lib.h"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
hppa*64*-*-linux*)
+ tmake_file="$tmake_file pa/t-linux pa/t-linux64"
;;
hppa*-*-linux*)
+ tmake_file="$tmake_file pa/t-linux t-slibgcc-libgcc"
+ # Set the libgcc version number
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
+ else
+ tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
+ fi
md_unwind_header=pa/linux-unwind.h
;;
hppa[12]*-*-hpux10*)
+ tmake_file="$tmake_file pa/t-hpux pa/t-hpux10 t-libgcc-pic t-slibgcc"
+ # Set the libgcc version number
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
+ else
+ tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
+ fi
+ tmake_file="$tmake_file pa/t-slibgcc-hpux t-slibgcc-hpux"
md_unwind_header=pa/hpux-unwind.h
;;
hppa*64*-*-hpux11*)
+ tmake_file="$tmake_file pa/t-hpux pa/t-pa64 pa/t-stublib pa/t-stublib64 t-libgcc-pic t-slibgcc"
+ # Set the libgcc version number
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
+ else
+ tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
+ fi
+ tmake_file="$tmake_file pa/t-slibgcc-hpux t-slibgcc-hpux"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
+ libgcc_stub.a"
md_unwind_header=pa/hpux-unwind.h
;;
hppa[12]*-*-hpux11*)
+ tmake_file="$tmake_file pa/t-hpux pa/t-stublib t-libgcc-pic t-slibgcc"
+ # Set the libgcc version number
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
+ else
+ tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
+ fi
+ tmake_file="$tmake_file pa/t-slibgcc-hpux t-slibgcc-hpux"
+ extra_parts="libgcc_stub.a"
md_unwind_header=pa/hpux-unwind.h
;;
i[34567]86-*-darwin*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+ tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-darwin*)
- tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtpc i386/t-crtfm t-slibgcc-darwin"
+ tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+ tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
i[34567]86-*-elf*)
+ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
;;
x86_64-*-elf*)
+ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
;;
i[34567]86-*-freebsd*)
- tmake_file="${tmake_file} i386/t-freebsd"
+ tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
;;
x86_64-*-freebsd*)
- tmake_file="${tmake_file} i386/t-freebsd"
+ tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
;;
i[34567]86-*-netbsdelf*)
;;
x86_64-*-netbsd*)
+ tmake_file="${tmake_file} i386/t-crtstuff"
;;
i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
;;
@@ -414,31 +543,33 @@ i[34567]86-*-openbsd*)
;;
i[34567]86-*-linux*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
md_unwind_header=i386/linux-unwind.h
;;
i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
;;
x86_64-*-linux*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
md_unwind_header=i386/linux-unwind.h
;;
x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
;;
i[34567]86-pc-msdosdjgpp*)
;;
i[34567]86-*-lynxos*)
;;
i[34567]86-*-nto-qnx*)
+ tmake_file="$tmake_file i386/t-nto t-libgcc-pic"
+ extra_parts=crtbegin.o
;;
i[34567]86-*-rtems*)
- extra_parts="crtbegin.o crtend.o crti.o crtn.o"
- tmake_file="${tmake_file} t-crtin i386/t-softfp i386/t-crtstuff t-rtems"
+ tmake_file="$tmake_file i386/t-softfp i386/t-crtstuff"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
@@ -449,86 +580,164 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
;;
i[34567]86-*-cygwin*)
extra_parts="crtbegin.o crtend.o crtfastmath.o"
- tmake_file="i386/t-cygming i386/t-crtfm t-dfprules"
+ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_eh_file="i386/t-sjlj-eh"
+ else
+ tmake_eh_file="i386/t-dw2-eh"
+ fi
+ # Shared libgcc DLL install dir depends on cross/native build.
+ if test x${build} = x${host} ; then
+ tmake_dlldir_file="i386/t-dlldir"
+ else
+ tmake_dlldir_file="i386/t-dlldir-x"
+ fi
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm i386/t-chkstk t-dfprules"
+ case ${target_thread_file} in
+ posix)
+ tmake_file="i386/t-mingw-pthread $tmake_file"
+ ;;
+ esac
;;
i[34567]86-*-mingw*)
extra_parts="crtbegin.o crtend.o crtfastmath.o"
- tmake_file="i386/t-cygming i386/t-crtfm t-dfprules"
+ case ${target_thread_file} in
+ win32)
+ tmake_file="$tmake_file i386/t-gthr-win32"
+ ;;
+ esac
+ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_eh_file="i386/t-sjlj-eh"
+ else
+ tmake_eh_file="i386/t-dw2-eh"
+ fi
+ # Shared libgcc DLL install dir depends on cross/native build.
+ if test x${build} = x${host} ; then
+ tmake_dlldir_file="i386/t-dlldir"
+ else
+ tmake_dlldir_file="i386/t-dlldir-x"
+ fi
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 i386/t-crtfm i386/t-chkstk t-dfprules"
md_unwind_header=i386/w32-unwind.h
;;
x86_64-*-mingw*)
- tmake_file="t-dfprules i386/t-crtfm"
+ case ${target_thread_file} in
+ win32)
+ tmake_file="$tmake_file i386/t-gthr-win32"
+ ;;
+ esac
+ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_eh_file="i386/t-sjlj-eh"
+ else
+ tmake_eh_file="i386/t-dw2-eh"
+ fi
+ # Shared libgcc DLL install dir depends on cross/native build.
+ if test x${build} = x${host} ; then
+ tmake_dlldir_file="i386/t-dlldir"
+ else
+ tmake_dlldir_file="i386/t-dlldir-x"
+ fi
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-mingw32 t-dfprules i386/t-crtfm i386/t-chkstk"
extra_parts="$extra_parts crtfastmath.o"
;;
i[34567]86-*-interix3*)
+ tmake_file="$tmake_file i386/t-interix i386/t-chkstk"
;;
ia64*-*-elf*)
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o"
tmake_file="ia64/t-ia64 ia64/t-eh-ia64 t-crtfm"
;;
ia64*-*-freebsd*)
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
- tmake_file="ia64/t-ia64 ia64/t-eh-ia64 t-crtfm"
+ extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="$tmake_file ia64/t-ia64 ia64/t-eh-ia64 t-crtfm"
;;
ia64*-*-linux*)
+ # Don't use crtbeginT.o from *-*-linux* default.
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
- tmake_file="ia64/t-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat ia64/t-eh-ia64 t-libunwind ia64/t-glibc"
+ tmake_file="$tmake_file ia64/t-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat ia64/t-eh-ia64 t-libunwind ia64/t-linux"
if test x$with_system_libunwind != xyes ; then
- tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
+ tmake_file="${tmake_file} t-libunwind-elf ia64/t-linux-libunwind"
fi
md_unwind_header=ia64/linux-unwind.h
;;
ia64*-*-hpux*)
- tmake_file="ia64/t-hpux"
+ tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc ia64/t-slibgcc-hpux t-slibgcc-hpux"
;;
ia64-hp-*vms*)
- tmake_file="vms/t-vms vms/t-vms64 ia64/t-eh-ia64 ia64/t-vms"
+ tmake_file="$tmake_file ia64/t-ia64 ia64/t-eh-ia64 ia64/t-vms t-slibgcc-vms"
+ extra_parts="$extra_parts crtinitS.o"
md_unwind_header=ia64/vms-unwind.h
;;
iq2000*-*-elf*)
tmake_file=t-fdpbit
+ # Don't use default.
+ extra_parts=
;;
-lm32-*-elf*|lm32-*-rtems*)
- extra_parts="crtbegin.o crtend.o crti.o crtn.o"
+lm32-*-elf*)
+ extra_parts="$extra_parts crti.o crtn.o"
tmake_file="lm32/t-lm32 lm32/t-elf t-softfp-sfdf t-softfp"
;;
+lm32-*-rtems*)
+ tmake_file="$tmake_file lm32/t-lm32 lm32/t-elf t-softfp-sfdf t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
+ ;;
lm32-*-uclinux*)
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp-sfdf t-softfp"
+ extra_parts="$extra_parts crtbegin.o crtendS.o crtbeginT.o"
+ tmake_file="lm32/t-lm32 lm32/t-uclinux t-libgcc-pic t-softfp-sfdf t-softfp"
;;
-m32r-*-elf*|m32r-*-rtems*)
+m32r-*-elf*)
tmake_file=t-fdpbit
;;
+m32r-*-rtems*)
+ tmake_file="$tmake_file m32r/t-m32r t-fdpbit"
+ ;;
m32rle-*-elf*)
tmake_file=t-fdpbit
;;
m32r-*-linux*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file m32r/t-linux t-fdpbit"
;;
m32rle-*-linux*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file m32r/t-linux t-fdpbit"
;;
-m68k-*-elf*)
+m68k-*-elf* | fido-*-elf)
+ tmake_file="$tmake_file m68k/t-floatlib"
;;
m68k*-*-netbsdelf*)
;;
m68k*-*-openbsd*)
;;
m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
+ tmake_file="$tmake_file m68k/t-floatlib"
md_unwind_header=m68k/linux-unwind.h
;;
m68k-*-linux*) # Motorola m68k's running GNU/Linux
# with ELF format using glibc 2
# aka the GNU/Linux C library 6.
+ tmake_file="$tmake_file m68k/t-floatlib"
+ # If not configured with --enable-sjlj-exceptions, bump the
+ # libgcc version number.
+ if test x$enable_sjlj_exceptions != xyes; then
+ tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
+ fi
md_unwind_header=m68k/linux-unwind.h
;;
m68k-*-rtems*)
+ tmake_file="$tmake_file m68k/t-floatlib"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mcore-*-elf)
- tmake_file=t-fdpbit
+ tmake_file="mcore/t-mcore t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o"
+ ;;
+microblaze*-linux*)
+ tmake_file="$tmake_file t-slibgcc-nolc-override microblaze/t-microblaze t-fdpbit"
;;
microblaze*-*-*)
tmake_file="microblaze/t-microblaze t-fdpbit"
+ extra_parts="crtbegin.o crtend.o crti.o crtn.o"
;;
mips-sgi-irix6.5*)
tmake_file="$tmake_file mips/t-irix6 t-crtfm mips/t-tpbit t-slibgcc mips/t-slibgcc-irix"
@@ -550,47 +759,57 @@ mips*-*-linux*) # Linux MIPS, either endian.
mips*-*-openbsd*)
;;
mips*-sde-elf*)
+ tmake_file="mips/t-crtstuff mips/t-mips16"
case "${with_newlib}" in
yes)
# newlib / libgloss.
;;
*)
# MIPS toolkit libraries.
- tmake_file=mips/t-sdemtk
+ tmake_file="$tmake_file mips/t-sdemtk"
;;
esac
- tmake_file="$tmake_file mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mipsisa32-*-elf* | mipsisa32el-*-elf* | \
mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
mipsisa64-*-elf* | mipsisa64el-*-elf* | \
mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mipsisa64sr71k-*-elf*)
- tmake_file=t-fdpbit
+ tmake_file="mips/t-elf mips/t-crtstuff t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips-*-elf* | mipsel-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips64-*-elf* | mips64el-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips64vr-*-elf* | mips64vrel-*-elf*)
+ tmake_file="$tmake_file mips/t-elf mips/t-vr mips/t-crtstuff"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips64orion-*-elf* | mips64orionel-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips*-*-rtems*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
mips-wrs-vxworks)
;;
mipstx39-*-elf* | mipstx39el-*-elf*)
- tmake_file="$tmake_file mips/t-mips16"
+ tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
;;
mmix-knuth-mmixware)
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
@@ -599,12 +818,17 @@ mmix-knuth-mmixware)
mn10300-*-*)
tmake_file=t-fdpbit
;;
-moxie-*-*)
+moxie-*-elf | moxie-*-uclinux*)
tmake_file="moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
- extra_parts="crtbegin.o crtend.o crti.o crtn.o"
+ extra_parts="$extra_parts crti.o crtn.o"
+ ;;
+moxie-*-rtems*)
+ tmake_file="$tmake_file moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
+ # Don't use default.
+ extra_parts=
;;
pdp11-*-*)
- tmake_file=t-fdpbit
+ tmake_file="pdp11/t-pdp11 t-fdpbit"
;;
picochip-*-*)
tmake_file="picochip/t-picochip t-fpbit"
@@ -623,72 +847,86 @@ powerpc-*-darwin*)
extra_parts="$extra_parts crt2.o"
;;
powerpc64-*-darwin*)
- tmake_file="$tmake_file rs6000/t-ibm-ldouble"
+ tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble"
extra_parts="$extra_parts crt2.o"
;;
powerpc-*-freebsd*)
- tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp t-slibgcc-libgcc"
+ extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-netbsd*)
+ tmake_file="$tmake_file rs6000/t-crtstuff"
;;
powerpc-*-eabispe*)
- tmake_file="${tmake_file} rs6000/t-ppccomm"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-eabisimaltivec*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-eabisim*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-elf*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-eabialtivec*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-xilinx-eabi*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-eabi*)
- tmake_file="${tmake_file} rs6000/t-ppccomm t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-rtems*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpc-*-linux* | powerpc64-*-linux*)
- tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ldbl128 t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff rs6000/t-linux t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp t-slibgcc-libgcc"
+ extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
md_unwind_header=rs6000/linux-unwind.h
;;
powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
;;
powerpc-*-lynxos*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file t-fdpbit"
;;
powerpcle-*-elf*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpcle-*-eabisim*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
powerpcle-*-eabi*)
- tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
md_unwind_header=rs6000/aix-unwind.h
- tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
+ tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix"
;;
rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
md_unwind_header=rs6000/aix-unwind.h
- tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
+ tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix"
;;
rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
md_unwind_header=rs6000/aix-unwind.h
- tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
+ tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix"
;;
rx-*-elf)
- extra_parts="crtbegin.o crtend.o"
tmake_file="rx/t-rx t-fdpbit"
+ tm_file="$tm_file rx/rx-abi.h rx/rx-lib.h"
;;
s390-*-linux*)
tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi"
@@ -699,37 +937,60 @@ s390x-*-linux*)
md_unwind_header=s390/linux-unwind.h
;;
s390x-ibm-tpf*)
- tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf t-eh-dw2-dip"
+ tmake_file="${tmake_file} s390/t-crtstuff t-libgcc-pic t-eh-dw2-dip"
+ extra_parts="crtbeginS.o crtendS.o"
md_unwind_header=s390/tpf-unwind.h
;;
score-*-elf)
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
-sh-*-elf* | sh[12346l]*-*-elf* | \
- sh-*-linux* | sh[2346lbe]*-*-linux* | \
- sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
- sh64-*-netbsd* | sh64l*-*-netbsd*)
- case ${host} in
- sh*-*-linux*)
- tmake_file="${tmake_file} sh/t-linux t-fdpbit"
- md_unwind_header=sh/linux-unwind.h
+sh-*-elf* | sh[12346l]*-*-elf*)
+ tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
+ libic_invalidate_array_4-100.a \
+ libic_invalidate_array_4-200.a \
+ libic_invalidate_array_4a.a \
+ libgcc-Os-4-200.a libgcc-4-300.a"
+ case ${host} in sh64*-*-*)
+ tmake_file="$tmake_file sh/t-sh64"
;;
- sh*-*-netbsd*)
- # NetBSD's C library includes a fast software FP library that
- # has support for setting/setting the rounding mode, exception
- # mask, etc. Therefore, we don't want to include software FP
- # in libgcc.
+ esac
+ case ${host} in
+ sh*-superh-elf)
+ tmake_file="$tmake_file sh/t-superh"
+ extra_parts="$extra_parts crt1-mmu.o gcrt1-mmu.o gcrt1.o"
+ ;;
+ esac
+ ;;
+sh-*-linux* | sh[2346lbe]*-*-linux*)
+ tmake_file="${tmake_file} sh/t-sh t-slibgcc-libgcc sh/t-linux t-fdpbit"
+ case ${host} in sh64*-*-linux*)
+ tmake_file="$tmake_file sh/t-sh64"
;;
- sh*-*-*)
- tmake_file=t-fdpbit
+ esac
+ md_unwind_header=sh/linux-unwind.h
+ ;;
+sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ tmake_file="$tmake_file sh/t-sh sh/t-netbsd"
+ case ${host} in
+ sh5*-*-netbsd* | sh64*-netbsd*)
+ tmake_file="$tmake_file sh/t-sh64"
;;
esac
+ # NetBSD's C library includes a fast software FP library that
+ # has support for setting/setting the rounding mode, exception
+ # mask, etc. Therefore, we don't want to include software FP
+ # in libgcc.
;;
sh-*-rtems*)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
+ $sh_ic_extra_parts $sh_opt_extra_parts"
;;
sh-wrs-vxworks)
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
;;
sparc-*-netbsdelf*)
;;
@@ -743,22 +1004,37 @@ sparc-*-elf*)
tmake_file="sparc/t-softmul"
;;
esac
- tmake_file="${tmake_file} t-fdpbit t-crtin t-crtfm"
- extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+ tmake_file="${tmake_file} t-fdpbit t-crtfm"
+ extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc-*-linux*) # SPARC's running GNU/Linux, libc6
+ tmake_file="${tmake_file} t-crtfm"
+ if test "${host_address}" = 64; then
+ tmake_file="$tmake_file sparc/t-linux64"
+ fi
case ${host} in
*-leon*)
- tmake_file=t-fdpbit
+ tmake_file="${tmake_file} t-fdpbit"
+ ;;
+ *)
+ tmake_file="${tmake_file} sparc/t-linux"
;;
esac
+ case ${host} in
+ *-leon[3-9]*)
+ ;;
+ *)
+ if test "${host_address}" = 32; then
+ tmake_file="$tmake_file sparc/t-softmul"
+ fi
+ ;;
+ esac
extra_parts="$extra_parts crtfastmath.o"
- tmake_file="${tmake_file} t-crtfm"
md_unwind_header=sparc/linux-unwind.h
;;
sparc-*-rtems*)
- tmake_file="sparc/t-elf t-crtin t-crtfm t-rtems t-fdpbit"
- extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+ tmake_file="$tmake_file sparc/t-elf sparc/t-softmul t-crtfm t-fdpbit"
+ extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc*-*-solaris2*)
tmake_file="$tmake_file t-crtfm"
@@ -766,60 +1042,83 @@ sparc*-*-solaris2*)
md_unwind_header=sparc/sol2-unwind.h
;;
sparc64-*-elf*)
- tmake_file="${tmake_file} t-crtin t-crtfm"
- extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+ tmake_file="${tmake_file} t-crtfm"
+ extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc64-*-rtems*)
- tmake_file="sparc/t-elf t-crtin t-crtfm t-rtems"
- extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+ tmake_file="$tmake_file sparc/t-elf t-crtfm"
+ extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc-wrs-vxworks)
;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
tmake_file="$tmake_file t-crtfm"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o crtfastmath.o"
+ extra_parts="$extra_parts crtfastmath.o"
;;
sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
extra_parts="$extra_parts crtfastmath.o"
- tmake_file="${tmake_file} t-crtfm"
+ tmake_file="${tmake_file} t-crtfm sparc/t-linux"
+ if test "${host_address}" = 64; then
+ tmake_file="${tmake_file} sparc/t-linux64"
+ fi
+ if test "${host_address}" = 32; then
+ tmake_file="${tmake_file} sparc/t-softmul"
+ fi
md_unwind_header=sparc/linux-unwind.h
;;
sparc64-*-netbsd*)
;;
spu-*-elf*)
- tmake_file="t-fdpbit spu/t-elf"
+ tmake_file="$tmake_file spu/t-elf t-libgcc-pic t-fdpbit"
+ extra_parts="$extra_parts \
+ libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
+ libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a \
+ libgcc_cache64k.a libgcc_cache128k.a"
+ ;;
+tic6x-*-uclinux)
+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf c6x/t-uclinux t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-gnu-prefix"
+ tm_file="$tm_file c6x/c6x-abi.h"
+ extra_parts="crtbeginS.o crtendS.o crti.o crtn.o"
+ unwind_header=config/c6x/unwind-c6x.h
;;
-tic6x-*-*)
- tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp t-gnu-prefix c6x/t-c6x-elf"
+tic6x-*-elf)
+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp t-gnu-prefix c6x/t-elf"
+ tm_file="$tm_file c6x/c6x-abi.h"
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o"
unwind_header=config/c6x/unwind-c6x.h
;;
v850*-*-*)
- tmake_file=t-fdpbit
+ tmake_file="v850/t-v850 t-fdpbit"
;;
vax-*-linux*)
+ tmake_file="$tmake_file vax/t-linux"
;;
vax-*-netbsdelf*)
;;
vax-*-openbsd*)
;;
xstormy16-*-elf)
- tmake_file=t-fdpbit
+ tmake_file="stormy16/t-stormy16 t-fdpbit"
;;
xtensa*-*-elf*)
- tmake_file=xtensa/t-xtensa
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-elf"
+ extra_parts="$extra_parts crti.o crtn.o"
;;
xtensa*-*-linux*)
- tmake_file=xtensa/t-xtensa
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux"
md_unwind_header=xtensa/linux-unwind.h
;;
am33_2.0-*-linux*)
+ # Don't need crtbeginT.o from *-*-linux* default.
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
- tmake_file=t-fdpbit
+ tmake_file="$tmake_file t-fdpbit"
;;
m32c-*-elf*|m32c-*-rtems*)
+ tmake_file="$tmake_file m32c/t-m32c"
;;
mep*-*-*)
- tmake_file=t-fdpbit
+ tmake_file="mep/t-mep t-fdpbit"
+ extra_parts="crtbegin.o crtend.o"
;;
*)
echo "*** Configuration ${host} not supported" 1>&2
@@ -829,9 +1128,10 @@ esac
case ${host} in
i[34567]86-*-linux* | x86_64-*-linux* | \
- i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | \
+ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
+ i[34567]86-*-knetbsd*-gnu | \
i[34567]86-*-gnu*)
- tmake_file="${tmake_file} t-tls"
+ tmake_file="${tmake_file} t-tls i386/t-linux"
if test "$libgcc_cv_cfi" = "yes"; then
tmake_file="${tmake_file} t-stack i386/t-stack-i386"
fi
@@ -860,5 +1160,6 @@ i[34567]86-*-linux* | x86_64-*-linux*)
if test "${host_address}" = 64; then
tmake_file="${tmake_file} i386/${host_address}/t-softfp-compat"
fi
+ tm_file="${tm_file} i386/value-unwind.h"
;;
esac
diff --git a/gcc/gthr-posix.c b/libgcc/config/alpha/gthr-posix.c
index 1987ba738c2..02681a4371e 100644
--- a/gcc/gthr-posix.c
+++ b/libgcc/config/alpha/gthr-posix.c
@@ -1,6 +1,7 @@
/* POSIX threads dummy routines for systems without weak definitions. */
/* Compile this one with gcc. */
-/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2011
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -25,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tconfig.h"
#include "tm.h"
+#include "libgcc_tm.h"
# define __gthrw_pragma(pragma) _Pragma (#pragma)
/* Define so we provide weak definitions of functions used by libobjc only. */
#define _LIBOBJC_WEAK
@@ -177,7 +179,7 @@ pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
}
int
-pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
+pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
const struct timespec *abstime ATTRIBUTE_UNUSED)
{
diff --git a/gcc/config/alpha/libgcc-alpha-ldbl.ver b/libgcc/config/alpha/libgcc-alpha-ldbl.ver
index 8dc54a74980..8dc54a74980 100644
--- a/gcc/config/alpha/libgcc-alpha-ldbl.ver
+++ b/libgcc/config/alpha/libgcc-alpha-ldbl.ver
diff --git a/gcc/config/alpha/qrnnd.asm b/libgcc/config/alpha/qrnnd.S
index 51b13bce6ad..51b13bce6ad 100644
--- a/gcc/config/alpha/qrnnd.asm
+++ b/libgcc/config/alpha/qrnnd.S
diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
index 14c72d0808b..0b6ffb1ba34 100644
--- a/libgcc/config/alpha/t-alpha
+++ b/libgcc/config/alpha/t-alpha
@@ -1,2 +1,2 @@
# This is a support routine for longlong.h, used by libgcc2.c.
-LIB2ADD += $(gcc_srcdir)/config/alpha/qrnnd.asm
+LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
diff --git a/gcc/config/alpha/t-linux b/libgcc/config/alpha/t-linux
index fabf38f9cce..fabf38f9cce 100644
--- a/gcc/config/alpha/t-linux
+++ b/libgcc/config/alpha/t-linux
diff --git a/libgcc/config/alpha/t-osf-pthread b/libgcc/config/alpha/t-osf-pthread
index c51f375a048..9a175dbeb9e 100644
--- a/libgcc/config/alpha/t-osf-pthread
+++ b/libgcc/config/alpha/t-osf-pthread
@@ -2,4 +2,4 @@
HOST_LIBGCC2_CFLAGS += -pthread
# Provide dummy POSIX threads functions
-LIB2ADD += $(gcc_srcdir)/gthr-posix.c
+LIB2ADD += $(srcdir)/config/alpha/gthr-posix.c
diff --git a/libgcc/config/alpha/t-slibgcc-osf b/libgcc/config/alpha/t-slibgcc-osf
index 33a07a7b6aa..66e5cf12aa1 100644
--- a/libgcc/config/alpha/t-slibgcc-osf
+++ b/libgcc/config/alpha/t-slibgcc-osf
@@ -22,7 +22,7 @@
SHLIB_LDFLAGS = -Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
-Wl,-hidden -Wl,-input,$(SHLIB_MAP)
-SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MKMAP_OPTS = -v osf_export=1
# Needed so mkmap-flat.awk can parse the nm output.
SHLIB_NM_FLAGS = -Bg
diff --git a/libgcc/config/alpha/t-vms b/libgcc/config/alpha/t-vms
new file mode 100644
index 00000000000..dd5760d9747
--- /dev/null
+++ b/libgcc/config/alpha/t-vms
@@ -0,0 +1,9 @@
+# This object must be linked with in order to make the executable debuggable.
+# vms-ld handles it automatically when passed -g.
+vms-dwarf2.o: $(srcdir)/config/alpha/vms-dwarf2.S
+ $(gcc_compile) -c -x assembler-with-cpp $<
+
+vms-dwarf2eh.o: $(srcdir)/config/alpha/vms-dwarf2eh.S
+ $(gcc_compile) -c -x assembler-with-cpp $<
+
+LIB2ADD += $(srcdir)/config/alpha/vms-gcc_shell_handler.c
diff --git a/gcc/config/alpha/vms-dwarf2.asm b/libgcc/config/alpha/vms-dwarf2.S
index 531c7aa9984..531c7aa9984 100644
--- a/gcc/config/alpha/vms-dwarf2.asm
+++ b/libgcc/config/alpha/vms-dwarf2.S
diff --git a/gcc/config/alpha/vms-dwarf2eh.asm b/libgcc/config/alpha/vms-dwarf2eh.S
index e0eaf9d3741..e0eaf9d3741 100644
--- a/gcc/config/alpha/vms-dwarf2eh.asm
+++ b/libgcc/config/alpha/vms-dwarf2eh.S
diff --git a/gcc/config/alpha/vms-gcc_shell_handler.c b/libgcc/config/alpha/vms-gcc_shell_handler.c
index 67d0fe7f9aa..67d0fe7f9aa 100644
--- a/gcc/config/alpha/vms-gcc_shell_handler.c
+++ b/libgcc/config/alpha/vms-gcc_shell_handler.c
diff --git a/gcc/config/arm/bpabi-v6m.S b/libgcc/config/arm/bpabi-v6m.S
index 4ecea6da5a6..4ecea6da5a6 100644
--- a/gcc/config/arm/bpabi-v6m.S
+++ b/libgcc/config/arm/bpabi-v6m.S
diff --git a/gcc/config/arm/bpabi.S b/libgcc/config/arm/bpabi.S
index 2ff338927fa..2ff338927fa 100644
--- a/gcc/config/arm/bpabi.S
+++ b/libgcc/config/arm/bpabi.S
diff --git a/gcc/config/arm/bpabi.c b/libgcc/config/arm/bpabi.c
index 283bdc0acf0..283bdc0acf0 100644
--- a/gcc/config/arm/bpabi.c
+++ b/libgcc/config/arm/bpabi.c
diff --git a/gcc/config/arm/crti.asm b/libgcc/config/arm/crti.S
index 9454273dd29..50915f9e31f 100644
--- a/gcc/config/arm/crti.asm
+++ b/libgcc/config/arm/crti.S
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
# Written By Nick Clifton
#
# This file is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
#endif /* __ARM_EABI__ */
# Note - this macro is complemented by the FUNC_END macro
- # in crtn.asm. If you change this macro you must also change
+ # in crtn.S. If you change this macro you must also change
# that macro match.
.macro FUNC_START
#ifdef __thumb__
@@ -83,4 +83,4 @@ _init:
_fini:
FUNC_START
-# end of crti.asm
+# end of crti.S
diff --git a/gcc/config/arm/crtn.asm b/libgcc/config/arm/crtn.S
index c7f90814d79..8c5f22572f7 100644
--- a/gcc/config/arm/crtn.asm
+++ b/libgcc/config/arm/crtn.S
@@ -1,4 +1,5 @@
-# Copyright (C) 2001, 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2008, 2009, 2010, 2011
+# Free Software Foundation, Inc.
# Written By Nick Clifton
#
# This file is free software; you can redistribute it and/or modify it
@@ -41,7 +42,7 @@
# This file is the last thing linked into any executable.
# Note - this macro is complemented by the FUNC_START macro
- # in crti.asm. If you change this macro you must also change
+ # in crti.S. If you change this macro you must also change
# that macro match.
#
# Note - we do not try any fancy optimizations of the return
@@ -79,4 +80,4 @@
;;
FUNC_END
-# end of crtn.asm
+# end of crtn.S
diff --git a/gcc/config/arm/fp16.c b/libgcc/config/arm/fp16.c
index 936caeb78d0..936caeb78d0 100644
--- a/gcc/config/arm/fp16.c
+++ b/libgcc/config/arm/fp16.c
diff --git a/gcc/config/arm/ieee754-df.S b/libgcc/config/arm/ieee754-df.S
index eb0c38632d0..eb0c38632d0 100644
--- a/gcc/config/arm/ieee754-df.S
+++ b/libgcc/config/arm/ieee754-df.S
diff --git a/gcc/config/arm/ieee754-sf.S b/libgcc/config/arm/ieee754-sf.S
index c93f66d8ff8..c93f66d8ff8 100644
--- a/gcc/config/arm/ieee754-sf.S
+++ b/libgcc/config/arm/ieee754-sf.S
diff --git a/gcc/config/arm/lib1funcs.asm b/libgcc/config/arm/lib1funcs.S
index 2e76c01df4b..2e76c01df4b 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/libgcc/config/arm/lib1funcs.S
diff --git a/gcc/config/arm/libgcc-bpabi.ver b/libgcc/config/arm/libgcc-bpabi.ver
index 3ba8364dc8e..3ba8364dc8e 100644
--- a/gcc/config/arm/libgcc-bpabi.ver
+++ b/libgcc/config/arm/libgcc-bpabi.ver
diff --git a/libgcc/config/arm/libunwind.S b/libgcc/config/arm/libunwind.S
index a3a19daab4b..8166cd86e47 100644
--- a/libgcc/config/arm/libunwind.S
+++ b/libgcc/config/arm/libunwind.S
@@ -40,7 +40,7 @@
#ifndef __symbian__
-#include "config/arm/lib1funcs.asm"
+#include "lib1funcs.S"
.macro UNPREFIX name
.global SYM (\name)
diff --git a/gcc/config/arm/linux-atomic-64bit.c b/libgcc/config/arm/linux-atomic-64bit.c
index af94c7f4ae5..af94c7f4ae5 100644
--- a/gcc/config/arm/linux-atomic-64bit.c
+++ b/libgcc/config/arm/linux-atomic-64bit.c
diff --git a/gcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c
index 80f161d06a7..80f161d06a7 100644
--- a/gcc/config/arm/linux-atomic.c
+++ b/libgcc/config/arm/linux-atomic.c
diff --git a/libgcc/config/arm/t-arm b/libgcc/config/arm/t-arm
new file mode 100644
index 00000000000..4e17e99b4a5
--- /dev/null
+++ b/libgcc/config/arm/t-arm
@@ -0,0 +1,3 @@
+LIB1ASMSRC = arm/lib1funcs.S
+LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi \
+ _thumb1_case_uhi _thumb1_case_si
diff --git a/libgcc/config/arm/t-bpabi b/libgcc/config/arm/t-bpabi
index a3b23dcd20c..e79cbd7064e 100644
--- a/libgcc/config/arm/t-bpabi
+++ b/libgcc/config/arm/t-bpabi
@@ -1,3 +1,15 @@
+# Add the bpabi.S functions.
+LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
+
+# Add the BPABI C functions.
+LIB2ADD += $(srcdir)/config/arm/bpabi.c \
+ $(srcdir)/config/arm/unaligned-funcs.c
+
+LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
+
LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
$(srcdir)/config/arm/libunwind.S \
$(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
+
+# Add the BPABI names.
+SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
diff --git a/libgcc/config/arm/t-elf b/libgcc/config/arm/t-elf
new file mode 100644
index 00000000000..d9e8064e4de
--- /dev/null
+++ b/libgcc/config/arm/t-elf
@@ -0,0 +1,18 @@
+# For most CPUs we have an assembly soft-float implementations.
+# However this is not true for ARMv6M. Here we want to use the soft-fp C
+# implementation. The soft-fp code is only build for ARMv6M. This pulls
+# in the asm implementation for other CPUs.
+LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
+ _call_via_rX _interwork_call_via_rX \
+ _lshrdi3 _ashrdi3 _ashldi3 \
+ _arm_negdf2 _arm_addsubdf3 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
+ _arm_fixdfsi _arm_fixunsdfsi \
+ _arm_truncdfsf2 _arm_negsf2 _arm_addsubsf3 _arm_muldivsf3 \
+ _arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi \
+ _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \
+ _clzsi2 _clzdi2
+
+# Currently there is a bug somewhere in GCC's alias analysis
+# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
+# Disabling function inlining is a workaround for this problem.
+HOST_LIBGCC2_CFLAGS += -fno-inline
diff --git a/libgcc/config/arm/t-linux b/libgcc/config/arm/t-linux
new file mode 100644
index 00000000000..4c1efebbd87
--- /dev/null
+++ b/libgcc/config/arm/t-linux
@@ -0,0 +1,7 @@
+LIB1ASMSRC = arm/lib1funcs.S
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+ _arm_addsubdf3 _arm_addsubsf3
+
+# Just for these, we omit the frame pointer since it makes such a big
+# difference.
+HOST_LIBGCC2_CFLAGS += -fomit-frame-pointer
diff --git a/libgcc/config/arm/t-linux-eabi b/libgcc/config/arm/t-linux-eabi
new file mode 100644
index 00000000000..a03e2b60064
--- /dev/null
+++ b/libgcc/config/arm/t-linux-eabi
@@ -0,0 +1,5 @@
+# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
+LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
+
+LIB2ADD_ST += $(srcdir)/config/arm/linux-atomic.c \
+ $(srcdir)/config/arm/linux-atomic-64bit.c
diff --git a/libgcc/config/arm/t-netbsd b/libgcc/config/arm/t-netbsd
new file mode 100644
index 00000000000..95358f931ba
--- /dev/null
+++ b/libgcc/config/arm/t-netbsd
@@ -0,0 +1,7 @@
+# Just for these, we omit the frame pointer since it makes such a big
+# difference. It is then pointless adding debugging.
+HOST_LIBGCC2_CFLAGS += -fomit-frame-pointer
+
+LIBGCC2_DEBUG_CFLAGS = -g0
+
+LIB2ADD += $(srcdir)/floatunsidf.c $(srcdir)/floatunsisf.c
diff --git a/libgcc/config/arm/t-strongarm-elf b/libgcc/config/arm/t-strongarm-elf
new file mode 100644
index 00000000000..45d1b993218
--- /dev/null
+++ b/libgcc/config/arm/t-strongarm-elf
@@ -0,0 +1,6 @@
+LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _clzsi2 _clzdi2
+
+# Currently there is a bug somewhere in GCC's alias analysis
+# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
+# Disabling function inlining is a workaround for this problem.
+HOST_LIBGCC2_CFLAGS += -fno-inline
diff --git a/libgcc/config/arm/t-symbian b/libgcc/config/arm/t-symbian
index 6788d5f40b3..06d98faa6ae 100644
--- a/libgcc/config/arm/t-symbian
+++ b/libgcc/config/arm/t-symbian
@@ -1,2 +1,19 @@
+LIB1ASMFUNCS += _bb_init_func _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
+
+# These functions have __aeabi equivalents and will never be called by GCC.
+# By putting them in LIB1ASMFUNCS, we avoid the standard libgcc2.c code being
+# used -- and we make sure that definitions are not available in lib1funcs.S,
+# either, so they end up undefined.
+LIB1ASMFUNCS += \
+ _ashldi3 _ashrdi3 _divdi3 _floatdidf _udivmoddi4 _umoddi3 \
+ _udivdi3 _lshrdi3 _moddi3 _muldi3 _negdi2 _cmpdi2 \
+ _fixdfdi _fixsfdi _fixunsdfdi _fixunssfdi _floatdisf \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi
+
+# Include half-float helpers.
+LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
+
# Include the gcc personality routine
LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
diff --git a/libgcc/config/arm/t-vxworks b/libgcc/config/arm/t-vxworks
new file mode 100644
index 00000000000..70ccdc1556a
--- /dev/null
+++ b/libgcc/config/arm/t-vxworks
@@ -0,0 +1 @@
+LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
diff --git a/libgcc/config/arm/t-wince-pe b/libgcc/config/arm/t-wince-pe
new file mode 100644
index 00000000000..33ea969ccf4
--- /dev/null
+++ b/libgcc/config/arm/t-wince-pe
@@ -0,0 +1 @@
+LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
diff --git a/gcc/config/arm/unaligned-funcs.c b/libgcc/config/arm/unaligned-funcs.c
index 4e684f4fc94..4e684f4fc94 100644
--- a/gcc/config/arm/unaligned-funcs.c
+++ b/libgcc/config/arm/unaligned-funcs.c
diff --git a/gcc/config/avr/libgcc.S b/libgcc/config/avr/lib1funcs.S
index 8c369c96a77..f7a8f6335c4 100644
--- a/gcc/config/avr/libgcc.S
+++ b/libgcc/config/avr/lib1funcs.S
@@ -562,30 +562,33 @@ ENDF __udivmodhi4
#if defined (L_divmodhi4)
DEFUN __divmodhi4
- .global _div
+ .global _div
_div:
- bst r_arg1H,7 ; store sign of dividend
- mov __tmp_reg__,r_arg1H
- eor __tmp_reg__,r_arg2H ; r0.7 is sign of result
- rcall __divmodhi4_neg1 ; dividend negative : negate
- sbrc r_arg2H,7
- rcall __divmodhi4_neg2 ; divisor negative : negate
- XCALL __udivmodhi4 ; do the unsigned div/mod
- rcall __divmodhi4_neg1 ; correct remainder sign
- tst __tmp_reg__
- brpl __divmodhi4_exit
+ bst r_arg1H,7 ; store sign of dividend
+ mov __tmp_reg__,r_arg2H
+ brtc 0f
+ com __tmp_reg__ ; r0.7 is sign of result
+ rcall __divmodhi4_neg1 ; dividend negative: negate
+0:
+ sbrc r_arg2H,7
+ rcall __divmodhi4_neg2 ; divisor negative: negate
+ XCALL __udivmodhi4 ; do the unsigned div/mod
+ sbrc __tmp_reg__,7
+ rcall __divmodhi4_neg2 ; correct remainder sign
+ brtc __divmodhi4_exit
+__divmodhi4_neg1:
+ ;; correct dividend/remainder sign
+ com r_arg1H
+ neg r_arg1L
+ sbci r_arg1H,0xff
+ ret
__divmodhi4_neg2:
- com r_arg2H
- neg r_arg2L ; correct divisor/result sign
- sbci r_arg2H,0xff
+ ;; correct divisor/result sign
+ com r_arg2H
+ neg r_arg2L
+ sbci r_arg2H,0xff
__divmodhi4_exit:
- ret
-__divmodhi4_neg1:
- brtc __divmodhi4_exit
- com r_arg1H
- neg r_arg1L ; correct dividend/remainder sign
- sbci r_arg1H,0xff
- ret
+ ret
ENDF __divmodhi4
#endif /* defined (L_divmodhi4) */
@@ -599,7 +602,142 @@ ENDF __divmodhi4
#undef r_arg2L
#undef r_cnt
-
+
+/*******************************************************
+ Division 24 / 24 => (result + remainder)
+*******************************************************/
+
+;; A[0..2]: In: Dividend; Out: Quotient
+#define A0 22
+#define A1 A0+1
+#define A2 A0+2
+
+;; B[0..2]: In: Divisor; Out: Remainder
+#define B0 18
+#define B1 B0+1
+#define B2 B0+2
+
+;; C[0..2]: Expand remainder
+#define C0 __zero_reg__
+#define C1 26
+#define C2 25
+
+;; Loop counter
+#define r_cnt 21
+
+#if defined (L_udivmodpsi4)
+;; R24:R22 = R24:R22 udiv R20:R18
+;; R20:R18 = R24:R22 umod R20:R18
+;; Clobbers: R21, R25, R26
+
+DEFUN __udivmodpsi4
+ ; init loop counter
+ ldi r_cnt, 24+1
+ ; Clear remainder and carry. C0 is already 0
+ clr C1
+ sub C2, C2
+ ; jump to entry point
+ rjmp __udivmodpsi4_start
+__udivmodpsi4_loop:
+ ; shift dividend into remainder
+ rol C0
+ rol C1
+ rol C2
+ ; compare remainder & divisor
+ cp C0, B0
+ cpc C1, B1
+ cpc C2, B2
+ brcs __udivmodpsi4_start ; remainder <= divisor
+ sub C0, B0 ; restore remainder
+ sbc C1, B1
+ sbc C2, B2
+__udivmodpsi4_start:
+ ; shift dividend (with CARRY)
+ rol A0
+ rol A1
+ rol A2
+ ; decrement loop counter
+ dec r_cnt
+ brne __udivmodpsi4_loop
+ com A0
+ com A1
+ com A2
+ ; div/mod results to return registers
+ ; remainder
+ mov B0, C0
+ mov B1, C1
+ mov B2, C2
+ clr __zero_reg__ ; C0
+ ret
+ENDF __udivmodpsi4
+#endif /* defined (L_udivmodpsi4) */
+
+#if defined (L_divmodpsi4)
+;; R24:R22 = R24:R22 div R20:R18
+;; R20:R18 = R24:R22 mod R20:R18
+;; Clobbers: T, __tmp_reg__, R21, R25, R26
+
+DEFUN __divmodpsi4
+ ; R0.7 will contain the sign of the result:
+ ; R0.7 = A.sign ^ B.sign
+ mov __tmp_reg__, B2
+ ; T-flag = sign of dividend
+ bst A2, 7
+ brtc 0f
+ com __tmp_reg__
+ ; Adjust dividend's sign
+ rcall __divmodpsi4_negA
+0:
+ ; Adjust divisor's sign
+ sbrc B2, 7
+ rcall __divmodpsi4_negB
+
+ ; Do the unsigned div/mod
+ XCALL __udivmodpsi4
+
+ ; Adjust quotient's sign
+ sbrc __tmp_reg__, 7
+ rcall __divmodpsi4_negA
+
+ ; Adjust remainder's sign
+ brtc __divmodpsi4_end
+
+__divmodpsi4_negB:
+ ; Correct divisor/remainder sign
+ com B2
+ com B1
+ neg B0
+ sbci B1, -1
+ sbci B2, -1
+ ret
+
+ ; Correct dividend/quotient sign
+__divmodpsi4_negA:
+ com A2
+ com A1
+ neg A0
+ sbci A1, -1
+ sbci A2, -1
+__divmodpsi4_end:
+ ret
+
+ENDF __divmodpsi4
+#endif /* defined (L_divmodpsi4) */
+
+#undef A0
+#undef A1
+#undef A2
+
+#undef B0
+#undef B1
+#undef B2
+
+#undef C0
+#undef C1
+#undef C2
+
+#undef r_cnt
+
/*******************************************************
Division 32 / 32 => (result + remainder)
*******************************************************/
@@ -672,36 +810,39 @@ ENDF __udivmodsi4
#if defined (L_divmodsi4)
DEFUN __divmodsi4
- bst r_arg1HH,7 ; store sign of dividend
- mov __tmp_reg__,r_arg1HH
- eor __tmp_reg__,r_arg2HH ; r0.7 is sign of result
- rcall __divmodsi4_neg1 ; dividend negative : negate
- sbrc r_arg2HH,7
- rcall __divmodsi4_neg2 ; divisor negative : negate
- XCALL __udivmodsi4 ; do the unsigned div/mod
- rcall __divmodsi4_neg1 ; correct remainder sign
- rol __tmp_reg__
- brcc __divmodsi4_exit
+ mov __tmp_reg__,r_arg2HH
+ bst r_arg1HH,7 ; store sign of dividend
+ brtc 0f
+ com __tmp_reg__ ; r0.7 is sign of result
+ rcall __divmodsi4_neg1 ; dividend negative: negate
+0:
+ sbrc r_arg2HH,7
+ rcall __divmodsi4_neg2 ; divisor negative: negate
+ XCALL __udivmodsi4 ; do the unsigned div/mod
+ sbrc __tmp_reg__, 7 ; correct quotient sign
+ rcall __divmodsi4_neg2
+ brtc __divmodsi4_exit ; correct remainder sign
+__divmodsi4_neg1:
+ ;; correct dividend/remainder sign
+ com r_arg1HH
+ com r_arg1HL
+ com r_arg1H
+ neg r_arg1L
+ sbci r_arg1H, 0xff
+ sbci r_arg1HL,0xff
+ sbci r_arg1HH,0xff
+ ret
__divmodsi4_neg2:
- com r_arg2HH
- com r_arg2HL
- com r_arg2H
- neg r_arg2L ; correct divisor/quotient sign
- sbci r_arg2H,0xff
- sbci r_arg2HL,0xff
- sbci r_arg2HH,0xff
+ ;; correct divisor/quotient sign
+ com r_arg2HH
+ com r_arg2HL
+ com r_arg2H
+ neg r_arg2L
+ sbci r_arg2H,0xff
+ sbci r_arg2HL,0xff
+ sbci r_arg2HH,0xff
__divmodsi4_exit:
- ret
-__divmodsi4_neg1:
- brtc __divmodsi4_exit
- com r_arg1HH
- com r_arg1HL
- com r_arg1H
- neg r_arg1L ; correct dividend/remainder sign
- sbci r_arg1H, 0xff
- sbci r_arg1HL,0xff
- sbci r_arg1HH,0xff
- ret
+ ret
ENDF __divmodsi4
#endif /* defined (L_divmodsi4) */
diff --git a/libgcc/config/avr/t-avr b/libgcc/config/avr/t-avr
index 78829c76af4..cd529ae8606 100644
--- a/libgcc/config/avr/t-avr
+++ b/libgcc/config/avr/t-avr
@@ -1,3 +1,60 @@
+LIB1ASMSRC = avr/lib1funcs.S
+LIB1ASMFUNCS = \
+ _mulqi3 \
+ _mulhi3 \
+ _mulhisi3 \
+ _umulhisi3 \
+ _usmulhisi3 \
+ _muluhisi3 \
+ _mulshisi3 \
+ _mulsi3 \
+ _udivmodqi4 \
+ _divmodqi4 \
+ _udivmodhi4 \
+ _divmodhi4 \
+ _divmodpsi4 _udivmodpsi4 \
+ _udivmodsi4 \
+ _divmodsi4 \
+ _prologue \
+ _epilogue \
+ _exit \
+ _cleanup \
+ _tablejump \
+ _tablejump_elpm \
+ _copy_data \
+ _clear_bss \
+ _ctors \
+ _dtors \
+ _ffssi2 \
+ _ffshi2 \
+ _loop_ffsqi2 \
+ _ctzsi2 \
+ _ctzhi2 \
+ _clzdi2 \
+ _clzsi2 \
+ _clzhi2 \
+ _paritydi2 \
+ _paritysi2 \
+ _parityhi2 \
+ _popcounthi2 \
+ _popcountsi2 \
+ _popcountdi2 \
+ _popcountqi2 \
+ _bswapsi2 \
+ _bswapdi2 \
+ _ashldi3 \
+ _ashrdi3 \
+ _lshrdi3 \
+ _fmul _fmuls _fmulsu
+
+LIB2FUNCS_EXCLUDE = \
+ _clz
+
+# We do not have the DF type.
+# Most of the C functions in libgcc2 use almost all registers,
+# so use -mcall-prologues for smaller code size.
+HOST_LIBGCC2_CFLAGS += -DDF=SF -Dinhibit_libc -mcall-prologues -Os
+
# Extra 16-bit integer functions.
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2
diff --git a/libgcc/config/avr/t-rtems b/libgcc/config/avr/t-rtems
new file mode 100644
index 00000000000..43b57ee323d
--- /dev/null
+++ b/libgcc/config/avr/t-rtems
@@ -0,0 +1,2 @@
+# RTEMS uses _exit from newlib
+LIB1ASMFUNCS := $(filter-out _exit,$(LIB1ASMFUNCS))
diff --git a/gcc/config/bfin/crti.s b/libgcc/config/bfin/crti.S
index b6f20fc9e6b..b6f20fc9e6b 100644
--- a/gcc/config/bfin/crti.s
+++ b/libgcc/config/bfin/crti.S
diff --git a/gcc/config/bfin/crtlibid.s b/libgcc/config/bfin/crtlibid.S
index beab8093810..beab8093810 100644
--- a/gcc/config/bfin/crtlibid.s
+++ b/libgcc/config/bfin/crtlibid.S
diff --git a/gcc/config/bfin/crtn.s b/libgcc/config/bfin/crtn.S
index 7fcd27bfade..7fcd27bfade 100644
--- a/gcc/config/bfin/crtn.s
+++ b/libgcc/config/bfin/crtn.S
diff --git a/gcc/config/bfin/lib1funcs.asm b/libgcc/config/bfin/lib1funcs.S
index c7bf4f3f05c..c7bf4f3f05c 100644
--- a/gcc/config/bfin/lib1funcs.asm
+++ b/libgcc/config/bfin/lib1funcs.S
diff --git a/gcc/config/bfin/libgcc-bfin.ver b/libgcc/config/bfin/libgcc-glibc.ver
index 516d91f6584..516d91f6584 100644
--- a/gcc/config/bfin/libgcc-bfin.ver
+++ b/libgcc/config/bfin/libgcc-glibc.ver
diff --git a/libgcc/config/bfin/t-bfin b/libgcc/config/bfin/t-bfin
new file mode 100644
index 00000000000..bc2b088ffc1
--- /dev/null
+++ b/libgcc/config/bfin/t-bfin
@@ -0,0 +1,3 @@
+LIB1ASMSRC = bfin/lib1funcs.S
+LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
+LIB1ASMFUNCS += _smulsi3_highpart
diff --git a/libgcc/config/bfin/t-crtlibid b/libgcc/config/bfin/t-crtlibid
new file mode 100644
index 00000000000..b0c93e71eb9
--- /dev/null
+++ b/libgcc/config/bfin/t-crtlibid
@@ -0,0 +1,3 @@
+# Assemble startup files.
+crtlibid.o: $(srcdir)/config/bfin/crtlibid.S
+ $(gcc_compile) -c -x assembler-with-cpp $<
diff --git a/libgcc/config/bfin/t-crtstuff b/libgcc/config/bfin/t-crtstuff
new file mode 100644
index 00000000000..eee12eb697a
--- /dev/null
+++ b/libgcc/config/bfin/t-crtstuff
@@ -0,0 +1 @@
+CRTSTUFF_T_CFLAGS = $(PICFLAG)
diff --git a/libgcc/config/bfin/t-linux b/libgcc/config/bfin/t-linux
new file mode 100644
index 00000000000..1c42e482b8d
--- /dev/null
+++ b/libgcc/config/bfin/t-linux
@@ -0,0 +1 @@
+SHLIB_MAPFILES = $(srcdir)/config/bfin/libgcc-glibc.ver
diff --git a/gcc/config/c6x/crti.s b/libgcc/config/c6x/crti.S
index 8fe35c1f121..8fe35c1f121 100644
--- a/gcc/config/c6x/crti.s
+++ b/libgcc/config/c6x/crti.S
diff --git a/gcc/config/c6x/crtn.s b/libgcc/config/c6x/crtn.S
index 5900a4b14c4..5900a4b14c4 100644
--- a/gcc/config/c6x/crtn.s
+++ b/libgcc/config/c6x/crtn.S
diff --git a/gcc/config/c6x/eqd.c b/libgcc/config/c6x/eqd.c
index d6b32013bcb..d6b32013bcb 100644
--- a/gcc/config/c6x/eqd.c
+++ b/libgcc/config/c6x/eqd.c
diff --git a/gcc/config/c6x/eqf.c b/libgcc/config/c6x/eqf.c
index ee6dafc98b7..ee6dafc98b7 100644
--- a/gcc/config/c6x/eqf.c
+++ b/libgcc/config/c6x/eqf.c
diff --git a/gcc/config/c6x/ged.c b/libgcc/config/c6x/ged.c
index 2089904f92a..2089904f92a 100644
--- a/gcc/config/c6x/ged.c
+++ b/libgcc/config/c6x/ged.c
diff --git a/gcc/config/c6x/gef.c b/libgcc/config/c6x/gef.c
index ce4c1c0af3d..ce4c1c0af3d 100644
--- a/gcc/config/c6x/gef.c
+++ b/libgcc/config/c6x/gef.c
diff --git a/gcc/config/c6x/gtd.c b/libgcc/config/c6x/gtd.c
index 6d45aef9af8..6d45aef9af8 100644
--- a/gcc/config/c6x/gtd.c
+++ b/libgcc/config/c6x/gtd.c
diff --git a/gcc/config/c6x/gtf.c b/libgcc/config/c6x/gtf.c
index c6a108a2833..c6a108a2833 100644
--- a/gcc/config/c6x/gtf.c
+++ b/libgcc/config/c6x/gtf.c
diff --git a/gcc/config/c6x/led.c b/libgcc/config/c6x/led.c
index c99e29e0ddf..c99e29e0ddf 100644
--- a/gcc/config/c6x/led.c
+++ b/libgcc/config/c6x/led.c
diff --git a/gcc/config/c6x/lef.c b/libgcc/config/c6x/lef.c
index ce2c16f8ede..ce2c16f8ede 100644
--- a/gcc/config/c6x/lef.c
+++ b/libgcc/config/c6x/lef.c
diff --git a/gcc/config/c6x/lib1funcs.asm b/libgcc/config/c6x/lib1funcs.S
index 5bf34474bbd..5bf34474bbd 100644
--- a/gcc/config/c6x/lib1funcs.asm
+++ b/libgcc/config/c6x/lib1funcs.S
diff --git a/gcc/config/c6x/libgcc-c6xeabi.ver b/libgcc/config/c6x/libgcc-eabi.ver
index 6bce556512e..6bce556512e 100644
--- a/gcc/config/c6x/libgcc-c6xeabi.ver
+++ b/libgcc/config/c6x/libgcc-eabi.ver
diff --git a/gcc/config/c6x/ltd.c b/libgcc/config/c6x/ltd.c
index d4de25866b7..d4de25866b7 100644
--- a/gcc/config/c6x/ltd.c
+++ b/libgcc/config/c6x/ltd.c
diff --git a/gcc/config/c6x/ltf.c b/libgcc/config/c6x/ltf.c
index 2fe15b99fde..2fe15b99fde 100644
--- a/gcc/config/c6x/ltf.c
+++ b/libgcc/config/c6x/ltf.c
diff --git a/libgcc/config/c6x/t-c6x-elf b/libgcc/config/c6x/t-c6x-elf
deleted file mode 100644
index 445de9b3224..00000000000
--- a/libgcc/config/c6x/t-c6x-elf
+++ /dev/null
@@ -1,4 +0,0 @@
-LIB2ADDEH = $(srcdir)/config/c6x/unwind-c6x.c \
- $(srcdir)/config/c6x/libunwind.S \
- $(srcdir)/config/c6x/pr-support.c $(srcdir)/unwind-c.c
-
diff --git a/libgcc/config/c6x/t-elf b/libgcc/config/c6x/t-elf
new file mode 100644
index 00000000000..c58c614849c
--- /dev/null
+++ b/libgcc/config/c6x/t-elf
@@ -0,0 +1,40 @@
+# Cannot use default rules due to $(CRTSTUFF_T_CFLAGS).
+CUSTOM_CRTIN = yes
+
+LIB1ASMSRC = c6x/lib1funcs.S
+LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _udivmodsi4 _divmodsi4
+LIB1ASMFUNCS += _strasgi _strasgi_64plus _clzsi2 _clzdi2 _clz
+LIB1ASMFUNCS += _push_rts _pop_rts _call_stub
+
+LIB2FUNCS_EXCLUDE = _cmpdi2 _ucmpdi2 _gcc_bcmp _eprintf _clzsi _clzdi
+
+LIB2ADD = $(srcdir)/config/c6x/gef.c \
+ $(srcdir)/config/c6x/gtf.c \
+ $(srcdir)/config/c6x/lef.c \
+ $(srcdir)/config/c6x/ltf.c \
+ $(srcdir)/config/c6x/eqf.c \
+ $(srcdir)/config/c6x/ged.c \
+ $(srcdir)/config/c6x/gtd.c \
+ $(srcdir)/config/c6x/led.c \
+ $(srcdir)/config/c6x/ltd.c \
+ $(srcdir)/config/c6x/eqd.c
+
+# Avoid failures when the user's GOT becomes too large.
+HOST_LIBGCC2_CFLAGS += -msdata=none
+
+LIB2ADDEH = $(srcdir)/config/c6x/unwind-c6x.c \
+ $(srcdir)/config/c6x/libunwind.S \
+ $(srcdir)/config/c6x/pr-support.c $(srcdir)/unwind-c.c
+
+# Assemble startup files.
+crti.o: $(srcdir)/config/c6x/crti.S
+ $(crt_compile) -c $(CRTSTUFF_T_CFLAGS) $<
+
+crtn.o: $(srcdir)/config/c6x/crtn.S
+ $(crt_compile) -c $(CRTSTUFF_T_CFLAGS) $<
+
+# Avoid failures when the user's GOT becomes too large.
+CRTSTUFF_T_CFLAGS = -msdata=none
+CRTSTUFF_T_CFLAGS_S = -msdata=none
+
+SHLIB_MAPFILES += $(srcdir)/config/c6x/libgcc-eabi.ver
diff --git a/libgcc/config/c6x/t-uclinux b/libgcc/config/c6x/t-uclinux
new file mode 100644
index 00000000000..72a170a575a
--- /dev/null
+++ b/libgcc/config/c6x/t-uclinux
@@ -0,0 +1,3 @@
+HOST_LIBGCC2_CFLAGS += -msdata=none
+
+CRTSTUFF_T_CFLAGS += $(PICFLAG)
diff --git a/gcc/config/cris/arit.c b/libgcc/config/cris/arit.c
index 32255f99d39..32255f99d39 100644
--- a/gcc/config/cris/arit.c
+++ b/libgcc/config/cris/arit.c
diff --git a/gcc/config/cris/libgcc.ver b/libgcc/config/cris/libgcc-glibc.ver
index e35de83100f..e35de83100f 100644
--- a/gcc/config/cris/libgcc.ver
+++ b/libgcc/config/cris/libgcc-glibc.ver
diff --git a/gcc/config/cris/mulsi3.asm b/libgcc/config/cris/mulsi3.S
index 76dfb634680..76dfb634680 100644
--- a/gcc/config/cris/mulsi3.asm
+++ b/libgcc/config/cris/mulsi3.S
diff --git a/libgcc/config/cris/t-cris b/libgcc/config/cris/t-cris
new file mode 100644
index 00000000000..b582974a42e
--- /dev/null
+++ b/libgcc/config/cris/t-cris
@@ -0,0 +1,10 @@
+LIB2ADD = _udivsi3.c _divsi3.c _umodsi3.c _modsi3.c
+
+# The fixed-point arithmetic code is in one file, arit.c,
+# similar to libgcc2.c (or the old libgcc1.c). We need to
+# "split it up" with one file per define.
+$(LIB2ADD): $(srcdir)/config/cris/arit.c
+ name=`echo $@ | sed -e 's,.*/,,' | sed -e 's,.c$$,,'`; \
+ echo "#define L$$name" > tmp-$@ \
+ && echo '#include "$<"' >> tmp-$@ \
+ && mv -f tmp-$@ $@
diff --git a/libgcc/config/cris/t-elfmulti b/libgcc/config/cris/t-elfmulti
new file mode 100644
index 00000000000..b180521039e
--- /dev/null
+++ b/libgcc/config/cris/t-elfmulti
@@ -0,0 +1,3 @@
+LIB2ADD_ST = $(srcdir)/config/cris/mulsi3.S
+
+CRTSTUFF_T_CFLAGS = -moverride-best-lib-options
diff --git a/libgcc/config/cris/t-linux b/libgcc/config/cris/t-linux
new file mode 100644
index 00000000000..8c7f4d44249
--- /dev/null
+++ b/libgcc/config/cris/t-linux
@@ -0,0 +1,2 @@
+# Override t-linux default.
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/cris/libgcc-glibc.ver
diff --git a/gcc/config/darwin-64.c b/libgcc/config/darwin-64.c
index a012e9dbc1e..a012e9dbc1e 100644
--- a/gcc/config/darwin-64.c
+++ b/libgcc/config/darwin-64.c
diff --git a/libgcc/config/darwin-crt3.c b/libgcc/config/darwin-crt3.c
index 9b64f2aa8c3..5ef00546260 100644
--- a/libgcc/config/darwin-crt3.c
+++ b/libgcc/config/darwin-crt3.c
@@ -1,5 +1,5 @@
/* __cxa_atexit backwards-compatibility support for Darwin.
- Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -25,10 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Don't do anything if we are compiling for a kext multilib. */
#ifdef __PIC__
-/* It is incorrect to include config.h here, because this file is being
- compiled for the target, and hence definitions concerning only the host
- do not apply. */
-
#include "tconfig.h"
#include "tsystem.h"
diff --git a/libgcc/config/epiphany/crti.S b/libgcc/config/epiphany/crti.S
new file mode 100644
index 00000000000..527d9264775
--- /dev/null
+++ b/libgcc/config/epiphany/crti.S
@@ -0,0 +1,34 @@
+# Start .init and .fini sections.
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ .global init
+ .balign 2
+init:
+ str lr,[sp],-4
+
+ .section .fini
+ .global fini
+ .balign 2
+fini:
+ str lr,[sp],-4
diff --git a/libgcc/config/epiphany/crtint.S b/libgcc/config/epiphany/crtint.S
new file mode 100644
index 00000000000..e66b34e0652
--- /dev/null
+++ b/libgcc/config/epiphany/crtint.S
@@ -0,0 +1,27 @@
+# initialize config for -mfp-mode=int
+# Copyright (C) 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ mov r0, %low(#524288)
+ movt r0, %high(#524288)
+ movts config,r0
diff --git a/libgcc/config/epiphany/crtm1reg-r43.S b/libgcc/config/epiphany/crtm1reg-r43.S
new file mode 100644
index 00000000000..02ef9f2025c
--- /dev/null
+++ b/libgcc/config/epiphany/crtm1reg-r43.S
@@ -0,0 +1,26 @@
+# initialize config for -m1reg-r43
+# Copyright (C) 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ mov r0, 0
+ sub r43,r0,1
diff --git a/libgcc/config/epiphany/crtm1reg-r63.S b/libgcc/config/epiphany/crtm1reg-r63.S
new file mode 100644
index 00000000000..8bd9fb605cb
--- /dev/null
+++ b/libgcc/config/epiphany/crtm1reg-r63.S
@@ -0,0 +1,26 @@
+# initialize config for -m1reg-r63
+# Copyright (C) 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ mov r0, 0
+ sub r63,r0,1
diff --git a/libgcc/config/epiphany/crtn.S b/libgcc/config/epiphany/crtn.S
new file mode 100644
index 00000000000..2c326bf7b96
--- /dev/null
+++ b/libgcc/config/epiphany/crtn.S
@@ -0,0 +1,32 @@
+# End .init and .fini sections.
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ ldr lr,[sp,4]
+ add sp,sp,16
+ jr lr
+
+ .section .fini
+ ldr lr,[sp,4]
+ add sp,sp,16
+ jr lr
diff --git a/libgcc/config/epiphany/crtrunc.S b/libgcc/config/epiphany/crtrunc.S
new file mode 100644
index 00000000000..37b0507b491
--- /dev/null
+++ b/libgcc/config/epiphany/crtrunc.S
@@ -0,0 +1,26 @@
+# initialize config for -mfp-mode=truncate
+# Copyright (C) 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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, 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/>.
+
+ .section .init
+ mov r0, 1
+ movts config,r0
diff --git a/libgcc/config/epiphany/divsi3-float.S b/libgcc/config/epiphany/divsi3-float.S
new file mode 100644
index 00000000000..31a0506946e
--- /dev/null
+++ b/libgcc/config/epiphany/divsi3-float.S
@@ -0,0 +1,77 @@
+/* Signed 32 bit division optimized for Epiphany.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__divsi3,T_UINT)
+ .global SYM(__divsi3)
+ .balign 4
+ HIDDEN_FUNC(__divsi3)
+SYM(__divsi3):
+ float TMP2,r0
+ mov TMP4,0
+ float TMP1,r1
+ sub TMP0,TMP4,r0
+ beq .Lret_r0
+ movgt r0,TMP0
+ sub TMP0,TMP4,r1
+ movgt r1,TMP0
+ mov TMP0,1
+ sub TMP2,TMP2,TMP1
+ asr TMP3,TMP2,31 ; save sign
+ lsl TMP2,TMP2,1
+ blt .Lret0
+ sub TMP1,TMP2,1 ; rounding compensation, avoid overflow
+ movgte TMP2,TMP1
+ lsr TMP2,TMP2,24
+ lsl r1,r1,TMP2
+ lsl TMP0,TMP0,TMP2
+ sub TMP1,r0,r1
+ movgteu r0,TMP1
+ movgteu TMP4,TMP0
+ lsl TMP5,TMP0,1
+ sub TMP1,r0,r1
+ movgteu r0,TMP1
+ movgteu TMP4,TMP5
+ sub TMP1,r1,1
+ mov r1,%low(.L0step)
+ movt r1,%high(.L0step)
+ lsl TMP2,TMP2,3
+ sub r1,r1,TMP2
+ jr r1
+ .rep 30
+ lsl r0,r0,1
+ sub.l r1,r0,TMP1
+ movgteu r0,r1
+ .endr
+.L0step:sub r1,TMP0,1 ; mask result bits from steps ...
+ and r0,r0,r1
+ orr r0,r0,TMP4 ; ... and combine with first bit.
+ eor r0,r0,TMP3 ; restore sign
+ sub r0,r0,TMP3
+.Lret_r0:rts
+.Lret0: mov r0,0
+ rts
+ ENDFUNC(__divsi3)
diff --git a/libgcc/config/epiphany/divsi3.S b/libgcc/config/epiphany/divsi3.S
new file mode 100644
index 00000000000..bdb2860dc0d
--- /dev/null
+++ b/libgcc/config/epiphany/divsi3.S
@@ -0,0 +1,92 @@
+/* Signed 32 bit division optimized for Epiphany.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__divsi3,T_INT)
+ .global SYM(__divsi3)
+ .balign 4
+ HIDDEN_FUNC(__divsi3)
+SYM(__divsi3):
+ mov r12,0
+ sub r2,r12,r0
+ movlt r2,r0
+ sub r3,r12,r1
+ movlt r3,r1
+ sub r19,r2,r3
+ bltu .Lret0
+ movt r12,0x4000
+ orr r16,r2,r12
+ orr r18,r3,r12
+ fsub r16,r16,r12
+ fsub r18,r18,r12
+ movt r12,0x4b80
+ lsr r19,r3,23
+ lsr r17,r2,23
+ movt r17,0x4b80
+ fsub r17,r17,r12
+ movt r19,0x4b80
+ fsub r19,r19,r12
+ mov r12,%low(.L0step)
+ movt r12,%high(.L0step)
+ mov r20,0
+ mov r21,1
+ movne r16,r17
+ lsr r17,r3,23
+ movne r18,r19
+ eor r1,r1,r0 ; save sign
+ asr r19,r1,31
+ lsr r1,r16,23
+ lsr r0,r18,23
+ sub r1,r1,r0 ; calculate bit number difference.
+ lsl r3,r3,r1
+ lsr r16,r3,1
+ lsl r0,r21,r1
+ lsl r1,r1,3
+ sub r12,r12,r1
+ sub r3,r2,r3
+ movgteu r2,r3
+ movgteu r20,r0
+ lsr r0,r0,1
+ add r17,r0,r20
+ sub r3,r2,r16
+ movgteu r2,r3
+ movgteu r20,r17
+ sub r16,r16,1
+ jr r12
+ .rep 30
+ lsl r2,r2,1
+ sub r3,r2,r16
+ movgteu r2,r3
+ .endr
+ sub r0,r0,1 ; mask result bits from steps ...
+ and r0,r0,r2
+ orr r20,r0,r20 ; ... and combine with first bit.
+.L0step:eor r0,r20,r19 ; restore sign
+ sub r0,r0,r19
+ rts
+.Lret0: mov r0,0
+ rts
+ ENDFUNC(__divsi3)
diff --git a/libgcc/config/epiphany/divsi3.c b/libgcc/config/epiphany/divsi3.c
new file mode 100644
index 00000000000..c15aaf3eef6
--- /dev/null
+++ b/libgcc/config/epiphany/divsi3.c
@@ -0,0 +1,120 @@
+/* Generic signed 32 bit division implementation.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+typedef union { unsigned int i; float f; } fu;
+
+/* Although the semantics of the function ask for signed / unsigned inputs,
+ for the actual implementation we use unsigned numbers. */
+unsigned int __divsi3 (unsigned int a, unsigned int b);
+
+unsigned int
+__divsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int sign = (int) (a ^ b) >> 31;
+ unsigned int d, t, s0, s1, s2, r0, r1;
+ fu u0, u1, u2, u1b, u2b;
+
+ a = abs (a);
+ b = abs (b);
+
+ if (b > a)
+ return 0;
+
+ /* Compute difference in number of bits in S0. */
+ u0.i = 0x40000000;
+ u1b.i = u2b.i = u0.i;
+ u1.i = a;
+ u2.i = b;
+ u1.i = a | u0.i;
+ t = 0x4b800000 | ((a >> 23) & 0xffff);
+ if (a >> 23)
+ {
+ u1.i = t;
+ u1b.i = 0x4b800000;
+ }
+ u2.i = b | u0.i;
+ t = 0x4b800000 | ((b >> 23) & 0xffff);
+ if (b >> 23)
+ {
+ u2.i = t;
+ u2b.i = 0x4b800000;
+ }
+ u1.f = u1.f - u1b.f;
+ u2.f = u2.f - u2b.f;
+ s1 = u1.i >> 23;
+ s2 = u2.i >> 23;
+ s0 = s1 - s2;
+
+ b <<= s0;
+ d = b - 1;
+
+ r0 = 1 << s0;
+ r1 = 0;
+ t = a - b;
+ if (t <= a)
+ {
+ a = t;
+ r1 = r0;
+ }
+
+#define STEP(n) case n: a += a; t = a - d; if (t <= a) a = t;
+ switch (s0)
+ {
+ STEP (31)
+ STEP (30)
+ STEP (29)
+ STEP (28)
+ STEP (27)
+ STEP (26)
+ STEP (25)
+ STEP (24)
+ STEP (23)
+ STEP (22)
+ STEP (21)
+ STEP (20)
+ STEP (19)
+ STEP (18)
+ STEP (17)
+ STEP (16)
+ STEP (15)
+ STEP (14)
+ STEP (13)
+ STEP (12)
+ STEP (11)
+ STEP (10)
+ STEP (9)
+ STEP (8)
+ STEP (7)
+ STEP (6)
+ STEP (5)
+ STEP (4)
+ STEP (3)
+ STEP (2)
+ STEP (1)
+ case 0: ;
+ }
+ r0 = r1 | (r0-1 & a);
+ return (r0 ^ sign) - sign;
+}
diff --git a/libgcc/config/epiphany/epiphany-asm.h b/libgcc/config/epiphany/epiphany-asm.h
new file mode 100644
index 00000000000..e86f7efd894
--- /dev/null
+++ b/libgcc/config/epiphany/epiphany-asm.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1995, 1997, 2007, 2008, 2009, 2011
+ Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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/>. */
+
+/* ANSI concatenation macros. */
+
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+#define STRINGIFY2(a, b) STRINGIFY(a##b)
+#define STRINGIFY(a) #a
+
+/* Use the right prefix for global labels. */
+
+#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
+
+#define FSTAB(X,T) .stabs STRINGIFY2(X##:F,T),36,0,__LINE__,SYM(X)
+#define FUNC(X) .type SYM(X),@function
+#define HIDDEN_FUNC(X) FUNC(X)` .hidden SYM(X)
+#define ENDFUNC0(X) CONCAT1(.Lfe_,X): .size X,CONCAT1(.Lfe_,X)-X
+#define ENDFUNC(X) ENDFUNC0(SYM(X))
+
+#define TMP0 r12
+#define TMP1 r16
+#define TMP2 r17
+#define TMP3 r18
+#define TMP4 r19
+#define TMP5 r20
+
+#define T_INT (0,1)
+ .stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,1,0
+#define T_UINT (0,2)
+ .stabs "unsigned int:t(0,2)=r(0,2);0;037777777777;",128,0,1,0
diff --git a/libgcc/config/epiphany/ieee-754/eqsf2.S b/libgcc/config/epiphany/ieee-754/eqsf2.S
new file mode 100644
index 00000000000..3c04e2a94fc
--- /dev/null
+++ b/libgcc/config/epiphany/ieee-754/eqsf2.S
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "../epiphany-asm.h"
+
+ /* Assumption: NaNs have all bits 10..30 and one of bit 0..9 set. */
+
+ FSTAB (__eqsf2,T_INT)
+ .global SYM(__eqsf2)
+ .balign 4
+ HIDDEN_FUNC(__eqsf2)
+SYM(__eqsf2):
+ sub TMP0,r0,r1
+ beq .Lno_bdiff
+ orr TMP0,r0,r1
+ add TMP0,TMP0,TMP0
+ rts
+.Lno_bdiff:
+#ifndef FLOAT_FORMAT_MOTOROLA
+ mov TMP0,0xffff
+ movt TMP0,0x7f
+ add TMP0,TMP0,r0
+#else
+ add TMP0,r0,0x3ff
+#endif
+ eor TMP0,TMP0,r0
+ lsr TMP0,TMP0,31
+ rts
+ ENDFUNC(__eqsf2)
diff --git a/libgcc/config/epiphany/ieee-754/fast_div.S b/libgcc/config/epiphany/ieee-754/fast_div.S
new file mode 100644
index 00000000000..a6cf748c620
--- /dev/null
+++ b/libgcc/config/epiphany/ieee-754/fast_div.S
@@ -0,0 +1,124 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "../epiphany-asm.h"
+
+.section _fast_div_text,"a",@progbits;
+ .balign 8;
+_fast_div_table:
+.word 0x007fffff// mantissa mask
+.word 0x40257ebb// hold constant a = 2.58586
+
+.word 0x3f000000// hold constant 126 shifted to bits [30:23]
+.word 0xc0ba2e88// hold constant b = -5.81818
+
+.word 0x4087c1e8// hold constant c = 4.24242
+.word 0x40000000// to hold constant 2 for Newton-Raphson iterations
+
+ .global SYM(__fast_recipsf2)
+ FUNC(__fast_recipsf2)
+SYM(__fast_recipsf2):
+
+//###################
+//# input operands:
+//###################
+// Divisor
+//R0
+// Function address (used with negative offsets to read _fast_div_table)
+//R1
+/* Scratch registers: two single (TMP0/TMP5) and two pairs. */
+#define P0L TMP1
+#define P0H TMP2
+#define P1L TMP3
+#define P1H TMP4
+
+//#########################################
+//# Constants to be used in the algorithm
+//#########################################
+ldrd P0L , [ R1 , -3 ]
+
+ldrd P1L , [ R1 , -2 ]
+
+
+
+//#############################################################################
+//# The Algorithm
+//#
+//# Operation: C=A/B
+//# stage 1 - find the reciprocal 1/B according to the following scheme:
+//# B = (2^E)*m (1<m<2, E=e-127)
+//# 1/B = 1/((2^E)*m) = 1/((2^(E+1))*m1) (0.5<m1<1)
+//# = (2^-(E+1))*(1/m1) = (2^E1)*(1/m1)
+//#
+//# Now we can find the new exponent:
+//# e1 = E1+127 = -E-1+127 = -e+127-1+127 = 253-e **
+//# 1/m1 alreadt has the exponent 127, so we have to add 126-e.
+//# the exponent might underflow, which we can detect as a sign change.
+//# Since the architeture uses flush-to-zero for subnormals, we can
+//# give the result 0. then.
+//#
+//# The 1/m1 term with 0.5<m1<1 is approximated with the Chebyshev polynomial
+//# 1/m1 = 2.58586*(m1^2) - 5.81818*m1 + 4.24242
+//#
+//# Next step is to use two iterations of Newton-Raphson algorithm to complete
+//# the reciprocal calculation.
+//#
+//# Final result is achieved by multiplying A with 1/B
+//#############################################################################
+
+
+
+// R0 exponent and sign "replacement" into TMP0
+AND TMP0,R0,P0L ;
+ORR TMP0,TMP0,P1L
+SUB TMP5,R0,TMP0 // R0 sign/exponent extraction into TMP5
+// Calculate new mantissa
+FMADD P1H,TMP0,P0H ;
+ // Calculate new exponent offset 126 - "old exponent"
+ SUB P1L,P1L,TMP5
+ ldrd P0L , [ R1 , -1 ]
+FMADD P0L,TMP0,P1H ;
+ eor P1H,r0,P1L // check for overflow (N-BIT).
+ blt .Lret_0
+// P0L exponent and sign "replacement"
+sub P0L,P0L,TMP5
+
+// Newton-Raphson iteration #1
+MOV TMP0,P0H ;
+FMSUB P0H,R0,P0L ;
+FMUL P0L,P0H,P0L ;
+// Newton-Raphson iteration #2
+FMSUB TMP0,R0,P0L ;
+FMUL R0,TMP0,P0L ;
+jr lr
+.Lret_0:ldrd P0L , [ R1 , -3 ]
+ lsr TMP0,r0,31 ; extract sign
+ lsl TMP0,TMP0,31
+ add P0L,P0L,r0 ; check for NaN input
+ eor P0L,P0L,r0
+ movgte r0,TMP0
+ jr lr
+// Quotient calculation is expected by the caller: FMUL quotient,divident,R0
+ ;
+ ENDFUNC(__fast_recipsf2)
diff --git a/libgcc/config/epiphany/ieee-754/gtesf2.S b/libgcc/config/epiphany/ieee-754/gtesf2.S
new file mode 100644
index 00000000000..615dde4fd8a
--- /dev/null
+++ b/libgcc/config/epiphany/ieee-754/gtesf2.S
@@ -0,0 +1,66 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "../epiphany-asm.h"
+
+ /* Assumptions: NaNs have all bits 10..30 and one of bit 0..9 set.
+ after sub: AC = ~Borrow.
+ clobber: TMP0
+ output: gt / gte indicates greater / greater or equal. */
+
+ FSTAB (__gtesf2,T_INT)
+ .global SYM(__gtesf2)
+ .balign 4
+ HIDDEN_FUNC(__gtesf2)
+SYM(__gtesf2):
+#ifndef FLOAT_FORMAT_MOTOROLA
+ mov TMP0,0xffff
+ movt TMP0,0x7f
+ add TMP0,TMP0,r0
+ eor TMP0,TMP0,r0
+ blt .Lret
+ mov TMP0,0xffff
+ movt TMP0,0x7f
+ add TMP0,TMP0,r1
+#else
+ add TMP0,r0,0x3ff; check for r0 NaN
+ eor TMP0,TMP0,r0
+ blt .Lret
+ add TMP0,r1,0x3ff; check for r1 NaN
+#endif
+ eor TMP0,TMP0,r1
+ blt .Lret
+ and TMP0,r0,r1
+ blt .Lneg
+ orr TMP0,r0,r1
+ lsl TMP0,TMP0,1
+ beq .Lret
+ sub TMP0,r0,r1
+.Lret:
+ rts
+ .balign 4
+.Lneg:
+ sub TMP0,r1,r0
+ rts
+ ENDFUNC(__gtesf2)
diff --git a/libgcc/config/epiphany/ieee-754/ordsf2.S b/libgcc/config/epiphany/ieee-754/ordsf2.S
new file mode 100644
index 00000000000..8493660102c
--- /dev/null
+++ b/libgcc/config/epiphany/ieee-754/ordsf2.S
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "../epiphany-asm.h"
+
+ FSTAB (__ordsf2,T_INT)
+ .global SYM(__ordsf2)
+ .balign 8,,2
+ HIDDEN_FUNC(__ordsf2)
+SYM(__ordsf2):
+#ifndef FLOAT_FORMAT_MOTOROLA
+ mov TMP0,0
+ movt TMP0,0xff00
+ lsl TMP1,r0,1
+ sub TMP1,TMP1,TMP0
+ bgtu .Lret
+ lsl TMP1,r1,1
+ sub TMP1,TMP1,TMP0
+.Lret: rts /* ordered: lteu */
+#else
+ /* Assumption: NaNs have all bits 9..30 and one of bit 0..8 set. */
+ lsl TMP0,r0,1
+ add TMP0,TMP0,0x3fe
+ bgteu .Lret
+ lsl TMP0,r1,1
+ add TMP0,TMP0,0x3fe
+.Lret: rts /* ordered: ltu */
+#endif
+ ENDFUNC(__ordsf2)
diff --git a/libgcc/config/epiphany/ieee-754/uneqsf2.S b/libgcc/config/epiphany/ieee-754/uneqsf2.S
new file mode 100644
index 00000000000..cba04d3946c
--- /dev/null
+++ b/libgcc/config/epiphany/ieee-754/uneqsf2.S
@@ -0,0 +1,45 @@
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, 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 "../epiphany-asm.h"
+
+ FSTAB (__uneqsf2,T_INT)
+ .global SYM(__uneqsf2)
+ .balign 8,,2
+ HIDDEN_FUNC(__uneqsf2)
+SYM(__uneqsf2):
+ sub TMP0,r0,r1
+ beq .Lret
+ orr TMP0,r0,r1
+ add TMP0,TMP0,TMP0
+ beq .Lret
+ mov TMP0,1
+ movt TMP0,0xff00
+ lsl TMP1,r0,1
+ sub TMP1,TMP0,TMP1
+ blteu .Lret
+ lsl TMP1,r1,1
+ sub TMP1,TMP0,TMP1
+.Lret: rts /* uneq: lteu */
+ ENDFUNC(__uneqsf2)
diff --git a/libgcc/config/epiphany/modsi3-float.S b/libgcc/config/epiphany/modsi3-float.S
new file mode 100644
index 00000000000..b789412ac1f
--- /dev/null
+++ b/libgcc/config/epiphany/modsi3-float.S
@@ -0,0 +1,65 @@
+/* Unsigned 32 bit division optimized for Epiphany.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__modsi3,T_UINT)
+ .global SYM(__modsi3)
+ .balign 4
+ HIDDEN_FUNC(__modsi3)
+SYM(__modsi3):
+ asr TMP3,r0,31 ; save sign
+ float TMP0,r0
+ float TMP1,r1
+ mov r2,0
+ sub TMP4,r2,r0
+ beq .Lret_r0
+ movgt r0,TMP4
+ sub TMP2,r2,r1
+ movlte TMP2,r1
+ sub r2,TMP0,TMP1
+ lsl r2,r2,1
+ blte .L0step
+ asr TMP4,r2,24
+ lsl r2,TMP4,3
+ mov TMP4,%low(.L0step)
+ movt TMP4,%high(.L0step)
+ sub r2,TMP4,r2
+ jr r2
+#define STEP(n) lsl.l r2,TMP2,n` sub r2,r0,r2` movgteu r0,r2
+ .balign 8,,2
+ STEP(31)` STEP(30)` STEP(29)` STEP(28)`
+ STEP(27)` STEP(26)` STEP(25)` STEP(24)`
+ STEP(23)` STEP(22)` STEP(21)` STEP(20)`
+ STEP(19)` STEP(18)` STEP(17)` STEP(16)`
+ STEP(15)` STEP(14)` STEP(13)` STEP(12)`
+ STEP(11)` STEP(10)` STEP(9)` STEP(8)`
+ STEP(7)` STEP(6)` STEP(5)` STEP(4)` STEP(3)` STEP(2)` STEP(1)
+.L0step:STEP(0)
+ eor r0,r0,TMP3 ; restore sign
+ sub r0,r0,TMP3
+.Lret_r0:
+ rts
+ ENDFUNC(__modsi3)
diff --git a/libgcc/config/epiphany/modsi3.S b/libgcc/config/epiphany/modsi3.S
new file mode 100644
index 00000000000..d969b79c933
--- /dev/null
+++ b/libgcc/config/epiphany/modsi3.S
@@ -0,0 +1,77 @@
+/* Signed 32 bit modulo optimized for Epiphany.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__modsi3,T_INT)
+ .global SYM(__modsi3)
+ .balign 4
+ HIDDEN_FUNC(__modsi3)
+SYM(__modsi3):
+ asr r17,r0,31 ; save sign
+ mov r2,0
+ sub r3,r2,r0
+ movgt r0,r3
+ sub r3,r2,r1
+ movgt r1,r3
+ movt r2,0xa000 ; 0xa0000000
+ orr r3,r2,r0
+ lsr r15,r0,16
+ movt r15,0xa800
+ movne r3,r15
+ lsr r16,r2,2 ; 0x28000000
+ and r15,r3,r16
+ fadd r12,r3,r15
+ orr r3,r2,r1
+ lsr r2,r1,16
+ movt r2,0xa800
+ movne r3,r2
+ and r2,r16,r3
+ fadd r3,r3,r2
+ sub r2,r0,r1
+ bltu .Lret_a
+ lsr r12,r12,23
+ mov r2,%low(.L0step)
+ movt r2,%high(.L0step)
+ lsr r3,r3,23
+ sub r3,r12,r3 ; calculate bit number difference.
+ lsl r3,r3,3
+ sub r2,r2,r3
+ jr r2
+/* lsl_l r2,r1,n` sub r2,r0,r2` movgteu r0,r2 */
+#define STEP(n) .long 0x0006441f | (n) << 5` sub r2,r0,r2` movgteu r0,r2
+ .balign 8,,2
+ STEP(31)` STEP(30)` STEP(29)` STEP(28)`
+ STEP(27)` STEP(26)` STEP(25)` STEP(24)`
+ STEP(23)` STEP(22)` STEP(21)` STEP(20)`
+ STEP(19)` STEP(18)` STEP(17)` STEP(16)`
+ STEP(15)` STEP(14)` STEP(13)` STEP(12)`
+ STEP(11)` STEP(10)` STEP(9)` STEP(8)`
+ STEP(7)` STEP(6)` STEP(5)` STEP(4)` STEP(3)` STEP(2)` STEP(1)
+.L0step:STEP(0)
+.Lret_a:eor r0,r0,r17 ; restore sign
+ sub r0,r0,r17
+ rts
+ ENDFUNC(__modsi3)
diff --git a/libgcc/config/epiphany/modsi3.c b/libgcc/config/epiphany/modsi3.c
new file mode 100644
index 00000000000..feee3d1ea25
--- /dev/null
+++ b/libgcc/config/epiphany/modsi3.c
@@ -0,0 +1,106 @@
+/* Generic signed 32 bit modulo implementation.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+typedef union { unsigned int i; float f; } fu;
+
+unsigned int __modsi3 (unsigned int a, unsigned int b);
+
+unsigned int
+__modsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int sign = (int) a >> 31;
+ unsigned int d, t, s0, s1, s2, r0, r1;
+ fu u0, u1, u2, u1b, u2b;
+
+ a = abs (a);
+ b = abs (b);
+
+ if (b > a)
+ goto ret_a;
+
+ /* Compute difference in number of bits in S0. */
+ u0.i = 0x40000000;
+ u1b.i = u2b.i = u0.i;
+ u1.i = a;
+ u2.i = b;
+ u1.i = a | u0.i;
+ t = 0x4b800000 | ((a >> 23) & 0xffff);
+ if (a >> 23)
+ {
+ u1.i = t;
+ u1b.i = 0x4b800000;
+ }
+ u2.i = b | u0.i;
+ t = 0x4b800000 | ((b >> 23) & 0xffff);
+ if (b >> 23)
+ {
+ u2.i = t;
+ u2b.i = 0x4b800000;
+ }
+ u1.f = u1.f - u1b.f;
+ u2.f = u2.f - u2b.f;
+ s1 = u1.i >> 23;
+ s2 = u2.i >> 23;
+ s0 = s1 - s2;
+
+#define STEP(n) case n: d = b << n; t = a - d; if (t <= a) a = t;
+ switch (s0)
+ {
+ STEP (31)
+ STEP (30)
+ STEP (29)
+ STEP (28)
+ STEP (27)
+ STEP (26)
+ STEP (25)
+ STEP (24)
+ STEP (23)
+ STEP (22)
+ STEP (21)
+ STEP (20)
+ STEP (19)
+ STEP (18)
+ STEP (17)
+ STEP (16)
+ STEP (15)
+ STEP (14)
+ STEP (13)
+ STEP (12)
+ STEP (11)
+ STEP (10)
+ STEP (9)
+ STEP (8)
+ STEP (7)
+ STEP (6)
+ STEP (5)
+ STEP (4)
+ STEP (3)
+ STEP (2)
+ STEP (1)
+ STEP (0)
+ }
+ ret_a:
+ return (a ^ sign) - sign;
+}
diff --git a/libgcc/config/epiphany/mulsi3.c b/libgcc/config/epiphany/mulsi3.c
new file mode 100644
index 00000000000..148361d92be
--- /dev/null
+++ b/libgcc/config/epiphany/mulsi3.c
@@ -0,0 +1,39 @@
+/* Generic 32 bit multiply.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+unsigned int
+__mulsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int r = 0;
+
+ while (a)
+ {
+ if (a & 1)
+ r += b;
+ a >>= 1;
+ b <<= 1;
+ }
+ return r;
+}
diff --git a/libgcc/config/epiphany/t-custom-eqsf b/libgcc/config/epiphany/t-custom-eqsf
new file mode 100644
index 00000000000..3b5a54acef2
--- /dev/null
+++ b/libgcc/config/epiphany/t-custom-eqsf
@@ -0,0 +1 @@
+FPBIT_FUNCS := $(filter-out _eq_sf,$(FPBIT_FUNCS))
diff --git a/libgcc/config/epiphany/t-epiphany b/libgcc/config/epiphany/t-epiphany
new file mode 100644
index 00000000000..4b67f5d4690
--- /dev/null
+++ b/libgcc/config/epiphany/t-epiphany
@@ -0,0 +1,35 @@
+# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003,
+# 2004, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Contributed by Embecosm on behalf of Adapteva, 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/>.
+
+LIB2ADD_ST = $(srcdir)/config/epiphany/modsi3-float.S \
+ $(srcdir)/config/epiphany/divsi3-float.S \
+ $(srcdir)/config/epiphany/udivsi3-float.S \
+ $(srcdir)/config/epiphany/umodsi3-float.S \
+ $(srcdir)/config/epiphany/ieee-754/eqsf2.S \
+ $(srcdir)/config/epiphany/ieee-754/gtesf2.S \
+ $(srcdir)/config/epiphany/ieee-754/ordsf2.S \
+ $(srcdir)/config/epiphany/ieee-754/uneqsf2.S \
+ $(srcdir)/config/epiphany/ieee-754/fast_div.S
+
+# .init/.fini section routines
+
+crtint.o crtrunc.o crtm1reg-r43.o crtm1reg-r63.o : \
+ %.o: $(srcdir)/config/epiphany/%.S $(GCC_PASSES) $(CONFIG_H)
+ $(crt_compile) -c -x assembler-with-cpp $<
diff --git a/libgcc/config/epiphany/udivsi3-float.S b/libgcc/config/epiphany/udivsi3-float.S
new file mode 100644
index 00000000000..5c960dce5f0
--- /dev/null
+++ b/libgcc/config/epiphany/udivsi3-float.S
@@ -0,0 +1,83 @@
+/* Unsigned 32 bit division optimized for Epiphany.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__udivsi3,T_UINT)
+ .global SYM(__udivsi3)
+ .balign 4
+ HIDDEN_FUNC(__udivsi3)
+SYM(__udivsi3):
+ sub TMP0,r0,r1
+ bltu .Lret0
+ float TMP2,r0
+ mov TMP1,%low(0xb0800000) ; ??? this would be faster with small data
+ float TMP3,r1
+ movt TMP1,%high(0xb0800000)
+ asr TMP0,r0,8
+ sub TMP0,TMP0,TMP1
+ movt TMP1,%high(0x00810000)
+ movgteu TMP2,TMP0
+ bblt .Lret1
+ sub TMP2,TMP2,TMP1
+ sub TMP2,TMP2,TMP3
+ mov TMP3,0
+ movltu TMP2,TMP3
+ lsr TMP2,TMP2,23
+ lsl r1,r1,TMP2
+ mov TMP0,1
+ lsl TMP0,TMP0,TMP2
+ sub r0,r0,r1
+ bltu .Ladd_back
+ add TMP3,TMP3,TMP0
+ sub r0,r0,r1
+ bltu .Ladd_back
+.Lsub_loop:; More than two iterations are rare, so it makes sense to leave
+ ; this label here to reduce average branch penalties.
+ add TMP3,TMP3,TMP0
+ sub r0,r0,r1
+ bgteu .Lsub_loop
+.Ladd_back:
+ add r0,r0,r1
+ sub TMP1,r1,1
+ mov r1,%low(.L0step)
+ movt r1,%high(.L0step)
+ lsl TMP2,TMP2,3
+ sub r1,r1,TMP2
+ jr r1
+ .rep 30
+ lsl r0,r0,1
+ sub.l r1,r0,TMP1
+ movgteu r0,r1
+ .endr
+.L0step:sub r1,TMP0,1 ; mask result bits from steps ...
+ and r0,r0,r1
+ orr r0,r0,TMP3 ; ... and combine with first bits.
+ rts
+.Lret0: mov r0,0
+ rts
+.Lret1: mov r0,1
+ rts
+ ENDFUNC(__udivsi3)
diff --git a/libgcc/config/epiphany/udivsi3-float.c b/libgcc/config/epiphany/udivsi3-float.c
new file mode 100644
index 00000000000..c7f10590c49
--- /dev/null
+++ b/libgcc/config/epiphany/udivsi3-float.c
@@ -0,0 +1,125 @@
+/* Generic unsigned 32 bit division implementation.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+typedef union { unsigned int i; float f; } fu;
+
+unsigned int __udivsi3 (unsigned int a, unsigned int b);
+
+unsigned int
+__udivsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int d, t, s0, s1, s2, r0, r1;
+ fu u0, u1, u2, u1b, u2b;
+
+ if (b > a)
+ return 0;
+ if ((int) b < 0)
+ return 1;
+
+ /* Assuming B is nonzero, compute S0 such that 0 <= S0,
+ (B << S0+1) does not overflow,
+ A < 4.01 * (B << S0), with S0 choosen as small as possible
+ without taking to much time calculating. */
+#ifdef CONVERT_UNSIGNED
+ u0.f = a;
+ u1.f = b;
+#else /* !CONVERT_UNSIGNED */
+ u0.f = (int) a;
+ u1.f = (int) b;
+#ifdef CONCISE
+ if (a < 0)
+ u0.i = (a >> 8) - 0x00800000 + 0x3f800000 + (31 << 23);
+#else /* To use flag seting / cmove, this can be written as: */
+ {
+ unsigned c = 0xff800000 - 0x4f000000;
+ t = (int)a >> 8;
+ if (t >= c)
+ u0.i = (t - c);
+ }
+#endif
+#endif /* !CONVERT_UNSIGNED */
+ s0 = u0.i + 1 /* Compensate for rounding errors. */
+ - 0x00800000 /* adjust by one */ ;
+ s0 = s0 - u1.i;
+ s0 = (int)s0 >= 0 ? s0 : 0;
+ s0 >>= 23;
+
+ b <<= s0;
+ r1 = 0;
+
+ r0 = 1 << s0;
+ a = ((t=a) - b);
+ if (a <= t)
+ {
+ r1 += r0;
+ a = ((t=a) - b);
+ if (a <= t)
+ do {
+ r1 += r0;
+ a = ((t=a) - b);
+ } while (a <= t);
+ }
+ a += b;
+ d = b - 1;
+
+#define STEP(n) case n: a += a; t = a - d; if (t <= a) a = t;
+ switch (s0)
+ {
+ STEP (31)
+ STEP (30)
+ STEP (29)
+ STEP (28)
+ STEP (27)
+ STEP (26)
+ STEP (25)
+ STEP (24)
+ STEP (23)
+ STEP (22)
+ STEP (21)
+ STEP (20)
+ STEP (19)
+ STEP (18)
+ STEP (17)
+ STEP (16)
+ STEP (15)
+ STEP (14)
+ STEP (13)
+ STEP (12)
+ STEP (11)
+ STEP (10)
+ STEP (9)
+ STEP (8)
+ STEP (7)
+ STEP (6)
+ STEP (5)
+ STEP (4)
+ STEP (3)
+ STEP (2)
+ STEP (1)
+ case 0: ;
+ }
+ r0 = r1 | (r0-1 & a);
+ return r0;
+}
diff --git a/libgcc/config/epiphany/udivsi3.S b/libgcc/config/epiphany/udivsi3.S
new file mode 100644
index 00000000000..1396281f73a
--- /dev/null
+++ b/libgcc/config/epiphany/udivsi3.S
@@ -0,0 +1,85 @@
+/* Unsigned 32 bit division optimized for Epiphany.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__udivsi3,T_UINT)
+ .global SYM(__udivsi3)
+ .balign 4
+ HIDDEN_FUNC(__udivsi3)
+SYM(__udivsi3):
+ sub r3,r0,r1
+ bltu .Lret0
+ mov r3,0x95
+ lsl r12,r3,23 ; 0x4a800000
+ lsl r3,r3,30 ; 0x40000000
+ orr r16,r0,r3
+ orr r2,r1,r3
+ fsub r16,r16,r3
+ fsub r2,r2,r3
+ lsr r3,r1,21
+ lsr r17,r0,21
+ movt r17,0x4a80
+ fsub r17,r17,r12
+ movt r3,0x4a80
+ fsub r3,r3,r12
+ mov r12,%low(.L0step)
+ movt r12,%high(.L0step)
+ mov r21,1
+ movne r16,r17
+ lsr r17,r1,21
+ movne r2,r3
+ lsr r3,r16,23 ; must mask lower bits of r2 in case op0 was ..
+ lsr r2,r2,23 ; .. shifted and op1 was not.
+ sub r3,r3,r2 ; calculate bit number difference.
+ lsl r1,r1,r3
+ lsr r16,r1,1
+ lsl r2,r21,r3
+ lsl r3,r3,3
+ sub r12,r12,r3
+ sub r3,r0,r1
+ movltu r3,r0
+ mov r0,0
+ movgteu r0,r2
+ lsr r2,r2,1
+ add r17,r2,r0
+ sub r1,r3,r16
+ movgteu r3,r1
+ movgteu r0,r17
+ sub r16,r16,1
+ jr r12
+ .rep 30
+ lsl r3,r3,1
+ sub r1,r3,r16
+ movgteu r3,r1
+ .endr
+ sub r2,r2,1 ; mask result bits from steps ...
+ and r3,r3,r2
+ orr r0,r0,r3 ; ... and combine with first bits.
+ nop
+.L0step:rts
+.Lret0: mov r0,0
+ rts
+ ENDFUNC(__udivsi3)
diff --git a/libgcc/config/epiphany/udivsi3.c b/libgcc/config/epiphany/udivsi3.c
new file mode 100644
index 00000000000..cd34c6d761c
--- /dev/null
+++ b/libgcc/config/epiphany/udivsi3.c
@@ -0,0 +1,114 @@
+/* Generic unsigned 32 bit division implementation.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+typedef union { unsigned int i; float f; } fu;
+
+unsigned int __udivsi3 (unsigned int a, unsigned int b);
+
+unsigned int
+__udivsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int d, t, s0, s1, s2, r0, r1;
+ fu u0, u1, u2, u1b, u2b;
+
+ if (b > a)
+ return 0;
+
+ /* Compute difference in number of bits in S0. */
+ u0.i = 0x40000000;
+ u1b.i = u2b.i = u0.i;
+ u1.i = a;
+ u2.i = b;
+ u1.i = a | u0.i;
+ t = 0x4b800000 | ((a >> 23) & 0xffff);
+ if (a >> 23)
+ {
+ u1.i = t;
+ u1b.i = 0x4b800000;
+ }
+ u2.i = b | u0.i;
+ t = 0x4b800000 | ((b >> 23) & 0xffff);
+ if (b >> 23)
+ {
+ u2.i = t;
+ u2b.i = 0x4b800000;
+ }
+ u1.f = u1.f - u1b.f;
+ u2.f = u2.f - u2b.f;
+ s1 = u1.i >> 23;
+ s2 = u2.i >> 23;
+ s0 = s1 - s2;
+
+ b <<= s0;
+ d = b - 1;
+
+ r0 = 1 << s0;
+ r1 = 0;
+ t = a - b;
+ if (t <= a)
+ {
+ a = t;
+ r1 = r0;
+ }
+
+#define STEP(n) case n: a += a; t = a - d; if (t <= a) a = t;
+ switch (s0)
+ {
+ STEP (31)
+ STEP (30)
+ STEP (29)
+ STEP (28)
+ STEP (27)
+ STEP (26)
+ STEP (25)
+ STEP (24)
+ STEP (23)
+ STEP (22)
+ STEP (21)
+ STEP (20)
+ STEP (19)
+ STEP (18)
+ STEP (17)
+ STEP (16)
+ STEP (15)
+ STEP (14)
+ STEP (13)
+ STEP (12)
+ STEP (11)
+ STEP (10)
+ STEP (9)
+ STEP (8)
+ STEP (7)
+ STEP (6)
+ STEP (5)
+ STEP (4)
+ STEP (3)
+ STEP (2)
+ STEP (1)
+ case 0: ;
+ }
+ r0 = r1 | (r0-1 & a);
+ return r0;
+}
diff --git a/libgcc/config/epiphany/umodsi3-float.S b/libgcc/config/epiphany/umodsi3-float.S
new file mode 100644
index 00000000000..ca5db48906c
--- /dev/null
+++ b/libgcc/config/epiphany/umodsi3-float.S
@@ -0,0 +1,63 @@
+/* Unsigned 32 bit division optimized for Epiphany.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+/* Because we handle a divident with bit 31 set with truncating integer
+ arithmetic, there is no rounding-related overflow. */
+ FSTAB (__umodsi3,T_UINT)
+ .global SYM(__umodsi3)
+ .balign 4
+ HIDDEN_FUNC(__umodsi3)
+SYM(__umodsi3):
+ float r2,r0
+ mov TMP1,%low(0xb0800000) ; ??? this would be faster with small data
+ float TMP2,r1
+ movt TMP1,%high(0xb0800000)
+ asr TMP0,r0,8
+ sub TMP0,TMP0,TMP1
+ mov TMP1,%low(.L0step)
+ movgteu r2,TMP0
+ sub r2,r2,TMP2
+ blteu .L0step
+ asr r2,r2,23
+ movt TMP1,%high(.L0step)
+ lsl TMP2,r2,3
+ lsl r2,r1,r2` sub r2,r0,r2` movgteu r0,r2 ; STEP(r2)
+ sub r2,TMP1,TMP2
+ jr r2
+#define STEP(n) lsl.l r2,r1,n` sub r2,r0,r2` movgteu r0,r2
+ .balign 8,,2
+ STEP(31)` STEP(30)` STEP(29)` STEP(28)`
+ STEP(27)` STEP(26)` STEP(25)` STEP(24)`
+ STEP(23)` STEP(22)` STEP(21)` STEP(20)`
+ STEP(19)` STEP(18)` STEP(17)` STEP(16)`
+ STEP(15)` STEP(14)` STEP(13)` STEP(12)`
+ STEP(11)` STEP(10)` STEP(9)` STEP(8)`
+ STEP(7)` STEP(6)` STEP(5)` STEP(4)` STEP(3)` STEP(2)` STEP(1)
+.L0step:STEP(0)
+.Lret_r0:
+ rts
+ ENDFUNC(__umodsi3)
diff --git a/libgcc/config/epiphany/umodsi3.S b/libgcc/config/epiphany/umodsi3.S
new file mode 100644
index 00000000000..6f808fdc7aa
--- /dev/null
+++ b/libgcc/config/epiphany/umodsi3.S
@@ -0,0 +1,70 @@
+/* Unsigned 32 bit modulo optimized for Epiphany.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+#include "epiphany-asm.h"
+
+ FSTAB (__umodsi3,T_UINT)
+ .global SYM(__umodsi3)
+ .balign 4
+ HIDDEN_FUNC(__umodsi3)
+SYM(__umodsi3):
+ mov r2,5
+ lsl r2,r2,29 ; 0xa0000000
+ orr r3,r2,r0
+ lsr r15,r0,16
+ movt r15,0xa800
+ movne r3,r15
+ lsr r16,r2,2 ; 0x28000000
+ and r15,r3,r16
+ fadd r12,r3,r15
+ orr r3,r2,r1
+ lsr r2,r1,16
+ movt r2,0xa800
+ movne r3,r2
+ and r2,r16,r3
+ fadd r3,r3,r2
+ sub r2,r0,r1
+ bltu .Lret_a
+ lsr r12,r12,23
+ mov r2,%low(.L0step)
+ movt r2,%high(.L0step)
+ lsr r3,r3,23
+ sub r3,r12,r3 ; calculate bit number difference.
+ lsl r3,r3,3
+ sub r2,r2,r3
+ jr r2
+/* lsl_l r2,r1,n` sub r2,r0,r2` movgteu r0,r2 */
+#define STEP(n) .long 0x0006441f | (n) << 5` sub r2,r0,r2` movgteu r0,r2
+ .balign 8,,2
+ STEP(31)` STEP(30)` STEP(29)` STEP(28)`
+ STEP(27)` STEP(26)` STEP(25)` STEP(24)`
+ STEP(23)` STEP(22)` STEP(21)` STEP(20)`
+ STEP(19)` STEP(18)` STEP(17)` STEP(16)`
+ STEP(15)` STEP(14)` STEP(13)` STEP(12)`
+ STEP(11)` STEP(10)` STEP(9)` STEP(8)`
+ STEP(7)` STEP(6)` STEP(5)` STEP(4)` STEP(3)` STEP(2)` STEP(1)
+.L0step:STEP(0)
+.Lret_a:rts
+ ENDFUNC(__umodsi3)
diff --git a/libgcc/config/epiphany/umodsi3.c b/libgcc/config/epiphany/umodsi3.c
new file mode 100644
index 00000000000..609a250f14a
--- /dev/null
+++ b/libgcc/config/epiphany/umodsi3.c
@@ -0,0 +1,101 @@
+/* Generic unsigned 32 bit modulo implementation.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Embecosm on behalf of Adapteva, Inc.
+
+This file is part of GCC.
+
+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, 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/>. */
+
+typedef union { unsigned int i; float f; } fu;
+
+unsigned int __umodsi3 (unsigned int a, unsigned int b);
+
+unsigned int
+__umodsi3 (unsigned int a, unsigned int b)
+{
+ unsigned int d, t, s0, s1, s2, r0, r1;
+ fu u0, u1, u2, u1b, u2b;
+
+ if (b > a)
+ return a;
+
+ /* Compute difference in number of bits in S0. */
+ u0.i = 0x40000000;
+ u1b.i = u2b.i = u0.i;
+ u1.i = a;
+ u2.i = b;
+ u1.i = a | u0.i;
+ t = 0x4b800000 | ((a >> 23) & 0xffff);
+ if (a >> 23)
+ {
+ u1.i = t;
+ u1b.i = 0x4b800000;
+ }
+ u2.i = b | u0.i;
+ t = 0x4b800000 | ((b >> 23) & 0xffff);
+ if (b >> 23)
+ {
+ u2.i = t;
+ u2b.i = 0x4b800000;
+ }
+ u1.f = u1.f - u1b.f;
+ u2.f = u2.f - u2b.f;
+ s1 = u1.i >> 23;
+ s2 = u2.i >> 23;
+ s0 = s1 - s2;
+
+#define STEP(n) case n: d = b << n; t = a - d; if (t <= a) a = t;
+ switch (s0)
+ {
+ STEP (31)
+ STEP (30)
+ STEP (29)
+ STEP (28)
+ STEP (27)
+ STEP (26)
+ STEP (25)
+ STEP (24)
+ STEP (23)
+ STEP (22)
+ STEP (21)
+ STEP (20)
+ STEP (19)
+ STEP (18)
+ STEP (17)
+ STEP (16)
+ STEP (15)
+ STEP (14)
+ STEP (13)
+ STEP (12)
+ STEP (11)
+ STEP (10)
+ STEP (9)
+ STEP (8)
+ STEP (7)
+ STEP (6)
+ STEP (5)
+ STEP (4)
+ STEP (3)
+ STEP (2)
+ STEP (1)
+ STEP (0)
+ }
+ return a;
+}
diff --git a/gcc/config/fr30/crti.asm b/libgcc/config/fr30/crti.S
index 4ce61231bd7..4ce61231bd7 100644
--- a/gcc/config/fr30/crti.asm
+++ b/libgcc/config/fr30/crti.S
diff --git a/gcc/config/fr30/crtn.asm b/libgcc/config/fr30/crtn.S
index ac2712186c3..c62d37b6671 100644
--- a/gcc/config/fr30/crtn.asm
+++ b/libgcc/config/fr30/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for ELF
+# crtn.S for ELF
-# Copyright (C) 1992, 1999, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1999, 2008, 2009, 2011 Free Software Foundation, Inc.
# Written By David Vinayak Henkel-Wallace, June 1992
#
# This file is free software; you can redistribute it and/or modify it
diff --git a/gcc/config/fr30/lib1funcs.asm b/libgcc/config/fr30/lib1funcs.S
index 7c63453123a..7c63453123a 100644
--- a/gcc/config/fr30/lib1funcs.asm
+++ b/libgcc/config/fr30/lib1funcs.S
diff --git a/libgcc/config/fr30/t-fr30 b/libgcc/config/fr30/t-fr30
new file mode 100644
index 00000000000..ee5ed9a127e
--- /dev/null
+++ b/libgcc/config/fr30/t-fr30
@@ -0,0 +1,2 @@
+LIB1ASMSRC = fr30/lib1funcs.S
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3
diff --git a/gcc/config/frv/cmovd.c b/libgcc/config/frv/cmovd.c
index e46070aac04..e46070aac04 100644
--- a/gcc/config/frv/cmovd.c
+++ b/libgcc/config/frv/cmovd.c
diff --git a/gcc/config/frv/cmovh.c b/libgcc/config/frv/cmovh.c
index 6b0901d95a7..6b0901d95a7 100644
--- a/gcc/config/frv/cmovh.c
+++ b/libgcc/config/frv/cmovh.c
diff --git a/gcc/config/frv/cmovw.c b/libgcc/config/frv/cmovw.c
index f27db75aaf6..f27db75aaf6 100644
--- a/gcc/config/frv/cmovw.c
+++ b/libgcc/config/frv/cmovw.c
diff --git a/gcc/config/frv/frvbegin.c b/libgcc/config/frv/frvbegin.c
index 23cbf1ecc93..23cbf1ecc93 100644
--- a/gcc/config/frv/frvbegin.c
+++ b/libgcc/config/frv/frvbegin.c
diff --git a/gcc/config/frv/frvend.c b/libgcc/config/frv/frvend.c
index 0bb07b56b4a..0bb07b56b4a 100644
--- a/gcc/config/frv/frvend.c
+++ b/libgcc/config/frv/frvend.c
diff --git a/gcc/config/frv/lib1funcs.asm b/libgcc/config/frv/lib1funcs.S
index d1ffcab6133..d1ffcab6133 100644
--- a/gcc/config/frv/lib1funcs.asm
+++ b/libgcc/config/frv/lib1funcs.S
diff --git a/gcc/config/frv/libgcc-frv.ver b/libgcc/config/frv/libgcc-glibc.ver
index 6e27b4f9b85..6e27b4f9b85 100644
--- a/gcc/config/frv/libgcc-frv.ver
+++ b/libgcc/config/frv/libgcc-glibc.ver
diff --git a/gcc/config/frv/modi.c b/libgcc/config/frv/modi.c
index d5a91fc0f55..d5a91fc0f55 100644
--- a/gcc/config/frv/modi.c
+++ b/libgcc/config/frv/modi.c
diff --git a/libgcc/config/frv/t-frv b/libgcc/config/frv/t-frv
new file mode 100644
index 00000000000..a4ff0585183
--- /dev/null
+++ b/libgcc/config/frv/t-frv
@@ -0,0 +1,22 @@
+LIB1ASMSRC = frv/lib1funcs.S
+LIB1ASMFUNCS = _cmpll _cmpf _cmpd _addll _subll _andll _orll _xorll _notll _cmov
+
+LIB2ADD = $(srcdir)/config/frv/cmovh.c \
+ $(srcdir)/config/frv/cmovw.c \
+ $(srcdir)/config/frv/cmovd.c \
+ $(srcdir)/config/frv/modi.c \
+ $(srcdir)/config/frv/umodi.c \
+ $(srcdir)/config/frv/uitof.c \
+ $(srcdir)/config/frv/uitod.c \
+ $(srcdir)/config/frv/ulltof.c \
+ $(srcdir)/config/frv/ulltod.c
+
+# Compile two additional files that are linked with every program
+# linked using GCC on systems using COFF or ELF, for the sake of C++
+# constructors.
+
+frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c
+ $(gcc_compile) -c $<
+
+frvend$(objext): $(srcdir)/config/frv/frvend.c
+ $(gcc_compile) -c $<
diff --git a/libgcc/config/frv/t-linux b/libgcc/config/frv/t-linux
new file mode 100644
index 00000000000..0240efefae9
--- /dev/null
+++ b/libgcc/config/frv/t-linux
@@ -0,0 +1,3 @@
+CRTSTUFF_T_CFLAGS = $(PICFLAG)
+
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/frv/libgcc-glibc.ver
diff --git a/gcc/config/frv/uitod.c b/libgcc/config/frv/uitod.c
index 14290ab6b04..14290ab6b04 100644
--- a/gcc/config/frv/uitod.c
+++ b/libgcc/config/frv/uitod.c
diff --git a/gcc/config/frv/uitof.c b/libgcc/config/frv/uitof.c
index 059bc7c7417..059bc7c7417 100644
--- a/gcc/config/frv/uitof.c
+++ b/libgcc/config/frv/uitof.c
diff --git a/gcc/config/frv/ulltod.c b/libgcc/config/frv/ulltod.c
index e6bee12081f..e6bee12081f 100644
--- a/gcc/config/frv/ulltod.c
+++ b/libgcc/config/frv/ulltod.c
diff --git a/gcc/config/frv/ulltof.c b/libgcc/config/frv/ulltof.c
index 29cdfd4d2a1..29cdfd4d2a1 100644
--- a/gcc/config/frv/ulltof.c
+++ b/libgcc/config/frv/ulltof.c
diff --git a/gcc/config/frv/umodi.c b/libgcc/config/frv/umodi.c
index 4ffe5ad8132..4ffe5ad8132 100644
--- a/gcc/config/frv/umodi.c
+++ b/libgcc/config/frv/umodi.c
diff --git a/gcc/gthr-lynx.h b/libgcc/config/gthr-lynx.h
index 13b81d2fedb..d9211b0e556 100644
--- a/gcc/gthr-lynx.h
+++ b/libgcc/config/gthr-lynx.h
@@ -1,7 +1,7 @@
/* Threads compatibility routines for libgcc2 and libobjc for
LynxOS. */
/* Compile this one with gcc. */
-/* Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/gthr-rtems.h b/libgcc/config/gthr-rtems.h
index c5bd52292cf..c5bd52292cf 100644
--- a/gcc/gthr-rtems.h
+++ b/libgcc/config/gthr-rtems.h
diff --git a/gcc/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h
index d4da14ef492..63116c460a6 100644
--- a/gcc/gthr-vxworks.h
+++ b/libgcc/config/gthr-vxworks.h
@@ -1,6 +1,7 @@
/* Threads compatibility routines for libgcc2 and libobjc for VxWorks. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2008, 2009, 2011
+ Free Software Foundation, Inc.
Contributed by Mike Stump <mrs@wrs.com>.
This file is part of GCC.
diff --git a/gcc/config/h8300/clzhi2.c b/libgcc/config/h8300/clzhi2.c
index 54db7b9c56b..54db7b9c56b 100644
--- a/gcc/config/h8300/clzhi2.c
+++ b/libgcc/config/h8300/clzhi2.c
diff --git a/gcc/config/h8300/crti.asm b/libgcc/config/h8300/crti.S
index 7ee3ae74503..f58c3aac9dd 100644
--- a/gcc/config/h8300/crti.asm
+++ b/libgcc/config/h8300/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -23,11 +23,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The code in sections .init and .fini is supposed to be a single
regular function. The function in .init is called directly from
- start in crt0.asm. The function in .fini is atexit()ed in crt0.asm
+ start in crt0.S. The function in .fini is atexit()ed in crt0.S
too.
- crti.asm contributes the prologue of a function to these sections,
- and crtn.asm comes up the epilogue. STARTFILE_SPEC should list
+ crti.S contributes the prologue of a function to these sections,
+ and crtn.S comes up the epilogue. STARTFILE_SPEC should list
crti.o before any other object files that might add code to .init
or .fini sections, and ENDFILE_SPEC should list crtn.o after any
such object files. */
diff --git a/gcc/config/h8300/crtn.asm b/libgcc/config/h8300/crtn.S
index 173fde13b5b..7a591694563 100644
--- a/gcc/config/h8300/crtn.asm
+++ b/libgcc/config/h8300/crtn.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009, 2011 Free Software Foundation, Inc.
This file was adapted from glibc sources.
This file is part of GCC.
@@ -22,7 +22,7 @@ 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/>. */
-/* See an explanation about .init and .fini in crti.asm. */
+/* See an explanation about .init and .fini in crti.S. */
#ifdef __H8300H__
#ifdef __NORMAL_MODE__
diff --git a/gcc/config/h8300/ctzhi2.c b/libgcc/config/h8300/ctzhi2.c
index ba6f8e9086f..ba6f8e9086f 100644
--- a/gcc/config/h8300/ctzhi2.c
+++ b/libgcc/config/h8300/ctzhi2.c
diff --git a/gcc/config/h8300/fixunssfsi.c b/libgcc/config/h8300/fixunssfsi.c
index 2fe62b7a1a8..940d0c6dc6a 100644
--- a/gcc/config/h8300/fixunssfsi.c
+++ b/libgcc/config/h8300/fixunssfsi.c
@@ -1,6 +1,6 @@
/* More subroutines needed by GCC output code on some machines. */
/* Compile this one with gcc. */
-/* Copyright (C) 1989, 1992, 2001, 2002, 2003, 2004, 2009
+/* Copyright (C) 1989, 1992, 2001, 2002, 2003, 2004, 2009, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The libgcc2.c implementation gets confused by our type setup and creates
a directly recursive call, so we do our own implementation. For
- the H8/300, that's in lib1funcs.asm, for H8/300H and H8S, it's here. */
+ the H8/300, that's in lib1funcs.S, for H8/300H and H8S, it's here. */
#ifndef __H8300__
long __fixunssfsi (float a);
diff --git a/gcc/config/h8300/lib1funcs.asm b/libgcc/config/h8300/lib1funcs.S
index 1b75b73269d..1b75b73269d 100644
--- a/gcc/config/h8300/lib1funcs.asm
+++ b/libgcc/config/h8300/lib1funcs.S
diff --git a/gcc/config/h8300/parityhi2.c b/libgcc/config/h8300/parityhi2.c
index d58cb89b5c7..d58cb89b5c7 100644
--- a/gcc/config/h8300/parityhi2.c
+++ b/libgcc/config/h8300/parityhi2.c
diff --git a/gcc/config/h8300/popcounthi2.c b/libgcc/config/h8300/popcounthi2.c
index 47be193b38d..47be193b38d 100644
--- a/gcc/config/h8300/popcounthi2.c
+++ b/libgcc/config/h8300/popcounthi2.c
diff --git a/libgcc/config/h8300/t-h8300 b/libgcc/config/h8300/t-h8300
new file mode 100644
index 00000000000..b6448523e34
--- /dev/null
+++ b/libgcc/config/h8300/t-h8300
@@ -0,0 +1,13 @@
+LIB1ASMSRC = h8300/lib1funcs.S
+LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
+ _fixunssfsi_asm
+
+LIB2ADD = \
+ $(srcdir)/config/h8300/clzhi2.c \
+ $(srcdir)/config/h8300/ctzhi2.c \
+ $(srcdir)/config/h8300/parityhi2.c \
+ $(srcdir)/config/h8300/popcounthi2.c \
+ $(srcdir)/config/h8300/fixunssfsi.c
+
+# We do not have DF type, so fake out the libgcc2 compilation.
+HOST_LIBGCC2_CFLAGS += -DDF=SF
diff --git a/libgcc/config/i386/sol2-ci.S b/libgcc/config/i386/crti.S
index 61e1436f560..76fd35869b5 100644
--- a/libgcc/config/i386/sol2-ci.S
+++ b/libgcc/config/i386/crti.S
@@ -1,4 +1,4 @@
-/* crti.s for Solaris 2, x86.
+/* crti.S for x86.
Copyright (C) 1993, 2008, 2009 Free Software Foundation, Inc.
Written By Fred Fish, Nov 1992
diff --git a/libgcc/config/i386/sol2-cn.S b/libgcc/config/i386/crtn.S
index 993675d2341..572e9cd931b 100644
--- a/libgcc/config/i386/sol2-cn.S
+++ b/libgcc/config/i386/crtn.S
@@ -1,4 +1,4 @@
-/* crtn.s for Solaris 2, x86.
+/* crtn.S for x86.
Copyright (C) 1993, 2008, 2009 Free Software Foundation, Inc.
Written By Fred Fish, Nov 1992
diff --git a/gcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
index fc36cce257d..b589841fd01 100644
--- a/gcc/config/i386/cygming-crtbegin.c
+++ b/libgcc/config/i386/cygming-crtbegin.c
@@ -1,5 +1,5 @@
/* crtbegin object for windows32 targets.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Danny Smith <dannysmith@users.sourceforge.net>
@@ -32,6 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "unwind-dw2-fde.h"
#define WIN32_LEAN_AND_MEAN
diff --git a/gcc/config/i386/cygming-crtend.c b/libgcc/config/i386/cygming-crtend.c
index 8545420b271..ea53c84f6f1 100644
--- a/gcc/config/i386/cygming-crtend.c
+++ b/libgcc/config/i386/cygming-crtend.c
@@ -1,5 +1,5 @@
/* crtend object for windows32 targets.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Danny Smith <dannysmith@users.sourceforge.net>
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "unwind-dw2-fde.h"
#if defined(HAVE_LD_RO_RW_SECTION_MIXING)
diff --git a/gcc/config/i386/cygwin.asm b/libgcc/config/i386/cygwin.S
index 8f9c486850e..8f9c486850e 100644
--- a/gcc/config/i386/cygwin.asm
+++ b/libgcc/config/i386/cygwin.S
diff --git a/gcc/config/i386/gthr-win32.c b/libgcc/config/i386/gthr-win32.c
index 46ecb0d4b26..ab1b69fd4cf 100644
--- a/gcc/config/i386/gthr-win32.c
+++ b/libgcc/config/i386/gthr-win32.c
@@ -1,7 +1,8 @@
/* Implementation of W32-specific threads compatibility routines for
libgcc2. */
-/* Copyright (C) 1999, 2000, 2002, 2004, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2002, 2004, 2008, 2009, 2011
+ Free Software Foundation, Inc.
Contributed by Mumit Khan <khan@xraylith.wisc.edu>.
Modified and moved to separate file by Danny Smith
<dannysmith@users.sourceforge.net>.
@@ -33,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
#undef __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
#define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
-#include <gthr-win32.h>
+#include "gthr-win32.h"
/* Windows32 threads specific definitions. The windows32 threading model
does not map well into pthread-inspired gcc's threading model, and so
diff --git a/gcc/gthr-win32.h b/libgcc/config/i386/gthr-win32.h
index 53f8396cc81..53f8396cc81 100644
--- a/gcc/gthr-win32.h
+++ b/libgcc/config/i386/gthr-win32.h
diff --git a/gcc/config/i386/darwin-libgcc.10.4.ver b/libgcc/config/i386/libgcc-darwin.10.4.ver
index 67f5e239ca1..67f5e239ca1 100644
--- a/gcc/config/i386/darwin-libgcc.10.4.ver
+++ b/libgcc/config/i386/libgcc-darwin.10.4.ver
diff --git a/gcc/config/i386/darwin-libgcc.10.5.ver b/libgcc/config/i386/libgcc-darwin.10.5.ver
index eeec9fbfcdf..eeec9fbfcdf 100644
--- a/gcc/config/i386/darwin-libgcc.10.5.ver
+++ b/libgcc/config/i386/libgcc-darwin.10.5.ver
diff --git a/gcc/config/i386/libgcc-glibc.ver b/libgcc/config/i386/libgcc-glibc.ver
index e79d3267f6f..e79d3267f6f 100644
--- a/gcc/config/i386/libgcc-glibc.ver
+++ b/libgcc/config/i386/libgcc-glibc.ver
diff --git a/libgcc/config/i386/t-chkstk b/libgcc/config/i386/t-chkstk
new file mode 100644
index 00000000000..822981faab8
--- /dev/null
+++ b/libgcc/config/i386/t-chkstk
@@ -0,0 +1,2 @@
+LIB1ASMSRC = i386/cygwin.S
+LIB1ASMFUNCS = _chkstk _chkstk_ms
diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming
index 048cadbd5a1..d76004c48e5 100644
--- a/libgcc/config/i386/t-cygming
+++ b/libgcc/config/i386/t-cygming
@@ -1,11 +1,14 @@
+# If we are building next to winsup, this will let us find the real
+# limits.h when building libgcc2. Otherwise, winsup must be installed
+# first.
+LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include
+
CUSTOM_CRTSTUFF = yes
-crtbegin.o: $(gcc_srcdir)/config/i386/cygming-crtbegin.c
- $(crt_compile) -fno-omit-frame-pointer -c \
- $(gcc_srcdir)/config/i386/cygming-crtbegin.c
+crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
+ $(crt_compile) -fno-omit-frame-pointer -c $<
# We intentionally use a implementation-reserved init priority of 0,
# so allow the warning.
-crtend.o: $(gcc_srcdir)/config/i386/cygming-crtend.c
- $(crt_compile) -fno-omit-frame-pointer -Wno-error -c \
- $(gcc_srcdir)/config/i386/cygming-crtend.c
+crtend.o: $(srcdir)/config/i386/cygming-crtend.c
+ $(crt_compile) -fno-omit-frame-pointer -Wno-error -c $<
diff --git a/gcc/config/i386/t-cygwin b/libgcc/config/i386/t-cygwin
index f5eda91c0ef..f85ec24220e 100644
--- a/gcc/config/i386/t-cygwin
+++ b/libgcc/config/i386/t-cygwin
@@ -1,22 +1,3 @@
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009, 2010
-# Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
# If we are building next to winsup, this will let us find the real
# limits.h when building libgcc2. Otherwise, winsup must be installed
# first.
@@ -36,4 +17,3 @@ SHLIB_SONAME = cyggcc_s$(SHLIB_EH_EXTENSION)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
# We'd like to use SHLIB_SONAME here too, and we can, since
# we don't rely on shlib_base_name substitution for it.
SHLIB_MKMAP_OPTS = -v pe_dll=$(SHLIB_SONAME)
-
diff --git a/libgcc/config/i386/t-darwin b/libgcc/config/i386/t-darwin
index 4578f74c3fa..5f2c69725d0 100644
--- a/libgcc/config/i386/t-darwin
+++ b/libgcc/config/i386/t-darwin
@@ -1 +1,3 @@
-SHLIB_VERPFX = $(gcc_srcdir)/config/i386/darwin-libgcc
+LIB2_SIDITI_CONV_FUNCS = yes
+LIB2ADD = $(srcdir)/config/darwin-64.c
+LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
diff --git a/libgcc/config/i386/t-darwin64 b/libgcc/config/i386/t-darwin64
index 4578f74c3fa..30cf58b38f9 100644
--- a/libgcc/config/i386/t-darwin64
+++ b/libgcc/config/i386/t-darwin64
@@ -1 +1,2 @@
-SHLIB_VERPFX = $(gcc_srcdir)/config/i386/darwin-libgcc
+LIB2_SIDITI_CONV_FUNCS = yes
+LIB2ADD = $(srcdir)/config/darwin-64.c
diff --git a/libgcc/config/i386/t-dlldir b/libgcc/config/i386/t-dlldir
new file mode 100644
index 00000000000..d2cf39bddd6
--- /dev/null
+++ b/libgcc/config/i386/t-dlldir
@@ -0,0 +1,2 @@
+# In a native build, target DLLs go in bindir, where they can be executed.
+SHLIB_DLLDIR = $(bindir)
diff --git a/libgcc/config/i386/t-dlldir-x b/libgcc/config/i386/t-dlldir-x
new file mode 100644
index 00000000000..0f8c29b4e90
--- /dev/null
+++ b/libgcc/config/i386/t-dlldir-x
@@ -0,0 +1,3 @@
+# In a cross build, bindir contains host not target binaries, so target DLLs
+# instead go in toolexeclibdir, alongside other target binaries and static libs.
+SHLIB_DLLDIR = $(toolexeclibdir)
diff --git a/gcc/config/i386/t-dw2-eh b/libgcc/config/i386/t-dw2-eh
index ffcc39aea33..ffcc39aea33 100644
--- a/gcc/config/i386/t-dw2-eh
+++ b/libgcc/config/i386/t-dw2-eh
diff --git a/gcc/config/i386/t-gthr-win32 b/libgcc/config/i386/t-gthr-win32
index f67fa1e25a8..e7380d6f6e4 100644
--- a/gcc/config/i386/t-gthr-win32
+++ b/libgcc/config/i386/t-gthr-win32
@@ -1,2 +1,2 @@
# We hide calls to w32api needed for w32 thread support here:
-LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c
+LIB2ADD = $(srcdir)/config/i386/gthr-win32.c
diff --git a/libgcc/config/i386/t-interix b/libgcc/config/i386/t-interix
new file mode 100644
index 00000000000..8889e7c6c63
--- /dev/null
+++ b/libgcc/config/i386/t-interix
@@ -0,0 +1,3 @@
+# We need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
+# built without debugging information
+LIBGCC2_DEBUG_CFLAGS =
diff --git a/gcc/config/i386/t-linux b/libgcc/config/i386/t-linux
index 500d932fec8..29b4c223983 100644
--- a/gcc/config/i386/t-linux
+++ b/libgcc/config/i386/t-linux
@@ -1,5 +1,4 @@
# On 64bit we do not need any exports for glibc for 64-bit libgcc_s.
# Need to support TImode for x86. Override the settings from
# t-slibgcc-elf-ver and t-linux
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
- $(srcdir)/config/i386/libgcc-glibc.ver
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
diff --git a/gcc/config/i386/t-mingw-pthread b/libgcc/config/i386/t-mingw-pthread
index 622ef82be6e..622ef82be6e 100644
--- a/gcc/config/i386/t-mingw-pthread
+++ b/libgcc/config/i386/t-mingw-pthread
diff --git a/gcc/config/i386/t-mingw32 b/libgcc/config/i386/t-mingw32
index bfdef6723ce..bfdef6723ce 100644
--- a/gcc/config/i386/t-mingw32
+++ b/libgcc/config/i386/t-mingw32
diff --git a/libgcc/config/i386/t-nto b/libgcc/config/i386/t-nto
new file mode 100644
index 00000000000..44c90661824
--- /dev/null
+++ b/libgcc/config/i386/t-nto
@@ -0,0 +1,3 @@
+HOST_LIBGCC2_CFLAGS += -fexceptions
+
+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer $(PICFLAG)
diff --git a/gcc/config/i386/t-sjlj-eh b/libgcc/config/i386/t-sjlj-eh
index c9085f43216..c9085f43216 100644
--- a/gcc/config/i386/t-sjlj-eh
+++ b/libgcc/config/i386/t-sjlj-eh
diff --git a/libgcc/config/i386/t-slibgcc-cygming b/libgcc/config/i386/t-slibgcc-cygming
new file mode 100644
index 00000000000..3bee8b98084
--- /dev/null
+++ b/libgcc/config/i386/t-slibgcc-cygming
@@ -0,0 +1,58 @@
+# Build a shared libgcc library for PECOFF with a DEF file
+# with the GNU linker.
+#
+# mkmap-flat.awk is used with the pe_dll option to produce a DEF instead
+# of an ELF map file.
+#
+# Warning: If SHLIB_SOVERSION or SHLIB_SONAME are updated, LIBGCC_SONAME
+# in mingw32.h and SHLIB_MKMAP_OPTS below must be updated also.
+
+SHLIB_EXT = .dll
+SHLIB_IMPLIB = @shlib_base_name@.a
+SHLIB_SOVERSION = 1
+SHLIB_SONAME = @shlib_base_name@_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
+SHLIB_MAP = @shlib_map_file@
+SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@/shlib
+SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+# SHLIB_DLLDIR is defined by including one of either t-dlldir or t-dlldir-x
+# (native/cross build respectively) in the tmake_file list in
+# libgcc/config.host.
+ifndef SHLIB_DLLDIR
+$(error SHLIB_DLLDIR must be defined)
+endif
+ifndef SHLIB_PTHREAD_CFLAG
+SHLIB_PTHREAD_CFLAG =
+endif
+ifndef SHLIB_PTHREAD_LDFLAG
+SHLIB_PTHREAD_LDFLAG =
+endif
+
+SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
+ if [ ! -d $(SHLIB_DIR) ]; then \
+ mkdir $(SHLIB_DIR); \
+ else true; fi && \
+ $(CC) $(LIBGCC2_CFLAGS) $(SHLIB_PTHREAD_CFLAG) \
+ -shared -nodefaultlibs \
+ $(SHLIB_MAP).def \
+ -Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) ${SHLIB_PTHREAD_LDFLAG} $(SHLIB_LC) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ mv $(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp $(SHLIB_DIR)/$(SHLIB_IMPLIB)
+SHLIB_INSTALL = \
+ $(mkinstalldirs) $(DESTDIR)$(SHLIB_DLLDIR) \
+ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+ $(INSTALL) $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(DESTDIR)$(SHLIB_DLLDIR)/$(SHLIB_SONAME); \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \
+ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB)
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+# We'd like to use SHLIB_SONAME here too, but shlib_base_name
+# does not get substituted before mkmap-flat.awk is run.
+SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
+SHLIB_MAPFILES = libgcc-std.ver
diff --git a/libgcc/config/i386/t-sol2 b/libgcc/config/i386/t-sol2
index 1102146a589..b9cfb00ef49 100644
--- a/libgcc/config/i386/t-sol2
+++ b/libgcc/config/i386/t-sol2
@@ -7,7 +7,7 @@
# We must also enable optimization to avoid having any code appear after
# the call & alignment statement, but before we switch back to the
# .text section.
-CRTSTUFF_T_CFLAGS = -fPIC -O2
+CRTSTUFF_T_CFLAGS = $(PICFLAG) -O2
# Add support for the introduction of 128-bit long double.
SHLIB_MAPFILES += $(srcdir)/config/i386/libgcc-sol2.ver
diff --git a/libgcc/config/ia64/__divxf3.asm b/libgcc/config/ia64/__divxf3.S
index f741bdaf9bc..9cba8f59423 100644
--- a/libgcc/config/ia64/__divxf3.asm
+++ b/libgcc/config/ia64/__divxf3.S
@@ -3,7 +3,7 @@
#endif
#define L__divxf3
-#include "config/ia64/lib1funcs.asm"
+#include "config/ia64/lib1funcs.S"
#ifdef SHARED
#undef __divtf3
diff --git a/libgcc/config/ia64/_fixtfdi.asm b/libgcc/config/ia64/_fixtfdi.S
index 4d13c808c51..863b70f7edc 100644
--- a/libgcc/config/ia64/_fixtfdi.asm
+++ b/libgcc/config/ia64/_fixtfdi.S
@@ -3,7 +3,7 @@
#endif
#define L_fixtfdi
-#include "config/ia64/lib1funcs.asm"
+#include "config/ia64/lib1funcs.S"
#ifdef SHARED
#undef __fixtfti
diff --git a/libgcc/config/ia64/_fixunstfdi.asm b/libgcc/config/ia64/_fixunstfdi.S
index b722d9e90dc..aac6a284eaa 100644
--- a/libgcc/config/ia64/_fixunstfdi.asm
+++ b/libgcc/config/ia64/_fixunstfdi.S
@@ -3,7 +3,7 @@
#endif
#define L_fixunstfdi
-#include "config/ia64/lib1funcs.asm"
+#include "config/ia64/lib1funcs.S"
#ifdef SHARED
#undef __fixunstfti
diff --git a/libgcc/config/ia64/_floatditf.asm b/libgcc/config/ia64/_floatditf.S
index 21d77028176..e37404d26d5 100644
--- a/libgcc/config/ia64/_floatditf.asm
+++ b/libgcc/config/ia64/_floatditf.S
@@ -3,7 +3,7 @@
#endif
#define L_floatditf
-#include "config/ia64/lib1funcs.asm"
+#include "config/ia64/lib1funcs.S"
#ifdef SHARED
#undef __floattitf
diff --git a/gcc/config/ia64/crtbegin.asm b/libgcc/config/ia64/crtbegin.S
index 638489990d5..638489990d5 100644
--- a/gcc/config/ia64/crtbegin.asm
+++ b/libgcc/config/ia64/crtbegin.S
diff --git a/gcc/config/ia64/crtend.asm b/libgcc/config/ia64/crtend.S
index a904af9cfd9..a904af9cfd9 100644
--- a/gcc/config/ia64/crtend.asm
+++ b/libgcc/config/ia64/crtend.S
diff --git a/gcc/config/ia64/crti.asm b/libgcc/config/ia64/crti.S
index a9d51509782..c15ff662bbe 100644
--- a/gcc/config/ia64/crti.asm
+++ b/libgcc/config/ia64/crti.S
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2001, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2008, 2009, 2011 Free Software Foundation, Inc.
# Written By Timothy Wall
#
# This file is free software; you can redistribute it and/or modify it
@@ -50,4 +50,4 @@ _fini:
mov r33 = b0
.body
-# end of crti.asm
+# end of crti.S
diff --git a/gcc/config/ia64/crtn.asm b/libgcc/config/ia64/crtn.S
index e1a18795f79..d44abbea3c7 100644
--- a/gcc/config/ia64/crtn.asm
+++ b/libgcc/config/ia64/crtn.S
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2001, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2008, 2009, 2011 Free Software Foundation, Inc.
# Written By Timothy Wall
#
# This file is free software; you can redistribute it and/or modify it
@@ -40,4 +40,4 @@
mov r12 = r35
br.ret.sptk.many b0
-# end of crtn.asm
+# end of crtn.S
diff --git a/libgcc/config/ia64/fde-vms.c b/libgcc/config/ia64/fde-vms.c
index c9ac5d28076..e02b9abbccf 100644
--- a/libgcc/config/ia64/fde-vms.c
+++ b/libgcc/config/ia64/fde-vms.c
@@ -29,10 +29,10 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include "md-unwind-support.h"
#include "unwind-ia64.h"
#define __int64 long
diff --git a/gcc/config/ia64/lib1funcs.asm b/libgcc/config/ia64/lib1funcs.S
index b7eaa6eca3c..b7eaa6eca3c 100644
--- a/gcc/config/ia64/lib1funcs.asm
+++ b/libgcc/config/ia64/lib1funcs.S
diff --git a/gcc/config/ia64/libgcc-glibc.ver b/libgcc/config/ia64/libgcc-glibc.ver
index 34a69618d1b..34a69618d1b 100644
--- a/gcc/config/ia64/libgcc-glibc.ver
+++ b/libgcc/config/ia64/libgcc-glibc.ver
diff --git a/gcc/config/ia64/libgcc-ia64.ver b/libgcc/config/ia64/libgcc-ia64.ver
index 11c1fe629bd..11c1fe629bd 100644
--- a/gcc/config/ia64/libgcc-ia64.ver
+++ b/libgcc/config/ia64/libgcc-ia64.ver
diff --git a/gcc/config/ia64/quadlib.c b/libgcc/config/ia64/quadlib.c
index f9ee30b587c..f9ee30b587c 100644
--- a/gcc/config/ia64/quadlib.c
+++ b/libgcc/config/ia64/quadlib.c
diff --git a/libgcc/config/ia64/t-hpux b/libgcc/config/ia64/t-hpux
index ef3387e7a61..ddc1135d737 100644
--- a/libgcc/config/ia64/t-hpux
+++ b/libgcc/config/ia64/t-hpux
@@ -1 +1,9 @@
+# On HP-UX we do not want _fixtfdi, _fixunstfdi, or _floatditf from
+# LIB1ASMSRC. These functions map the 128 bit conversion function names
+# to 80 bit conversions and were done for Linux backwards compatibility.
+LIB1ASMFUNCS := $(filter-out _fixtfdi _fixunstfdi _floatditf,$(LIB1ASMFUNCS))
+
+# Support routines for HP-UX 128 bit floats.
+LIB2ADD = $(srcdir)/config/ia64/quadlib.c $(srcdir)/floatunsitf.c
+
LIB2ADDEH = $(srcdir)/unwind-c.c
diff --git a/libgcc/config/ia64/t-ia64 b/libgcc/config/ia64/t-ia64
index 3ec5fc5db08..d1ec3536db0 100644
--- a/libgcc/config/ia64/t-ia64
+++ b/libgcc/config/ia64/t-ia64
@@ -1,15 +1,36 @@
+LIB1ASMSRC = ia64/lib1funcs.S
+
+# We use different names for the DImode div/mod files so that they won't
+# conflict with libgcc2.c files. We used to use __ia64 as a prefix, now
+# we use __ as the prefix. Note that L_divdi3 in libgcc2.c actually defines
+# a TImode divide function, so there is no actual overlap here between
+# libgcc2.c and lib1funcs.S.
+LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
+ __divdi3 __moddi3 __udivdi3 __umoddi3 \
+ __divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
+ __nonlocal_goto __restore_stack_nonlocal __trampoline \
+ _fixtfdi _fixunstfdi _floatditf
+
+# ??? Hack to get -P option used when compiling lib1funcs.S, because Intel
+# assembler does not accept # line number as a comment.
+# ??? This breaks C++ pragma interface/implementation, which is used in the
+# C++ part of libgcc2, hence it had to be disabled. Must find some other way
+# to support the Intel assembler.
+#LIBGCC2_DEBUG_CFLAGS = -g1 -P
+
CUSTOM_CRTSTUFF = yes
# Assemble startup files.
-crtbegin.o: $(gcc_srcdir)/config/ia64/crtbegin.asm
+# FIXME: -I$(gcc_objdir) is necessary to find auto-host.h. Really?
+crtbegin.o: $(srcdir)/config/ia64/crtbegin.S
+ $(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp $<
+crtend.o: $(srcdir)/config/ia64/crtend.S
+ $(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp $<
+crtbeginS.o: $(srcdir)/config/ia64/crtbegin.S
$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
- -o $@ $(gcc_srcdir)/config/ia64/crtbegin.asm
-crtend.o: $(gcc_srcdir)/config/ia64/crtend.asm
+ -o $@ -DSHARED $<
+crtendS.o: $(srcdir)/config/ia64/crtend.S
$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
- -o $@ $(gcc_srcdir)/config/ia64/crtend.asm
-crtbeginS.o: $(gcc_srcdir)/config/ia64/crtbegin.asm
- $(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
- -o $@ -DSHARED $(gcc_srcdir)/config/ia64/crtbegin.asm
-crtendS.o: $(gcc_srcdir)/config/ia64/crtend.asm
- $(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
- -o $@ -DSHARED $(gcc_srcdir)/config/ia64/crtend.asm
+ -o $@ -DSHARED $<
+
+SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64.ver
diff --git a/libgcc/config/ia64/t-glibc b/libgcc/config/ia64/t-linux
index df4fe9c4404..e6d72b94a87 100644
--- a/libgcc/config/ia64/t-glibc
+++ b/libgcc/config/ia64/t-linux
@@ -1,3 +1,5 @@
# Use system libunwind library on IA-64 GLIBC based system.
LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
$(srcdir)/unwind-compat.c
+
+SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver
diff --git a/libgcc/config/ia64/t-glibc-libunwind b/libgcc/config/ia64/t-linux-libunwind
index 8b1736a2d67..8b1736a2d67 100644
--- a/libgcc/config/ia64/t-glibc-libunwind
+++ b/libgcc/config/ia64/t-linux-libunwind
diff --git a/libgcc/config/ia64/t-slibgcc-hpux b/libgcc/config/ia64/t-slibgcc-hpux
new file mode 100644
index 00000000000..27c7a661b1e
--- /dev/null
+++ b/libgcc/config/ia64/t-slibgcc-hpux
@@ -0,0 +1,6 @@
+# Build a shared libgcc library with the HP-UX linker on IA64.
+
+SHLIB_SOVERSION = 0
+# Must include -lunwind in the link, so that libgcc_s.so has the necessary
+# DT_NEEDED entry for libunwind.
+SHLIB_LC += -lunwind
diff --git a/libgcc/config/ia64/t-softfp-compat b/libgcc/config/ia64/t-softfp-compat
index d3dad68c48f..00f45d51cd0 100644
--- a/libgcc/config/ia64/t-softfp-compat
+++ b/libgcc/config/ia64/t-softfp-compat
@@ -3,5 +3,5 @@
# Replace __dvxf3 _fixtfdi _fixunstfdi _floatditf
libgcc1-tf-functions = __divxf3 _fixtfdi _fixunstfdi _floatditf
LIB1ASMFUNCS := $(filter-out $(libgcc1-tf-functions), $(LIB1ASMFUNCS))
-libgcc1-tf-compats = $(addsuffix .asm, $(libgcc1-tf-functions))
+libgcc1-tf-compats = $(addsuffix .S, $(libgcc1-tf-functions))
LIB2ADD += $(addprefix $(srcdir)/config/ia64/, $(libgcc1-tf-compats))
diff --git a/libgcc/config/ia64/t-vms b/libgcc/config/ia64/t-vms
index 9bc933adfe0..140c748b771 100644
--- a/libgcc/config/ia64/t-vms
+++ b/libgcc/config/ia64/t-vms
@@ -1 +1,7 @@
+CRTSTUFF_T_CFLAGS = -O0
+CRTSTUFF_T_CFLAGS_S = -O0
+
+crtinitS.o: $(srcdir)/config/ia64/vms-crtinit.S
+ $(gcc_compile) -c -x assembler-with-cpp $<
+
LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
diff --git a/libgcc/config/ia64/unwind-ia64.c b/libgcc/config/ia64/unwind-ia64.c
index e9ddfca8864..ca5c2670bf2 100644
--- a/libgcc/config/ia64/unwind-ia64.c
+++ b/libgcc/config/ia64/unwind-ia64.c
@@ -31,6 +31,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "unwind.h"
#include "unwind-ia64.h"
#include "unwind-compat.h"
diff --git a/gcc/config/ia64/vms-crtinit.asm b/libgcc/config/ia64/vms-crtinit.S
index 322b2927347..322b2927347 100644
--- a/gcc/config/ia64/vms-crtinit.asm
+++ b/libgcc/config/ia64/vms-crtinit.S
diff --git a/gcc/config/iq2000/lib2extra-funcs.c b/libgcc/config/iq2000/lib2funcs.c
index d53786c8c7d..d53786c8c7d 100644
--- a/gcc/config/iq2000/lib2extra-funcs.c
+++ b/libgcc/config/iq2000/lib2funcs.c
diff --git a/libgcc/config/iq2000/t-iq2000 b/libgcc/config/iq2000/t-iq2000
new file mode 100644
index 00000000000..18fd53c37d6
--- /dev/null
+++ b/libgcc/config/iq2000/t-iq2000
@@ -0,0 +1,5 @@
+LIB2ADD = $(srcdir)/udivmod.c \
+ $(srcdir)/divmod.c \
+ $(srcdir)/udivmodsi4.c \
+ $(srcdir)/config/iq2000/lib2funcs.c
+
diff --git a/libgcc/config/libbid/bid_gcc_intrinsics.h b/libgcc/config/libbid/bid_gcc_intrinsics.h
index 3f3e1ef1706..70529618c11 100644
--- a/libgcc/config/libbid/bid_gcc_intrinsics.h
+++ b/libgcc/config/libbid/bid_gcc_intrinsics.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
diff --git a/gcc/config/libgcc-glibc.ver b/libgcc/config/libgcc-glibc.ver
index 7824ad5a268..7824ad5a268 100644
--- a/gcc/config/libgcc-glibc.ver
+++ b/libgcc/config/libgcc-glibc.ver
diff --git a/gcc/libgcc-libsystem.ver b/libgcc/config/libgcc-libsystem.ver
index 47631749dc2..47631749dc2 100644
--- a/gcc/libgcc-libsystem.ver
+++ b/libgcc/config/libgcc-libsystem.ver
diff --git a/libgcc/config/lm32/t-elf b/libgcc/config/lm32/t-elf
index 679f00711e7..f96c0988b07 100644
--- a/libgcc/config/lm32/t-elf
+++ b/libgcc/config/lm32/t-elf
@@ -1,12 +1,2 @@
-# Assemble startup files.
-
-$(T)crti.o: $(srcdir)/config/lm32/crti.S $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/lm32/crti.S
-
-$(T)crtn.o: $(srcdir)/config/lm32/crtn.S $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/lm32/crtn.S
-
CRTSTUFF_T_CFLAGS = -G 0 -msign-extend-enabled
-HOST_LIBGCC2_CFLAGS = -G 0 -msign-extend-enabled
+HOST_LIBGCC2_CFLAGS += -G 0 -msign-extend-enabled
diff --git a/libgcc/config/lm32/t-uclinux b/libgcc/config/lm32/t-uclinux
index d388f56c3a2..764243c8f88 100644
--- a/libgcc/config/lm32/t-uclinux
+++ b/libgcc/config/lm32/t-uclinux
@@ -1,2 +1,2 @@
-CRTSTUFF_T_CFLAGS = -fPIC -msign-extend-enabled
-HOST_LIBGCC2_CFLAGS = -fPIC -msign-extend-enabled
+CRTSTUFF_T_CFLAGS = $(PICFLAG) -msign-extend-enabled
+HOST_LIBGCC2_CFLAGS += -msign-extend-enabled
diff --git a/gcc/config/m32c/m32c-lib1.S b/libgcc/config/m32c/lib1funcs.S
index 9b657787187..9b657787187 100644
--- a/gcc/config/m32c/m32c-lib1.S
+++ b/libgcc/config/m32c/lib1funcs.S
diff --git a/gcc/config/m32c/m32c-lib2.c b/libgcc/config/m32c/lib2funcs.c
index 274affc4ab0..274affc4ab0 100644
--- a/gcc/config/m32c/m32c-lib2.c
+++ b/libgcc/config/m32c/lib2funcs.c
diff --git a/libgcc/config/m32c/t-m32c b/libgcc/config/m32c/t-m32c
new file mode 100644
index 00000000000..dac99ec652f
--- /dev/null
+++ b/libgcc/config/m32c/t-m32c
@@ -0,0 +1,13 @@
+LIB1ASMSRC = m32c/lib1funcs.S
+
+LIB1ASMFUNCS = \
+ __m32c_memregs \
+ __m32c_eh_return \
+ __m32c_mulsi3 \
+ __m32c_cmpsi2 \
+ __m32c_ucmpsi2 \
+ __m32c_jsri16
+
+LIB2ADD = $(srcdir)/config/m32c/lib2funcs.c \
+ $(srcdir)/config/m32c/trapv.c
+
diff --git a/gcc/config/m32c/m32c-lib2-trapv.c b/libgcc/config/m32c/trapv.c
index bb61ceaf0f4..0c8c174ef81 100644
--- a/gcc/config/m32c/m32c-lib2-trapv.c
+++ b/libgcc/config/m32c/trapv.c
@@ -1,5 +1,5 @@
/* 16-bit trapping arithmetic routines for R8C/M16C/M32C
- Copyright (C) 2009
+ Copyright (C) 2009, 2011
Free Software Foundation, Inc.
Contributed by Red Hat.
@@ -28,10 +28,10 @@
m32c.h for why we are creating extra versions of some of the
functions defined in libgcc2.c.
- Note - this file is separate from m32c-lib2.c so that the following
+ Note - this file is separate from lib2funcs.c so that the following
functions will appear in the their object file. This is necessary
because they call abort() which is defined in the C library whereas
- the functions in m32c-lib2.c are completely self sufficieent. */
+ the functions in lib2funcs.c are completely self sufficient. */
#define LIBGCC2_UNITS_PER_WORD 2
diff --git a/gcc/config/m32r/initfini.c b/libgcc/config/m32r/initfini.c
index 6e7d58614c7..56332459223 100644
--- a/gcc/config/m32r/initfini.c
+++ b/libgcc/config/m32r/initfini.c
@@ -1,5 +1,5 @@
/* .init/.fini section handling + C++ global constructor/destructor handling.
- This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
+ This file is based on crtstuff.c, sol2-crti.S, sol2-crtn.S.
Copyright (C) 1996, 1997, 1998, 2006, 2009 Free Software Foundation, Inc.
diff --git a/gcc/config/m32r/libgcc-glibc.ver b/libgcc/config/m32r/libgcc-glibc.ver
index 0e1304b2a3a..0e1304b2a3a 100644
--- a/gcc/config/m32r/libgcc-glibc.ver
+++ b/libgcc/config/m32r/libgcc-glibc.ver
diff --git a/libgcc/config/m32r/t-linux b/libgcc/config/m32r/t-linux
new file mode 100644
index 00000000000..5223b731ff7
--- /dev/null
+++ b/libgcc/config/m32r/t-linux
@@ -0,0 +1,5 @@
+# Turn off the SDA while compiling libgcc2. There are no headers for it
+# and we want maximal upward compatibility here.
+HOST_LIBGCC2_CFLAGS += -G 0
+
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/m32r/libgcc-glibc.ver
diff --git a/libgcc/config/m32r/t-m32r b/libgcc/config/m32r/t-m32r
new file mode 100644
index 00000000000..861044b15b9
--- /dev/null
+++ b/libgcc/config/m32r/t-m32r
@@ -0,0 +1,23 @@
+# Turn off the SDA while compiling libgcc2. There are no headers for it
+# and we want maximal upward compatibility here.
+HOST_LIBGCC2_CFLAGS += -G 0
+
+# We need to use -fpic when we are using gcc to compile the routines in
+# initfini.c. This is only really needed when we are going to use gcc/g++
+# to produce a shared library, but since we don't know ahead of time when
+# we will be doing that, we just always use -fpic when compiling the
+# routines in initfini.c.
+# -fpic currently isn't supported for the m32r.
+# FIXME: No longer true. Empty CRTSTUFF_T_CFLAGS is the default.
+CRTSTUFF_T_CFLAGS =
+
+# .init/.fini section routines
+crtinit.o: $(srcdir)/config/m32r/initfini.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_INIT \
+ -finhibit-size-directive -fno-inline-functions -g0 \
+ -mmodel=medium -c $<
+
+crtfini.o: $(srcdir)/config/m32r/initfini.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_FINI \
+ -finhibit-size-directive -fno-inline-functions -g0 \
+ -mmodel=medium -c $<
diff --git a/gcc/config/m68k/crti.s b/libgcc/config/m68k/crti.S
index 12fb59f4130..12fb59f4130 100644
--- a/gcc/config/m68k/crti.s
+++ b/libgcc/config/m68k/crti.S
diff --git a/gcc/config/m68k/crtn.s b/libgcc/config/m68k/crtn.S
index b7d70f02ed5..b7d70f02ed5 100644
--- a/gcc/config/m68k/crtn.s
+++ b/libgcc/config/m68k/crtn.S
diff --git a/gcc/config/m68k/fpgnulib.c b/libgcc/config/m68k/fpgnulib.c
index 2a7f6c75d11..fe41edf26aa 100644
--- a/gcc/config/m68k/fpgnulib.c
+++ b/libgcc/config/m68k/fpgnulib.c
@@ -1,6 +1,6 @@
/* This is a stripped down version of floatlib.c. It supplies only those
functions which exist in libgcc, but for which there is not assembly
- language versions in m68k/lb1sf68.asm.
+ language versions in m68k/lb1sf68.S.
It also includes simplistic support for extended floats (by working in
double precision). You must compile this file again with -DEXTFLOAT
diff --git a/gcc/config/m68k/lb1sf68.asm b/libgcc/config/m68k/lb1sf68.S
index 0339a092c4f..0339a092c4f 100644
--- a/gcc/config/m68k/lb1sf68.asm
+++ b/libgcc/config/m68k/lb1sf68.S
diff --git a/libgcc/config/m68k/t-floatlib b/libgcc/config/m68k/t-floatlib
new file mode 100644
index 00000000000..1ee8782d9fd
--- /dev/null
+++ b/libgcc/config/m68k/t-floatlib
@@ -0,0 +1,11 @@
+LIB1ASMSRC = m68k/lb1sf68.S
+LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
+ _double _float _floatex \
+ _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
+ _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
+
+LIB2ADD = $(srcdir)/config/m68k/fpgnulib.c xfgnulib.c
+
+xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
+ echo '#define EXTFLOAT' > xfgnulib.c
+ cat $< >> xfgnulib.c
diff --git a/gcc/config/m68k/t-slibgcc-elf-ver b/libgcc/config/m68k/t-slibgcc-elf-ver
index 6aac37cc08f..6aac37cc08f 100644
--- a/gcc/config/m68k/t-slibgcc-elf-ver
+++ b/libgcc/config/m68k/t-slibgcc-elf-ver
diff --git a/gcc/config/mcore/crti.asm b/libgcc/config/mcore/crti.S
index 03f59292896..467e944fb37 100644
--- a/gcc/config/mcore/crti.asm
+++ b/libgcc/config/mcore/crti.S
@@ -1,6 +1,7 @@
-# crti.asm for ELF based systems
+# crti.S for ELF based systems
-# Copyright (C) 1992, 1998, 1999, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1998, 1999, 2008, 2009, 2011
+# Free Software Foundation, Inc.
# Written By David Vinayak Henkel-Wallace, June 1992
#
# This file is free software; you can redistribute it and/or modify it
diff --git a/gcc/config/mcore/crtn.asm b/libgcc/config/mcore/crtn.S
index b764441e721..85f75b1d42f 100644
--- a/gcc/config/mcore/crtn.asm
+++ b/libgcc/config/mcore/crtn.S
@@ -1,7 +1,8 @@
-# crtn.asm for ELF based systems
+# crtn.S for ELF based systems
-# Copyright (C) 1992, 1999, 2000, 2008, 2009 Free Software Foundation, Inc.
-# Written By David Vinayak Henkel-Wallace, June 1992
+# Copyright (C) 1992, 1999, 2000, 2008, 2009, 2011
+# Free Software Foundation, Inc.
+# Written By David Vinayak Henkel-Wallace, June 1992
#
# 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
diff --git a/gcc/config/mcore/lib1.asm b/libgcc/config/mcore/lib1funcs.S
index 701762f2a3c..701762f2a3c 100644
--- a/gcc/config/mcore/lib1.asm
+++ b/libgcc/config/mcore/lib1funcs.S
diff --git a/libgcc/config/mcore/t-mcore b/libgcc/config/mcore/t-mcore
new file mode 100644
index 00000000000..8268a17e7ad
--- /dev/null
+++ b/libgcc/config/mcore/t-mcore
@@ -0,0 +1,5 @@
+LIB1ASMSRC = mcore/lib1funcs.S
+LIB1ASMFUNCS = _divsi3 _udivsi3 _modsi3 _umodsi3
+
+# could use -msifilter to be safe from interrupt/jmp interactions and others.
+HOST_LIBGCC2_CFLAGS += -O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
diff --git a/gcc/config/mep/mep-lib1.asm b/libgcc/config/mep/lib1funcs.S
index 0a18913f927..0a18913f927 100644
--- a/gcc/config/mep/mep-lib1.asm
+++ b/libgcc/config/mep/lib1funcs.S
diff --git a/gcc/config/mep/mep-lib2.c b/libgcc/config/mep/lib2funcs.c
index 1dbf57d9535..1dbf57d9535 100644
--- a/gcc/config/mep/mep-lib2.c
+++ b/libgcc/config/mep/lib2funcs.c
diff --git a/libgcc/config/mep/t-mep b/libgcc/config/mep/t-mep
new file mode 100644
index 00000000000..fb3a0d60c4d
--- /dev/null
+++ b/libgcc/config/mep/t-mep
@@ -0,0 +1,16 @@
+# profiling support
+LIB1ASMSRC = mep/lib1funcs.S
+
+LIB1ASMFUNCS = _mep_profile \
+ _mep_bb_init_trace \
+ _mep_bb_init \
+ _mep_bb_trace \
+ _mep_bb_increment
+
+# multiply and divide routines
+LIB2ADD = \
+ $(srcdir)/config/mep/lib2funcs.c \
+ $(srcdir)/config/mep/tramp.c
+
+# Use -O0 instead of -O2 so we don't get complex relocations
+CRTSTUFF_CFLAGS += -O0
diff --git a/gcc/config/mep/mep-tramp.c b/libgcc/config/mep/tramp.c
index bf484ca4e95..bf484ca4e95 100644
--- a/gcc/config/mep/mep-tramp.c
+++ b/libgcc/config/mep/tramp.c
diff --git a/gcc/config/microblaze/crti.s b/libgcc/config/microblaze/crti.S
index 3944443b437..3944443b437 100644
--- a/gcc/config/microblaze/crti.s
+++ b/libgcc/config/microblaze/crti.S
diff --git a/gcc/config/microblaze/crtn.s b/libgcc/config/microblaze/crtn.S
index 7970dee1c93..7970dee1c93 100644
--- a/gcc/config/microblaze/crtn.s
+++ b/libgcc/config/microblaze/crtn.S
diff --git a/libgcc/config/microblaze/divsi3.asm b/libgcc/config/microblaze/divsi3.S
index 7d888b32e8d..f3b7a198306 100644
--- a/libgcc/config/microblaze/divsi3.asm
+++ b/libgcc/config/microblaze/divsi3.S
@@ -1,6 +1,6 @@
###################################-
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# divsi3.asm
+# divsi3.S
#
# Divide operation for 32 bit integers.
# Input : Dividend in Reg r5
diff --git a/libgcc/config/microblaze/moddi3.asm b/libgcc/config/microblaze/moddi3.S
index 4923b45ffeb..3e8d94f70a9 100644
--- a/libgcc/config/microblaze/moddi3.asm
+++ b/libgcc/config/microblaze/moddi3.S
@@ -1,6 +1,6 @@
###################################
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# modsi3.asm
+# modsi3.S
#
# modulo operation for 64 bit integers.
#
diff --git a/libgcc/config/microblaze/modsi3.asm b/libgcc/config/microblaze/modsi3.S
index cae95c8bc63..4be6be42616 100644
--- a/libgcc/config/microblaze/modsi3.asm
+++ b/libgcc/config/microblaze/modsi3.S
@@ -1,6 +1,6 @@
###################################
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# modsi3.asm
+# modsi3.S
#
# modulo operation for 32 bit integers.
# Input : op1 in Reg r5
diff --git a/libgcc/config/microblaze/muldi3_hard.asm b/libgcc/config/microblaze/muldi3_hard.S
index 0499e2a550b..14cfff59772 100644
--- a/libgcc/config/microblaze/muldi3_hard.asm
+++ b/libgcc/config/microblaze/muldi3_hard.S
@@ -1,6 +1,6 @@
###################################-
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# muldi3_hard.asm
+# muldi3_hard.S
#
# Multiply operation for 64 bit integers, for devices with hard multiply
# Input : Operand1[H] in Reg r5
diff --git a/libgcc/config/microblaze/mulsi3.asm b/libgcc/config/microblaze/mulsi3.S
index 03fe0288df8..77d2daa9270 100644
--- a/libgcc/config/microblaze/mulsi3.asm
+++ b/libgcc/config/microblaze/mulsi3.S
@@ -1,6 +1,6 @@
###################################-*-asm*-
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# mulsi3.asm
+# mulsi3.S
#
# Multiply operation for 32 bit integers.
# Input : Operand1 in Reg r5
diff --git a/libgcc/config/microblaze/stack_overflow_exit.asm b/libgcc/config/microblaze/stack_overflow_exit.S
index 30b31f0a5ba..98182a2b361 100644
--- a/libgcc/config/microblaze/stack_overflow_exit.asm
+++ b/libgcc/config/microblaze/stack_overflow_exit.S
@@ -1,6 +1,6 @@
###################################-*-asm*-
#
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009, 2011 Free Software Foundation, Inc.
#
#
# Contributed by Michael Eager <eager@eagercon.com>.
@@ -24,7 +24,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# stack_overflow_exit.asm
+# stack_overflow_exit.S
#
# Checks for stack overflows and sets the global variable
# stack_overflow_error with the value of current stack pointer
diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze
index 85fc8d39d8a..3a9c7ff23fe 100644
--- a/libgcc/config/microblaze/t-microblaze
+++ b/libgcc/config/microblaze/t-microblaze
@@ -1,12 +1,10 @@
LIB2ADD += \
- $(srcdir)/config/microblaze/divsi3.asm \
- $(srcdir)/config/microblaze/moddi3.asm \
- $(srcdir)/config/microblaze/modsi3.asm \
- $(srcdir)/config/microblaze/muldi3_hard.asm \
- $(srcdir)/config/microblaze/mulsi3.asm \
- $(srcdir)/config/microblaze/stack_overflow_exit.asm \
- $(srcdir)/config/microblaze/udivsi3.asm \
- $(srcdir)/config/microblaze/umodsi3.asm \
+ $(srcdir)/config/microblaze/divsi3.S \
+ $(srcdir)/config/microblaze/moddi3.S \
+ $(srcdir)/config/microblaze/modsi3.S \
+ $(srcdir)/config/microblaze/muldi3_hard.S \
+ $(srcdir)/config/microblaze/mulsi3.S \
+ $(srcdir)/config/microblaze/stack_overflow_exit.S \
+ $(srcdir)/config/microblaze/udivsi3.S \
+ $(srcdir)/config/microblaze/umodsi3.S \
$(srcdir)/config/microblaze/divsi3_table.c
-
-MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high
diff --git a/libgcc/config/microblaze/udivsi3.asm b/libgcc/config/microblaze/udivsi3.S
index 879cd349ca7..07a2d658092 100644
--- a/libgcc/config/microblaze/udivsi3.asm
+++ b/libgcc/config/microblaze/udivsi3.S
@@ -1,6 +1,6 @@
###################################-
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# udivsi3.asm
+# udivsi3.S
#
# Unsigned divide operation.
# Input : Divisor in Reg r5
diff --git a/libgcc/config/microblaze/umodsi3.asm b/libgcc/config/microblaze/umodsi3.S
index f7fd0087965..67de12c84ac 100644
--- a/libgcc/config/microblaze/umodsi3.asm
+++ b/libgcc/config/microblaze/umodsi3.S
@@ -1,6 +1,6 @@
###################################
#
-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
#
# Contributed by Michael Eager <eager@eagercon.com>.
#
@@ -23,7 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
#
-# umodsi3.asm
+# umodsi3.S
#
# Unsigned modulo operation for 32 bit integers.
# Input : op1 in Reg r5
diff --git a/gcc/config/mips/crti.asm b/libgcc/config/mips/crti.S
index ac04271c598..ac04271c598 100644
--- a/gcc/config/mips/crti.asm
+++ b/libgcc/config/mips/crti.S
diff --git a/gcc/config/mips/crtn.asm b/libgcc/config/mips/crtn.S
index 03a6b68c9cf..03a6b68c9cf 100644
--- a/gcc/config/mips/crtn.asm
+++ b/libgcc/config/mips/crtn.S
diff --git a/gcc/gthr-mipssde.h b/libgcc/config/mips/gthr-mipssde.h
index 34f9b6cf54b..34f9b6cf54b 100644
--- a/gcc/gthr-mipssde.h
+++ b/libgcc/config/mips/gthr-mipssde.h
diff --git a/gcc/config/mips/libgcc-mips16.ver b/libgcc/config/mips/libgcc-mips16.ver
index ddb23e7e750..ddb23e7e750 100644
--- a/gcc/config/mips/libgcc-mips16.ver
+++ b/libgcc/config/mips/libgcc-mips16.ver
diff --git a/gcc/config/mips/mips16.S b/libgcc/config/mips/mips16.S
index ec331b5f65e..ec331b5f65e 100644
--- a/gcc/config/mips/mips16.S
+++ b/libgcc/config/mips/mips16.S
diff --git a/libgcc/config/mips/t-crtstuff b/libgcc/config/mips/t-crtstuff
new file mode 100644
index 00000000000..d8ab43be2ae
--- /dev/null
+++ b/libgcc/config/mips/t-crtstuff
@@ -0,0 +1,2 @@
+# Don't let CTOR_LIST end up in sdata section.
+CRTSTUFF_T_CFLAGS = -G 0
diff --git a/libgcc/config/mips/t-elf b/libgcc/config/mips/t-elf
new file mode 100644
index 00000000000..651f10a5303
--- /dev/null
+++ b/libgcc/config/mips/t-elf
@@ -0,0 +1,3 @@
+# We must build libgcc2.a with -G 0, in case the user wants to link
+# without the $gp register.
+HOST_LIBGCC2_CFLAGS += -G 0
diff --git a/libgcc/config/mips/t-mips b/libgcc/config/mips/t-mips
index b7d13b3ddb3..719c062ef0d 100644
--- a/libgcc/config/mips/t-mips
+++ b/libgcc/config/mips/t-mips
@@ -1,3 +1,5 @@
+LIB2_SIDITI_CONV_FUNCS = yes
+
FPBIT = true
FPBIT_CFLAGS = -DQUIET_NAN_NEGATED
DPBIT = true
diff --git a/libgcc/config/mips/t-mips16 b/libgcc/config/mips/t-mips16
index 94fa0e94275..5553ed76e2d 100644
--- a/libgcc/config/mips/t-mips16
+++ b/libgcc/config/mips/t-mips16
@@ -1,2 +1,45 @@
+# Copyright (C) 2007, 2008, 2011 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/>.
+
+LIB1ASMSRC = mips/mips16.S
+LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \
+ _m16eqsf2 _m16nesf2 _m16gtsf2 _m16gesf2 _m16lesf2 _m16ltsf2 \
+ _m16unordsf2 \
+ _m16fltsisf _m16fix_truncsfsi _m16fltunsisf \
+ _m16adddf3 _m16subdf3 _m16muldf3 _m16divdf3 \
+ _m16extsfdf2 _m16trdfsf2 \
+ _m16eqdf2 _m16nedf2 _m16gtdf2 _m16gedf2 _m16ledf2 _m16ltdf2 \
+ _m16unorddf2 \
+ _m16fltsidf _m16fix_truncdfsi _m16fltunsidf \
+ _m16retsf _m16retdf \
+ _m16retsc _m16retdc \
+ _m16stub1 _m16stub2 _m16stub5 _m16stub6 _m16stub9 _m16stub10 \
+ _m16stubsf0 _m16stubsf1 _m16stubsf2 _m16stubsf5 _m16stubsf6 \
+ _m16stubsf9 _m16stubsf10 \
+ _m16stubdf0 _m16stubdf1 _m16stubdf2 _m16stubdf5 _m16stubdf6 \
+ _m16stubdf9 _m16stubdf10 \
+ _m16stubsc0 _m16stubsc1 _m16stubsc2 _m16stubsc5 _m16stubsc6 \
+ _m16stubsc9 _m16stubsc10 \
+ _m16stubdc0 _m16stubdc1 _m16stubdc2 _m16stubdc5 _m16stubdc6 \
+ _m16stubdc9 _m16stubdc10
+
SYNC = yes
SYNC_CFLAGS = -mno-mips16
+
+# Version these symbols if building libgcc.so.
+SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
diff --git a/libgcc/config/mips/t-slibgcc-irix b/libgcc/config/mips/t-slibgcc-irix
index 6e0ac365437..47b2e0eec21 100644
--- a/libgcc/config/mips/t-slibgcc-irix
+++ b/libgcc/config/mips/t-slibgcc-irix
@@ -3,5 +3,5 @@
SHLIB_LDFLAGS = -Wl,-soname,$(SHLIB_SONAME) \
-Wl,-exports_file,$(SHLIB_MAP)
-SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = libgcc-std.ver
diff --git a/libgcc/config/mips/t-vr b/libgcc/config/mips/t-vr
new file mode 100644
index 00000000000..601fbdece1a
--- /dev/null
+++ b/libgcc/config/mips/t-vr
@@ -0,0 +1,2 @@
+LIB2ADD_ST = $(srcdir)/config/mips/mips16.S \
+ $(srcdir)/config/mips/vr4120-div.S
diff --git a/gcc/config/mips/vr4120-div.S b/libgcc/config/mips/vr4120-div.S
index 79ede3de955..79ede3de955 100644
--- a/gcc/config/mips/vr4120-div.S
+++ b/libgcc/config/mips/vr4120-div.S
diff --git a/gcc/config/mmix/crti.asm b/libgcc/config/mmix/crti.S
index f5f4c5d68c4..69858046975 100644
--- a/gcc/config/mmix/crti.asm
+++ b/libgcc/config/mmix/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com>
This file is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@ Main SETL $255,32
PUT rG,$255
% Initialize the stack pointer. It is supposedly made a global
-% zero-initialized (allowed to change) register in crtn.asm; we use the
+% zero-initialized (allowed to change) register in crtn.S; we use the
% explicit number.
GETA $255,stackpp
LDOU $254,$255,0
diff --git a/gcc/config/mmix/crtn.asm b/libgcc/config/mmix/crtn.S
index c109e54db01..c109e54db01 100644
--- a/gcc/config/mmix/crtn.asm
+++ b/libgcc/config/mmix/crtn.S
diff --git a/libgcc/config/mmix/t-mmix b/libgcc/config/mmix/t-mmix
index 9d66737e256..2ee4f001ad6 100644
--- a/libgcc/config/mmix/t-mmix
+++ b/libgcc/config/mmix/t-mmix
@@ -1,14 +1,22 @@
+HOST_LIBGCC2_CFLAGS += -mlibfuncs -O2
+
+# We need to turn off some assumptions on normality for code in crtstuff.c
+# and crt{i,n}.S, specifically about execution not continuing past the
+# end of the section in the file being compiled. Thus we must stop the
+# assembler from generating stubbable PUSHJ relocs, because that will add
+# stubs at the end of the current section when necessary.
+CRTSTUFF_T_CFLAGS = -Wa,--no-stubs
+
# Don't use global registers in libraries.
# FIXME: Not applied at "root" level, so disabled at the moment to stop
# incorrect comparisons with -mabi=gnu.
#MULTILIB_EXTRA_OPTS = mno-base-addresses
-$(T)crti.o: $(gcc_srcdir)/config/mmix/crti.asm $(GCC_PASSES)
- $(crt_compile) $(INCLUDES) \
- $(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
- $(gcc_srcdir)/config/mmix/crti.asm
+# Cannot use default rules due to $(CRTSTUFF_T_CFLAGS).
+CUSTOM_CRTIN = yes
+
+crti.o: $(srcdir)/config/mmix/crti.S
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $<
-$(T)crtn.o: $(gcc_srcdir)/config/mmix/crtn.asm $(GCC_PASSES)
- $(crt_compile) $(INCLUDES) \
- $(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
- $(gcc_srcdir)/config/mmix/crtn.asm
+crtn.o: $(srcdir)/config/mmix/crtn.S
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $<
diff --git a/libgcc/config/moxie/crti.asm b/libgcc/config/moxie/crti.S
index f44582799a3..c59d3ecf0ef 100644
--- a/libgcc/config/moxie/crti.asm
+++ b/libgcc/config/moxie/crti.S
@@ -1,6 +1,6 @@
-# crti.asm for moxie
+# crti.S for moxie
#
-# Copyright (C) 2009 Free Software Foundation
+# Copyright (C) 2009, 2011 Free Software Foundation
#
# 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
@@ -25,7 +25,7 @@
# .init sections. Users may put any desired instructions in those
# sections.
- .file "crti.asm"
+ .file "crti.S"
.section ".init"
.global _init
diff --git a/libgcc/config/moxie/crtn.asm b/libgcc/config/moxie/crtn.S
index 3ac9d31eed8..4455237a602 100644
--- a/libgcc/config/moxie/crtn.asm
+++ b/libgcc/config/moxie/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for moxie
+# crtn.S for moxie
#
-# Copyright (C) 2009 Free Software Foundation
+# Copyright (C) 2009, 2011 Free Software Foundation
#
# 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
@@ -25,7 +25,7 @@
# fact return. Users may put any desired instructions in those sections.
# This file is the last thing linked into any executable.
- .file "crtn.asm"
+ .file "crtn.S"
.section ".init"
ret
diff --git a/libgcc/config/moxie/t-moxie b/libgcc/config/moxie/t-moxie
deleted file mode 100644
index 6e62aec2224..00000000000
--- a/libgcc/config/moxie/t-moxie
+++ /dev/null
@@ -1,9 +0,0 @@
-# Assemble startup files.
-
-$(T)crti.o: $(srcdir)/config/moxie/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/moxie/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/moxie/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/moxie/crtn.asm
diff --git a/gcc/config/pa/fptr.c b/libgcc/config/pa/fptr.c
index 320d18267c8..320d18267c8 100644
--- a/gcc/config/pa/fptr.c
+++ b/libgcc/config/pa/fptr.c
diff --git a/gcc/gthr-dce.h b/libgcc/config/pa/gthr-dce.h
index d32155a9352..d32155a9352 100644
--- a/gcc/gthr-dce.h
+++ b/libgcc/config/pa/gthr-dce.h
diff --git a/gcc/config/pa/lib2funcs.asm b/libgcc/config/pa/lib2funcs.S
index 8aa398c8797..8aa398c8797 100644
--- a/gcc/config/pa/lib2funcs.asm
+++ b/libgcc/config/pa/lib2funcs.S
diff --git a/gcc/config/pa/linux-atomic.c b/libgcc/config/pa/linux-atomic.c
index 2ae2426357a..2ae2426357a 100644
--- a/gcc/config/pa/linux-atomic.c
+++ b/libgcc/config/pa/linux-atomic.c
diff --git a/gcc/config/pa/milli64.S b/libgcc/config/pa/milli64.S
index 2e9c4f741b6..2e9c4f741b6 100644
--- a/gcc/config/pa/milli64.S
+++ b/libgcc/config/pa/milli64.S
diff --git a/gcc/config/pa/quadlib.c b/libgcc/config/pa/quadlib.c
index 2c1160015ed..2c1160015ed 100644
--- a/gcc/config/pa/quadlib.c
+++ b/libgcc/config/pa/quadlib.c
diff --git a/gcc/config/pa/stublib.c b/libgcc/config/pa/stublib.c
index d3cf559c8ab..d3cf559c8ab 100644
--- a/gcc/config/pa/stublib.c
+++ b/libgcc/config/pa/stublib.c
diff --git a/libgcc/config/pa/t-hpux b/libgcc/config/pa/t-hpux
new file mode 100644
index 00000000000..fcf93aba3ab
--- /dev/null
+++ b/libgcc/config/pa/t-hpux
@@ -0,0 +1,3 @@
+LIB2ADD = $(srcdir)/config/pa/lib2funcs.S $(srcdir)/config/pa/quadlib.c
+
+HOST_LIBGCC2_CFLAGS += -frandom-seed=fixed-seed
diff --git a/libgcc/config/pa/t-hpux10 b/libgcc/config/pa/t-hpux10
new file mode 100644
index 00000000000..5620f314a62
--- /dev/null
+++ b/libgcc/config/pa/t-hpux10
@@ -0,0 +1 @@
+HOST_LIBGCC2_CFLAGS += -D_T_HPUX10
diff --git a/libgcc/config/pa/t-linux b/libgcc/config/pa/t-linux
new file mode 100644
index 00000000000..2157de9b007
--- /dev/null
+++ b/libgcc/config/pa/t-linux
@@ -0,0 +1,10 @@
+#Plug millicode routines into libgcc.a We want these on both native and
+#cross compiles. We use the "64-bit" routines because the "32-bit" code
+#is broken for certain corner cases.
+LIB1ASMSRC = pa/milli64.S
+LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall
+
+HOST_LIBGCC2_CFLAGS += -DELF=1 -DLINUX=1
+
+LIB2ADD = $(srcdir)/config/pa/fptr.c
+LIB2ADD_ST = $(srcdir)/config/pa/linux-atomic.c
diff --git a/libgcc/config/pa/t-linux64 b/libgcc/config/pa/t-linux64
new file mode 100644
index 00000000000..1d0a6ada1a1
--- /dev/null
+++ b/libgcc/config/pa/t-linux64
@@ -0,0 +1,8 @@
+# Plug millicode routines into libgcc.a We want these on both native and
+# cross compiles.
+# FIXME: Explain.
+LIB1ASMFUNCS := $(filter-out _dyncall, $(LIB1ASMFUNCS))
+
+LIB2ADD_ST = $(srcdir)/config/pa/linux-atomic.c
+
+HOST_LIBGCC2_CFLAGS += -Dpa64=1 -DELF=1
diff --git a/libgcc/config/pa/t-pa64 b/libgcc/config/pa/t-pa64
new file mode 100644
index 00000000000..98f28edb1c6
--- /dev/null
+++ b/libgcc/config/pa/t-pa64
@@ -0,0 +1,3 @@
+LIB2ADD = $(srcdir)/config/pa/quadlib.c
+
+HOST_LIBGCC2_CFLAGS += -Dpa64=1 -DELF=1 -mlong-calls
diff --git a/gcc/config/pa/t-slibgcc-dwarf-ver b/libgcc/config/pa/t-slibgcc-dwarf-ver
index fa4688d6994..fa4688d6994 100644
--- a/gcc/config/pa/t-slibgcc-dwarf-ver
+++ b/libgcc/config/pa/t-slibgcc-dwarf-ver
diff --git a/gcc/config/sh/t-netbsd b/libgcc/config/pa/t-slibgcc-hpux
index 11bfe31458e..d7ed64a8652 100644
--- a/gcc/config/sh/t-netbsd
+++ b/libgcc/config/pa/t-slibgcc-hpux
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2004, 2009, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2011
+# Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,9 +17,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-TARGET_LIBGCC2_CFLAGS = -fpic -mieee
-LIB1ASMFUNCS_CACHE = _ic_invalidate
+# Build a shared libgcc library with the HP-UX linker on PA.
-LIB2FUNCS_EXTRA=
-
-EXTRA_MULTILIB_PARTS=
+SHLIB_EXT = .sl
+SHLIB_SOLINK = @shlib_base_name@$(SHLIB_EXT)
+SHLIB_SONAME = @shlib_base_name@.$(SHLIB_SOVERSION)
+SHLIB_LC =
diff --git a/gcc/config/pa/t-slibgcc-sjlj-ver b/libgcc/config/pa/t-slibgcc-sjlj-ver
index 00140cf204f..00140cf204f 100644
--- a/gcc/config/pa/t-slibgcc-sjlj-ver
+++ b/libgcc/config/pa/t-slibgcc-sjlj-ver
diff --git a/libgcc/config/pa/t-stublib b/libgcc/config/pa/t-stublib
new file mode 100644
index 00000000000..017998ff689
--- /dev/null
+++ b/libgcc/config/pa/t-stublib
@@ -0,0 +1,21 @@
+LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
+ pthread_mutex_lock-stub.o \
+ pthread_mutex_unlock-stub.o \
+ pthread_once-stub.o
+
+pthread_default_stacksize_np-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_pthread_default_stacksize_np $<
+
+pthread_mutex_lock-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_pthread_mutex_lock $<
+
+pthread_mutex_unlock-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_pthread_mutex_unlock $<
+
+pthread_once-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_pthread_once $<
+
+libgcc_stub.a: $(LIBGCCSTUB_OBJS)
+ -rm -rf $@
+ $(AR) rc $@ $<
+ $(RANLIB) $@
diff --git a/libgcc/config/pa/t-stublib64 b/libgcc/config/pa/t-stublib64
new file mode 100644
index 00000000000..5d0d9682abf
--- /dev/null
+++ b/libgcc/config/pa/t-stublib64
@@ -0,0 +1,13 @@
+LIBGCCSTUB_OBJS += rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o
+
+rfi-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_register_frame_info $<
+
+dfi-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_deregister_frame_info $<
+
+cxaf-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_cxa_finalize $<
+
+jvrc-stub.o: $(srcdir)/config/pa/stublib.c
+ $(gcc_compile) -c -O2 -DL_Jv_RegisterClasses $<
diff --git a/libgcc/config/pdp11/t-pdp11 b/libgcc/config/pdp11/t-pdp11
new file mode 100644
index 00000000000..7cadae11a2a
--- /dev/null
+++ b/libgcc/config/pdp11/t-pdp11
@@ -0,0 +1,8 @@
+LIB2ADD = $(srcdir)/udivmod.c \
+ $(srcdir)/udivmodsi4.c \
+ $(srcdir)/memcmp.c \
+ $(srcdir)/memcpy.c \
+ $(srcdir)/memmove.c \
+ $(srcdir)/memset.c
+
+HOST_LIBGCC2_CFLAGS += -O2 -mfloat32
diff --git a/gcc/config/picochip/libgccExtras/adddi3.asm b/libgcc/config/picochip/adddi3.S
index 77373ed9f64..77373ed9f64 100644
--- a/gcc/config/picochip/libgccExtras/adddi3.asm
+++ b/libgcc/config/picochip/adddi3.S
diff --git a/gcc/config/picochip/libgccExtras/ashlsi3.asm b/libgcc/config/picochip/ashlsi3.S
index 688cd8d96ff..688cd8d96ff 100644
--- a/gcc/config/picochip/libgccExtras/ashlsi3.asm
+++ b/libgcc/config/picochip/ashlsi3.S
diff --git a/gcc/config/picochip/libgccExtras/ashlsi3.c b/libgcc/config/picochip/ashlsi3.c
index 600461c0b83..600461c0b83 100644
--- a/gcc/config/picochip/libgccExtras/ashlsi3.c
+++ b/libgcc/config/picochip/ashlsi3.c
diff --git a/gcc/config/picochip/libgccExtras/ashrsi3.asm b/libgcc/config/picochip/ashrsi3.S
index fddd70b6895..fddd70b6895 100644
--- a/gcc/config/picochip/libgccExtras/ashrsi3.asm
+++ b/libgcc/config/picochip/ashrsi3.S
diff --git a/gcc/config/picochip/libgccExtras/ashrsi3.c b/libgcc/config/picochip/ashrsi3.c
index 4f1567b1347..4f1567b1347 100644
--- a/gcc/config/picochip/libgccExtras/ashrsi3.c
+++ b/libgcc/config/picochip/ashrsi3.c
diff --git a/gcc/config/picochip/libgccExtras/clzsi2.asm b/libgcc/config/picochip/clzsi2.S
index 835d4694167..d5c99aa7154 100644
--- a/gcc/config/picochip/libgccExtras/clzsi2.asm
+++ b/libgcc/config/picochip/clzsi2.S
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2011 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -22,7 +22,7 @@
// <http://www.gnu.org/licenses/>.
// picoChip ASM file
-//.file "clzsi2.asm"
+//.file "clzsi2.S"
.section .text
diff --git a/gcc/config/picochip/libgccExtras/cmpsi2.asm b/libgcc/config/picochip/cmpsi2.S
index 95322f32419..95322f32419 100644
--- a/gcc/config/picochip/libgccExtras/cmpsi2.asm
+++ b/libgcc/config/picochip/cmpsi2.S
diff --git a/gcc/config/picochip/libgccExtras/divmod15.asm b/libgcc/config/picochip/divmod15.S
index d314b3be570..d314b3be570 100644
--- a/gcc/config/picochip/libgccExtras/divmod15.asm
+++ b/libgcc/config/picochip/divmod15.S
diff --git a/gcc/config/picochip/libgccExtras/divmodhi4.asm b/libgcc/config/picochip/divmodhi4.S
index 9dad674c7bc..9dad674c7bc 100644
--- a/gcc/config/picochip/libgccExtras/divmodhi4.asm
+++ b/libgcc/config/picochip/divmodhi4.S
diff --git a/gcc/config/picochip/libgccExtras/divmodsi4.asm b/libgcc/config/picochip/divmodsi4.S
index 4fc1acb1b63..4fc1acb1b63 100644
--- a/gcc/config/picochip/libgccExtras/divmodsi4.asm
+++ b/libgcc/config/picochip/divmodsi4.S
diff --git a/libgcc/config/picochip/lib1funcs.S b/libgcc/config/picochip/lib1funcs.S
new file mode 100644
index 00000000000..d344170d248
--- /dev/null
+++ b/libgcc/config/picochip/lib1funcs.S
@@ -0,0 +1,4 @@
+// picoChip ASM file
+// Fake libgcc asm file. This contains nothing, but is used to prevent gcc
+// getting upset about the lack of a lib1funcs.S file when LIB1ASMFUNCS is
+// defined to switch off the compilation of parts of libgcc.
diff --git a/gcc/config/picochip/libgccExtras/longjmp.asm b/libgcc/config/picochip/longjmp.S
index d2a80aca730..d2a80aca730 100644
--- a/gcc/config/picochip/libgccExtras/longjmp.asm
+++ b/libgcc/config/picochip/longjmp.S
diff --git a/gcc/config/picochip/libgccExtras/lshrsi3.asm b/libgcc/config/picochip/lshrsi3.S
index 4fc53902955..4fc53902955 100644
--- a/gcc/config/picochip/libgccExtras/lshrsi3.asm
+++ b/libgcc/config/picochip/lshrsi3.S
diff --git a/gcc/config/picochip/libgccExtras/lshrsi3.c b/libgcc/config/picochip/lshrsi3.c
index fa32dc726ef..fa32dc726ef 100644
--- a/gcc/config/picochip/libgccExtras/lshrsi3.c
+++ b/libgcc/config/picochip/lshrsi3.c
diff --git a/gcc/config/picochip/libgccExtras/parityhi2.asm b/libgcc/config/picochip/parityhi2.S
index b9d0cdc63dd..b9d0cdc63dd 100644
--- a/gcc/config/picochip/libgccExtras/parityhi2.asm
+++ b/libgcc/config/picochip/parityhi2.S
diff --git a/gcc/config/picochip/libgccExtras/popcounthi2.asm b/libgcc/config/picochip/popcounthi2.S
index 2da618c96de..2da618c96de 100644
--- a/gcc/config/picochip/libgccExtras/popcounthi2.asm
+++ b/libgcc/config/picochip/popcounthi2.S
diff --git a/gcc/config/picochip/libgccExtras/setjmp.asm b/libgcc/config/picochip/setjmp.S
index 247c715f6a9..247c715f6a9 100644
--- a/gcc/config/picochip/libgccExtras/setjmp.asm
+++ b/libgcc/config/picochip/setjmp.S
diff --git a/gcc/config/picochip/libgccExtras/subdi3.asm b/libgcc/config/picochip/subdi3.S
index d1c833ea824..d1c833ea824 100644
--- a/gcc/config/picochip/libgccExtras/subdi3.asm
+++ b/libgcc/config/picochip/subdi3.S
diff --git a/libgcc/config/picochip/t-picochip b/libgcc/config/picochip/t-picochip
index 5135d500cbb..4de5dbbdcd3 100644
--- a/libgcc/config/picochip/t-picochip
+++ b/libgcc/config/picochip/t-picochip
@@ -1,2 +1,39 @@
+# Prevent some of the more complicated libgcc functions from being
+# compiled. This is because they are generally too big to fit into an
+# AE anyway, so there is no point in having them. Also, some don't
+# compile properly so we'll ignore them for the moment.
+LIB1ASMSRC = picochip/lib1funcs.S
+LIB1ASMFUNCS = _mulsc3 _divsc3
+
+# Compile the extra library functions.
+LIB2ADD = \
+ $(srcdir)/config/picochip/ashrsi3.S \
+ $(srcdir)/config/picochip/ashlsi3.S \
+ $(srcdir)/config/picochip/divmodhi4.S \
+ $(srcdir)/config/picochip/udivmodhi4.S \
+ $(srcdir)/config/picochip/divmodsi4.S \
+ $(srcdir)/config/picochip/udivmodsi4.S \
+ $(srcdir)/config/picochip/divmod15.S \
+ $(srcdir)/config/picochip/ucmpsi2.S \
+ $(srcdir)/config/picochip/cmpsi2.S \
+ $(srcdir)/config/picochip/clzsi2.S \
+ $(srcdir)/config/picochip/adddi3.S \
+ $(srcdir)/config/picochip/subdi3.S \
+ $(srcdir)/config/picochip/lshrsi3.S \
+ $(srcdir)/config/picochip/parityhi2.S \
+ $(srcdir)/config/picochip/popcounthi2.S
+
+# Special libgcc setup. Make single/double floating point the same,
+# and use our own include files.
+HOST_LIBGCC2_CFLAGS += -DDF=SF -I../../includes/
+
+# Switch off all debugging for the embedded libraries.
+# (embedded processors need small libraries by default).
+# NOTE: If the debug level is increased, turn off instruction scheduling.
+LIBGCC2_DEBUG_CFLAGS = -g0
+
# Turn off the building of exception handling libraries.
LIB2ADDEH =
+
+# Turn off ranlib on target libraries.
+RANLIB_FOR_TARGET = cat
diff --git a/gcc/config/picochip/libgccExtras/ucmpsi2.asm b/libgcc/config/picochip/ucmpsi2.S
index 10c03cfcd6e..10c03cfcd6e 100644
--- a/gcc/config/picochip/libgccExtras/ucmpsi2.asm
+++ b/libgcc/config/picochip/ucmpsi2.S
diff --git a/gcc/config/picochip/libgccExtras/udivmodhi4.asm b/libgcc/config/picochip/udivmodhi4.S
index ac16fae39cf..ac16fae39cf 100644
--- a/gcc/config/picochip/libgccExtras/udivmodhi4.asm
+++ b/libgcc/config/picochip/udivmodhi4.S
diff --git a/gcc/config/picochip/libgccExtras/udivmodsi4.asm b/libgcc/config/picochip/udivmodsi4.S
index 92c2a4983ce..92c2a4983ce 100644
--- a/gcc/config/picochip/libgccExtras/udivmodsi4.asm
+++ b/libgcc/config/picochip/udivmodsi4.S
diff --git a/gcc/config/rs6000/crtresfpr.asm b/libgcc/config/rs6000/crtresfpr.S
index 9fb228cf458..9fb228cf458 100644
--- a/gcc/config/rs6000/crtresfpr.asm
+++ b/libgcc/config/rs6000/crtresfpr.S
diff --git a/gcc/config/rs6000/crtresgpr.asm b/libgcc/config/rs6000/crtresgpr.S
index 9f9cec9f9ca..9f9cec9f9ca 100644
--- a/gcc/config/rs6000/crtresgpr.asm
+++ b/libgcc/config/rs6000/crtresgpr.S
diff --git a/gcc/config/rs6000/crtresxfpr.asm b/libgcc/config/rs6000/crtresxfpr.S
index 633f2db61f0..633f2db61f0 100644
--- a/gcc/config/rs6000/crtresxfpr.asm
+++ b/libgcc/config/rs6000/crtresxfpr.S
diff --git a/gcc/config/rs6000/crtresxgpr.asm b/libgcc/config/rs6000/crtresxgpr.S
index 451b2b69d1e..451b2b69d1e 100644
--- a/gcc/config/rs6000/crtresxgpr.asm
+++ b/libgcc/config/rs6000/crtresxgpr.S
diff --git a/gcc/config/rs6000/crtsavfpr.asm b/libgcc/config/rs6000/crtsavfpr.S
index 3cdb25033ca..3cdb25033ca 100644
--- a/gcc/config/rs6000/crtsavfpr.asm
+++ b/libgcc/config/rs6000/crtsavfpr.S
diff --git a/gcc/config/rs6000/crtsavgpr.asm b/libgcc/config/rs6000/crtsavgpr.S
index 6d473963bad..6d473963bad 100644
--- a/gcc/config/rs6000/crtsavgpr.asm
+++ b/libgcc/config/rs6000/crtsavgpr.S
diff --git a/gcc/config/rs6000/darwin-asm.h b/libgcc/config/rs6000/darwin-asm.h
index 837b7a33ef8..837b7a33ef8 100644
--- a/gcc/config/rs6000/darwin-asm.h
+++ b/libgcc/config/rs6000/darwin-asm.h
diff --git a/libgcc/config/rs6000/darwin-fallback.c b/libgcc/config/rs6000/darwin-fallback.c
index 4591071ea74..a61ea0b9ca2 100644
--- a/libgcc/config/rs6000/darwin-fallback.c
+++ b/libgcc/config/rs6000/darwin-fallback.c
@@ -1,5 +1,5 @@
/* Fallback frame-state unwinder for Darwin.
- Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "dwarf2.h"
#include "unwind.h"
#include "unwind-dw2.h"
diff --git a/gcc/config/rs6000/darwin-fpsave.asm b/libgcc/config/rs6000/darwin-fpsave.S
index 47fdc92f860..47fdc92f860 100644
--- a/gcc/config/rs6000/darwin-fpsave.asm
+++ b/libgcc/config/rs6000/darwin-fpsave.S
diff --git a/gcc/config/rs6000/darwin-gpsave.asm b/libgcc/config/rs6000/darwin-gpsave.S
index d3c3b912d27..d3c3b912d27 100644
--- a/gcc/config/rs6000/darwin-gpsave.asm
+++ b/libgcc/config/rs6000/darwin-gpsave.S
diff --git a/gcc/config/rs6000/darwin-tramp.asm b/libgcc/config/rs6000/darwin-tramp.S
index 5188c98ef05..5188c98ef05 100644
--- a/gcc/config/rs6000/darwin-tramp.asm
+++ b/libgcc/config/rs6000/darwin-tramp.S
diff --git a/gcc/config/rs6000/darwin-vecsave.asm b/libgcc/config/rs6000/darwin-vecsave.S
index 0a46be20c89..0a46be20c89 100644
--- a/gcc/config/rs6000/darwin-vecsave.asm
+++ b/libgcc/config/rs6000/darwin-vecsave.S
diff --git a/gcc/config/rs6000/darwin-world.asm b/libgcc/config/rs6000/darwin-world.S
index c0b1bf1a2b1..c0b1bf1a2b1 100644
--- a/gcc/config/rs6000/darwin-world.asm
+++ b/libgcc/config/rs6000/darwin-world.S
diff --git a/gcc/config/rs6000/e500crtres32gpr.asm b/libgcc/config/rs6000/e500crtres32gpr.S
index 6fbff820b88..6fbff820b88 100644
--- a/gcc/config/rs6000/e500crtres32gpr.asm
+++ b/libgcc/config/rs6000/e500crtres32gpr.S
diff --git a/gcc/config/rs6000/e500crtres64gpr.asm b/libgcc/config/rs6000/e500crtres64gpr.S
index 5182e55392d..5182e55392d 100644
--- a/gcc/config/rs6000/e500crtres64gpr.asm
+++ b/libgcc/config/rs6000/e500crtres64gpr.S
diff --git a/gcc/config/rs6000/e500crtres64gprctr.asm b/libgcc/config/rs6000/e500crtres64gprctr.S
index 74309d6bed6..74309d6bed6 100644
--- a/gcc/config/rs6000/e500crtres64gprctr.asm
+++ b/libgcc/config/rs6000/e500crtres64gprctr.S
diff --git a/gcc/config/rs6000/e500crtrest32gpr.asm b/libgcc/config/rs6000/e500crtrest32gpr.S
index 4e61010dcff..4e61010dcff 100644
--- a/gcc/config/rs6000/e500crtrest32gpr.asm
+++ b/libgcc/config/rs6000/e500crtrest32gpr.S
diff --git a/gcc/config/rs6000/e500crtrest64gpr.asm b/libgcc/config/rs6000/e500crtrest64gpr.S
index 090786fdc71..090786fdc71 100644
--- a/gcc/config/rs6000/e500crtrest64gpr.asm
+++ b/libgcc/config/rs6000/e500crtrest64gpr.S
diff --git a/gcc/config/rs6000/e500crtresx32gpr.asm b/libgcc/config/rs6000/e500crtresx32gpr.S
index 0b35245df42..0b35245df42 100644
--- a/gcc/config/rs6000/e500crtresx32gpr.asm
+++ b/libgcc/config/rs6000/e500crtresx32gpr.S
diff --git a/gcc/config/rs6000/e500crtresx64gpr.asm b/libgcc/config/rs6000/e500crtresx64gpr.S
index ce2a6cfa2aa..ce2a6cfa2aa 100644
--- a/gcc/config/rs6000/e500crtresx64gpr.asm
+++ b/libgcc/config/rs6000/e500crtresx64gpr.S
diff --git a/gcc/config/rs6000/e500crtsav32gpr.asm b/libgcc/config/rs6000/e500crtsav32gpr.S
index c891030507e..c891030507e 100644
--- a/gcc/config/rs6000/e500crtsav32gpr.asm
+++ b/libgcc/config/rs6000/e500crtsav32gpr.S
diff --git a/gcc/config/rs6000/e500crtsav64gpr.asm b/libgcc/config/rs6000/e500crtsav64gpr.S
index 2a5d3e475fd..2a5d3e475fd 100644
--- a/gcc/config/rs6000/e500crtsav64gpr.asm
+++ b/libgcc/config/rs6000/e500crtsav64gpr.S
diff --git a/gcc/config/rs6000/e500crtsav64gprctr.asm b/libgcc/config/rs6000/e500crtsav64gprctr.S
index dd0bdf3c89a..dd0bdf3c89a 100644
--- a/gcc/config/rs6000/e500crtsav64gprctr.asm
+++ b/libgcc/config/rs6000/e500crtsav64gprctr.S
diff --git a/gcc/config/rs6000/e500crtsavg32gpr.asm b/libgcc/config/rs6000/e500crtsavg32gpr.S
index d14088e0dec..d14088e0dec 100644
--- a/gcc/config/rs6000/e500crtsavg32gpr.asm
+++ b/libgcc/config/rs6000/e500crtsavg32gpr.S
diff --git a/gcc/config/rs6000/e500crtsavg64gpr.asm b/libgcc/config/rs6000/e500crtsavg64gpr.S
index cbad75bc053..cbad75bc053 100644
--- a/gcc/config/rs6000/e500crtsavg64gpr.asm
+++ b/libgcc/config/rs6000/e500crtsavg64gpr.S
diff --git a/gcc/config/rs6000/e500crtsavg64gprctr.asm b/libgcc/config/rs6000/e500crtsavg64gprctr.S
index 238df4e8319..238df4e8319 100644
--- a/gcc/config/rs6000/e500crtsavg64gprctr.asm
+++ b/libgcc/config/rs6000/e500crtsavg64gprctr.S
diff --git a/gcc/config/rs6000/eabi-ci.asm b/libgcc/config/rs6000/eabi-ci.S
index 696f33d394f..696f33d394f 100644
--- a/gcc/config/rs6000/eabi-ci.asm
+++ b/libgcc/config/rs6000/eabi-ci.S
diff --git a/gcc/config/rs6000/eabi-cn.asm b/libgcc/config/rs6000/eabi-cn.S
index 68774097c7c..68774097c7c 100644
--- a/gcc/config/rs6000/eabi-cn.asm
+++ b/libgcc/config/rs6000/eabi-cn.S
diff --git a/gcc/config/rs6000/eabi.asm b/libgcc/config/rs6000/eabi.S
index 292d88e5016..292d88e5016 100644
--- a/gcc/config/rs6000/eabi.asm
+++ b/libgcc/config/rs6000/eabi.S
diff --git a/gcc/gthr-aix.h b/libgcc/config/rs6000/gthr-aix.h
index 6827e8f316d..3681af4257e 100644
--- a/gcc/gthr-aix.h
+++ b/libgcc/config/rs6000/gthr-aix.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/config/rs6000/darwin-libgcc.10.4.ver b/libgcc/config/rs6000/libgcc-darwin.10.4.ver
index 0c6f7c23156..0c6f7c23156 100644
--- a/gcc/config/rs6000/darwin-libgcc.10.4.ver
+++ b/libgcc/config/rs6000/libgcc-darwin.10.4.ver
diff --git a/gcc/config/rs6000/darwin-libgcc.10.5.ver b/libgcc/config/rs6000/libgcc-darwin.10.5.ver
index c2f08924fd7..c2f08924fd7 100644
--- a/gcc/config/rs6000/darwin-libgcc.10.5.ver
+++ b/libgcc/config/rs6000/libgcc-darwin.10.5.ver
diff --git a/libgcc/config/rs6000/libgcc-ppc-glibc.ver b/libgcc/config/rs6000/libgcc-glibc.ver
index 8862c14cb3d..8862c14cb3d 100644
--- a/libgcc/config/rs6000/libgcc-ppc-glibc.ver
+++ b/libgcc/config/rs6000/libgcc-glibc.ver
diff --git a/libgcc/config/rs6000/libgcc-ppc64.ver b/libgcc/config/rs6000/libgcc-ibm-ldouble.ver
index b27b4b49249..b27b4b49249 100644
--- a/libgcc/config/rs6000/libgcc-ppc64.ver
+++ b/libgcc/config/rs6000/libgcc-ibm-ldouble.ver
diff --git a/gcc/config/rs6000/sol-ci.asm b/libgcc/config/rs6000/sol-ci.S
index 7c2fbae9747..7c2fbae9747 100644
--- a/gcc/config/rs6000/sol-ci.asm
+++ b/libgcc/config/rs6000/sol-ci.S
diff --git a/gcc/config/rs6000/sol-cn.asm b/libgcc/config/rs6000/sol-cn.S
index 4aeacaf2cff..4aeacaf2cff 100644
--- a/gcc/config/rs6000/sol-cn.asm
+++ b/libgcc/config/rs6000/sol-cn.S
diff --git a/libgcc/config/rs6000/t-crtstuff b/libgcc/config/rs6000/t-crtstuff
new file mode 100644
index 00000000000..7422d383754
--- /dev/null
+++ b/libgcc/config/rs6000/t-crtstuff
@@ -0,0 +1,3 @@
+# If .sdata is enabled __CTOR_{LIST,END}__ go into .sdata instead of
+# .ctors.
+CRTSTUFF_T_CFLAGS = -msdata=none
diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin
index 4464fd7d6e6..abb41fc9bce 100644
--- a/libgcc/config/rs6000/t-darwin
+++ b/libgcc/config/rs6000/t-darwin
@@ -3,8 +3,21 @@ DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4
crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c
$(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $<
-LIB2ADD += $(srcdir)/config/rs6000/ppc64-fp.c
+LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \
+ $(srcdir)/config/darwin-64.c \
+ $(srcdir)/config/rs6000/darwin-fpsave.S \
+ $(srcdir)/config/rs6000/darwin-gpsave.S \
+ $(srcdir)/config/rs6000/darwin-world.S \
+ $(srcdir)/config/rs6000/ppc64-fp.c
-LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
+LIB2ADD_ST = \
+ $(srcdir)/config/rs6000/darwin-vecsave.S
+
+# The .S files above are designed to run on all processors, even though
+# they use AltiVec instructions.
+# -Wa is used because -force_cpusubtype_ALL doesn't work with -dynamiclib.
+# -mmacosx-version-min=10.4 is used to provide compatibility for code from
+# earlier OSX versions.
+HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4
-SHLIB_VERPFX = $(gcc_srcdir)/config/rs6000/darwin-libgcc
+LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
diff --git a/libgcc/config/rs6000/t-darwin64 b/libgcc/config/rs6000/t-darwin64
new file mode 100644
index 00000000000..eea0671f3b5
--- /dev/null
+++ b/libgcc/config/rs6000/t-darwin64
@@ -0,0 +1,6 @@
+LIB2_SIDITI_CONV_FUNCS = yes
+
+LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \
+ $(srcdir)/config/darwin-64.c \
+ $(srcdir)/config/rs6000/darwin-world.S
+
diff --git a/libgcc/config/rs6000/t-ibm-ldouble b/libgcc/config/rs6000/t-ibm-ldouble
index 3f7a2d847e2..b13278498ec 100644
--- a/libgcc/config/rs6000/t-ibm-ldouble
+++ b/libgcc/config/rs6000/t-ibm-ldouble
@@ -3,4 +3,4 @@ LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
HOST_LIBGCC2_CFLAGS += -mlong-double-128
-SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
+SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ibm-ldouble.ver
diff --git a/libgcc/config/rs6000/t-ldbl128 b/libgcc/config/rs6000/t-ldbl128
deleted file mode 100644
index ecc3581b1a0..00000000000
--- a/libgcc/config/rs6000/t-ldbl128
+++ /dev/null
@@ -1,3 +0,0 @@
-SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc-glibc.ver
-
-HOST_LIBGCC2_CFLAGS += -mlong-double-128
diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
new file mode 100644
index 00000000000..dcf7ffc255e
--- /dev/null
+++ b/libgcc/config/rs6000/t-linux
@@ -0,0 +1,3 @@
+SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
+
+HOST_LIBGCC2_CFLAGS += -mlong-double-128
diff --git a/libgcc/config/rs6000/t-linux64 b/libgcc/config/rs6000/t-linux64
index 7b08315abc0..2b60f1a1f43 100644
--- a/libgcc/config/rs6000/t-linux64
+++ b/libgcc/config/rs6000/t-linux64
@@ -1,2 +1,4 @@
+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
+
softfp_wrap_start := '\#ifndef __powerpc64__'
softfp_wrap_end := '\#endif'
diff --git a/libgcc/config/rs6000/t-lynx b/libgcc/config/rs6000/t-lynx
new file mode 100644
index 00000000000..af7f5982b9c
--- /dev/null
+++ b/libgcc/config/rs6000/t-lynx
@@ -0,0 +1 @@
+LIB2ADD = $(srcdir)/config/rs6000/tramp.S
diff --git a/libgcc/config/rs6000/t-netbsd b/libgcc/config/rs6000/t-netbsd
new file mode 100644
index 00000000000..3b4ba32a215
--- /dev/null
+++ b/libgcc/config/rs6000/t-netbsd
@@ -0,0 +1,9 @@
+LIB2ADD = $(srcdir)/config/rs6000/tramp.S
+
+LIB2ADD_ST = \
+ $(srcdir)/config/rs6000/crtsavfpr.S \
+ $(srcdir)/config/rs6000/crtresfpr.S \
+ $(srcdir)/config/rs6000/crtsavgpr.S \
+ $(srcdir)/config/rs6000/crtresgpr.S \
+ $(srcdir)/config/rs6000/crtresxfpr.S \
+ $(srcdir)/config/rs6000/crtresxgpr.S
diff --git a/libgcc/config/rs6000/t-ppccomm b/libgcc/config/rs6000/t-ppccomm
index f75bee22737..e9233688268 100644
--- a/libgcc/config/rs6000/t-ppccomm
+++ b/libgcc/config/rs6000/t-ppccomm
@@ -1,107 +1,41 @@
-LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
-
-LIB2ADD_ST += crtsavfpr.S crtresfpr.S \
- crtsavgpr.S crtresgpr.S \
- crtresxfpr.S crtresxgpr.S \
- e500crtres32gpr.S \
- e500crtres64gpr.S \
- e500crtres64gprctr.S \
- e500crtrest32gpr.S \
- e500crtrest64gpr.S \
- e500crtresx32gpr.S \
- e500crtresx64gpr.S \
- e500crtsav32gpr.S \
- e500crtsav64gpr.S \
- e500crtsav64gprctr.S \
- e500crtsavg32gpr.S \
- e500crtsavg64gpr.S \
- e500crtsavg64gprctr.S
-
-EXTRA_PARTS += crtbegin$(objext) crtend$(objext) \
- crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
- ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext)
+LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c \
+ $(srcdir)/config/rs6000/tramp.S
+
+# These can't end up in shared libgcc
+LIB2ADD_ST += \
+ $(srcdir)/config/rs6000/crtsavfpr.S \
+ $(srcdir)/config/rs6000/crtresfpr.S \
+ $(srcdir)/config/rs6000/crtsavgpr.S \
+ $(srcdir)/config/rs6000/crtresgpr.S \
+ $(srcdir)/config/rs6000/crtresxfpr.S \
+ $(srcdir)/config/rs6000/crtresxgpr.S \
+ $(srcdir)/config/rs6000/e500crtres32gpr.S \
+ $(srcdir)/config/rs6000/e500crtres64gpr.S \
+ $(srcdir)/config/rs6000/e500crtres64gprctr.S \
+ $(srcdir)/config/rs6000/e500crtrest32gpr.S \
+ $(srcdir)/config/rs6000/e500crtrest64gpr.S \
+ $(srcdir)/config/rs6000/e500crtresx32gpr.S \
+ $(srcdir)/config/rs6000/e500crtresx64gpr.S \
+ $(srcdir)/config/rs6000/e500crtsav32gpr.S \
+ $(srcdir)/config/rs6000/e500crtsav64gpr.S \
+ $(srcdir)/config/rs6000/e500crtsav64gprctr.S \
+ $(srcdir)/config/rs6000/e500crtsavg32gpr.S \
+ $(srcdir)/config/rs6000/e500crtsavg64gpr.S \
+ $(srcdir)/config/rs6000/e500crtsavg64gprctr.S \
+ $(srcdir)/config/rs6000/eabi.S
# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
# end labels to all of the special sections used when we link using gcc.
# Assemble startup files.
-ecrti.S: $(gcc_srcdir)/config/rs6000/eabi-ci.asm
- cat $(gcc_srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
-
-ecrtn.S: $(gcc_srcdir)/config/rs6000/eabi-cn.asm
- cat $(gcc_srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
-
-ncrti.S: $(gcc_srcdir)/config/rs6000/sol-ci.asm
- cat $(gcc_srcdir)/config/rs6000/sol-ci.asm >ncrti.S
-
-ncrtn.S: $(gcc_srcdir)/config/rs6000/sol-cn.asm
- cat $(gcc_srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
-
-crtsavfpr.S: $(gcc_srcdir)/config/rs6000/crtsavfpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
-
-crtresfpr.S: $(gcc_srcdir)/config/rs6000/crtresfpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
-
-crtsavgpr.S: $(gcc_srcdir)/config/rs6000/crtsavgpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
-
-crtresgpr.S: $(gcc_srcdir)/config/rs6000/crtresgpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
-
-crtresxfpr.S: $(gcc_srcdir)/config/rs6000/crtresxfpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
-
-crtresxgpr.S: $(gcc_srcdir)/config/rs6000/crtresxgpr.asm
- cat $(gcc_srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
-
-e500crtres32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtres32gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtres32gpr.asm >e500crtres32gpr.S
-
-e500crtres64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtres64gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtres64gpr.asm >e500crtres64gpr.S
-
-e500crtres64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtres64gprctr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtres64gprctr.asm >e500crtres64gprctr.S
-
-e500crtrest32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtrest32gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtrest32gpr.asm >e500crtrest32gpr.S
-
-e500crtrest64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtrest64gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtrest64gpr.asm >e500crtrest64gpr.S
-
-e500crtresx32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtresx32gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtresx32gpr.asm >e500crtresx32gpr.S
-
-e500crtresx64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtresx64gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtresx64gpr.asm >e500crtresx64gpr.S
-
-e500crtsav32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsav32gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsav32gpr.asm >e500crtsav32gpr.S
-
-e500crtsav64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsav64gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsav64gpr.asm >e500crtsav64gpr.S
-
-e500crtsav64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtsav64gprctr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsav64gprctr.asm >e500crtsav64gprctr.S
-
-e500crtsavg32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg32gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsavg32gpr.asm >e500crtsavg32gpr.S
-
-e500crtsavg64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg64gpr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsavg64gpr.asm >e500crtsavg64gpr.S
-
-e500crtsavg64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm
- cat $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm >e500crtsavg64gprctr.S
-
-ecrti$(objext): ecrti.S
- $(crt_compile) -c ecrti.S
+ecrti$(objext): $(srcdir)/config/rs6000/eabi-ci.S
+ $(crt_compile) -c $<
-ecrtn$(objext): ecrtn.S
- $(crt_compile) -c ecrtn.S
+ecrtn$(objext): $(srcdir)/config/rs6000/eabi-cn.S
+ $(crt_compile) -c $<
-ncrti$(objext): ncrti.S
- $(crt_compile) -c ncrti.S
+ncrti$(objext): $(srcdir)/config/rs6000/sol-ci.S
+ $(crt_compile) -c $<
-ncrtn$(objext): ncrtn.S
- $(crt_compile) -c ncrtn.S
+ncrtn$(objext): $(srcdir)/config/rs6000/sol-cn.S
+ $(crt_compile) -c $<
diff --git a/libgcc/config/rs6000/t-slibgcc-aix b/libgcc/config/rs6000/t-slibgcc-aix
new file mode 100644
index 00000000000..a0fdd133926
--- /dev/null
+++ b/libgcc/config/rs6000/t-slibgcc-aix
@@ -0,0 +1,44 @@
+# Copyright (C) 2002, 2003, 2004, 2005, 2006,
+# 2008, 2011 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/>.
+
+# Build a shared libgcc library.
+SHLIB_EXT = .a
+SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
+ @multilib_flags@ @shlib_objs@ -lc \
+ `case @multilib_dir@ in \
+ *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
+ *) echo -lc ;; esac` ; \
+ rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
+ $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/shr.o ; \
+ mv @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/@shlib_base_name@.a ; \
+ rm -f @multilib_dir@/shr.o
+SHLIB_INSTALL = \
+ $(mkinstalldirs) $(DESTDIR)$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
+ $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/
+SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+SHLIB_MAPFILES = libgcc-std.ver
+SHLIB_NM_FLAGS = -Bpg -X32_64
+
+# Either 32-bit and 64-bit objects in archives.
+AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/tramp.asm b/libgcc/config/rs6000/tramp.S
index 133b98840f1..133b98840f1 100644
--- a/gcc/config/rs6000/tramp.asm
+++ b/libgcc/config/rs6000/tramp.S
diff --git a/gcc/gthr-tpf.h b/libgcc/config/s390/gthr-tpf.h
index fb23e91cfcd..fb23e91cfcd 100644
--- a/gcc/gthr-tpf.h
+++ b/libgcc/config/s390/gthr-tpf.h
diff --git a/libgcc/config/s390/t-crtstuff b/libgcc/config/s390/t-crtstuff
index 92e87b2da7e..f90e35b7220 100644
--- a/libgcc/config/s390/t-crtstuff
+++ b/libgcc/config/s390/t-crtstuff
@@ -2,5 +2,4 @@
# because then __FRAME_END__ might not be the last thing in .eh_frame
# section.
CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables
-CRTSTUFF_T_CFLAGS_S += -fno-asynchronous-unwind-tables
-
+CRTSTUFF_T_CFLAGS_S += -fno-asynchronous-unwind-tables -fPIC
diff --git a/libgcc/config/s390/t-tpf b/libgcc/config/s390/t-tpf
deleted file mode 100644
index 9d416acc12d..00000000000
--- a/libgcc/config/s390/t-tpf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Compile libgcc2.a with pic.
-HOST_LIBGCC2_CFLAGS += -fPIC
diff --git a/gcc/config/score/crti.asm b/libgcc/config/score/crti.S
index 4cd00cf9914..8e7c78b978b 100644
--- a/gcc/config/score/crti.asm
+++ b/libgcc/config/score/crti.S
@@ -1,6 +1,6 @@
-# crti.asm for Sunplus S+CORE
+# crti.S for Sunplus S+CORE
#
-# Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2009, 2010, 2011 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
diff --git a/gcc/config/score/crtn.asm b/libgcc/config/score/crtn.S
index 8132388a0c7..adf4eb08400 100644
--- a/gcc/config/score/crtn.asm
+++ b/libgcc/config/score/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for Sunplus S+CORE
+# crtn.S for Sunplus S+CORE
-# Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2009, 2010, 2011 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
diff --git a/gcc/config/sh/crt1.asm b/libgcc/config/sh/crt1.S
index e2857904f86..ce09a09458f 100644
--- a/gcc/config/sh/crt1.asm
+++ b/libgcc/config/sh/crt1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009
+/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009, 2011
Free Software Foundation, Inc.
This file was pretty much copied from newlib.
@@ -36,7 +36,7 @@ __timer_stack:
#endif /* MMU_SUPPORT */
/* ;----------------------------------------
- Normal newlib crt1.asm */
+ Normal newlib crt1.S */
#ifdef __SH5__
.section .data,"aw"
diff --git a/gcc/config/sh/crti.asm b/libgcc/config/sh/crti.S
index ef5cd719d82..a8e4f8bed22 100644
--- a/gcc/config/sh/crti.asm
+++ b/libgcc/config/sh/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2009, 2011 Free Software Foundation, Inc.
This file was adapted from glibc sources.
This file is part of GCC.
@@ -25,11 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The code in sections .init and .fini is supposed to be a single
regular function. The function in .init is called directly from
- start in crt1.asm. The function in .fini is atexit()ed in crt1.asm
+ start in crt1.S. The function in .fini is atexit()ed in crt1.S
too.
- crti.asm contributes the prologue of a function to these sections,
- and crtn.asm comes up the epilogue. STARTFILE_SPEC should list
+ crti.S contributes the prologue of a function to these sections,
+ and crtn.S comes up the epilogue. STARTFILE_SPEC should list
crti.o before any other object files that might add code to .init
or .fini sections, and ENDFILE_SPEC should list crtn.o after any
such object files. */
diff --git a/gcc/config/sh/crtn.asm b/libgcc/config/sh/crtn.S
index 670d90f7b6a..d2f58c01b1b 100644
--- a/gcc/config/sh/crtn.asm
+++ b/libgcc/config/sh/crtn.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2009, 2011 Free Software Foundation, Inc.
This file was adapted from glibc sources.
This file is part of GCC.
@@ -22,7 +22,7 @@ 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/>. */
-/* See an explanation about .init and .fini in crti.asm. */
+/* See an explanation about .init and .fini in crti.S. */
.section .init
#if __SHMEDIA__
diff --git a/gcc/config/sh/lib1funcs-4-300.asm b/libgcc/config/sh/lib1funcs-4-300.S
index b131877f121..b131877f121 100644
--- a/gcc/config/sh/lib1funcs-4-300.asm
+++ b/libgcc/config/sh/lib1funcs-4-300.S
diff --git a/gcc/config/sh/lib1funcs-Os-4-200.asm b/libgcc/config/sh/lib1funcs-Os-4-200.S
index aae57ccd36c..aae57ccd36c 100644
--- a/gcc/config/sh/lib1funcs-Os-4-200.asm
+++ b/libgcc/config/sh/lib1funcs-Os-4-200.S
diff --git a/gcc/config/sh/lib1funcs.asm b/libgcc/config/sh/lib1funcs.S
index 2f0ca16cd91..2f0ca16cd91 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/libgcc/config/sh/lib1funcs.S
diff --git a/gcc/config/sh/lib1funcs.h b/libgcc/config/sh/lib1funcs.h
index af4b41cc314..af4b41cc314 100644
--- a/gcc/config/sh/lib1funcs.h
+++ b/libgcc/config/sh/lib1funcs.h
diff --git a/gcc/config/sh/libgcc-excl.ver b/libgcc/config/sh/libgcc-excl.ver
index 325c74054ec..325c74054ec 100644
--- a/gcc/config/sh/libgcc-excl.ver
+++ b/libgcc/config/sh/libgcc-excl.ver
diff --git a/gcc/config/sh/libgcc-glibc.ver b/libgcc/config/sh/libgcc-glibc.ver
index b8ec3265310..b8ec3265310 100644
--- a/gcc/config/sh/libgcc-glibc.ver
+++ b/libgcc/config/sh/libgcc-glibc.ver
diff --git a/gcc/config/sh/linux-atomic.asm b/libgcc/config/sh/linux-atomic.S
index 743c61bb76c..743c61bb76c 100644
--- a/gcc/config/sh/linux-atomic.asm
+++ b/libgcc/config/sh/linux-atomic.S
diff --git a/libgcc/config/sh/t-linux b/libgcc/config/sh/t-linux
index a98fb18e8d1..d0f92405fd8 100644
--- a/libgcc/config/sh/t-linux
+++ b/libgcc/config/sh/t-linux
@@ -1,4 +1,8 @@
-HOST_LIBGCC2_CFLAGS = -fpic -mieee -DNO_FPSCR_VALUES
+LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
+
+LIB2ADD = $(srcdir)/config/sh/linux-atomic.S
+
+HOST_LIBGCC2_CFLAGS += -mieee -DNO_FPSCR_VALUES
# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used, and hide some lib1func
@@ -6,32 +10,5 @@ HOST_LIBGCC2_CFLAGS = -fpic -mieee -DNO_FPSCR_VALUES
# the list from scratch.
SHLIB_MAPFILES = \
libgcc-std.ver \
- $(gcc_srcdir)/config/sh/libgcc-excl.ver \
- $(gcc_srcdir)/config/sh/libgcc-glibc.ver
-
-# Override SHLIB_LINK and SHLIB_INSTALL to use linker script
-# libgcc_s.so.
-SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,--soname=@shlib_base_name@.so.1 \
- -Wl,--version-script=@shlib_map_file@ \
- -o @multilib_dir@/@shlib_base_name@.so.1.tmp @multilib_flags@ \
- @shlib_objs@ -lc && \
- rm -f @multilib_dir@/@shlib_base_name@.so && \
- if [ -f @multilib_dir@/@shlib_base_name@.so.1 ]; then \
- mv -f @multilib_dir@/@shlib_base_name@.so.1 \
- @multilib_dir@/@shlib_base_name@.so.1.backup; \
- else true; fi && \
- mv @multilib_dir@/@shlib_base_name@.so.1.tmp \
- @multilib_dir@/@shlib_base_name@.so.1 && \
- (echo "/* GNU ld script"; \
- echo " Use the shared library, but some functions are only in"; \
- echo " the static library. */"; \
- echo "GROUP ( @shlib_base_name@.so.1 libgcc.a )" \
- ) > @multilib_dir@/@shlib_base_name@.so
-SHLIB_INSTALL = \
- $(mkinstalldirs) $(DESTDIR)$(slibdir)@shlib_slibdir_qual@; \
- $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so.1 \
- $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so.1; \
- rm -f $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
- $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so \
- $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so
+ $(srcdir)/config/sh/libgcc-excl.ver \
+ $(srcdir)/config/sh/libgcc-glibc.ver
diff --git a/libgcc/config/sh/t-netbsd b/libgcc/config/sh/t-netbsd
new file mode 100644
index 00000000000..d4df407fa16
--- /dev/null
+++ b/libgcc/config/sh/t-netbsd
@@ -0,0 +1,5 @@
+LIB1ASMFUNCS_CACHE = _ic_invalidate
+
+LIB2ADD =
+
+HOST_LIBGCC2_CFLAGS += -mieee
diff --git a/libgcc/config/sh/t-sh b/libgcc/config/sh/t-sh
new file mode 100644
index 00000000000..efbaff8479e
--- /dev/null
+++ b/libgcc/config/sh/t-sh
@@ -0,0 +1,63 @@
+# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2006, 2008, 2009, 2011 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/>.
+
+LIB1ASMSRC = sh/lib1funcs.S
+LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \
+ _movmem_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
+ _div_table _udiv_qrnnd_16 \
+ $(LIB1ASMFUNCS_CACHE)
+LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
+
+crt1.o: $(srcdir)/config/sh/crt1.S
+ $(gcc_compile) -c $<
+
+ic_invalidate_array_4-100.o: $(srcdir)/config/sh/lib1funcs.S
+ $(gcc_compile) -c -DL_ic_invalidate_array -DWAYS=1 -DWAY_SIZE=0x2000 $<
+libic_invalidate_array_4-100.a: ic_invalidate_array_4-100.o
+ $(AR_CREATE_FOR_TARGET) $@ $<
+
+ic_invalidate_array_4-200.o: $(srcdir)/config/sh/lib1funcs.S
+ $(gcc_compile) -c -DL_ic_invalidate_array -DWAYS=2 -DWAY_SIZE=0x2000 $<
+libic_invalidate_array_4-200.a: ic_invalidate_array_4-200.o
+ $(AR_CREATE_FOR_TARGET) $@ $<
+
+ic_invalidate_array_4a.o: $(srcdir)/config/sh/lib1funcs.S
+ $(gcc_compile) -c -DL_ic_invalidate_array -D__FORCE_SH4A__ $<
+libic_invalidate_array_4a.a: ic_invalidate_array_4a.o
+ $(AR_CREATE_FOR_TARGET) $@ $<
+
+sdivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.S
+ $(gcc_compile) -c -DL_sdivsi3_i4i $<
+udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.S
+ $(gcc_compile) -c -DL_udivsi3_i4i $<
+unwind-dw2-Os-4-200.o: $(srcdir)/unwind-dw2.c
+ $(gcc_compile) $(LIBGCC2_CFLAGS) $(vis_hide) -fexceptions -Os -c $<
+
+OBJS_Os_4_200=sdivsi3_i4i-Os-4-200.o udivsi3_i4i-Os-4-200.o unwind-dw2-Os-4-200.o
+libgcc-Os-4-200.a: $(OBJS_Os_4_200)
+ $(AR_CREATE_FOR_TARGET) $@ $(OBJS_Os_4_200)
+
+div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.S
+ $(gcc_compile) -c -DL_div_table $<
+
+libgcc-4-300.a: div_table-4-300.o
+ $(AR_CREATE_FOR_TARGET) $@ div_table-4-300.o
+
+HOST_LIBGCC2_CFLAGS += -mieee
+
diff --git a/libgcc/config/sh/t-sh64 b/libgcc/config/sh/t-sh64
new file mode 100644
index 00000000000..fa9950e03b2
--- /dev/null
+++ b/libgcc/config/sh/t-sh64
@@ -0,0 +1,6 @@
+LIB1ASMFUNCS = \
+ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
+ _shcompact_call_trampoline _shcompact_return_trampoline \
+ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
+ _push_pop_shmedia_regs \
+ _udivdi3 _divdi3 _umoddi3 _moddi3 _div_table
diff --git a/libgcc/config/sh/t-superh b/libgcc/config/sh/t-superh
new file mode 100644
index 00000000000..b87aa5a3167
--- /dev/null
+++ b/libgcc/config/sh/t-superh
@@ -0,0 +1,11 @@
+# Compile crt1-mmu.o as crt1.o with -DMMU_SUPPORT
+crt1-mmu.o: $(srcdir)/config/sh/crt1.S
+ $(gcc_compile) -c -DMMU_SUPPORT $<
+
+# Compile gcrt1-mmu.o as crt1-mmu.o with -DPROFILE
+gcrt1-mmu.o: $(srcdir)/config/sh/crt1.S
+ $(gcc_compile) -c -DPROFILE -DMMU_SUPPORT $<
+
+# For sh4-400: Compile gcrt1.o as crt1.o with -DPROFILE
+gcrt1.o: $(srcdir)/config/sh/crt1.S
+ $(gcc_compile) -c -DPROFILE $<
diff --git a/libgcc/config/sparc/sol2-ci.S b/libgcc/config/sparc/crti.S
index a89cc20c86f..a5c1da5e86b 100644
--- a/libgcc/config/sparc/sol2-ci.S
+++ b/libgcc/config/sparc/crti.S
@@ -1,4 +1,4 @@
-! crti.s for solaris 2.0.
+! crti.S for SPARC
! Copyright (C) 1992, 2008, 2009, 2011 Free Software Foundation, Inc.
! Written By David Vinayak Henkel-Wallace, June 1992
diff --git a/libgcc/config/sparc/sol2-cn.S b/libgcc/config/sparc/crtn.S
index 08862a78e02..1084628c6f6 100644
--- a/libgcc/config/sparc/sol2-cn.S
+++ b/libgcc/config/sparc/crtn.S
@@ -1,4 +1,4 @@
-! crtn.s for solaris 2.0.
+! crtn.S for SPARC
! Copyright (C) 1992, 2008, 2009, 2011 Free Software Foundation, Inc.
! Written By David Vinayak Henkel-Wallace, June 1992
diff --git a/gcc/config/sparc/lb1spc.asm b/libgcc/config/sparc/lb1spc.S
index b60bd5740e7..b60bd5740e7 100644
--- a/gcc/config/sparc/lb1spc.asm
+++ b/libgcc/config/sparc/lb1spc.S
diff --git a/gcc/config/sparc/libgcc-sparc-glibc.ver b/libgcc/config/sparc/libgcc-glibc.ver
index 91138d3795e..91138d3795e 100644
--- a/gcc/config/sparc/libgcc-sparc-glibc.ver
+++ b/libgcc/config/sparc/libgcc-glibc.ver
diff --git a/gcc/config/sparc/t-linux b/libgcc/config/sparc/t-linux
index 30daa376614..474f1755ea3 100644
--- a/gcc/config/sparc/t-linux
+++ b/libgcc/config/sparc/t-linux
@@ -1,5 +1,4 @@
# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
# Avoid the t-linux version file.
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
- $(srcdir)/config/sparc/libgcc-sparc-glibc.ver
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/sparc/libgcc-glibc.ver
diff --git a/libgcc/config/sparc/t-linux64 b/libgcc/config/sparc/t-linux64
new file mode 100644
index 00000000000..6583fe25ac7
--- /dev/null
+++ b/libgcc/config/sparc/t-linux64
@@ -0,0 +1 @@
+CRTSTUFF_T_CFLAGS = -mcmodel=medany
diff --git a/libgcc/config/sparc/t-softmul b/libgcc/config/sparc/t-softmul
index 49faae47c53..7142200600f 100644
--- a/libgcc/config/sparc/t-softmul
+++ b/libgcc/config/sparc/t-softmul
@@ -1,2 +1,2 @@
-LIB1ASMSRC = sparc/lb1spc.asm
+LIB1ASMSRC = sparc/lb1spc.S
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
diff --git a/libgcc/config/sparc/t-sol2 b/libgcc/config/sparc/t-sol2
index 372522bd0e4..ea3fa63a272 100644
--- a/libgcc/config/sparc/t-sol2
+++ b/libgcc/config/sparc/t-sol2
@@ -3,4 +3,4 @@
# to produce a shared library, but since we don't know ahead of time when
# we will be doing that, we just always use -fPIC when compiling the
# routines in crtstuff.c.
-CRTSTUFF_T_CFLAGS = -fPIC
+CRTSTUFF_T_CFLAGS = $(PICFLAG)
diff --git a/gcc/config/spu/cache.S b/libgcc/config/spu/cache.S
index 9ffb6a0d194..9ffb6a0d194 100644
--- a/gcc/config/spu/cache.S
+++ b/libgcc/config/spu/cache.S
diff --git a/gcc/config/spu/cachemgr.c b/libgcc/config/spu/cachemgr.c
index e7abd5e62db..e7abd5e62db 100644
--- a/gcc/config/spu/cachemgr.c
+++ b/libgcc/config/spu/cachemgr.c
diff --git a/gcc/config/spu/divmodti4.c b/libgcc/config/spu/divmodti4.c
index 57c975c6b3c..c63fb6b393c 100644
--- a/gcc/config/spu/divmodti4.c
+++ b/libgcc/config/spu/divmodti4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009, 2011 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
@@ -65,7 +65,7 @@ count_leading_zeros (UTItype x)
}
/* Based on implementation of udivmodsi4, which is essentially
- * an optimized version of gcc/config/udivmodsi4.c
+ * an optimized version of libgcc/udivmodsi4.c
clz %7,%2
clz %4,%1
il %5,1
diff --git a/gcc/config/spu/divv2df3.c b/libgcc/config/spu/divv2df3.c
index 9d5e1a594e1..9d5e1a594e1 100644
--- a/gcc/config/spu/divv2df3.c
+++ b/libgcc/config/spu/divv2df3.c
diff --git a/gcc/config/spu/float_disf.c b/libgcc/config/spu/float_disf.c
index 0f4fe3d8e29..0f4fe3d8e29 100644
--- a/gcc/config/spu/float_disf.c
+++ b/libgcc/config/spu/float_disf.c
diff --git a/gcc/config/spu/float_unsdidf.c b/libgcc/config/spu/float_unsdidf.c
index 4fdf0b88a2b..4fdf0b88a2b 100644
--- a/gcc/config/spu/float_unsdidf.c
+++ b/libgcc/config/spu/float_unsdidf.c
diff --git a/gcc/config/spu/float_unsdisf.c b/libgcc/config/spu/float_unsdisf.c
index 7af120ecc8c..7af120ecc8c 100644
--- a/gcc/config/spu/float_unsdisf.c
+++ b/libgcc/config/spu/float_unsdisf.c
diff --git a/gcc/config/spu/float_unssidf.c b/libgcc/config/spu/float_unssidf.c
index b255f81af55..b255f81af55 100644
--- a/gcc/config/spu/float_unssidf.c
+++ b/libgcc/config/spu/float_unssidf.c
diff --git a/gcc/config/spu/mfc_multi_tag_release.c b/libgcc/config/spu/mfc_multi_tag_release.c
index 62eb2beeb8f..62eb2beeb8f 100644
--- a/gcc/config/spu/mfc_multi_tag_release.c
+++ b/libgcc/config/spu/mfc_multi_tag_release.c
diff --git a/gcc/config/spu/mfc_multi_tag_reserve.c b/libgcc/config/spu/mfc_multi_tag_reserve.c
index 06d70259276..06d70259276 100644
--- a/gcc/config/spu/mfc_multi_tag_reserve.c
+++ b/libgcc/config/spu/mfc_multi_tag_reserve.c
diff --git a/gcc/config/spu/mfc_tag_release.c b/libgcc/config/spu/mfc_tag_release.c
index d59c5713053..d59c5713053 100644
--- a/gcc/config/spu/mfc_tag_release.c
+++ b/libgcc/config/spu/mfc_tag_release.c
diff --git a/gcc/config/spu/mfc_tag_reserve.c b/libgcc/config/spu/mfc_tag_reserve.c
index 23b4817c74f..23b4817c74f 100644
--- a/gcc/config/spu/mfc_tag_reserve.c
+++ b/libgcc/config/spu/mfc_tag_reserve.c
diff --git a/gcc/config/spu/mfc_tag_table.c b/libgcc/config/spu/mfc_tag_table.c
index bd08c580c18..bd08c580c18 100644
--- a/gcc/config/spu/mfc_tag_table.c
+++ b/libgcc/config/spu/mfc_tag_table.c
diff --git a/gcc/config/spu/multi3.c b/libgcc/config/spu/multi3.c
index b8b0e90ee25..b8b0e90ee25 100644
--- a/gcc/config/spu/multi3.c
+++ b/libgcc/config/spu/multi3.c
diff --git a/libgcc/config/spu/t-elf b/libgcc/config/spu/t-elf
index 7094da526bb..83616c1ca7d 100644
--- a/libgcc/config/spu/t-elf
+++ b/libgcc/config/spu/t-elf
@@ -1,3 +1,59 @@
+# Don't let CTOR_LIST end up in sdata section.
+# FIXME: This is the default.
+CRTSTUFF_T_CFLAGS =
+
+# We exclude those because the libgcc2.c default versions do not support
+# the SPU single-precision format (round towards zero). We provide our
+# own versions below and/or via direct expansion.
+LIB2ADD = _floatdisf _floatundisf _floattisf _floatunstisf
+
+LIB2ADD_ST = $(srcdir)/config/spu/float_unssidf.c \
+ $(srcdir)/config/spu/float_unsdidf.c \
+ $(srcdir)/config/spu/float_unsdisf.c \
+ $(srcdir)/config/spu/float_disf.c \
+ $(srcdir)/config/spu/mfc_tag_table.c \
+ $(srcdir)/config/spu/mfc_tag_reserve.c \
+ $(srcdir)/config/spu/mfc_tag_release.c \
+ $(srcdir)/config/spu/mfc_multi_tag_reserve.c \
+ $(srcdir)/config/spu/mfc_multi_tag_release.c \
+ $(srcdir)/config/spu/multi3.c \
+ $(srcdir)/config/spu/divmodti4.c \
+ $(srcdir)/config/spu/divv2df3.c
+
+# Build TImode conversion routines to support Fortran 128-bit
+# integer data types.
+LIB2_SIDITI_CONV_FUNCS = yes
+
+HOST_LIBGCC2_CFLAGS += -mwarn-reloc -D__IN_LIBGCC2
+
+# 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.
+
+cachemgr.o: $(srcdir)/config/spu/cachemgr.c
+ $(gcc_compile) -c $<
+
+# Specialised rule to add a -D flag.
+cachemgr_nonatomic.o: $(srcdir)/config/spu/cachemgr.c
+ $(gcc_compile) -DNONATOMIC -c $<
+
+libgcc_%.a: %.o
+ $(AR_FOR_TARGET) -rcs $@ $<
+
+cache8k.o: $(srcdir)/config/spu/cache.S
+ $(gcc_compile) -D__CACHE_SIZE__=8 -c $<
+
+cache16k.o: $(srcdir)/config/spu/cache.S
+ $(gcc_compile) -D__CACHE_SIZE__=16 -c $<
+
+cache32k.o: $(srcdir)/config/spu/cache.S
+ $(gcc_compile) -D__CACHE_SIZE__=32 -c $<
+
+cache64k.o: $(srcdir)/config/spu/cache.S
+ $(gcc_compile) -D__CACHE_SIZE__=64 -c $<
+
+cache128k.o: $(srcdir)/config/spu/cache.S
+ $(gcc_compile) -D__CACHE_SIZE__=128 -c $<
+
# We provide our own version of __divdf3 that performs better and has
# better support for non-default rounding modes.
DPBIT_FUNCS := $(filter-out _div_df, $(DPBIT_FUNCS))
diff --git a/libgcc/config/stormy16/ashlsi3.c b/libgcc/config/stormy16/ashlsi3.c
new file mode 100644
index 00000000000..0ef42ad66d3
--- /dev/null
+++ b/libgcc/config/stormy16/ashlsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_ASHLSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/ashrsi3.c b/libgcc/config/stormy16/ashrsi3.c
new file mode 100644
index 00000000000..67bcbbbe05b
--- /dev/null
+++ b/libgcc/config/stormy16/ashrsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_ASHRSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/clzhi2.c b/libgcc/config/stormy16/clzhi2.c
new file mode 100644
index 00000000000..350ef41daaf
--- /dev/null
+++ b/libgcc/config/stormy16/clzhi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_CLZHI2
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/cmpsi2.c b/libgcc/config/stormy16/cmpsi2.c
new file mode 100644
index 00000000000..fe32fda95cb
--- /dev/null
+++ b/libgcc/config/stormy16/cmpsi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_CMPSI2
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/ctzhi2.c b/libgcc/config/stormy16/ctzhi2.c
new file mode 100644
index 00000000000..98ab76dcd69
--- /dev/null
+++ b/libgcc/config/stormy16/ctzhi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_CTZHI2
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/divsi3.c b/libgcc/config/stormy16/divsi3.c
new file mode 100644
index 00000000000..0fa75342f4a
--- /dev/null
+++ b/libgcc/config/stormy16/divsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_DIVSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/ffshi2.c b/libgcc/config/stormy16/ffshi2.c
new file mode 100644
index 00000000000..a36dec87eb9
--- /dev/null
+++ b/libgcc/config/stormy16/ffshi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_FFSHI2
+#include "lib2funcs.c"
diff --git a/gcc/config/stormy16/stormy16-lib2.c b/libgcc/config/stormy16/lib2funcs.c
index e3c16435471..a10a9b28119 100644
--- a/gcc/config/stormy16/stormy16-lib2.c
+++ b/libgcc/config/stormy16/lib2funcs.c
@@ -4,7 +4,7 @@
files. On this glorious day maybe this code can be integrated into
it too. */
-/* Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,6 +31,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#ifdef HAVE_GAS_HIDDEN
#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
diff --git a/libgcc/config/stormy16/lshrsi3.c b/libgcc/config/stormy16/lshrsi3.c
new file mode 100644
index 00000000000..13903d3d24a
--- /dev/null
+++ b/libgcc/config/stormy16/lshrsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_LSHRSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/modsi3.c b/libgcc/config/stormy16/modsi3.c
new file mode 100644
index 00000000000..c63e8906824
--- /dev/null
+++ b/libgcc/config/stormy16/modsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_MODSI3
+#include "lib2funcs.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-parityhi2.c b/libgcc/config/stormy16/parityhi2.c
index 1d128171a8b..4be7fbf3e14 100644
--- a/gcc/config/stormy16/stormy16-lib2-parityhi2.c
+++ b/libgcc/config/stormy16/parityhi2.c
@@ -1,2 +1,2 @@
#define XSTORMY16_PARITYHI2
-#include "stormy16-lib2.c"
+#include "lib2funcs.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-popcounthi2.c b/libgcc/config/stormy16/popcounthi2.c
index f07d66873e6..30bf0950d3d 100644
--- a/gcc/config/stormy16/stormy16-lib2-popcounthi2.c
+++ b/libgcc/config/stormy16/popcounthi2.c
@@ -1,2 +1,2 @@
#define XSTORMY16_POPCOUNTHI2
-#include "stormy16-lib2.c"
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/t-stormy16 b/libgcc/config/stormy16/t-stormy16
new file mode 100644
index 00000000000..d62d167d93d
--- /dev/null
+++ b/libgcc/config/stormy16/t-stormy16
@@ -0,0 +1,39 @@
+# -*- makefile -*-
+#
+# Copyright (C) 2001, 2004, 2010, 2011 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/>.
+
+# SImode arithmetic and logical routines, HImode bit counting routines.
+LIB2ADD = \
+ $(srcdir)/config/stormy16/udivmodsi4.c \
+ $(srcdir)/config/stormy16/divsi3.c \
+ $(srcdir)/config/stormy16/modsi3.c \
+ $(srcdir)/config/stormy16/udivsi3.c \
+ $(srcdir)/config/stormy16/umodsi3.c \
+ $(srcdir)/config/stormy16/ashlsi3.c \
+ $(srcdir)/config/stormy16/ashrsi3.c \
+ $(srcdir)/config/stormy16/lshrsi3.c \
+ $(srcdir)/config/stormy16/popcounthi2.c \
+ $(srcdir)/config/stormy16/parityhi2.c \
+ $(srcdir)/config/stormy16/clzhi2.c \
+ $(srcdir)/config/stormy16/ctzhi2.c \
+ $(srcdir)/config/stormy16/ffshi2.c \
+ $(srcdir)/config/stormy16/cmpsi2.c \
+ $(srcdir)/config/stormy16/ucmpsi2.c
+
+HOST_LIBGCC2_CFLAGS += -O2
diff --git a/libgcc/config/stormy16/ucmpsi2.c b/libgcc/config/stormy16/ucmpsi2.c
new file mode 100644
index 00000000000..ee327b1da15
--- /dev/null
+++ b/libgcc/config/stormy16/ucmpsi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_UCMPSI2
+#include "lib2funcs.c"
diff --git a/gcc/config/stormy16/stormy16-lib2-udivmodsi4.c b/libgcc/config/stormy16/udivmodsi4.c
index d555e64c6d8..5fdd0f9189e 100644
--- a/gcc/config/stormy16/stormy16-lib2-udivmodsi4.c
+++ b/libgcc/config/stormy16/udivmodsi4.c
@@ -1,2 +1,2 @@
#define XSTORMY16_UDIVMODSI4
-#include "stormy16-lib2.c"
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/udivsi3.c b/libgcc/config/stormy16/udivsi3.c
new file mode 100644
index 00000000000..ad12bd86a58
--- /dev/null
+++ b/libgcc/config/stormy16/udivsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_UDIVSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/stormy16/umodsi3.c b/libgcc/config/stormy16/umodsi3.c
new file mode 100644
index 00000000000..eeec67f56c0
--- /dev/null
+++ b/libgcc/config/stormy16/umodsi3.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_UMODSI3
+#include "lib2funcs.c"
diff --git a/libgcc/config/t-crtin b/libgcc/config/t-crtin
deleted file mode 100644
index b30e0d52e2f..00000000000
--- a/libgcc/config/t-crtin
+++ /dev/null
@@ -1,4 +0,0 @@
-crti.o: $(srcdir)/config/$(cpu_type)/sol2-ci.S
- $(crt_compile) -c $<
-crtn.o: $(srcdir)/config/$(cpu_type)/sol2-cn.S
- $(crt_compile) -c $<
diff --git a/libgcc/config/t-crtstuff-pic b/libgcc/config/t-crtstuff-pic
new file mode 100644
index 00000000000..4cda4c9bffb
--- /dev/null
+++ b/libgcc/config/t-crtstuff-pic
@@ -0,0 +1,2 @@
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) $(PICFLAG)
diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin
index 311b7e2679f..e32127e9d8a 100644
--- a/libgcc/config/t-darwin
+++ b/libgcc/config/t-darwin
@@ -3,6 +3,12 @@ crt3.o: $(srcdir)/config/darwin-crt3.c
$(crt_compile) \
-fno-tree-dominator-opts $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $<
+# -pipe because there's an assembler bug, 4077127, which causes
+# it to not properly process the first # directive, causing temporary
+# file names to appear in stabs, causing the bootstrap to fail. Using -pipe
+# works around this by not having any temporary file names.
+HOST_LIBGCC2_CFLAGS += -pipe
+
# Use unwind-dw2-fde-darwin
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-freebsd-thread b/libgcc/config/t-freebsd-thread
index 6e5c64f78cf..2948dc1a44c 100644
--- a/gcc/config/t-freebsd-thread
+++ b/libgcc/config/t-freebsd-thread
@@ -1,2 +1,2 @@
# This is currently needed to compile libgcc2 for threads support
-TARGET_LIBGCC2_CFLAGS += -pthread
+HOST_LIBGCC2_CFLAGS += -pthread
diff --git a/libgcc/config/t-libgcc-pic b/libgcc/config/t-libgcc-pic
new file mode 100644
index 00000000000..0eea16ebc39
--- /dev/null
+++ b/libgcc/config/t-libgcc-pic
@@ -0,0 +1,2 @@
+# Compile libgcc2.a with pic.
+HOST_LIBGCC2_CFLAGS += $(PICFLAG)
diff --git a/libgcc/config/t-libunwind b/libgcc/config/t-libunwind
index 1c7a898675f..5244928da3c 100644
--- a/libgcc/config/t-libunwind
+++ b/libgcc/config/t-libunwind
@@ -1,3 +1,12 @@
+# Use the system libunwind library.
+
+HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+
LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
$(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+
+# Override the default value from t-slibgcc-elf-ver and mention -lunwind
+# so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
+# libunwind.
+SHLIB_LC = -lunwind -lc
diff --git a/libgcc/config/t-linux b/libgcc/config/t-linux
new file mode 100644
index 00000000000..d1bdac4f32d
--- /dev/null
+++ b/libgcc/config/t-linux
@@ -0,0 +1,3 @@
+# Override t-slibgcc-elf-ver to export some libgcc symbols with
+# the symbol versions that glibc used.
+SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
diff --git a/gcc/config/t-openbsd-thread b/libgcc/config/t-openbsd-thread
index 5f4edf567c5..50b61e5865f 100644
--- a/gcc/config/t-openbsd-thread
+++ b/libgcc/config/t-openbsd-thread
@@ -1,3 +1,3 @@
# This is currently needed to compile libgcc2 for threads support
-TARGET_LIBGCC2_CFLAGS=-pthread
+HOST_LIBGCC2_CFLAGS += -pthread
diff --git a/libgcc/config/t-rtems b/libgcc/config/t-rtems
index 85e931e60f6..85f1da90d3b 100644
--- a/libgcc/config/t-rtems
+++ b/libgcc/config/t-rtems
@@ -1,4 +1,4 @@
# If we are building next to newlib, this will let us find the RTEMS
# limits.h when building libgcc2. Otherwise, newlib must be installed
# first.
-HOST_LIBGCC2_CFLAGS = -I$(srcdir)/../newlib/libc/sys/rtems/include
+LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include
diff --git a/libgcc/config/t-slibgcc b/libgcc/config/t-slibgcc
index 0b5cc4bfc50..3727244c424 100644
--- a/libgcc/config/t-slibgcc
+++ b/libgcc/config/t-slibgcc
@@ -43,9 +43,12 @@ SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
else true; fi && \
mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
$(SHLIB_MAKE_SOLINK)
+
+INSTALL_SHLIB = $(INSTALL_DATA)
+
SHLIB_INSTALL = \
$(mkinstalldirs) $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(INSTALL_SHLIB) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(SHLIB_INSTALL_SOLINK)
diff --git a/libgcc/config/t-slibgcc-darwin b/libgcc/config/t-slibgcc-darwin
index bb6569a87d9..9970d003436 100644
--- a/libgcc/config/t-slibgcc-darwin
+++ b/libgcc/config/t-slibgcc-darwin
@@ -22,9 +22,10 @@ SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
$(SHLIB_VERSTRING) \
@multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC)
-SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MKMAP_OPTS = -v leading_underscore=1
-SHLIB_MAPFILES += libgcc-std.ver $(gcc_srcdir)/libgcc-libsystem.ver
+SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/libgcc-libsystem.ver
+SHLIB_VERPFX = $(srcdir)/config/$(cpu_type)/libgcc-darwin
# we're only going to build the stubs if the target slib is /usr/lib
# there is no other case in which they're useful in a live system.
diff --git a/libgcc/config/t-slibgcc-elf-ver b/libgcc/config/t-slibgcc-elf-ver
index 2616d31cae5..4a00edc9663 100644
--- a/libgcc/config/t-slibgcc-elf-ver
+++ b/libgcc/config/t-slibgcc-elf-ver
@@ -1,4 +1,4 @@
# Build a shared libgcc library for ELF with symbol versioning.
-SHLIB_MKMAP = $(gcc_srcdir)/mkmap-symver.awk
+SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
SHLIB_MAPFILES = libgcc-std.ver
diff --git a/libgcc/config/t-slibgcc-gld-nover b/libgcc/config/t-slibgcc-gld-nover
new file mode 100644
index 00000000000..e9b78ea9410
--- /dev/null
+++ b/libgcc/config/t-slibgcc-gld-nover
@@ -0,0 +1,3 @@
+# Build a shared libgcc library for ELF with the GNU linker.
+
+SHLIB_LDFLAGS = -Wl,--soname=$(SHLIB_SONAME)
diff --git a/libgcc/config/t-slibgcc-hpux b/libgcc/config/t-slibgcc-hpux
new file mode 100644
index 00000000000..866457fe9ae
--- /dev/null
+++ b/libgcc/config/t-slibgcc-hpux
@@ -0,0 +1,7 @@
+# Build a shared libgcc library with the HP-UX linker.
+
+SHLIB_LDFLAGS = -Wl,+h,$(SHLIB_SONAME)
+
+INSTALL_SHLIB = $(INSTALL_DATA) -m 555
+
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
diff --git a/gcc/config/t-slibgcc-libgcc b/libgcc/config/t-slibgcc-libgcc
index df004a5e964..ec36b2727ae 100644
--- a/gcc/config/t-slibgcc-libgcc
+++ b/libgcc/config/t-slibgcc-libgcc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -29,4 +29,4 @@ SHLIB_MAKE_SOLINK = \
) > $(SHLIB_DIR)/$(SHLIB_SOLINK)
SHLIB_INSTALL_SOLINK = \
$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SOLINK) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
diff --git a/gcc/config/t-slibgcc-nolc-override b/libgcc/config/t-slibgcc-nolc-override
index 959d2cc2a1f..959d2cc2a1f 100644
--- a/gcc/config/t-slibgcc-nolc-override
+++ b/libgcc/config/t-slibgcc-nolc-override
diff --git a/libgcc/config/t-slibgcc-vms b/libgcc/config/t-slibgcc-vms
new file mode 100644
index 00000000000..d01c34341c8
--- /dev/null
+++ b/libgcc/config/t-slibgcc-vms
@@ -0,0 +1,28 @@
+shlib_version:=$(shell $(CC) --version 2>&1 | \
+ sed -n 's/^.*(GCC).* \([0-9]*\.[0-9.]*\).*$/\1/p' | \
+ sed -e 's/\./,/' -e 's/\.//g')
+SHLIB_EXT = .exe
+SHLIB_OBJS = @shlib_objs@
+SHLIB_NAME = @shlib_base_name@.exe
+SHLIB_MULTILIB =
+SHLIB_INSTALL = $(INSTALL_DATA) $(SHLIB_NAME) $(DESTDIR)$(libsubdir)/$(SHLIB_NAME)
+SHLIB_SYMVEC = \
+ grep -F -e "\$$BSS\$$" -e "\$$DATA\$$" -e " sdata " -e " data.rel " -e " data.rel.ro " -e " sbss " \
+ -e "\$$LINK\$$" -e "\$$READONLY\$$" | \
+ sed -e "s/.*\$$LINK\$$ \(.*\)/SYMBOL_VECTOR=(\1=PROCEDURE)/" \
+ -e "s/.*\$$DATA\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.* sbss \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.* sdata \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.* data.rel \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.* data.rel.ro \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.*\$$BSS\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/" \
+ -e "s/.*\$$READONLY\$$ \(.*\)/SYMBOL_VECTOR=(\1=DATA)/"
+SHLIB_LINK = \
+ echo "case_sensitive=yes" > SYMVEC_$$$$.opt; \
+ objdump --syms $(SHLIB_OBJS) | \
+ $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt ; \
+ echo "case_sensitive=NO" >> SYMVEC_$$$$.opt; \
+ $(CC) $(LIBGCC2_CFLAGS) -nodefaultlibs \
+ -shared --for-linker=/noinform -o $(SHLIB_NAME) $(SHLIB_OBJS) \
+ --for-linker=SYMVEC_$$$$.opt \
+ --for-linker=gsmatch=equal,$(shlib_version)
diff --git a/libgcc/config/t-sol2 b/libgcc/config/t-sol2
index bfb8f3b5cc2..cb511abd2fc 100644
--- a/libgcc/config/t-sol2
+++ b/libgcc/config/t-sol2
@@ -25,5 +25,3 @@ crt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
$(crt_compile) -c $<
gcrt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
$(crt_compile) -c -DGCRT1 $<
-
-HOST_LIBGCC2_CFLAGS = -fPIC
diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks
new file mode 100644
index 00000000000..3647f75d572
--- /dev/null
+++ b/libgcc/config/t-vxworks
@@ -0,0 +1,14 @@
+# Don't build libgcc.a with debug info
+LIBGCC2_DEBUG_CFLAGS =
+
+# Extra libgcc2 modules used by gthr-vxworks.h functions
+LIB2ADD = $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
+
+# This ensures that the correct target headers are used; some
+# VxWorks system headers have names that collide with GCC's
+# internal (host) headers, e.g. regs.h.
+LIBGCC2_INCLUDES = -nostdinc -I \
+ `case "/$$(MULTIDIR)" in \
+ */mrtp*) echo $(WIND_USR)/h ;; \
+ *) echo $(WIND_BASE)/target/h ;; \
+ esac`
diff --git a/gcc/config/v850/lib1funcs.asm b/libgcc/config/v850/lib1funcs.S
index 04e9b1e0ad4..04e9b1e0ad4 100644
--- a/gcc/config/v850/lib1funcs.asm
+++ b/libgcc/config/v850/lib1funcs.S
diff --git a/libgcc/config/v850/t-v850 b/libgcc/config/v850/t-v850
new file mode 100644
index 00000000000..b61703ace09
--- /dev/null
+++ b/libgcc/config/v850/t-v850
@@ -0,0 +1,60 @@
+LIB1ASMSRC = v850/lib1funcs.S
+LIB1ASMFUNCS = _mulsi3 \
+ _divsi3 \
+ _udivsi3 \
+ _modsi3 \
+ _umodsi3 \
+ _save_2 \
+ _save_20 \
+ _save_21 \
+ _save_22 \
+ _save_23 \
+ _save_24 \
+ _save_25 \
+ _save_26 \
+ _save_27 \
+ _save_28 \
+ _save_29 \
+ _save_2c \
+ _save_20c \
+ _save_21c \
+ _save_22c \
+ _save_23c \
+ _save_24c \
+ _save_25c \
+ _save_26c \
+ _save_27c \
+ _save_28c \
+ _save_29c \
+ _save_31c \
+ _save_interrupt \
+ _save_all_interrupt \
+ _callt_save_20 \
+ _callt_save_21 \
+ _callt_save_22 \
+ _callt_save_23 \
+ _callt_save_24 \
+ _callt_save_25 \
+ _callt_save_26 \
+ _callt_save_27 \
+ _callt_save_28 \
+ _callt_save_29 \
+ _callt_save_20c \
+ _callt_save_21c \
+ _callt_save_22c \
+ _callt_save_23c \
+ _callt_save_24c \
+ _callt_save_25c \
+ _callt_save_26c \
+ _callt_save_27c \
+ _callt_save_28c \
+ _callt_save_29c \
+ _callt_save_31c \
+ _callt_save_interrupt \
+ _callt_save_all_interrupt \
+ _callt_save_r2_r29 \
+ _callt_save_r2_r31 \
+ _negdi2 \
+ _cmpdi2 \
+ _ucmpdi2 \
+ _muldi3
diff --git a/gcc/config/vax/lib1funcs.asm b/libgcc/config/vax/lib1funcs.S
index 1d57b56dad9..1d57b56dad9 100644
--- a/gcc/config/vax/lib1funcs.asm
+++ b/libgcc/config/vax/lib1funcs.S
diff --git a/gcc/config/vax/t-linux b/libgcc/config/vax/t-linux
index 9af1edb0fab..17929c8717c 100644
--- a/gcc/config/vax/t-linux
+++ b/libgcc/config/vax/t-linux
@@ -1,2 +1,2 @@
-LIB1ASMSRC = vax/lib1funcs.asm
+LIB1ASMSRC = vax/lib1funcs.S
LIB1ASMFUNCS = _udivsi3 _umodsi3
diff --git a/libgcc/config/vms/t-vms b/libgcc/config/vms/t-vms
new file mode 100644
index 00000000000..93d8255dcb0
--- /dev/null
+++ b/libgcc/config/vms/t-vms
@@ -0,0 +1,6 @@
+# Assemble startup files.
+vcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c
+ $(gcc_compile) -c $<
+
+pcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c
+ $(gcc_compile) -c -DCRT0_POSIX_EXIT $<
diff --git a/gcc/config/vms/vms-ucrt0.c b/libgcc/config/vms/vms-ucrt0.c
index 344b59520e0..344b59520e0 100644
--- a/gcc/config/vms/vms-ucrt0.c
+++ b/libgcc/config/vms/vms-ucrt0.c
diff --git a/gcc/config/vxlib-tls.c b/libgcc/config/vxlib-tls.c
index c4696768f0f..c4696768f0f 100644
--- a/gcc/config/vxlib-tls.c
+++ b/libgcc/config/vxlib-tls.c
diff --git a/gcc/config/vxlib.c b/libgcc/config/vxlib.c
index 0ff996cfced..0ff996cfced 100644
--- a/gcc/config/vxlib.c
+++ b/libgcc/config/vxlib.c
diff --git a/gcc/config/xtensa/crti.asm b/libgcc/config/xtensa/crti.S
index cbe91b0e748..cbe91b0e748 100644
--- a/gcc/config/xtensa/crti.asm
+++ b/libgcc/config/xtensa/crti.S
diff --git a/gcc/config/xtensa/crtn.asm b/libgcc/config/xtensa/crtn.S
index 413cfa0ac10..413cfa0ac10 100644
--- a/gcc/config/xtensa/crtn.asm
+++ b/libgcc/config/xtensa/crtn.S
diff --git a/gcc/config/xtensa/ieee754-df.S b/libgcc/config/xtensa/ieee754-df.S
index 9b46889bdc2..9b46889bdc2 100644
--- a/gcc/config/xtensa/ieee754-df.S
+++ b/libgcc/config/xtensa/ieee754-df.S
diff --git a/gcc/config/xtensa/ieee754-sf.S b/libgcc/config/xtensa/ieee754-sf.S
index d75be0e5ae5..d75be0e5ae5 100644
--- a/gcc/config/xtensa/ieee754-sf.S
+++ b/libgcc/config/xtensa/ieee754-sf.S
diff --git a/gcc/config/xtensa/lib1funcs.asm b/libgcc/config/xtensa/lib1funcs.S
index 071b9171177..071b9171177 100644
--- a/gcc/config/xtensa/lib1funcs.asm
+++ b/libgcc/config/xtensa/lib1funcs.S
diff --git a/gcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
index 65134e24ccf..65134e24ccf 100644
--- a/gcc/config/xtensa/lib2funcs.S
+++ b/libgcc/config/xtensa/lib2funcs.S
diff --git a/gcc/config/xtensa/libgcc-xtensa.ver b/libgcc/config/xtensa/libgcc-glibc.ver
index 43e7d4fc7c7..43e7d4fc7c7 100644
--- a/gcc/config/xtensa/libgcc-xtensa.ver
+++ b/libgcc/config/xtensa/libgcc-glibc.ver
diff --git a/gcc/config/xtensa/t-elf b/libgcc/config/xtensa/t-elf
index 7d6cd1a3a9b..59d51210b95 100644
--- a/gcc/config/xtensa/t-elf
+++ b/libgcc/config/xtensa/t-elf
@@ -1,6 +1,5 @@
# Build CRT files and libgcc with the "longcalls" option
CRTSTUFF_T_CFLAGS += -mlongcalls
CRTSTUFF_T_CFLAGS_S += -mlongcalls
-TARGET_LIBGCC2_CFLAGS += -mlongcalls
-EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o
+HOST_LIBGCC2_CFLAGS += -mlongcalls
diff --git a/libgcc/config/xtensa/t-linux b/libgcc/config/xtensa/t-linux
new file mode 100644
index 00000000000..6f4ae893486
--- /dev/null
+++ b/libgcc/config/xtensa/t-linux
@@ -0,0 +1 @@
+SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-glibc.ver
diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa
index 7d9e9db0487..27399e67fa0 100644
--- a/libgcc/config/xtensa/t-xtensa
+++ b/libgcc/config/xtensa/t-xtensa
@@ -1,2 +1,16 @@
+LIB1ASMSRC = xtensa/lib1funcs.S
+LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \
+ _umulsidi3 _clz _clzsi2 _ctzsi2 _ffssi2 \
+ _ashldi3 _ashrdi3 _lshrdi3 \
+ _negsf2 _addsubsf3 _mulsf3 _divsf3 _cmpsf2 _fixsfsi _fixsfdi \
+ _fixunssfsi _fixunssfdi _floatsisf _floatunsisf \
+ _floatdisf _floatundisf \
+ _negdf2 _addsubdf3 _muldf3 _divdf3 _cmpdf2 _fixdfsi _fixdfdi \
+ _fixunsdfsi _fixunsdfdi _floatsidf _floatunsidf \
+ _floatdidf _floatundidf \
+ _truncdfsf2 _extendsfdf2
+
+LIB2ADD = $(srcdir)/config/xtensa/lib2funcs.S
+
LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
$(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
index 54daf7637ce..2ded579929f 100644
--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
+++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
@@ -28,6 +28,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "dwarf2.h"
#include "unwind.h"
#ifdef __USING_SJLJ_EXCEPTIONS__
diff --git a/libgcc/configure b/libgcc/configure
index 80bb61c80af..e1c58f57937 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -593,6 +593,8 @@ LIBOBJS
asm_hidden_op
extra_parts
cpu_type
+tm_defines
+tm_file
tmake_file
sfp_machine_header
set_use_emutls
@@ -627,6 +629,13 @@ build_subdir
build_libsubdir
target_noncanonical
host_noncanonical
+AWK
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+MAINT
+slibdir
+PICFLAG
host_os
host_vendor
host_cpu
@@ -635,12 +644,6 @@ build_os
build_vendor
build_cpu
build
-AWK
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-MAINT
-slibdir
enable_shared
libgcc_topdir
target_alias
@@ -694,6 +697,7 @@ enable_maintainer_mode
with_build_libsubdir
enable_decimal_float
with_system_libunwind
+enable_sjlj_exceptions
enable_tls
'
ac_precious_vars='build_alias
@@ -1328,6 +1332,8 @@ Optional Features:
enable decimal float extension to C. Selecting 'bid'
or 'dpd' choses which decimal floating point format
to use
+ --enable-sjlj-exceptions
+ force use of builtin_setjmp for exceptions
--enable-tls Use thread-local storage [default=yes]
Optional Packages:
@@ -2194,6 +2200,158 @@ fi
+# 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
+
+
+{ $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
+
+
+
+
+
+
+case "${host}" in
+ # PIC is the default on some targets or must not be used.
+ *-*-darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ PICFLAG=-fno-common
+ ;;
+ alpha*-dec-osf5*)
+ # PIC is the default.
+ ;;
+ hppa*64*-*-hpux*)
+ # PIC is the default for 64-bit PA HP-UX.
+ ;;
+ i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
+ ;;
+ i[34567]86-*-interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ i[34567]86-*-nto-qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ PICFLAG='-fPIC -shared'
+ ;;
+ i[34567]86-pc-msdosdjgpp*)
+ # DJGPP does not support shared libraries at all.
+ ;;
+ ia64*-*-hpux*)
+ # On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ PICFLAG=-fPIC
+ ;;
+ mips-sgi-irix6*)
+ # PIC is the default.
+ ;;
+ rs6000-ibm-aix* | powerpc-ibm-aix*)
+ # All AIX code is PIC.
+ ;;
+
+ # Some targets support both -fPIC and -fpic, but prefer the latter.
+ # FIXME: Why?
+ i[34567]86-*-* | x86_64-*-*)
+ PICFLAG=-fpic
+ ;;
+ m68k-*-*)
+ PICFLAG=-fpic
+ ;;
+ s390*-*-*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Override -fPIC default in libgcc only?
+ sh-*-linux* | sh[2346lbe]*-*-linux*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Simplify to sh*-*-netbsd*?
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ PICFLAG=-fpic
+ ;;
+ # Default to -fPIC unless specified otherwise.
+ *)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+# If the user explicitly uses -fpic/-fPIC, keep that.
+case "${CFLAGS}" in
+ *-fpic*)
+ PICFLAG=-fpic
+ ;;
+ *-fPIC*)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
# Check whether --enable-version-specific-runtime-libs was given.
@@ -2382,76 +2540,6 @@ case ${AWK} in
"") as_fn_error "can't build without awk, bailing out" "$LINENO" 5 ;;
esac
-# 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
-
-
-{ $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
-
case ${build_alias} in
"") build_noncanonical=${build} ;;
@@ -4408,6 +4496,72 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
+# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
+# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
+# libobjc/configure.ac (for Objective-C).
+# FIXME: This should be centralized in config/sjlj.m4.
+# Check whether --enable-sjlj-exceptions was given.
+if test "${enable_sjlj_exceptions+set}" = set; then :
+ enableval=$enable_sjlj_exceptions; case "$enableval" in
+ yes|no|auto) ;;
+ *) as_fn_error "unknown argument to --enable-sjlj-exceptions" "$LINENO" 5 ;;
+ esac
+else
+ enable_sjlj_exceptions=auto
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use setjmp/longjmp exceptions" >&5
+$as_echo_n "checking whether to use setjmp/longjmp exceptions... " >&6; }
+if test "${libgcc_cv_lib_sjlj_exceptions+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+void bar ();
+void clean (int *);
+void foo ()
+{
+ int i __attribute__ ((cleanup (clean)));
+ bar();
+}
+
+_ACEOF
+CFLAGS_hold=$CFLAGS
+CFLAGS="--save-temps -fexceptions"
+libgcc_cv_lib_sjlj_exceptions=unknown
+if ac_fn_c_try_compile; then :
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi
+fi
+CFLAGS=$CFLAGS_hold
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_lib_sjlj_exceptions" >&5
+$as_echo "$libgcc_cv_lib_sjlj_exceptions" >&6; }
+
+if test "$enable_sjlj_exceptions" = "auto"; then
+ enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
+fi
+
+case $enable_sjlj_exceptions in
+yes)
+
+$as_echo "#define LIBGCC_SJLJ_EXCEPTIONS 1" >>confdefs.h
+
+ ;;
+no)
+ ;;
+*)
+ as_fn_error "unable to detect exception model" "$LINENO" 5
+ ;;
+esac
+
{ $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 "${acl_cv_prog_gnu_ld+set}" = set; then :
@@ -4455,20 +4609,16 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_cfi" >&5
$as_echo "$libgcc_cv_cfi" >&6; }
-# Check 32bit or 64bit for x86.
-case ${host} in
-i?86*-*-* | x86_64*-*-*)
- cat > conftest.c <<EOF
-#ifdef __x86_64__
+# Check 32bit or 64bit
+cat > conftest.c <<EOF
+#if defined(__x86_64__) || (!defined(__i386__) && defined(__LP64__))
host_address=64
#else
host_address=32
#endif
EOF
- eval `${CC-cc} -E conftest.c | grep host_address=`
- rm -f conftest.c
- ;;
-esac
+eval `${CC-cc} -E conftest.c | grep host_address=`
+rm -f conftest.c
# Collect host-machine-specific information.
. ${srcdir}/config.host
@@ -4632,6 +4782,30 @@ done
tmake_file="${tmake_file_}"
+# Likewise export definitions for libgcc_tm.h
+tm_file_=
+for f in ${tm_file}
+do
+ tm_file_="${tm_file_} \$(srcdir)/config/$f"
+done
+tm_file="${tm_file_}"
+
+
+
+# Map from thread model to thread header.
+case $target_thread_file in
+ aix) thread_header=config/rs6000/gthr-aix.h ;;
+ dce) thread_header=config/pa/gthr-dce.h ;;
+ lynx) thread_header=config/gthr-lynx.h ;;
+ mipssde) thread_header=config/mips/gthr-mipssde.h ;;
+ posix) thread_header=gthr-posix.h ;;
+ rtems) thread_header=config/gthr-rtems.h ;;
+ single) thread_header=gthr-single.h ;;
+ tpf) thread_header=config/s390/gthr-tpf.h ;;
+ vxworks) thread_header=config/gthr-vxworks.h ;;
+ win32) thread_header=config/i386/gthr-win32.h ;;
+esac
+
# Substitute configuration variables
@@ -4644,6 +4818,8 @@ ac_config_links="$ac_config_links md-unwind-support.h:config/$md_unwind_header"
ac_config_links="$ac_config_links sfp-machine.h:config/$sfp_machine_header"
+ac_config_links="$ac_config_links gthr-default.h:$thread_header"
+
# We need multilib support.
ac_config_files="$ac_config_files Makefile"
@@ -5373,6 +5549,7 @@ do
"unwind.h") CONFIG_LINKS="$CONFIG_LINKS unwind.h:$unwind_header" ;;
"md-unwind-support.h") CONFIG_LINKS="$CONFIG_LINKS md-unwind-support.h:config/$md_unwind_header" ;;
"sfp-machine.h") CONFIG_LINKS="$CONFIG_LINKS sfp-machine.h:config/$sfp_machine_header" ;;
+ "gthr-default.h") CONFIG_LINKS="$CONFIG_LINKS gthr-default.h:$thread_header" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index c1a3dce0f5b..748189393e6 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -6,6 +6,7 @@ sinclude(../config/acx.m4)
sinclude(../config/no-executables.m4)
sinclude(../config/lib-ld.m4)
sinclude(../config/override.m4)
+sinclude(../config/picflag.m4)
sinclude(../config/dfp.m4)
sinclude(../config/unwind_ipinfo.m4)
@@ -58,6 +59,9 @@ AC_ARG_ENABLE(shared,
], [enable_shared=yes])
AC_SUBST(enable_shared)
+GCC_PICFLAG
+AC_SUBST(PICFLAG)
+
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
@@ -180,6 +184,60 @@ AC_SUBST(fixed_point)
# config.gcc also contains tests of with_system_libunwind.
GCC_CHECK_UNWIND_GETIPINFO
+# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
+# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
+# libobjc/configure.ac (for Objective-C).
+# FIXME: This should be centralized in config/sjlj.m4.
+AC_ARG_ENABLE(sjlj-exceptions,
+ AC_HELP_STRING([--enable-sjlj-exceptions],
+ [force use of builtin_setjmp for exceptions]),
+ [case "$enableval" in
+ yes|no|auto) ;;
+ *) AC_MSG_ERROR([unknown argument to --enable-sjlj-exceptions]) ;;
+ esac],
+ [enable_sjlj_exceptions=auto])
+
+AC_CACHE_CHECK([whether to use setjmp/longjmp exceptions],
+[libgcc_cv_lib_sjlj_exceptions],
+[AC_LANG_CONFTEST(
+ [AC_LANG_SOURCE([
+void bar ();
+void clean (int *);
+void foo ()
+{
+ int i __attribute__ ((cleanup (clean)));
+ bar();
+}
+])])
+CFLAGS_hold=$CFLAGS
+CFLAGS="--save-temps -fexceptions"
+libgcc_cv_lib_sjlj_exceptions=unknown
+AS_IF([ac_fn_c_try_compile],
+ [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi])
+CFLAGS=$CFLAGS_hold
+rm -f conftest*
+])
+
+if test "$enable_sjlj_exceptions" = "auto"; then
+ enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
+fi
+
+case $enable_sjlj_exceptions in
+yes)
+ AC_DEFINE(LIBGCC_SJLJ_EXCEPTIONS, 1,
+ [Define if the C compiler is configured for setjmp/longjmp exceptions.])
+ ;;
+no)
+ ;;
+*)
+ AC_MSG_ERROR([unable to detect exception model])
+ ;;
+esac
+
AC_LIB_PROG_LD_GNU
AC_MSG_CHECKING([for thread model used by GCC])
@@ -197,20 +255,16 @@ AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi],
[libgcc_cv_cfi=yes],
[libgcc_cv_cfi=no])])
-# Check 32bit or 64bit for x86.
-case ${host} in
-i?86*-*-* | x86_64*-*-*)
- cat > conftest.c <<EOF
-#ifdef __x86_64__
+# Check 32bit or 64bit
+cat > conftest.c <<EOF
+#if defined(__x86_64__) || (!defined(__i386__) && defined(__LP64__))
host_address=64
#else
host_address=32
#endif
EOF
- eval `${CC-cc} -E conftest.c | grep host_address=`
- rm -f conftest.c
- ;;
-esac
+eval `${CC-cc} -E conftest.c | grep host_address=`
+rm -f conftest.c
# Collect host-machine-specific information.
. ${srcdir}/config.host
@@ -296,6 +350,30 @@ done
tmake_file="${tmake_file_}"
AC_SUBST(tmake_file)
+# Likewise export definitions for libgcc_tm.h
+tm_file_=
+for f in ${tm_file}
+do
+ tm_file_="${tm_file_} \$(srcdir)/config/$f"
+done
+tm_file="${tm_file_}"
+AC_SUBST(tm_file)
+AC_SUBST(tm_defines)
+
+# Map from thread model to thread header.
+case $target_thread_file in
+ aix) thread_header=config/rs6000/gthr-aix.h ;;
+ dce) thread_header=config/pa/gthr-dce.h ;;
+ lynx) thread_header=config/gthr-lynx.h ;;
+ mipssde) thread_header=config/mips/gthr-mipssde.h ;;
+ posix) thread_header=gthr-posix.h ;;
+ rtems) thread_header=config/gthr-rtems.h ;;
+ single) thread_header=gthr-single.h ;;
+ tpf) thread_header=config/s390/gthr-tpf.h ;;
+ vxworks) thread_header=config/gthr-vxworks.h ;;
+ win32) thread_header=config/i386/gthr-win32.h ;;
+esac
+
# Substitute configuration variables
AC_SUBST(cpu_type)
AC_SUBST(extra_parts)
@@ -304,6 +382,7 @@ AC_CONFIG_LINKS([enable-execute-stack.c:$enable_execute_stack])
AC_CONFIG_LINKS([unwind.h:$unwind_header])
AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
AC_CONFIG_LINKS([sfp-machine.h:config/$sfp_machine_header])
+AC_CONFIG_LINKS([gthr-default.h:$thread_header])
# We need multilib support.
AC_CONFIG_FILES([Makefile])
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
new file mode 100644
index 00000000000..66b2cdf2446
--- /dev/null
+++ b/libgcc/crtstuff.c
@@ -0,0 +1,651 @@
+/* Specialized bits of code needed to support construction and
+ destruction of file-scope objects in C++ code.
+ Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
+ Free Software Foundation, Inc.
+ Contributed by Ron Guilmette (rfg@monkeys.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/>. */
+
+/* This file is a bit like libgcc2.c in that it is compiled
+ multiple times and yields multiple .o files.
+
+ This file is useful on target machines where the object file format
+ supports multiple "user-defined" sections (e.g. COFF, ELF, ROSE). On
+ such systems, this file allows us to avoid running collect (or any
+ other such slow and painful kludge). Additionally, if the target
+ system supports a .init section, this file allows us to support the
+ linking of C++ code with a non-C++ main program.
+
+ Note that if INIT_SECTION_ASM_OP is defined in the tm.h file, then
+ this file *will* make use of the .init section. If that symbol is
+ not defined however, then the .init section will not be used.
+
+ Currently, only ELF and COFF are supported. It is likely however that
+ ROSE could also be supported, if someone was willing to do the work to
+ make whatever (small?) adaptations are needed. (Some work may be
+ needed on the ROSE assembler and linker also.)
+
+ This file must be compiled with gcc. */
+
+/* Target machine header files require this define. */
+#define IN_LIBGCC2
+
+/* FIXME: Including auto-host is incorrect, but until we have
+ identified the set of defines that need to go into auto-target.h,
+ this will have to do. */
+#include "auto-host.h"
+#undef pid_t
+#undef rlim_t
+#undef ssize_t
+#undef vfork
+#include "tconfig.h"
+#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "libgcc_tm.h"
+#include "unwind-dw2-fde.h"
+
+#ifndef FORCE_CODE_SECTION_ALIGN
+# define FORCE_CODE_SECTION_ALIGN
+#endif
+
+#ifndef CRT_CALL_STATIC_FUNCTION
+# define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+static void __attribute__((__used__)) \
+call_ ## FUNC (void) \
+{ \
+ asm (SECTION_OP); \
+ FUNC (); \
+ FORCE_CODE_SECTION_ALIGN \
+ asm (TEXT_SECTION_ASM_OP); \
+}
+#endif
+
+#if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+ && defined(__FreeBSD__) && __FreeBSD__ >= 7
+#include <link.h>
+# define USE_PT_GNU_EH_FRAME
+#endif
+
+#if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+ && defined(__sun__) && defined(__svr4__)
+#include <link.h>
+# define USE_PT_GNU_EH_FRAME
+#endif
+
+#if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+ && defined(__GLIBC__) && __GLIBC__ >= 2
+#include <link.h>
+/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+ But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
+# if !defined(__UCLIBC__) \
+ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+# define USE_PT_GNU_EH_FRAME
+# endif
+#endif
+#if defined(EH_FRAME_SECTION_NAME) && !defined(USE_PT_GNU_EH_FRAME)
+# define USE_EH_FRAME_REGISTRY
+#endif
+#if defined(EH_FRAME_SECTION_NAME) && EH_TABLES_CAN_BE_READ_ONLY
+# define EH_FRAME_SECTION_CONST const
+#else
+# define EH_FRAME_SECTION_CONST
+#endif
+
+#if !defined(DTOR_LIST_END) && defined(OBJECT_FORMAT_ELF) \
+ && defined(HAVE_GAS_HIDDEN) && !defined(FINI_ARRAY_SECTION_ASM_OP)
+# define HIDDEN_DTOR_LIST_END
+#endif
+
+/* We do not want to add the weak attribute to the declarations of these
+ routines in unwind-dw2-fde.h because that will cause the definition of
+ these symbols to be weak as well.
+
+ This exposes a core issue, how to handle creating weak references vs
+ how to create weak definitions. Either we have to have the definition
+ of TARGET_WEAK_ATTRIBUTE be conditional in the shared header files or
+ have a second declaration if we want a function's references to be weak,
+ but not its definition.
+
+ Making TARGET_WEAK_ATTRIBUTE conditional seems like a good solution until
+ one thinks about scaling to larger problems -- i.e., the condition under
+ which TARGET_WEAK_ATTRIBUTE is active will eventually get far too
+ complicated.
+
+ So, we take an approach similar to #pragma weak -- we have a second
+ declaration for functions that we want to have weak references.
+
+ Neither way is particularly good. */
+
+/* References to __register_frame_info and __deregister_frame_info should
+ be weak in this file if at all possible. */
+extern void __register_frame_info (const void *, struct object *)
+ TARGET_ATTRIBUTE_WEAK;
+extern void __register_frame_info_bases (const void *, struct object *,
+ void *, void *)
+ TARGET_ATTRIBUTE_WEAK;
+extern void *__deregister_frame_info (const void *)
+ TARGET_ATTRIBUTE_WEAK;
+extern void *__deregister_frame_info_bases (const void *)
+ TARGET_ATTRIBUTE_WEAK;
+extern void __do_global_ctors_1 (void);
+
+/* Likewise for _Jv_RegisterClasses. */
+extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK;
+
+#ifdef OBJECT_FORMAT_ELF
+
+/* Declare a pointer to void function type. */
+typedef void (*func_ptr) (void);
+#define STATIC static
+
+#else /* OBJECT_FORMAT_ELF */
+
+#include "gbl-ctors.h"
+
+#define STATIC
+
+#endif /* OBJECT_FORMAT_ELF */
+
+#ifdef CRT_BEGIN
+
+/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
+ to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
+ __DTOR_END__ } per root executable and also one set of these symbols
+ per shared library. So in any given whole process image, we may have
+ multiple definitions of each of these symbols. In order to prevent
+ these definitions from conflicting with one another, and in order to
+ ensure that the proper lists are used for the initialization/finalization
+ of each individual shared library (respectively), we give these symbols
+ only internal (i.e. `static') linkage, and we also make it a point to
+ refer to only the __CTOR_END__ symbol in crtend.o and the __DTOR_LIST__
+ symbol in crtbegin.o, where they are defined. */
+
+/* No need for .ctors/.dtors section if linker can place them in
+ .init_array/.fini_array section. */
+#ifndef USE_INITFINI_ARRAY
+/* The -1 is a flag to __do_global_[cd]tors indicating that this table
+ does not start with a count of elements. */
+#ifdef CTOR_LIST_BEGIN
+CTOR_LIST_BEGIN;
+#elif defined(CTORS_SECTION_ASM_OP)
+/* Hack: force cc1 to switch to .data section early, so that assembling
+ __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */
+static func_ptr force_to_data[1] __attribute__ ((__used__)) = { };
+asm (CTORS_SECTION_ASM_OP);
+STATIC func_ptr __CTOR_LIST__[1]
+ __attribute__ ((__used__, aligned(sizeof(func_ptr))))
+ = { (func_ptr) (-1) };
+#else
+STATIC func_ptr __CTOR_LIST__[1]
+ __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr))))
+ = { (func_ptr) (-1) };
+#endif /* __CTOR_LIST__ alternatives */
+
+#ifdef DTOR_LIST_BEGIN
+DTOR_LIST_BEGIN;
+#elif defined(DTORS_SECTION_ASM_OP)
+asm (DTORS_SECTION_ASM_OP);
+STATIC func_ptr __DTOR_LIST__[1]
+ __attribute__ ((aligned(sizeof(func_ptr))))
+ = { (func_ptr) (-1) };
+#else
+STATIC func_ptr __DTOR_LIST__[1]
+ __attribute__((section(".dtors"), aligned(sizeof(func_ptr))))
+ = { (func_ptr) (-1) };
+#endif /* __DTOR_LIST__ alternatives */
+#endif /* USE_INITFINI_ARRAY */
+
+#ifdef USE_EH_FRAME_REGISTRY
+/* Stick a label at the beginning of the frame unwind info so we can register
+ and deregister it with the exception handling library code. */
+STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
+ __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+ = { };
+#endif /* USE_EH_FRAME_REGISTRY */
+
+#ifdef JCR_SECTION_NAME
+/* Stick a label at the beginning of the java class registration info
+ so we can register them properly. */
+STATIC void *__JCR_LIST__[]
+ __attribute__ ((used, section(JCR_SECTION_NAME), aligned(sizeof(void*))))
+ = { };
+#endif /* JCR_SECTION_NAME */
+
+#if defined(INIT_SECTION_ASM_OP) || defined(INIT_ARRAY_SECTION_ASM_OP)
+
+#ifdef OBJECT_FORMAT_ELF
+
+/* Declare the __dso_handle variable. It should have a unique value
+ in every shared-object; in a main program its value is zero. The
+ object should in any case be protected. This means the instance
+ in one DSO or the main program is not used in another object. The
+ dynamic linker takes care of this. */
+
+#ifdef TARGET_LIBGCC_SDATA_SECTION
+extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION)));
+#endif
+#ifdef HAVE_GAS_HIDDEN
+extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
+#endif
+#ifdef CRTSTUFFS_O
+void *__dso_handle = &__dso_handle;
+#else
+void *__dso_handle = 0;
+#endif
+
+/* The __cxa_finalize function may not be available so we use only a
+ weak declaration. */
+extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK;
+
+/* Run all the global destructors on exit from the program. */
+
+/* Some systems place the number of pointers in the first word of the
+ table. On SVR4 however, that word is -1. In all cases, the table is
+ null-terminated. On SVR4, we start from the beginning of the list and
+ invoke each per-compilation-unit destructor routine in order
+ until we find that null.
+
+ Note that this function MUST be static. There will be one of these
+ functions in each root executable and one in each shared library, but
+ although they all have the same code, each one is unique in that it
+ refers to one particular associated `__DTOR_LIST__' which belongs to the
+ same particular root executable or shared library file.
+
+ On some systems, this routine is run more than once from the .fini,
+ when exit is called recursively, so we arrange to remember where in
+ the list we left off processing, and we resume at that point,
+ should we be re-invoked. */
+
+static void __attribute__((used))
+__do_global_dtors_aux (void)
+{
+ static _Bool completed;
+
+ if (__builtin_expect (completed, 0))
+ return;
+
+#ifdef CRTSTUFFS_O
+ if (__cxa_finalize)
+ __cxa_finalize (__dso_handle);
+#endif
+
+#ifdef FINI_ARRAY_SECTION_ASM_OP
+ /* If we are using .fini_array then destructors will be run via that
+ mechanism. */
+#elif defined(HIDDEN_DTOR_LIST_END)
+ {
+ /* Safer version that makes sure only .dtors function pointers are
+ called even if the static variable is maliciously changed. */
+ extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden")));
+ static size_t dtor_idx;
+ const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1;
+ func_ptr f;
+
+ while (dtor_idx < max_idx)
+ {
+ f = __DTOR_LIST__[++dtor_idx];
+ f ();
+ }
+ }
+#else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */
+ {
+ static func_ptr *p = __DTOR_LIST__ + 1;
+ func_ptr f;
+
+ while ((f = *p))
+ {
+ p++;
+ f ();
+ }
+ }
+#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
+
+#ifdef USE_EH_FRAME_REGISTRY
+#ifdef CRT_GET_RFIB_DATA
+ /* If we used the new __register_frame_info_bases interface,
+ make sure that we deregister from the same place. */
+ if (__deregister_frame_info_bases)
+ __deregister_frame_info_bases (__EH_FRAME_BEGIN__);
+#else
+ if (__deregister_frame_info)
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
+#endif
+#endif
+
+ completed = 1;
+}
+
+/* Stick a call to __do_global_dtors_aux into the .fini section. */
+#ifdef FINI_SECTION_ASM_OP
+CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux)
+#elif defined (FINI_ARRAY_SECTION_ASM_OP)
+static func_ptr __do_global_dtors_aux_fini_array_entry[]
+ __attribute__ ((__used__, section(".fini_array")))
+ = { __do_global_dtors_aux };
+#else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */
+static void __attribute__((used))
+__do_global_dtors_aux_1 (void)
+{
+ atexit (__do_global_dtors_aux);
+}
+CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_dtors_aux_1)
+#endif
+
+#if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
+/* Stick a call to __register_frame_info into the .init section. For some
+ reason calls with no arguments work more reliably in .init, so stick the
+ call in another function. */
+
+static void __attribute__((used))
+frame_dummy (void)
+{
+#ifdef USE_EH_FRAME_REGISTRY
+ static struct object object;
+#ifdef CRT_GET_RFIB_DATA
+ void *tbase, *dbase;
+ tbase = 0;
+ CRT_GET_RFIB_DATA (dbase);
+ if (__register_frame_info_bases)
+ __register_frame_info_bases (__EH_FRAME_BEGIN__, &object, tbase, dbase);
+#else
+ if (__register_frame_info)
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#endif /* CRT_GET_RFIB_DATA */
+#endif /* USE_EH_FRAME_REGISTRY */
+#ifdef JCR_SECTION_NAME
+ if (__JCR_LIST__[0])
+ {
+ void (*register_classes) (void *) = _Jv_RegisterClasses;
+ __asm ("" : "+r" (register_classes));
+ if (register_classes)
+ register_classes (__JCR_LIST__);
+ }
+#endif /* JCR_SECTION_NAME */
+}
+
+#ifdef INIT_SECTION_ASM_OP
+CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy)
+#else /* defined(INIT_SECTION_ASM_OP) */
+static func_ptr __frame_dummy_init_array_entry[]
+ __attribute__ ((__used__, section(".init_array")))
+ = { frame_dummy };
+#endif /* !defined(INIT_SECTION_ASM_OP) */
+#endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME */
+
+#else /* OBJECT_FORMAT_ELF */
+
+/* The function __do_global_ctors_aux is compiled twice (once in crtbegin.o
+ and once in crtend.o). It must be declared static to avoid a link
+ error. Here, we define __do_global_ctors as an externally callable
+ function. It is externally callable so that __main can invoke it when
+ INVOKE__main is defined. This has the additional effect of forcing cc1
+ to switch to the .text section. */
+
+static void __do_global_ctors_aux (void);
+void
+__do_global_ctors (void)
+{
+#ifdef INVOKE__main
+ /* If __main won't actually call __do_global_ctors then it doesn't matter
+ what's inside the function. The inside of __do_global_ctors_aux is
+ called automatically in that case. And the Alliant fx2800 linker
+ crashes on this reference. So prevent the crash. */
+ __do_global_ctors_aux ();
+#endif
+}
+
+asm (INIT_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
+
+/* A routine to invoke all of the global constructors upon entry to the
+ program. We put this into the .init section (for systems that have
+ such a thing) so that we can properly perform the construction of
+ file-scope static-storage C++ objects within shared libraries. */
+
+static void __attribute__((used))
+__do_global_ctors_aux (void) /* prologue goes in .init section */
+{
+ FORCE_CODE_SECTION_ALIGN /* explicit align before switch to .text */
+ asm (TEXT_SECTION_ASM_OP); /* don't put epilogue and body in .init */
+ DO_GLOBAL_CTORS_BODY;
+ atexit (__do_global_dtors);
+}
+
+#endif /* OBJECT_FORMAT_ELF */
+
+#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+
+extern void __do_global_dtors (void);
+
+/* This case is used by the Irix 6 port, which supports named sections but
+ not an SVR4-style .fini section. __do_global_dtors can be non-static
+ in this case because we protect it with -hidden_symbol. */
+
+void
+__do_global_dtors (void)
+{
+ func_ptr *p, f;
+ for (p = __DTOR_LIST__ + 1; (f = *p); p++)
+ f ();
+
+#ifdef USE_EH_FRAME_REGISTRY
+ if (__deregister_frame_info)
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
+#endif
+}
+
+#if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
+/* A helper function for __do_global_ctors, which is in crtend.o. Here
+ in crtbegin.o, we can reference a couple of symbols not visible there.
+ Plus, since we're before libgcc.a, we have no problems referencing
+ functions from there. */
+void
+__do_global_ctors_1(void)
+{
+#ifdef USE_EH_FRAME_REGISTRY
+ static struct object object;
+ if (__register_frame_info)
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#endif
+#ifdef JCR_SECTION_NAME
+ if (__JCR_LIST__[0])
+ {
+ void (*register_classes) (void *) = _Jv_RegisterClasses;
+ __asm ("" : "+r" (register_classes));
+ if (register_classes)
+ register_classes (__JCR_LIST__);
+ }
+#endif
+}
+#endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME */
+
+#else /* ! INIT_SECTION_ASM_OP && ! HAS_INIT_SECTION */
+#error "What are you doing with crtstuff.c, then?"
+#endif
+
+#elif defined(CRT_END) /* ! CRT_BEGIN */
+
+/* No need for .ctors/.dtors section if linker can place them in
+ .init_array/.fini_array section. */
+#ifndef USE_INITFINI_ARRAY
+/* Put a word containing zero at the end of each of our two lists of function
+ addresses. Note that the words defined here go into the .ctors and .dtors
+ sections of the crtend.o file, and since that file is always linked in
+ last, these words naturally end up at the very ends of the two lists
+ contained in these two sections. */
+
+#ifdef CTOR_LIST_END
+CTOR_LIST_END;
+#elif defined(CTORS_SECTION_ASM_OP)
+/* Hack: force cc1 to switch to .data section early, so that assembling
+ __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */
+static func_ptr force_to_data[1] __attribute__ ((__used__)) = { };
+asm (CTORS_SECTION_ASM_OP);
+STATIC func_ptr __CTOR_END__[1]
+ __attribute__((aligned(sizeof(func_ptr))))
+ = { (func_ptr) 0 };
+#else
+STATIC func_ptr __CTOR_END__[1]
+ __attribute__((section(".ctors"), aligned(sizeof(func_ptr))))
+ = { (func_ptr) 0 };
+#endif
+
+#ifdef DTOR_LIST_END
+DTOR_LIST_END;
+#elif defined(HIDDEN_DTOR_LIST_END)
+#ifdef DTORS_SECTION_ASM_OP
+asm (DTORS_SECTION_ASM_OP);
+#endif
+func_ptr __DTOR_END__[1]
+ __attribute__ ((used,
+#ifndef DTORS_SECTION_ASM_OP
+ section(".dtors"),
+#endif
+ aligned(sizeof(func_ptr)), visibility ("hidden")))
+ = { (func_ptr) 0 };
+#elif defined(DTORS_SECTION_ASM_OP)
+asm (DTORS_SECTION_ASM_OP);
+STATIC func_ptr __DTOR_END__[1]
+ __attribute__ ((used, aligned(sizeof(func_ptr))))
+ = { (func_ptr) 0 };
+#else
+STATIC func_ptr __DTOR_END__[1]
+ __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr))))
+ = { (func_ptr) 0 };
+#endif
+#endif /* USE_INITFINI_ARRAY */
+
+#ifdef EH_FRAME_SECTION_NAME
+/* Terminate the frame unwind info section with a 4byte 0 as a sentinel;
+ this would be the 'length' field in a real FDE. */
+# if __INT_MAX__ == 2147483647
+typedef int int32;
+# elif __LONG_MAX__ == 2147483647
+typedef long int32;
+# elif __SHRT_MAX__ == 2147483647
+typedef short int32;
+# else
+# error "Missing a 4 byte integer"
+# endif
+STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[]
+ __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
+ aligned(sizeof(int32))))
+ = { 0 };
+#endif /* EH_FRAME_SECTION_NAME */
+
+#ifdef JCR_SECTION_NAME
+/* Null terminate the .jcr section array. */
+STATIC void *__JCR_END__[1]
+ __attribute__ ((used, section(JCR_SECTION_NAME),
+ aligned(sizeof(void *))))
+ = { 0 };
+#endif /* JCR_SECTION_NAME */
+
+#ifdef INIT_ARRAY_SECTION_ASM_OP
+
+/* If we are using .init_array, there is nothing to do. */
+
+#elif defined(INIT_SECTION_ASM_OP)
+
+#ifdef OBJECT_FORMAT_ELF
+static void __attribute__((used))
+__do_global_ctors_aux (void)
+{
+ func_ptr *p;
+ for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
+ (*p) ();
+}
+
+/* Stick a call to __do_global_ctors_aux into the .init section. */
+CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_ctors_aux)
+#else /* OBJECT_FORMAT_ELF */
+
+/* Stick the real initialization code, followed by a normal sort of
+ function epilogue at the very end of the .init section for this
+ entire root executable file or for this entire shared library file.
+
+ Note that we use some tricks here to get *just* the body and just
+ a function epilogue (but no function prologue) into the .init
+ section of the crtend.o file. Specifically, we switch to the .text
+ section, start to define a function, and then we switch to the .init
+ section just before the body code.
+
+ Earlier on, we put the corresponding function prologue into the .init
+ section of the crtbegin.o file (which will be linked in first).
+
+ Note that we want to invoke all constructors for C++ file-scope static-
+ storage objects AFTER any other possible initialization actions which
+ may be performed by the code in the .init section contributions made by
+ other libraries, etc. That's because those other initializations may
+ include setup operations for very primitive things (e.g. initializing
+ the state of the floating-point coprocessor, etc.) which should be done
+ before we start to execute any of the user's code. */
+
+static void
+__do_global_ctors_aux (void) /* prologue goes in .text section */
+{
+ asm (INIT_SECTION_ASM_OP);
+ DO_GLOBAL_CTORS_BODY;
+ atexit (__do_global_dtors);
+} /* epilogue and body go in .init section */
+
+FORCE_CODE_SECTION_ALIGN
+asm (TEXT_SECTION_ASM_OP);
+
+#endif /* OBJECT_FORMAT_ELF */
+
+#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+
+extern void __do_global_ctors (void);
+
+/* This case is used by the Irix 6 port, which supports named sections but
+ not an SVR4-style .init section. __do_global_ctors can be non-static
+ in this case because we protect it with -hidden_symbol. */
+void
+__do_global_ctors (void)
+{
+ func_ptr *p;
+#if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
+ __do_global_ctors_1();
+#endif
+ for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
+ (*p) ();
+}
+
+#else /* ! INIT_SECTION_ASM_OP && ! HAS_INIT_SECTION */
+#error "What are you doing with crtstuff.c, then?"
+#endif
+
+#else /* ! CRT_BEGIN && ! CRT_END */
+#error "One of CRT_BEGIN or CRT_END must be defined."
+#endif
diff --git a/libgcc/dfp-bit.h b/libgcc/dfp-bit.h
index 45b79086bc9..c97869baca1 100644
--- a/libgcc/dfp-bit.h
+++ b/libgcc/dfp-bit.h
@@ -1,5 +1,5 @@
/* Header file for dfp-bit.c.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
diff --git a/gcc/config/divmod.c b/libgcc/divmod.c
index c227b99ccd2..c227b99ccd2 100644
--- a/gcc/config/divmod.c
+++ b/libgcc/divmod.c
diff --git a/libgcc/emutls.c b/libgcc/emutls.c
index b7ee3bdfa7c..22ea4403edb 100644
--- a/libgcc/emutls.c
+++ b/libgcc/emutls.c
@@ -1,5 +1,5 @@
/* TLS emulation.
- Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of GCC.
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "gthr.h"
typedef unsigned int word __attribute__((mode(word)));
diff --git a/libgcc/fixed-bit.c b/libgcc/fixed-bit.c
index d434d131eec..84e58155ccd 100644
--- a/libgcc/fixed-bit.c
+++ b/libgcc/fixed-bit.c
@@ -1,5 +1,5 @@
/* This is a software fixed-point library.
- Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -46,6 +46,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#ifndef MIN_UNITS_PER_WORD
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
diff --git a/gcc/config/floatunsidf.c b/libgcc/floatunsidf.c
index ff28112502b..ff28112502b 100644
--- a/gcc/config/floatunsidf.c
+++ b/libgcc/floatunsidf.c
diff --git a/gcc/config/floatunsisf.c b/libgcc/floatunsisf.c
index 11d4aa78cbe..11d4aa78cbe 100644
--- a/gcc/config/floatunsisf.c
+++ b/libgcc/floatunsisf.c
diff --git a/gcc/config/floatunsitf.c b/libgcc/floatunsitf.c
index 955d67666c5..955d67666c5 100644
--- a/gcc/config/floatunsitf.c
+++ b/libgcc/floatunsitf.c
diff --git a/gcc/config/floatunsixf.c b/libgcc/floatunsixf.c
index 52511688dad..52511688dad 100644
--- a/gcc/config/floatunsixf.c
+++ b/libgcc/floatunsixf.c
diff --git a/libgcc/fp-bit.c b/libgcc/fp-bit.c
index de9b3ada5ec..7509f76f71e 100644
--- a/libgcc/fp-bit.c
+++ b/libgcc/fp-bit.c
@@ -37,6 +37,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "fp-bit.h"
/* The following macros can be defined to change the behavior of this file:
diff --git a/gcc/gbl-ctors.h b/libgcc/gbl-ctors.h
index ac4faae1292..ac4faae1292 100644
--- a/gcc/gbl-ctors.h
+++ b/libgcc/gbl-ctors.h
diff --git a/libgcc/generic-morestack-thread.c b/libgcc/generic-morestack-thread.c
index 794fdc3dc54..bbe6dd12b5a 100644
--- a/libgcc/generic-morestack-thread.c
+++ b/libgcc/generic-morestack-thread.c
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
/* If inhibit_libc is defined, we can not compile this file. The
effect is that people will not be able to use -fsplit-stack. That
diff --git a/libgcc/generic-morestack.c b/libgcc/generic-morestack.c
index 0b660cedd5f..07bc2a66073 100644
--- a/libgcc/generic-morestack.c
+++ b/libgcc/generic-morestack.c
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
/* If inhibit_libc is defined, we can not compile this file. The
effect is that people will not be able to use -fsplit-stack. That
diff --git a/gcc/gthr-posix.h b/libgcc/gthr-posix.h
index 46054f6a7c2..46054f6a7c2 100644
--- a/gcc/gthr-posix.h
+++ b/libgcc/gthr-posix.h
diff --git a/gcc/gthr-single.h b/libgcc/gthr-single.h
index 357528ad1f1..357528ad1f1 100644
--- a/gcc/gthr-single.h
+++ b/libgcc/gthr-single.h
diff --git a/gcc/gthr.h b/libgcc/gthr.h
index 0c7bfb17aa3..607c26eb563 100644
--- a/gcc/gthr.h
+++ b/libgcc/gthr.h
@@ -132,23 +132,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
__gthread_recursive_mutex_t *mutex,
const __gthread_time_t *abs_time)
- Currently supported threads packages are
- TPF threads with -D__tpf__
- POSIX/Unix98 threads with -D_PTHREADS
- DCE threads with -D_DCE_THREADS
-
*/
-/* Check first for thread specific defines. */
-#if defined (__tpf__)
-#include "gthr-tpf.h"
-#elif _PTHREADS
-#include "gthr-posix.h"
-#elif _DCE_THREADS
-#include "gthr-dce.h"
-
-/* Include GTHREAD_FILE if one is defined. */
-#elif defined(HAVE_GTHR_DEFAULT)
#if SUPPORTS_WEAK
#ifndef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 1
@@ -156,11 +141,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
#include "gthr-default.h"
-/* Fallback to single thread definitions. */
-#else
-#include "gthr-single.h"
-#endif
-
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop
#endif
diff --git a/gcc/libgcc2.c b/libgcc/libgcc2.c
index 57c40c5800f..b672bcbdd41 100644
--- a/gcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#ifdef HAVE_GAS_HIDDEN
#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
diff --git a/gcc/libgcc2.h b/libgcc/libgcc2.h
index 0c7d0e15623..0c7d0e15623 100644
--- a/gcc/libgcc2.h
+++ b/libgcc/libgcc2.h
diff --git a/libgcc/libgcov.c b/libgcc/libgcov.c
index b39ef49343f..f7691df967c 100644
--- a/libgcc/libgcov.c
+++ b/libgcc/libgcov.c
@@ -1,7 +1,7 @@
/* Routines required for instrumenting a program. */
/* Compile this one with gcc. */
/* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#if defined(inhibit_libc)
#define IN_LIBGCOV (-1)
@@ -77,6 +78,14 @@ void __gcov_merge_delta (gcov_type *counters __attribute__ ((unused)),
#ifdef L_gcov
#include "gcov-io.c"
+struct gcov_fn_buffer
+{
+ struct gcov_fn_buffer *next;
+ unsigned fn_ix;
+ struct gcov_fn_info info;
+ /* note gcov_fn_info ends in a trailing array. */
+};
+
/* Chain of per-object gcov structures. */
static struct gcov_info *gcov_list;
@@ -134,6 +143,64 @@ create_file_directory (char *filename)
#endif
}
+static struct gcov_fn_buffer **
+buffer_fn_data (struct gcov_info *gi_ptr, struct gcov_fn_buffer **end_ptr,
+ unsigned fn_ix)
+{
+ unsigned n_ctrs = 0, ix;
+ struct gcov_fn_buffer *fn_buffer;
+
+ for (ix = GCOV_COUNTERS; ix--;)
+ if (gi_ptr->merge[ix])
+ n_ctrs++;
+
+ fn_buffer = (struct gcov_fn_buffer *)malloc
+ (sizeof (*fn_buffer) + sizeof (fn_buffer->info.ctrs[0]) * n_ctrs);
+
+ if (!fn_buffer)
+ return 0; /* We'll horribly fail. */
+
+ fn_buffer->next = 0;
+ fn_buffer->fn_ix = fn_ix;
+ fn_buffer->info.ident = gcov_read_unsigned ();
+ fn_buffer->info.lineno_checksum = gcov_read_unsigned ();
+ fn_buffer->info.cfg_checksum = gcov_read_unsigned ();
+
+ for (n_ctrs = ix = 0; ix != GCOV_COUNTERS; ix++)
+ {
+ gcov_unsigned_t length;
+ gcov_type *values;
+
+ if (!gi_ptr->merge[ix])
+ continue;
+
+ if (gcov_read_unsigned () != GCOV_TAG_FOR_COUNTER (ix))
+ goto fail;
+
+ length = GCOV_TAG_COUNTER_NUM (gcov_read_unsigned ());
+ values = (gcov_type *)malloc (length * sizeof (gcov_type));
+ if (!values)
+ {
+ while (n_ctrs--)
+ free (fn_buffer->info.ctrs[n_ctrs].values);
+ goto fail;
+ }
+ fn_buffer->info.ctrs[n_ctrs].num = length;
+ fn_buffer->info.ctrs[n_ctrs].values = values;
+
+ while (length--)
+ *values++ = gcov_read_counter ();
+ n_ctrs++;
+ }
+
+ *end_ptr = fn_buffer;
+ return &fn_buffer->next;
+
+ fail:
+ free (fn_buffer);
+ return 0;
+}
+
/* Check if VERSION of the info block PTR matches libgcov one.
Return 1 on success, or zero in case of versions mismatch.
If FILENAME is not NULL, its value used for reporting purposes
@@ -169,39 +236,46 @@ static void
gcov_exit (void)
{
struct gcov_info *gi_ptr;
- struct gcov_summary this_program;
- struct gcov_summary all;
+ const struct gcov_fn_info *gfi_ptr;
+ struct gcov_summary this_prg; /* summary for program. */
+ struct gcov_summary all_prg; /* summary for all instances of program. */
struct gcov_ctr_summary *cs_ptr;
const struct gcov_ctr_info *ci_ptr;
- unsigned t_ix;
+ unsigned t_ix, f_ix;
gcov_unsigned_t c_num;
const char *gcov_prefix;
int gcov_prefix_strip = 0;
size_t prefix_length;
char *gi_filename, *gi_filename_up;
- memset (&all, 0, sizeof (all));
+ memset (&all_prg, 0, sizeof (all_prg));
/* Find the totals for this execution. */
- memset (&this_program, 0, sizeof (this_program));
+ memset (&this_prg, 0, sizeof (this_prg));
for (gi_ptr = gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
- {
- ci_ptr = gi_ptr->counts;
- for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
- {
- if (!((1 << t_ix) & gi_ptr->ctr_mask))
- continue;
+ for (f_ix = 0; f_ix != gi_ptr->n_functions; f_ix++)
+ {
+ gfi_ptr = gi_ptr->functions[f_ix];
+
+ if (!gfi_ptr || gfi_ptr->key != gi_ptr)
+ continue;
+
+ ci_ptr = gfi_ptr->ctrs;
+ for (t_ix = 0; t_ix != GCOV_COUNTERS_SUMMABLE; t_ix++)
+ {
+ if (!gi_ptr->merge[t_ix])
+ continue;
- cs_ptr = &this_program.ctrs[t_ix];
- cs_ptr->num += ci_ptr->num;
- for (c_num = 0; c_num < ci_ptr->num; c_num++)
- {
- cs_ptr->sum_all += ci_ptr->values[c_num];
- if (cs_ptr->run_max < ci_ptr->values[c_num])
- cs_ptr->run_max = ci_ptr->values[c_num];
- }
- ci_ptr++;
- }
- }
+ cs_ptr = &this_prg.ctrs[t_ix];
+ cs_ptr->num += ci_ptr->num;
+ for (c_num = 0; c_num < ci_ptr->num; c_num++)
+ {
+ cs_ptr->sum_all += ci_ptr->values[c_num];
+ if (cs_ptr->run_max < ci_ptr->values[c_num])
+ cs_ptr->run_max = ci_ptr->values[c_num];
+ }
+ ci_ptr++;
+ }
+ }
{
/* Check if the level of dirs to strip off specified. */
@@ -214,6 +288,7 @@ gcov_exit (void)
gcov_prefix_strip = 0;
}
}
+
/* Get file name relocation prefix. Non-absolute values are ignored. */
gcov_prefix = getenv("GCOV_PREFIX");
if (gcov_prefix)
@@ -243,24 +318,20 @@ gcov_exit (void)
/* Now merge each file. */
for (gi_ptr = gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
{
- struct gcov_summary this_object;
- struct gcov_summary object, program;
- gcov_type *values[GCOV_COUNTERS];
- const struct gcov_fn_info *fi_ptr;
- unsigned fi_stride;
- unsigned c_ix, f_ix, n_counts;
- struct gcov_ctr_summary *cs_obj, *cs_tobj, *cs_prg, *cs_tprg, *cs_all;
+ unsigned n_counts;
+ struct gcov_summary prg; /* summary for this object over all
+ program. */
+ struct gcov_ctr_summary *cs_prg, *cs_tprg, *cs_all;
int error = 0;
gcov_unsigned_t tag, length;
gcov_position_t summary_pos = 0;
gcov_position_t eof_pos = 0;
const char *fname, *s;
+ struct gcov_fn_buffer *fn_buffer = 0;
+ struct gcov_fn_buffer **fn_tail = &fn_buffer;
fname = gi_ptr->filename;
- memset (&this_object, 0, sizeof (this_object));
- memset (&object, 0, sizeof (object));
-
/* Avoid to add multiple drive letters into combined path. */
if (prefix_length != 0 && HAS_DRIVE_SPEC(fname))
fname += 2;
@@ -282,6 +353,7 @@ gcov_exit (void)
level++;
}
}
+
/* Update complete filename with stripped original. */
if (prefix_length != 0 && !IS_DIR_SEPARATOR (*fname))
{
@@ -292,42 +364,6 @@ gcov_exit (void)
else
strcpy (gi_filename_up, fname);
- /* Totals for this object file. */
- ci_ptr = gi_ptr->counts;
- for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
- {
- if (!((1 << t_ix) & gi_ptr->ctr_mask))
- continue;
-
- cs_ptr = &this_object.ctrs[t_ix];
- cs_ptr->num += ci_ptr->num;
- for (c_num = 0; c_num < ci_ptr->num; c_num++)
- {
- cs_ptr->sum_all += ci_ptr->values[c_num];
- if (cs_ptr->run_max < ci_ptr->values[c_num])
- cs_ptr->run_max = ci_ptr->values[c_num];
- }
-
- ci_ptr++;
- }
-
- c_ix = 0;
- for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- values[c_ix] = gi_ptr->counts[c_ix].values;
- c_ix++;
- }
-
- /* Calculate the function_info stride. This depends on the
- number of counter types being measured. */
- fi_stride = sizeof (struct gcov_fn_info) + c_ix * sizeof (unsigned);
- if (__alignof__ (struct gcov_fn_info) > sizeof (unsigned))
- {
- fi_stride += __alignof__ (struct gcov_fn_info) - 1;
- fi_stride &= ~(__alignof__ (struct gcov_fn_info) - 1);
- }
-
if (!gcov_open (gi_filename))
{
/* Open failed likely due to missed directory.
@@ -363,83 +399,98 @@ gcov_exit (void)
/* Read from a different compilation. Overwrite the file. */
goto rewrite;
- /* Merge execution counts for each function. */
- for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
+ /* Look for program summary. */
+ for (f_ix = ~0u;;)
{
- fi_ptr = (const struct gcov_fn_info *)
- ((const char *) gi_ptr->functions + f_ix * fi_stride);
+ struct gcov_summary tmp;
+
+ eof_pos = gcov_position ();
tag = gcov_read_unsigned ();
+ if (tag != GCOV_TAG_PROGRAM_SUMMARY)
+ break;
+
+ length = gcov_read_unsigned ();
+ if (length != GCOV_TAG_SUMMARY_LENGTH)
+ goto read_mismatch;
+ gcov_read_summary (&tmp);
+ if ((error = gcov_is_error ()))
+ goto read_error;
+ if (!summary_pos && tmp.checksum == gcov_crc32)
+ {
+ prg = tmp;
+ summary_pos = eof_pos;
+ }
+ }
+
+ /* Merge execution counts for each function. */
+ for (f_ix = 0; f_ix != gi_ptr->n_functions;
+ f_ix++, tag = gcov_read_unsigned ())
+ {
+ gfi_ptr = gi_ptr->functions[f_ix];
+
+ if (tag != GCOV_TAG_FUNCTION)
+ goto read_mismatch;
length = gcov_read_unsigned ();
- /* Check function. */
- if (tag != GCOV_TAG_FUNCTION
- || length != GCOV_TAG_FUNCTION_LENGTH
- || gcov_read_unsigned () != fi_ptr->ident
- || gcov_read_unsigned () != fi_ptr->lineno_checksum
- || gcov_read_unsigned () != fi_ptr->cfg_checksum)
+ if (!length)
+ /* This function did not appear in the other program.
+ We have nothing to merge. */
+ continue;
+
+ if (length != GCOV_TAG_FUNCTION_LENGTH)
+ goto read_mismatch;
+
+ if (!gfi_ptr || gfi_ptr->key != gi_ptr)
{
- read_mismatch:;
- fprintf (stderr, "profiling:%s:Merge mismatch for %s\n",
- gi_filename,
- f_ix + 1 ? "function" : "summaries");
- goto read_fatal;
+ /* This function appears in the other program. We
+ need to buffer the information in order to write
+ it back out -- we'll be inserting data before
+ this point, so cannot simply keep the data in the
+ file. */
+ fn_tail = buffer_fn_data (gi_ptr, fn_tail, f_ix);
+ if (!fn_tail)
+ goto read_mismatch;
+ continue;
}
- c_ix = 0;
+ if (gcov_read_unsigned () != gfi_ptr->ident
+ || gcov_read_unsigned () != gfi_ptr->lineno_checksum
+ || gcov_read_unsigned () != gfi_ptr->cfg_checksum)
+ goto read_mismatch;
+
+ ci_ptr = gfi_ptr->ctrs;
for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
{
- gcov_merge_fn merge;
+ gcov_merge_fn merge = gi_ptr->merge[t_ix];
- if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ if (!merge)
continue;
- n_counts = fi_ptr->n_ctrs[c_ix];
- merge = gi_ptr->counts[c_ix].merge;
-
tag = gcov_read_unsigned ();
length = gcov_read_unsigned ();
if (tag != GCOV_TAG_FOR_COUNTER (t_ix)
- || length != GCOV_TAG_COUNTER_LENGTH (n_counts))
+ || length != GCOV_TAG_COUNTER_LENGTH (ci_ptr->num))
goto read_mismatch;
- (*merge) (values[c_ix], n_counts);
- values[c_ix] += n_counts;
- c_ix++;
+ (*merge) (ci_ptr->values, ci_ptr->num);
+ ci_ptr++;
}
if ((error = gcov_is_error ()))
goto read_error;
}
- f_ix = ~0u;
- /* Check program & object summary */
- while (1)
+ if (tag)
{
- int is_program;
-
- eof_pos = gcov_position ();
- tag = gcov_read_unsigned ();
- if (!tag)
- break;
-
- length = gcov_read_unsigned ();
- is_program = tag == GCOV_TAG_PROGRAM_SUMMARY;
- if (length != GCOV_TAG_SUMMARY_LENGTH
- || (!is_program && tag != GCOV_TAG_OBJECT_SUMMARY))
- goto read_mismatch;
- gcov_read_summary (is_program ? &program : &object);
- if ((error = gcov_is_error ()))
- goto read_error;
- if (is_program && program.checksum == gcov_crc32)
- {
- summary_pos = eof_pos;
- goto rewrite;
- }
+ read_mismatch:;
+ fprintf (stderr, "profiling:%s:Merge mismatch for %s\n",
+ gi_filename, f_ix + 1 ? "function" : "summaries");
+ goto read_fatal;
}
}
goto rewrite;
read_error:;
- fprintf (stderr, error < 0 ? "profiling:%s:Overflow merging\n"
- : "profiling:%s:Error merging\n", gi_filename);
+ fprintf (stderr, "profiling:%s:%s merging\n", gi_filename,
+ error < 0 ? "Overflow": "Error");
read_fatal:;
gcov_close ();
@@ -448,29 +499,20 @@ gcov_exit (void)
rewrite:;
gcov_rewrite ();
if (!summary_pos)
- memset (&program, 0, sizeof (program));
+ {
+ memset (&prg, 0, sizeof (prg));
+ summary_pos = eof_pos;
+ }
/* Merge the summaries. */
- f_ix = ~0u;
for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
{
- cs_obj = &object.ctrs[t_ix];
- cs_tobj = &this_object.ctrs[t_ix];
- cs_prg = &program.ctrs[t_ix];
- cs_tprg = &this_program.ctrs[t_ix];
- cs_all = &all.ctrs[t_ix];
+ cs_prg = &prg.ctrs[t_ix];
+ cs_tprg = &this_prg.ctrs[t_ix];
+ cs_all = &all_prg.ctrs[t_ix];
- if ((1 << t_ix) & gi_ptr->ctr_mask)
+ if (gi_ptr->merge[t_ix])
{
- if (!cs_obj->runs++)
- cs_obj->num = cs_tobj->num;
- else if (cs_obj->num != cs_tobj->num)
- goto read_mismatch;
- cs_obj->sum_all += cs_tobj->sum_all;
- if (cs_obj->run_max < cs_tobj->run_max)
- cs_obj->run_max = cs_tobj->run_max;
- cs_obj->sum_max += cs_tobj->run_max;
-
if (!cs_prg->runs++)
cs_prg->num = cs_tprg->num;
else if (cs_prg->num != cs_tprg->num)
@@ -480,78 +522,94 @@ gcov_exit (void)
cs_prg->run_max = cs_tprg->run_max;
cs_prg->sum_max += cs_tprg->run_max;
}
- else if (cs_obj->num || cs_prg->num)
+ else if (cs_prg->runs)
goto read_mismatch;
if (!cs_all->runs && cs_prg->runs)
memcpy (cs_all, cs_prg, sizeof (*cs_all));
- else if (!all.checksum
+ else if (!all_prg.checksum
&& (!GCOV_LOCKED || cs_all->runs == cs_prg->runs)
&& memcmp (cs_all, cs_prg, sizeof (*cs_all)))
{
- fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s",
+ fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s\n",
gi_filename, GCOV_LOCKED
- ? "" : " or concurrent update without locking support");
- all.checksum = ~0u;
+ ? "" : " or concurrently updated without locking support");
+ all_prg.checksum = ~0u;
}
}
- c_ix = 0;
- for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- values[c_ix] = gi_ptr->counts[c_ix].values;
- c_ix++;
- }
-
- program.checksum = gcov_crc32;
+ prg.checksum = gcov_crc32;
/* Write out the data. */
- gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION);
- gcov_write_unsigned (gi_ptr->stamp);
+ if (!eof_pos)
+ {
+ gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION);
+ gcov_write_unsigned (gi_ptr->stamp);
+ }
+
+ if (summary_pos)
+ gcov_seek (summary_pos);
+
+ /* Generate whole program statistics. */
+ gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &prg);
+
+ if (summary_pos < eof_pos)
+ gcov_seek (eof_pos);
/* Write execution counts for each function. */
for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
{
- fi_ptr = (const struct gcov_fn_info *)
- ((const char *) gi_ptr->functions + f_ix * fi_stride);
+ unsigned buffered = 0;
- /* Announce function. */
- gcov_write_tag_length (GCOV_TAG_FUNCTION, GCOV_TAG_FUNCTION_LENGTH);
- gcov_write_unsigned (fi_ptr->ident);
- gcov_write_unsigned (fi_ptr->lineno_checksum);
- gcov_write_unsigned (fi_ptr->cfg_checksum);
+ if (fn_buffer && fn_buffer->fn_ix == f_ix)
+ {
+ /* Buffered data from another program. */
+ buffered = 1;
+ gfi_ptr = &fn_buffer->info;
+ length = GCOV_TAG_FUNCTION_LENGTH;
+ }
+ else
+ {
+ gfi_ptr = gi_ptr->functions[f_ix];
+ if (gfi_ptr && gfi_ptr->key == gi_ptr)
+ length = GCOV_TAG_FUNCTION_LENGTH;
+ else
+ length = 0;
+ }
+
+ gcov_write_tag_length (GCOV_TAG_FUNCTION, length);
+ if (!length)
+ continue;
+
+ gcov_write_unsigned (gfi_ptr->ident);
+ gcov_write_unsigned (gfi_ptr->lineno_checksum);
+ gcov_write_unsigned (gfi_ptr->cfg_checksum);
- c_ix = 0;
+ ci_ptr = gfi_ptr->ctrs;
for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
{
- gcov_type *c_ptr;
-
- if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ if (!gi_ptr->merge[t_ix])
continue;
- n_counts = fi_ptr->n_ctrs[c_ix];
-
+ n_counts = ci_ptr->num;
gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix),
GCOV_TAG_COUNTER_LENGTH (n_counts));
- c_ptr = values[c_ix];
+ gcov_type *c_ptr = ci_ptr->values;
while (n_counts--)
gcov_write_counter (*c_ptr++);
-
- values[c_ix] = c_ptr;
- c_ix++;
+ if (buffered)
+ free (ci_ptr->values);
+ ci_ptr++;
+ }
+ if (buffered)
+ {
+ struct gcov_fn_buffer *tmp = fn_buffer;
+ fn_buffer = fn_buffer->next;
+ free (tmp);
}
}
- /* Object file summary. */
- gcov_write_summary (GCOV_TAG_OBJECT_SUMMARY, &object);
-
- /* Generate whole program statistics. */
- if (eof_pos)
- gcov_seek (eof_pos);
- gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &program);
- if (!summary_pos)
- gcov_write_unsigned (0);
+ gcov_write_unsigned (0);
if ((error = gcov_close ()))
fprintf (stderr, error < 0 ?
"profiling:%s:Overflow writing\n" :
@@ -617,15 +675,25 @@ __gcov_flush (void)
gcov_exit ();
for (gi_ptr = gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
{
- unsigned t_ix;
- const struct gcov_ctr_info *ci_ptr;
+ unsigned f_ix;
- for (t_ix = 0, ci_ptr = gi_ptr->counts; t_ix != GCOV_COUNTERS; t_ix++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- memset (ci_ptr->values, 0, sizeof (gcov_type) * ci_ptr->num);
- ci_ptr++;
- }
+ for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
+ {
+ unsigned t_ix;
+ const struct gcov_fn_info *gfi_ptr = gi_ptr->functions[f_ix];
+
+ if (!gfi_ptr || gfi_ptr->key != gi_ptr)
+ continue;
+ const struct gcov_ctr_info *ci_ptr = gfi_ptr->ctrs;
+ for (t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++)
+ {
+ if (!gi_ptr->merge[t_ix])
+ continue;
+
+ memset (ci_ptr->values, 0, sizeof (gcov_type) * ci_ptr->num);
+ ci_ptr++;
+ }
+ }
}
}
diff --git a/gcc/longlong.h b/libgcc/longlong.h
index 30cc2e337f3..30cc2e337f3 100644
--- a/gcc/longlong.h
+++ b/libgcc/longlong.h
diff --git a/gcc/config/memcmp.c b/libgcc/memcmp.c
index 2348afe1d27..2348afe1d27 100644
--- a/gcc/config/memcmp.c
+++ b/libgcc/memcmp.c
diff --git a/gcc/config/memcpy.c b/libgcc/memcpy.c
index 58b1e405627..58b1e405627 100644
--- a/gcc/config/memcpy.c
+++ b/libgcc/memcpy.c
diff --git a/gcc/config/memmove.c b/libgcc/memmove.c
index 13b340af6a0..13b340af6a0 100644
--- a/gcc/config/memmove.c
+++ b/libgcc/memmove.c
diff --git a/gcc/config/memset.c b/libgcc/memset.c
index 3e7025ee394..3e7025ee394 100644
--- a/gcc/config/memset.c
+++ b/libgcc/memset.c
diff --git a/libgcc/mkheader.sh b/libgcc/mkheader.sh
new file mode 100755
index 00000000000..69ea3704901
--- /dev/null
+++ b/libgcc/mkheader.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# Copyright (C) 2001, 2002, 2006, 2007, 2010, 2011 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/>.
+
+
+# Print libgcc_tm.h to the standard output.
+# DEFINES and HEADERS are expected to be set in the environment.
+
+# Add multiple inclusion protection guard, part one.
+echo "#ifndef LIBGCC_TM_H"
+echo "#define LIBGCC_TM_H"
+
+# Generate the body of the file
+echo "/* Automatically generated by mkheader.sh. */"
+for def in $DEFINES; do
+ echo "#ifndef $def" | sed 's/=.*//'
+ echo "# define $def" | sed 's/=/ /'
+ echo "#endif"
+done
+
+for file in $HEADERS; do
+ echo "#include \"$file\""
+done
+
+# Add multiple inclusion protection guard, part two.
+echo "#endif /* LIBGCC_TM_H */"
diff --git a/gcc/mkmap-flat.awk b/libgcc/mkmap-flat.awk
index ec5e1fdf513..ec5e1fdf513 100644
--- a/gcc/mkmap-flat.awk
+++ b/libgcc/mkmap-flat.awk
diff --git a/gcc/mkmap-symver.awk b/libgcc/mkmap-symver.awk
index 4877e905147..4877e905147 100644
--- a/gcc/mkmap-symver.awk
+++ b/libgcc/mkmap-symver.awk
diff --git a/libgcc/siditi-object.mk b/libgcc/siditi-object.mk
index 69df8338f52..77699cb79ec 100644
--- a/libgcc/siditi-object.mk
+++ b/libgcc/siditi-object.mk
@@ -11,12 +11,12 @@ iter-labels := $(wordlist 2,$(words $(iter-labels)),$(iter-labels))
$o-size := $(firstword $(iter-sizes))
iter-sizes := $(wordlist 2,$(words $(iter-sizes)),$(iter-sizes))
-$o$(objext): %$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_compile) -DL$($*-label) -c $(gcc_srcdir)/libgcc2.c $(vis_hide) \
+$o$(objext): %$(objext): $(srcdir)/libgcc2.c
+ $(gcc_compile) -DL$($*-label) -c $< $(vis_hide) \
-DLIBGCC2_UNITS_PER_WORD=$($*-size)
ifeq ($(enable_shared),yes)
-$(o)_s$(objext): %_s$(objext): $(gcc_srcdir)/libgcc2.c
- $(gcc_s_compile) -DL$($*-label) -c $(gcc_srcdir)/libgcc2.c \
+$(o)_s$(objext): %_s$(objext): $(srcdir)/libgcc2.c
+ $(gcc_s_compile) -DL$($*-label) -c $< \
-DLIBGCC2_UNITS_PER_WORD=$($*-size)
endif
diff --git a/gcc/config/udivmod.c b/libgcc/udivmod.c
index dc70de64fc7..dc70de64fc7 100644
--- a/gcc/config/udivmod.c
+++ b/libgcc/udivmod.c
diff --git a/gcc/config/udivmodsi4.c b/libgcc/udivmodsi4.c
index 39c030fa4df..39c030fa4df 100644
--- a/gcc/config/udivmodsi4.c
+++ b/libgcc/udivmodsi4.c
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
index d8e3c0e934b..f57dc8c3925 100644
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -38,6 +38,7 @@
#endif
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "dwarf2.h"
#include "unwind.h"
#define NO_BASE_OF_ENCODED_VALUE
diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
index 93d427165c4..7a783329f7c 100644
--- a/libgcc/unwind-dw2-fde.c
+++ b/libgcc/unwind-dw2-fde.c
@@ -1,6 +1,6 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of GCC.
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "dwarf2.h"
#include "unwind.h"
#define NO_BASE_OF_ENCODED_VALUE
diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
index 92aa233eb26..475ad00bf52 100644
--- a/libgcc/unwind-dw2.c
+++ b/libgcc/unwind-dw2.c
@@ -27,6 +27,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "dwarf2.h"
#include "unwind.h"
#ifdef __USING_SJLJ_EXCEPTIONS__
diff --git a/libgcc/unwind-sjlj.c b/libgcc/unwind-sjlj.c
index c71e79858ee..1fc1c5d3dc9 100644
--- a/libgcc/unwind-sjlj.c
+++ b/libgcc/unwind-sjlj.c
@@ -1,6 +1,6 @@
/* SJLJ exception handling and frame unwind runtime interface routines.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
- 2009 Free Software Foundation, Inc.
+ 2009, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -27,6 +27,7 @@
#include "tsystem.h"
#include "coretypes.h"
#include "tm.h"
+#include "libgcc_tm.h"
#include "unwind.h"
#include "gthr.h"
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a022ee2ec63..82538422db4 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,19 @@
+2011-11-07 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/45723
+ * io/open.c (new_unit): Don't check file size before attempting
+ seek.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.am (AM_CPPFLAGS): Add
+ -I$(srcdir)/$(MULTISRCTOP)../libgcc, -I$(MULTIBUILDTOP)../libgcc.
+ * Makefile.in: Regenerate.
+ * acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Remove.
+ * configure.ac (LIBGFOR_CHECK_GTHR_DEFAULT): Likewise.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
2011-11-01 Janne Blomqvist <jb@gcc.gnu.org>
* io/io.h (next_available_newunit): Remove prototype.
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index ce0d7250328..350b7161059 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -56,7 +56,9 @@ libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
## use -iquote
AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
- -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc
+ -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+ -I$(srcdir)/$(MULTISRCTOP)../libgcc \
+ -I$(MULTIBUILDTOP)../libgcc
# Fortran rules for complex multiplication and division
AM_CFLAGS += -fcx-fortran-rules
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index d41b7bb2b82..80a6c60968d 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -506,7 +506,9 @@ libcaf_single_la_DEPENDENCIES = caf/libcaf.h
libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
- -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc
+ -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+ -I$(srcdir)/$(MULTISRCTOP)../libgcc \
+ -I$(MULTIBUILDTOP)../libgcc
gfor_io_src = \
io/close.c \
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 92e027177b5..b6cb40430af 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -83,17 +83,6 @@ if (foovar > 10) return __sync_add_and_fetch (&foovar, -1);]])],
[Define to 1 if the target supports __sync_fetch_and_add])
fi])
-dnl Check if threads are supported.
-AC_DEFUN([LIBGFOR_CHECK_GTHR_DEFAULT], [
- AC_CACHE_CHECK([configured target thread model],
- libgfor_cv_target_thread_file, [
-libgfor_cv_target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`])
-
- if test $libgfor_cv_target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if the compiler has a thread header that is non single.])
- fi])
-
dnl Check for pragma weak.
AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [
AC_CACHE_CHECK([whether pragma weak works],
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index 57f66b51ab9..708ec7cd02d 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -483,9 +483,6 @@
/* Define to 1 if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
-/* Define if the compiler has a thread header that is non single. */
-#undef HAVE_GTHR_DEFAULT
-
/* libm includes hypot */
#undef HAVE_HYPOT
diff --git a/libgfortran/configure b/libgfortran/configure
index a716ff37faf..3a1174a1237 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -25704,25 +25704,6 @@ $as_echo "#define HAVE_SYNC_FETCH_AND_ADD 1" >>confdefs.h
fi
-# Check out thread support.
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking configured target thread model" >&5
-$as_echo_n "checking configured target thread model... " >&6; }
-if test "${libgfor_cv_target_thread_file+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
-libgfor_cv_target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_target_thread_file" >&5
-$as_echo "$libgfor_cv_target_thread_file" >&6; }
-
- if test $libgfor_cv_target_thread_file != single; then
-
-$as_echo "#define HAVE_GTHR_DEFAULT 1" >>confdefs.h
-
- fi
-
# Check out #pragma weak.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pragma weak works" >&5
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 74cfe441a75..447ea9df998 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -550,9 +550,6 @@ LIBGFOR_CHECK_ATTRIBUTE_ALIAS
# Check out sync builtins support.
LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
-# Check out thread support.
-LIBGFOR_CHECK_GTHR_DEFAULT
-
# Check out #pragma weak.
LIBGFOR_GTHREAD_WEAK
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 0102b9cf99f..8f969edb5e1 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -554,7 +554,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
if (flags->position == POSITION_APPEND)
{
- if (file_size (opp->file, opp->file_len) > 0 && sseek (u->s, 0, SEEK_END) < 0)
+ if (sseek (u->s, 0, SEEK_END) < 0)
generate_error (&opp->common, LIBERROR_OS, NULL);
u->endfile = AT_ENDFILE;
}
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 2a680190ff5..eb414906605 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -2639,7 +2639,7 @@ encoding/pem/check: $(CHECK_DEPS)
@$(CHECK)
.PHONY: encoding/pem/check
-exp/ebnf.lo: $(go_exp_ebnf_files) go/scanner.gox go/token.gox os.gox \
+exp/ebnf.lo: $(go_exp_ebnf_files) scanner.gox go/token.gox os.gox \
strconv.gox unicode.gox utf8.gox
$(BUILDPACKAGE)
exp/ebnf/check: $(CHECK_DEPS)
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index da7031f4381..4c07233d43d 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -5268,7 +5268,7 @@ encoding/pem/check: $(CHECK_DEPS)
@$(CHECK)
.PHONY: encoding/pem/check
-exp/ebnf.lo: $(go_exp_ebnf_files) go/scanner.gox go/token.gox os.gox \
+exp/ebnf.lo: $(go_exp_ebnf_files) scanner.gox go/token.gox os.gox \
strconv.gox unicode.gox utf8.gox
$(BUILDPACKAGE)
exp/ebnf/check: $(CHECK_DEPS)
diff --git a/libgo/go/exp/terminal/terminal.go b/libgo/go/exp/terminal/terminal.go
index aacd90905f5..05a8990b041 100644
--- a/libgo/go/exp/terminal/terminal.go
+++ b/libgo/go/exp/terminal/terminal.go
@@ -17,7 +17,6 @@ package terminal
import (
"os"
"syscall"
- "unsafe"
)
// State contains the state of a terminal.
@@ -28,7 +27,7 @@ type State struct {
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd int) bool {
var termios syscall.Termios
- _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCGETS), uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
+ e := syscall.Tcgetattr(fd, &termios)
return e == 0
}
@@ -37,14 +36,14 @@ func IsTerminal(fd int) bool {
// restored.
func MakeRaw(fd int) (*State, os.Error) {
var oldState State
- if _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCGETS), uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); e != 0 {
+ if e := syscall.Tcgetattr(fd, &oldState.termios); e != 0 {
return nil, os.Errno(e)
}
newState := oldState.termios
newState.Iflag &^= syscall.ISTRIP | syscall.INLCR | syscall.ICRNL | syscall.IGNCR | syscall.IXON | syscall.IXOFF
newState.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.ISIG
- if _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCSETS), uintptr(unsafe.Pointer(&newState)), 0, 0, 0); e != 0 {
+ if e := syscall.Tcsetattr(fd, syscall.TCSANOW, &newState); e != 0 {
return nil, os.Errno(e)
}
@@ -54,7 +53,7 @@ func MakeRaw(fd int) (*State, os.Error) {
// Restore restores the terminal connected to the given file descriptor to a
// previous state.
func Restore(fd int, state *State) os.Error {
- _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCSETS), uintptr(unsafe.Pointer(&state.termios)), 0, 0, 0)
+ e := syscall.Tcsetattr(fd, syscall.TCSANOW, &state.termios)
return os.Errno(e)
}
@@ -63,18 +62,18 @@ func Restore(fd int, state *State) os.Error {
// returned does not include the \n.
func ReadPassword(fd int) ([]byte, os.Error) {
var oldState syscall.Termios
- if _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCGETS), uintptr(unsafe.Pointer(&oldState)), 0, 0, 0); e != 0 {
+ if e := syscall.Tcgetattr(fd, &oldState); e != 0 {
return nil, os.Errno(e)
}
newState := oldState
newState.Lflag &^= syscall.ECHO
- if _, _, e := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCSETS), uintptr(unsafe.Pointer(&newState)), 0, 0, 0); e != 0 {
+ if e := syscall.Tcsetattr(fd, syscall.TCSANOW, &newState); e != 0 {
return nil, os.Errno(e)
}
defer func() {
- syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TCSETS), uintptr(unsafe.Pointer(&oldState)), 0, 0, 0)
+ syscall.Tcsetattr(fd, syscall.TCSANOW, &oldState)
}()
var buf [16]byte
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index a78af36f70d..3948e51ae28 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -186,8 +186,9 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0)
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (errno int)
//faccessat(dirfd int, pathname *byte, mode int, flags int) int
-//sys Fallocate(fd int, mode uint32, off int64, len int64) (errno int)
-//fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
+// FIXME: Only in glibc 2.10 and later.
+// //sys Fallocate(fd int, mode uint32, off int64, len int64) (errno int)
+// //fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int)
//fchmodat(dirfd int, pathname *byte, mode Mode_t, flags int) int
@@ -223,8 +224,9 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0)
//sysnb InotifyInit() (fd int, errno int)
//inotify_init() int
-//sysnb InotifyInit1(flags int) (fd int, errno int)
-//inotify_init1(flags int) int
+// FIXME: Only in glibc 2.9 and later.
+// //sysnb InotifyInit1(flags int) (fd int, errno int)
+// //inotify_init1(flags int) int
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
//inotify_rm_watch(fd int, wd uint32) int
@@ -298,8 +300,9 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
// //sys Statfs(path string, buf *Statfs_t) (errno int)
// //statfs(path *byte, buf *Statfs_t) int
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
-//sync_file_range(fd int, off Offset_t, n Offset_t, flags uint) int
+// FIXME: Only in glibc 2.6 and later.
+// //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
+// //sync_file_range(fd int, off Offset_t, n Offset_t, flags uint) int
// FIXME: mksysinfo Sysinfo_t
// //sysnb Sysinfo(info *Sysinfo_t) (errno int)
diff --git a/libgo/go/syscall/libcall_posix.go b/libgo/go/syscall/libcall_posix.go
index 5d7c98f9d26..87ed4e628fd 100644
--- a/libgo/go/syscall/libcall_posix.go
+++ b/libgo/go/syscall/libcall_posix.go
@@ -377,3 +377,9 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
tv.Usec = Timeval_usec_t(nsec % 1e9 / 1e3)
return
}
+
+//sysnb Tcgetattr(fd int, p *Termios) (errno int)
+//tcgetattr(fd int, p *Termios) int
+
+//sys Tcsetattr(fd int, actions int, p *Termios) (errno int)
+//tcsetattr(fd int, actions int, p *Termios) int
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 6a93998e244..559f0c97341 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * cp-demangle.c (d_special_name, d_print_comp): Handle a
+ discriminator number on DEMANGLE_COMPONENT_REFTEMP.
+
+2011-11-02 Doug Evans <dje@google.com>
+
+ * Makefile.in (CFILES): Add timeval-utils.c.
+ (REQUIRED_OFILES): Add timeval-utils.$(objext).
+ (INSTALLED_HEADERS): Add timeval-utils.h.
+ (timeval-utils.$(objext)): Add rule.
+
2011-10-28 Ian Lance Taylor <iant@google.com>
* setproctitle.c (setproctitle): Use "GNU/Linux" in comment.
@@ -25,10 +38,6 @@
2011-09-28 Doug Evans <dje@google.com>
* timeval-utils.c: New file.
- * Makefile.in (CFILES): Add it.
- (REQUIRED_OFILES): Add timeval-utils.$(objext).
- (INSTALLED_HEADERS): Add timeval-utils.h.
- (timeval-utils.$(objext)): Add rule.
* argv.c (countargv): New function.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index bcd03fd0167..5280bc1585c 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -152,7 +152,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \
strcasecmp.c strchr.c strdup.c strerror.c strncasecmp.c \
strncmp.c strrchr.c strsignal.c strstr.c strtod.c strtol.c \
strtoul.c strndup.c strverscmp.c \
- tmpnam.c \
+ timeval-utils.c tmpnam.c \
unlink-if-ordinary.c \
vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \
waitpid.c \
@@ -184,8 +184,8 @@ REQUIRED_OFILES = \
./simple-object-elf.$(objext) ./simple-object-mach-o.$(objext) \
./sort.$(objext) ./spaces.$(objext) \
./splay-tree.$(objext) ./stack-limit.$(objext) \
- ./strerror.$(objext) \
- ./strsignal.$(objext) ./unlink-if-ordinary.$(objext) \
+ ./strerror.$(objext) ./strsignal.$(objext) \
+ ./timeval-utils.$(objext) ./unlink-if-ordinary.$(objext) \
./xatexit.$(objext) ./xexit.$(objext) ./xmalloc.$(objext) \
./xmemdup.$(objext) ./xstrdup.$(objext) ./xstrerror.$(objext) \
./xstrndup.$(objext)
@@ -235,7 +235,8 @@ INSTALLED_HEADERS = \
$(INCDIR)/partition.h \
$(INCDIR)/safe-ctype.h \
$(INCDIR)/sort.h \
- $(INCDIR)/splay-tree.h
+ $(INCDIR)/splay-tree.h \
+ $(INCDIR)/timeval-utils.h
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
-rm -f $(TARGETLIB) pic/$(TARGETLIB)
@@ -1141,6 +1142,13 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strverscmp.c $(OUTPUT_OPTION)
+./timeval-utils.$(objext): $(srcdir)/timeval-utils.c config.h \
+ $(INCDIR)/timeval-utils.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/timeval-utils.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/timeval-utils.c $(OUTPUT_OPTION)
+
./tmpnam.$(objext): $(srcdir)/tmpnam.c
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/tmpnam.c -o pic/$@; \
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 08391088467..0f1166be48c 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1856,8 +1856,11 @@ d_special_name (struct d_info *di)
return d_make_comp (di, DEMANGLE_COMPONENT_GUARD, d_name (di), NULL);
case 'R':
- return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, d_name (di),
- NULL);
+ {
+ struct demangle_component *name = d_name (di);
+ return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, name,
+ d_number_component (di));
+ }
case 'A':
return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS,
@@ -3954,7 +3957,9 @@ d_print_comp (struct d_print_info *dpi, int options,
return;
case DEMANGLE_COMPONENT_REFTEMP:
- d_append_string (dpi, "reference temporary for ");
+ d_append_string (dpi, "reference temporary #");
+ d_print_comp (dpi, options, d_right (dc));
+ d_append_string (dpi, " for ");
d_print_comp (dpi, options, d_left (dc));
return;
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 86e8c139194..474849480e0 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Makefile.in (INCLUDES): Add -I$(MULTIBUILDTOP)../libgcc.
+ * configure.ac (target_thread_file, HAVE_GTHR_DEFAULT): Remove.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
2011-10-17 Paul Brook <paul@codesourcery.com>
Matthias Klose <doko@ubuntu.com>
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index 0935ccd98d6..1427bac43b2 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -102,6 +102,7 @@ INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config \
-I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
-I$(srcdir)/$(MULTISRCTOP)../libgcc \
+ -I$(MULTIBUILDTOP)../libgcc \
-I$(srcdir)/$(MULTISRCTOP)../include \
$(OBJC_BOEHM_GC_INCLUDES)
diff --git a/libobjc/config.h.in b/libobjc/config.h.in
index d9c8172d258..c055e7c1909 100644
--- a/libobjc/config.h.in
+++ b/libobjc/config.h.in
@@ -6,9 +6,6 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
-/* Define if the compiler has a thread header that is non single. */
-#undef HAVE_GTHR_DEFAULT
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/libobjc/configure b/libobjc/configure
index c68cde0f806..59e3d98a7a5 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -11248,18 +11248,6 @@ done
# Miscellanea
# -----------
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread model used by GCC" >&5
-$as_echo_n "checking for thread model used by GCC... " >&6; }
-target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_thread_file" >&5
-$as_echo "$target_thread_file" >&6; }
-
-if test $target_thread_file != single; then
-
-$as_echo "#define HAVE_GTHR_DEFAULT 1" >>confdefs.h
-
-fi
-
# Check if we have thread-local storage
@@ -11483,7 +11471,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
enableval=$enable_sjlj_exceptions; :
else
cat > conftest.$ac_ext << EOF
-#line 11486 "configure"
+#line 11474 "configure"
@interface Frob
@end
@implementation Frob
diff --git a/libobjc/configure.ac b/libobjc/configure.ac
index dd303fff065..52599e6019e 100644
--- a/libobjc/configure.ac
+++ b/libobjc/configure.ac
@@ -217,15 +217,6 @@ AC_CHECK_HEADERS(sched.h)
# Miscellanea
# -----------
-AC_MSG_CHECKING([for thread model used by GCC])
-target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
-AC_MSG_RESULT([$target_thread_file])
-
-if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if the compiler has a thread header that is non single.])
-fi
-
# Check if we have thread-local storage
GCC_CHECK_TLS
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index fd24f5f400d..97c15b573bf 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * printf/gmp-impl.h: Adapt path to longlong.h.
+
2011-09-21 Joseph Myers <joseph@codesourcery.com>
* Makefile.am (FLAGS_TO_PASS): Define.
diff --git a/libquadmath/printf/gmp-impl.h b/libquadmath/printf/gmp-impl.h
index ca49e196613..0f1419277de 100644
--- a/libquadmath/printf/gmp-impl.h
+++ b/libquadmath/printf/gmp-impl.h
@@ -1,6 +1,6 @@
/* Include file for internal GNU MP types and definitions.
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991, 1993, 1994, 1995, 1996, 2011 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -60,7 +60,7 @@ typedef unsigned int UHWtype;
#define attribute_hidden
#endif
-#include "../../gcc/longlong.h"
+#include "../../libgcc/longlong.h"
/* Copy NLIMBS *limbs* from SRC to DST. */
#define MPN_COPY_INCR(DST, SRC, NLIMBS) \
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ddc30f80aba..b8c222ba807 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,244 @@
+2011-11-07 Andrew MacLeod <amacleod@redhat.com>
+
+ * include/bits/atomic_base.h (atomic_thread_fence): Revert.
+ (atomic_signal_fence): Revert.
+
+2011-11-07 Andrew MacLeod <amacleod@redhat.com>
+
+ * include/bits/atomic_base.h (atomic_thread_fence): Call builtin.
+ (atomic_signal_fence): Call builtin.
+ (atomic_flag::test_and_set): Call __atomic_exchange when it is lockfree,
+ otherwise fall back to call __sync_lock_test_and_set.
+ (atomic_flag::clear): Call __atomic_store when it is lockfree,
+ otherwise fall back to call __sync_lock_release.
+
+2011-11-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR bootstrap/50982
+ * include/Makefile.am (${host_builddir}/gthr-posix.h): Reflect
+ gthr-posix.h move.
+ * include/Makefile.in: Regenerate.
+
+2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * acinclude.m4 (GLIBCXX_CHECK_SC_NPROC_ONLN): Define.
+ (GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP): Define.
+ (GLIBCXX_CHECK_SYSCTL_HW_NCPU): Define.
+ * configure.ac: Use new checks.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * src/thread.cc: Check new config macros.
+ * testsuite/lib/libstdc++.exp: Likewise.
+
+2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * config/abi/pre/gnu.ver: Fix exports for string::pop_back.
+
+2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * acinclude.m4: Check for <stdalign.h>
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+ * include/Makefile.am: Add <cstdalign>.
+ * include/Makefile.in: Regenerate.
+ * include/c_global/cstdalign: New.
+ * testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc: New.
+ * doc/xml/manual/backwards_compatibility.xml: Update.
+ * doc/xml/manual/status_cxx2011.xml: Update.
+
+2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/50982
+ * include/std/mutex (__once_proxy): Use void parameter list to
+ work on implicit extern "C" systems.
+
+2011-11-07 Xinliang David Li <davidxl@google.com>
+
+ * include/backward/hashtable.h: Make __stl_prime_list
+ in comdat section.
+
+2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/basic_string.h (basic_string::at): Move adjacent to other
+ overload.
+ (basic_string::pop_back): Define.
+ * include/debug/string (__gnu_debug::basic_string::pop_back): Likewise.
+ * include/ext/vstring.h (__versa_string::pop_back): Likewise.
+ * config/abi/pre/gnu.ver: Add new symbols.
+ * testsuite/21_strings/basic_string/modifiers/char/pop_back.cc: New.
+ * testsuite/21_strings/basic_string/modifiers/wchar_t/pop_back.cc: New.
+ * testsuite/21_strings/basic_string/range_access.cc: Split to ...
+ * testsuite/21_strings/basic_string/range_access/char/1.cc: Here and ...
+ * testsuite/21_strings/basic_string/range_access/wchar_t/1.cc: Here.
+ * testsuite/ext/vstring/modifiers/char/pop_back.cc: New.
+ * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: New.
+
+2011-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/backwards_compatibility.xml: Fix autoconf tests for
+ C++11 compiler features and library headers. Add stable id
+ attributes. Use <filename> element for headers and surround in angle
+ brackets. Use <classname> for classes.
+ * doc/html/*: Regenerate.
+
+2011-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/status_cxx2011.xml: Document <cuchar> and
+ <cstdalign> as missing.
+
+2011-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/faq.xml: Replace references to C++0x with C++11.
+ * doc/xml/manual/intro.xml: Likewise.
+ * doc/xml/manual/backwards_compatibility.xml: Likewise.
+ * doc/xml/manual/shared_ptr.xml: Likewise.
+ * doc/xml/manual/configure.xml: Likewise.
+ * doc/xml/manual/evolution.xml: Likewise.
+ * doc/xml/manual/using.xml: Likewise.
+ * doc/xml/manual/strings.xml: Likewise.
+ * doc/xml/manual/debug_mode.xml: Likewise.
+ * doc/xml/manual/policy_data_structures.xml: Likewise.
+ * doc/xml/manual/extensions.xml: Likewise.
+ * doc/xml/manual/diagnostics.xml: Likewise.
+ * doc/xml/manual/test.xml: Likewise.
+ * doc/xml/manual/status_cxx200x.xml: Likewise, and rename to...
+ * doc/xml/manual/status_cxx2011.xml: Here.
+ * doc/Makefile.am: Rename status_cxx200x.xml.
+ * doc/Makefile.in: Regenerate.
+ * doc/html/*: Regenerate.
+
+2011-11-06 François Dumont <fdumont@gcc.gnu.org>
+
+ * testsuite/performance/23_containers/insert_erase/41975.cc: Add
+ tests to check performance with or without cache of hash code and with
+ string type that has a costlier hash functor than int type.
+
+2011-11-06 Benjamin Kosnik <bkoz@redhat.com>
+ Andrew MacLeod <amacleod@redhat.com>
+
+ Merged from cxx-mem-model.
+
+ * include/Makefile.am (bits_headers): Remove atomic_0.h, atomic_2.h.
+ * include/Makefile.in: Regenerate.
+ * src/Makefile.am (sources): Rename atomic.cc to
+ compatibility-atomic-c++0x.cc.
+ * src/Makefile.in: Regenerate.
+ * include/bits/atomic_0.h: Remove.
+ * include/bits/atomic_2.h: Incorporate into...
+ * include/bits/atomic_base.h: ...this. Use new __atomic routines.
+ * include/std/atomic: Add generic atomic calls to basic atomic class.
+ * src/atomic.cc: Move...
+ * src/compatibility-atomic-c++0x.cc: ...here.
+ * src/compatibility-c++0x.cc: Tweak.
+ * testsuite/29_atomics/atomic/cons/user_pod.cc: Fix.
+ * testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc:
+ Same.
+ * testsuite/29_atomics/headers/atomic/macros.cc: Same.
+
+2011-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/test.xml: Fix dg-warning examples.
+
+2011-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/44436
+ * doc/xml/manual/status_cxx200x.xml: Document emplace members are
+ missing.
+
+2011-11-05 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/49894
+ PR bootstrap/50982
+ * include/std/mutex (once_flag): Use NSDMI.
+
+2011-11-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ * scripts/run_doxygen: Fix sed quoting.
+
+2011-11-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/doxygen/doxygroups.cc: Add markup for namespace tr2.
+ * include/tr2/bool_set: Adjust doxygen markup.
+ * include/tr2/dynamic_bitset: Same.
+ * include/tr2/type_traits: Same.
+
+2011-11-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/html/*: Regenerate.
+
+2011-11-02 Richard B. Kreckel <kreckel@ginac.de>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/50880
+ * include/std/complex (__complex_acosh): Fix in a better way,
+ use Kahan's formula.
+ * include/tr1/complex (__complex_acosh): Likewise.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/50951
+ * include/bits/random.tcc (operator<<(basic_ostream<>&,
+ const mersenne_twister_engine<>&): Output _M_p too.
+ (operator<<(basic_ostream<>&, const
+ subtract_with_carry_engine<>&): Likewise.
+ (operator>>(basic_istream<>&, mersenne_twister_engine<>&):
+ Reload it.
+ (operator>>(basic_istream<>&, subtract_with_carry_engine<>&):
+ Likewise.
+ * include/bits/random.h (mersenne_twister_engine<>::operator==):
+ Compare _M_p too.
+ (subtract_with_carry_engine<>::operator==): Compare _M_carry
+ and _M_p too.
+ (shuffle_order_engine<>::operator==): Compare _M_v(s) and _M_y too.
+ * testsuite/26_numerics/random/independent_bits_engine/
+ operators/serialize.cc: Extend.
+ * testsuite/26_numerics/random/subtract_with_carry_engine/
+ operators/serialize.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/
+ operators/serialize.cc: Likewise.
+ * testsuite/26_numerics/random/mersenne_twister_engine/
+ operators/serialize.cc: Likewise.
+ * testsuite/26_numerics/random/linear_congruential_engine/
+ operators/serialize.cc: Likewise.
+ * testsuite/26_numerics/random/shuffle_order_engine/
+ operators/serialize.cc: Likewise.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acinclude.m4 (GLIBCXX_CONFIGURE): Determine and substitute
+ toplevel_builddir.
+ (GLIBCXX_ENABLE_THREADS): Remove glibcxx_thread_h,
+ HAVE_GTHR_DEFAULT, enable_thread.
+ (GLIBCXX_CHECK_GTHREADS): Reflect gthr move to libgcc.
+ * include/Makefile.am (thread_host_headers): Remove
+ ${host_builddir}/gthr-tpf.h.
+ (${host_builddir}/gthr.h): Reflect gthr move to libgcc.
+ Use $<.
+ (${host_builddir}/gthr-single.h): Likewise.
+ (${host_builddir}/gthr-posix.h): Likewise.
+ (${host_builddir}/gthr-tpf.h): Remove.
+ (${host_builddir}/gthr-default.h): Likewise.
+ * configure, config.h.in: Regenerate.
+ * Makefile.in, doc/Makefile.in, include/Makefile.in,
+ libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in,
+ src/Makefile.intestsuite/Makefile.in: Regenerate.
+
+2011-11-02 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config: Add tr2 to versioned namespaces.
+ * scripts/run_doxygen: Adjust generated man files as well.
+ * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers.
+
+2011-11-02 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/std/future (promise): Add constructors for uses-allocator
+ construction from rvalue promise.
+ (packaged_task): Implement LWG 2067. Add additional constructors for
+ uses-allocator construction.
+ * testsuite/30_threads/packaged_task/cons/3.cc: New.
+ * testsuite/30_threads/packaged_task/cons/alloc2.cc: New.
+ * testsuite/30_threads/promise/cons/alloc2.cc: New.
+
2011-10-31 Jason Merrill <jason@redhat.com>
* include/Makefile.am (install-freestanding-headers): Install
@@ -8,7 +249,7 @@
* acinclude.m4 (GLIBCXX_CONFIGURE): Refer to GNU/Linux.
* configure: Regenerate.
-
+
2011-10-31 Jason Merrill <jason@redhat.com>
PR c++/50920
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 272c4eeea40..2284126ab06 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -239,7 +239,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -279,6 +278,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 9382250d057..6cc6ace873f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -35,6 +35,7 @@ dnl SUBDIRS
dnl Substs:
dnl glibcxx_builddir (absolute path)
dnl glibcxx_srcdir (absolute path)
+dnl toplevel_builddir (absolute path)
dnl toplevel_srcdir (absolute path)
dnl with_cross_host
dnl with_newlib
@@ -59,9 +60,11 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
[\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
*) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
+ toplevel_builddir=${glibcxx_builddir}/..
toplevel_srcdir=${glibcxx_srcdir}/..
AC_SUBST(glibcxx_builddir)
AC_SUBST(glibcxx_srcdir)
+ AC_SUBST(toplevel_builddir)
AC_SUBST(toplevel_srcdir)
# We use these options to decide which functions to include. They are
@@ -1638,6 +1641,9 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
# Check for the existence of the <stdbool.h> header.
AC_CHECK_HEADERS(stdbool.h)
+ # Check for the existence of the <stdalign.h> header.
+ AC_CHECK_HEADERS(stdalign.h)
+
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
@@ -3315,34 +3321,10 @@ dnl having to write complex code (the sed commands to clean the macro
dnl namespace are complex and fragile enough as it is). We must also
dnl add a relative path so that -I- is supported properly.
dnl
-dnl Substs:
-dnl glibcxx_thread_h
-dnl
-dnl Defines:
-dnl HAVE_GTHR_DEFAULT
-dnl
AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
AC_MSG_CHECKING([for thread model used by GCC])
target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
AC_MSG_RESULT([$target_thread_file])
-
- if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if gthr-default.h exists
- (meaning that threading support is enabled).])
- fi
-
- glibcxx_thread_h=gthr-$target_thread_file.h
-
- dnl Check for __GTHREADS define.
- gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
- if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
- enable_thread=yes
- else
- enable_thread=no
- fi
-
- AC_SUBST(glibcxx_thread_h)
])
@@ -3356,7 +3338,8 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions \
+ -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc"
target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
case $target_thread_file in
@@ -3476,6 +3459,94 @@ AC_DEFUN([GLIBCXX_CHECK_SC_NPROCESSORS_ONLN], [
AC_LANG_RESTORE
])
+dnl
+dnl Check whether sysconf(_SC_NPROC_ONLN) is available in <unistd.h>, and define _GLIBCXX_USE_SC_NPROC_ONLN.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_SC_NPROC_ONLN], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ AC_MSG_CHECKING([for _SC_NPROC_ONLN])
+ AC_CACHE_VAL(glibcxx_cv_SC_NPROC_ONLN, [
+ GCC_TRY_COMPILE_OR_LINK(
+ [#include <unistd.h>],
+ [int n = sysconf(_SC_NPROC_ONLN);],
+ [glibcxx_cv_SC_NPROC_ONLN=yes],
+ [glibcxx_cv_SC_NPROC_ONLN=no])
+ ])
+ if test $glibcxx_cv_SC_NPROC_ONLN = yes; then
+ AC_DEFINE(_GLIBCXX_USE_SC_NPROC_ONLN, 1, [Define if _SC_NPROC_ONLN is available in <unistd.h>.])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_SC_NPROC_ONLN)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
+dnl Check whether pthread_num_processors_np is available in <pthread.h>, and define _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ AC_MSG_CHECKING([for pthreads_num_processors_np])
+ AC_CACHE_VAL(glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP, [
+ GCC_TRY_COMPILE_OR_LINK(
+ [#include <pthread.h>],
+ [int n = pthread_num_processors_np();],
+ [glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes],
+ [glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no])
+ ])
+ if test $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP = yes; then
+ AC_DEFINE(_GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP, 1, [Define if pthreads_num_processors_np is available in <pthread.h>.])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
+dnl Check whether sysctl is available in <pthread.h>, and define _GLIBCXX_USE_SYSCTL_HW_NCPU.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_SYSCTL_HW_NCPU], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ AC_MSG_CHECKING([for hw.ncpu sysctl])
+ AC_CACHE_VAL(glibcxx_cv_SYSCTL_HW_NCPU, [
+ GCC_TRY_COMPILE_OR_LINK(
+ [
+ #include <stddef.h>
+ #include <sys/sysctl.h>
+ ],
+ [
+ int count;
+ size_t size = sizeof(count);
+ int mib[] = { CTL_HW, HW_NCPU };
+ sysctl(mib, 2, &count, &size, NULL, 0);
+ ],
+ [glibcxx_cv_SYSCTL_HW_NCPU=yes],
+ [glibcxx_cv_SYSCTL_HW_NCPU=no])
+ ])
+ if test $glibcxx_cv_SYSCTL_HW_NCPU = yes; then
+ AC_DEFINE(_GLIBCXX_USE_SYSCTL_HW_NCPU, 1, [Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>.])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_SYSCTL_HW_NCPU)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
# Macros from the top-level gcc directory.
m4_include([../config/gc++filt.m4])
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index df7effb6a6b..7215a7fec62 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -171,10 +171,6 @@
/* Define if _Unwind_GetIPInfo is available. */
#undef HAVE_GETIPINFO
-/* Define if gthr-default.h exists (meaning that threading support is
- enabled). */
-#undef HAVE_GTHR_DEFAULT
-
/* Define to 1 if you have the `hypot' function. */
#undef HAVE_HYPOT
@@ -334,6 +330,9 @@
/* Define to 1 if you have the `sqrtl' function. */
#undef HAVE_SQRTL
+/* Define to 1 if you have the <stdalign.h> header file. */
+#undef HAVE_STDALIGN_H
+
/* Define to 1 if you have the <stdbool.h> header file. */
#undef HAVE_STDBOOL_H
@@ -832,6 +831,9 @@
/* Define if NLS translations are to be used. */
#undef _GLIBCXX_USE_NLS
+/* Define if pthreads_num_processors_np is available in <pthread.h>. */
+#undef _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP
+
/* Define if /dev/random and /dev/urandom are available for the random_device
of TR1 (Chapter 5.1). */
#undef _GLIBCXX_USE_RANDOM_TR1
@@ -842,6 +844,12 @@
/* Define if _SC_NPROCESSORS_ONLN is available in <unistd.h>. */
#undef _GLIBCXX_USE_SC_NPROCESSORS_ONLN
+/* Define if _SC_NPROC_ONLN is available in <unistd.h>. */
+#undef _GLIBCXX_USE_SC_NPROC_ONLN
+
+/* Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>. */
+#undef _GLIBCXX_USE_SYSCTL_HW_NCPU
+
/* Define if code specialized for wchar_t should be used. */
#undef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index ecad24d00f3..ce56120c960 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -188,7 +188,7 @@ GLIBCXX_3.4 {
_ZNSs[0-58-9]a*;
_ZNSs5beginEv;
_ZNSs[0-58-9][c-e]*;
- _ZNSs[0-58-9][g-z]*;
+ _ZNSs[0-59][g-z]*;
# _ZNSs[67][a-z]*E[PRcjmvy]*;
_ZNSs6appendE[PRcjmvy]*;
_ZNSs6assignE[PRcjmvy]*;
@@ -249,7 +249,7 @@ GLIBCXX_3.4 {
_ZNSbIwSt11char_traitsIwESaIwEE[0-58-9]a*;
_ZNSbIwSt11char_traitsIwESaIwEE5beginEv;
_ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][c-e]*;
- _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][g-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-59][g-z]*;
# _ZNSbIwSt11char_traitsIwESaIwEE[67][a-b]*E[PRwjmvy]*;
_ZNSbIwSt11char_traitsIwESaIwEE6appendE[PRwjmvy]*;
_ZNSbIwSt11char_traitsIwESaIwEE6assignE[PRwjmvy]*;
@@ -1302,6 +1302,11 @@ GLIBCXX_3.4.17 {
_ZNSt14numeric_limitsInE*;
_ZNSt14numeric_limitsIoE*;
+ # std::string::pop_back()
+ _ZNSs8pop_backEv;
+ # std::wstring::pop_back()
+ _ZNSbIwSt11char_traitsIwESaIwEE8pop_backEv;
+
} GLIBCXX_3.4.16;
# Symbols in the support library (libsupc++) have their own tag.
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 77a4abfbadf..3be252e5c85 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -707,7 +707,6 @@ BASIC_FILE_H
CSTDIO_H
SECTION_FLAGS
WERROR
-glibcxx_thread_h
glibcxx_PCHFLAGS
GLIBCXX_BUILD_PCH_FALSE
GLIBCXX_BUILD_PCH_TRUE
@@ -741,6 +740,7 @@ AR
AS
LN_S
toplevel_srcdir
+toplevel_builddir
glibcxx_srcdir
glibcxx_builddir
ac_ct_CXX
@@ -4870,11 +4870,13 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
\\/$* | ?:\\/*) glibcxx_srcdir=${srcdir} ;;
*) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
+ toplevel_builddir=${glibcxx_builddir}/..
toplevel_srcdir=${glibcxx_srcdir}/..
+
# We use these options to decide which functions to include. They are
# set from the top level.
@@ -11485,7 +11487,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11488 "configure"
+#line 11490 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11591,7 +11593,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11594 "configure"
+#line 11596 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14949,7 +14951,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 14952 "configure"
+#line 14954 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -15077,23 +15079,6 @@ $as_echo_n "checking for thread model used by GCC... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_thread_file" >&5
$as_echo "$target_thread_file" >&6; }
- if test $target_thread_file != single; then
-
-$as_echo "#define HAVE_GTHR_DEFAULT 1" >>confdefs.h
-
- fi
-
- glibcxx_thread_h=gthr-$target_thread_file.h
-
- gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
- if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
- enable_thread=yes
- else
- enable_thread=no
- fi
-
-
-
ac_ext=cpp
@@ -15317,7 +15302,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15320 "configure"
+#line 15305 "configure"
int main()
{
typedef bool atomic_type;
@@ -15354,7 +15339,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15357 "configure"
+#line 15342 "configure"
int main()
{
typedef short atomic_type;
@@ -15391,7 +15376,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15394 "configure"
+#line 15379 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15429,7 +15414,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15432 "configure"
+#line 15417 "configure"
int main()
{
typedef long long atomic_type;
@@ -15505,7 +15490,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15508 "configure"
+#line 15493 "configure"
int main()
{
_Decimal32 d1;
@@ -15547,7 +15532,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15550 "configure"
+#line 15535 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -15581,7 +15566,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15584 "configure"
+#line 15569 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -19120,6 +19105,20 @@ fi
done
+ # Check for the existence of the <stdalign.h> header.
+ for ac_header in stdalign.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "stdalign.h" "ac_cv_header_stdalign_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdalign_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDALIGN_H 1
+_ACEOF
+
+fi
+
+done
+
+
CXXFLAGS="$ac_save_CXXFLAGS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -19821,7 +19820,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions \
+ -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc"
target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
case $target_thread_file in
@@ -20132,6 +20132,256 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_NPROC_ONLN" >&5
+$as_echo_n "checking for _SC_NPROC_ONLN... " >&6; }
+ if test "${glibcxx_cv_SC_NPROC_ONLN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main ()
+{
+int n = sysconf(_SC_NPROC_ONLN);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_SC_NPROC_ONLN=yes
+else
+ glibcxx_cv_SC_NPROC_ONLN=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main ()
+{
+int n = sysconf(_SC_NPROC_ONLN);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ glibcxx_cv_SC_NPROC_ONLN=yes
+else
+ glibcxx_cv_SC_NPROC_ONLN=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_SC_NPROC_ONLN = yes; then
+
+$as_echo "#define _GLIBCXX_USE_SC_NPROC_ONLN 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_SC_NPROC_ONLN" >&5
+$as_echo "$glibcxx_cv_SC_NPROC_ONLN" >&6; }
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ 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_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthreads_num_processors_np" >&5
+$as_echo_n "checking for pthreads_num_processors_np... " >&6; }
+ if test "${glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+int
+main ()
+{
+int n = pthread_num_processors_np();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes
+else
+ glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+int
+main ()
+{
+int n = pthread_num_processors_np();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes
+else
+ glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP = yes; then
+
+$as_echo "#define _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP" >&5
+$as_echo "$glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP" >&6; }
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ 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_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hw.ncpu sysctl" >&5
+$as_echo_n "checking for hw.ncpu sysctl... " >&6; }
+ if test "${glibcxx_cv_SYSCTL_HW_NCPU+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <sys/sysctl.h>
+
+int
+main ()
+{
+
+ int count;
+ size_t size = sizeof(count);
+ int mib[] = { CTL_HW, HW_NCPU };
+ sysctl(mib, 2, &count, &size, NULL, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_SYSCTL_HW_NCPU=yes
+else
+ glibcxx_cv_SYSCTL_HW_NCPU=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <sys/sysctl.h>
+
+int
+main ()
+{
+
+ int count;
+ size_t size = sizeof(count);
+ int mib[] = { CTL_HW, HW_NCPU };
+ sysctl(mib, 2, &count, &size, NULL, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ glibcxx_cv_SYSCTL_HW_NCPU=yes
+else
+ glibcxx_cv_SYSCTL_HW_NCPU=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_SYSCTL_HW_NCPU = yes; then
+
+$as_echo "#define _GLIBCXX_USE_SYSCTL_HW_NCPU 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_SYSCTL_HW_NCPU" >&5
+$as_echo "$glibcxx_cv_SYSCTL_HW_NCPU" >&6; }
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ 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
+
+
+
# Check for available headers.
for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index eb2fe85a7c4..8f853076cbe 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -174,6 +174,9 @@ AC_CHECK_HEADERS(sys/sysinfo.h)
GLIBCXX_CHECK_GET_NPROCS
AC_CHECK_HEADERS(unistd.h)
GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+GLIBCXX_CHECK_SC_NPROC_ONLN
+GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+GLIBCXX_CHECK_SYSCTL_HW_NCPU
# Check for available headers.
AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
index 81c05b9ea27..3cb6dce23b3 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -337,7 +337,7 @@ xml_sources_manual = \
${xml_dir}/manual/shared_ptr.xml \
${xml_dir}/manual/spine.xml \
${xml_dir}/manual/status_cxx1998.xml \
- ${xml_dir}/manual/status_cxx200x.xml \
+ ${xml_dir}/manual/status_cxx2011.xml \
${xml_dir}/manual/status_cxxtr1.xml \
${xml_dir}/manual/status_cxxtr24733.xml \
${xml_dir}/manual/strings.xml \
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 43045671ccd..472ed5466c2 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -215,7 +215,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -263,6 +262,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
@@ -390,7 +390,7 @@ xml_sources_manual = \
${xml_dir}/manual/shared_ptr.xml \
${xml_dir}/manual/spine.xml \
${xml_dir}/manual/status_cxx1998.xml \
- ${xml_dir}/manual/status_cxx200x.xml \
+ ${xml_dir}/manual/status_cxx2011.xml \
${xml_dir}/manual/status_cxxtr1.xml \
${xml_dir}/manual/status_cxxtr24733.xml \
${xml_dir}/manual/strings.xml \
diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc
index 00175388301..1212b6ff5f0 100644
--- a/libstdc++-v3/doc/doxygen/doxygroups.cc
+++ b/libstdc++-v3/doc/doxygen/doxygroups.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001, 2002, 2005, 2008, 2009, 2010
+ Copyright (C) 2001, 2002, 2005, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
See license.html for license.
@@ -29,6 +29,12 @@
/** @namespace std::tr1::__detail
* @brief Implementation details not part of the namespace std::tr1 interface.
*/
+/** @namespace std::tr2
+ * @brief ISO C++ TR2 entities toplevel namespace is std::tr2.
+*/
+/** @namespace std::tr2::__detail
+ * @brief Implementation details not part of the namespace std::tr2 interface.
+*/
/** @namespace __gnu_cxx
* @brief GNU extensions for public use.
*/
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index feb596b299a..06cfe2e8370 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -7,7 +7,7 @@
<a class="link" href="http://www.fsf.org/">FSF
</a>
- </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id548867"/><p>
+ </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id451922"/><p>
<a class="link" href="manual/license.html" title="License">License
</a>
</p></div></div></div><hr/></div><p>
diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html
index b4e05ed943f..b87c9d92a59 100644
--- a/libstdc++-v3/doc/html/faq.html
+++ b/libstdc++-v3/doc/html/faq.html
@@ -4,7 +4,7 @@
2008, 2010
<a class="link" href="http://www.fsf.org">FSF</a>
- </p></div></div><hr/></div><div class="qandaset" title="Frequently Asked Questions"><a id="id522425"/><dl><dt/><dd><dl><dt>1.1. <a href="faq.html#faq.what">
+ </p></div></div><hr/></div><div class="qandaset" title="Frequently Asked Questions"><a id="id486981"/><dl><dt/><dd><dl><dt>1.1. <a href="faq.html#faq.what">
What is libstdc++?
</a></dt><dt>1.2. <a href="faq.html#faq.why">
Why should I use libstdc++?
@@ -145,7 +145,7 @@
Who's in charge of it?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-who"/></td><td align="left" valign="top"><p>
The libstdc++ project is contributed to by several developers
- all over the world, in the same way as GCC or Linux.
+ all over the world, in the same way as GCC or the Linux kernel.
Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, Ulrich Drepper,
Loren James Rittle, and Paolo Carlini are the lead maintainers of
the SVN archive.
@@ -237,7 +237,7 @@
</a></dt></dl></td></tr><tr class="question" title="3.1."><td align="left" valign="top"><a id="faq.how_to_install"/><a id="q-how_to_install"/><p><strong>3.1.</strong></p></td><td align="left" valign="top"><p>How do I install libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_install"/></td><td align="left" valign="top"><p>
Often libstdc++ comes pre-installed as an integral part of many
- existing Linux and Unix systems, as well as many embedded
+ existing GNU/Linux and Unix systems, as well as many embedded
development tools. It may be necessary to install extra
development packages to get the headers, or the documentation, or
the source: please consult your vendor for details.
@@ -512,7 +512,7 @@
Long answer: See the implementation status pages for
<a class="link" href="manual/status.html#status.iso.1998" title="C++ 1998/2003">C++98</a>,
<a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">TR1</a>, and
- <a class="link" href="manual/status.html#status.iso.200x" title="C++ 200x">C++0x</a>.
+ <a class="link" href="manual/status.html#status.iso.2011" title="C++ 2011">C++11</a>.
</p></td></tr><tr class="question" title="5.2."><td align="left" valign="top"><a id="faq.standard_bugs"/><a id="q-standard_bugs"/><p><strong>5.2.</strong></p></td><td align="left" valign="top"><p>
Bugs in the ISO C++ language or library specification
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-standard_bugs"/></td><td align="left" valign="top"><p>
diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html
index 33e5ea69f33..deae95e566b 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -24,7 +24,7 @@
</p></div></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="book"><a href="manual/index.html">The GNU C++ Library Manual</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
Introduction
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="manual/status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="section"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt02.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="section"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="manual/status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.2011">C++ 2011</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="section"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt02.html">II.
Standard Contents
</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/support.html">4.
Support
@@ -35,13 +35,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/utilities.html">6.
Utilities
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="manual/memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="manual/memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="manual/memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id542426">Interface Design</a></span></dt><dt><span class="section"><a href="manual/memory.html#id542456">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id542566">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="manual/memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id543565">Class Hierarchy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id543744">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/memory.html#id543814">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id543936">Dual C++11 and TR1 Implementation</a></span></dt><dt><span class="section"><a href="manual/memory.html#id543992">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id556361">Examples</a></span></dt><dt><span class="section"><a href="manual/memory.html#id556391">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/localization.html">8.
Localization
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#id558091">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="manual/containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="manual/associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10.
@@ -144,22 +144,22 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="manual/test.html#test.exception.safety.status">
Existing tests
</a></span></dt><dt><span class="section"><a href="manual/test.html#test.exception.safety.containers">
-C++0x Requirements Test Sequence Descriptions
-</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710603">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></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
- </a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711092">
+C++11 Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.first.ios_base">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.first.cout_cin">No <code class="code">cout</code> in <code class="filename">&lt;ostream.h&gt;</code>, no <code class="code">cin</code> in <code class="filename">&lt;istream.h&gt;</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.second.std">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.iterators">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.isspace"><code class="code">isspace</code> from <code class="filename">&lt;cctype&gt;</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.at">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.eof">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.stringclear">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.ostreamform_istreamscan">
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711664">
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.stringstreams">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.wchar">Little or no wide character support</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.iostream_templates">No templatized iostreams</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second.thread_safety">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.third.headers">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.hash">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.nocreate_noreplace">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.streamattach">
No <code class="code">stream::attach(int fd)</code>
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711732">
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.support_cxx98">
Support for C++98 dialect.
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711760">
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.support_tr1">
Support for C++TR1 dialect.
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711804">
-Support for C++0x dialect.
-</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711882">
- Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.support_cxx11">
+Support for C++11 dialect.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third.iterator_type">
+ <code class="code">Container::iterator_type</code> is not necessarily <code class="code">Container::value_type*</code>
</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C.
Free Software Needs Free Documentation
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index dd3e011b0b0..b5b24d2a109 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -490,39 +490,39 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="link" href="http://www.codesourcery.com/public/cxx-abi">
C++ ABI Summary
</a>
- </em>. </span></p></div><div class="biblioentry" title="Intel Compilers for Linux Compatibility with the GNU Compilers"><a id="id708142"/><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry" title="Intel Compilers for Linux Compatibility with the GNU Compilers"><a id="id617197"/><p><span class="title"><em>
<a class="link" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm">
Intel Compilers for Linux Compatibility with the GNU Compilers
</a>
- </em>. </span></p></div><div class="biblioentry" title="Linker and Libraries Guide (document 819-0690)"><a id="id708158"/><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry" title="Linker and Libraries Guide (document 819-0690)"><a id="id617212"/><p><span class="title"><em>
<a class="link" href="http://download.oracle.com/docs/cd/E19963-01/html/819-0690/index.html">
Linker and Libraries Guide (document 819-0690)
</a>
- </em>. </span></p></div><div class="biblioentry" title="Sun Studio 11: C++ Migration Guide (document 819-3689)"><a id="id708173"/><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry" title="Sun Studio 11: C++ Migration Guide (document 819-3689)"><a id="id617228"/><p><span class="title"><em>
<a class="link" href="http://download.oracle.com/docs/cd/E19422-01/819-3689/index.html">
Sun Studio 11: C++ Migration Guide (document 819-3689)
</a>
- </em>. </span></p></div><div class="biblioentry" title="How to Write Shared Libraries"><a id="id708189"/><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry" title="How to Write Shared Libraries"><a id="id617243"/><p><span class="title"><em>
<a class="link" href="http://www.akkadia.org/drepper/dsohowto.pdf">
How to Write Shared Libraries
</a>
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry" title="C++ ABI for the ARM Architecture"><a id="id708217"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry" title="C++ ABI for the ARM Architecture"><a id="id617272"/><p><span class="title"><em>
<a class="link" href="http://www.arm.com/miscPDFs/8033.pdf">
C++ ABI for the ARM Architecture
</a>
- </em>. </span></p></div><div class="biblioentry" title="Dynamic Shared Objects: Survey and Issues"><a id="id708232"/><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry" title="Dynamic Shared Objects: Survey and Issues"><a id="id617287"/><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html">
Dynamic Shared Objects: Survey and Issues
</a>
</em>. </span><span class="subtitle">
ISO C++ J16/06-0046
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Versioning With Namespaces"><a id="id708260"/><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Versioning With Namespaces"><a id="id617314"/><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html">
Versioning With Namespaces
</a>
</em>. </span><span class="subtitle">
ISO C++ J16/06-0083
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems"><a id="id708287"/><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems"><a id="id617342"/><p><span class="title"><em>
<a class="link" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf">
Binary Compatibility of Shared Libraries Implemented in C++
on GNU/Linux Systems
diff --git a/libstdc++-v3/doc/html/manual/algorithms.html b/libstdc++-v3/doc/html/manual/algorithms.html
index dfbb967653d..900ccf31053 100644
--- a/libstdc++-v3/doc/html/manual/algorithms.html
+++ b/libstdc++-v3/doc/html/manual/algorithms.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 11.  Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="std.algorithms"/>Chapter 11. 
Algorithms
- <a id="id652390" class="indexterm"/>
+ <a id="id561444" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div><p>
The neatest accomplishment of the algorithms sect1 is that all the
work is done via iterators, not containers directly. This means two
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index 59ca7bca99f..7ae8b270702 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="id708847"/><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Allocator (3.4)</th><th style="text-align: left">Header (3.4)</th><th style="text-align: left">Allocator (3.[0-3])</th><th style="text-align: left">Header (3.[0-3])</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__new_alloc</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"> </td><td style="text-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="id617901"/><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Allocator (3.4)</th><th style="text-align: left">Header (3.4)</th><th style="text-align: left">Allocator (3.[0-3])</th><th style="text-align: left">Header (3.[0-3])</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__new_alloc</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"> </td><td style="text-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="id709077"/><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left">Allocator</th><th style="text-align: left">Include</th><th style="text-align: left">Version</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left">4.0.0</td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left">4.2.0</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id618132"/><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left">Allocator</th><th style="text-align: left">Include</th><th style="text-align: left">Version</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left">4.0.0</td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-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.
@@ -134,7 +134,7 @@ Backward include edit.
<code class="filename">tree.h</code> <code class="filename">vector.h</code>
</p></li><li class="listitem"><p>Added</p><p>
<code class="filename">hash_map</code> and <code class="filename">hash_set</code>
- </p></li><li class="listitem"><p>Added in C++0x</p><p>
+ </p></li><li class="listitem"><p>Added in C++11</p><p>
<code class="filename">auto_ptr.h</code> and <code class="filename">binders.h</code>
</p></li></ul></div><p>
Header dependency streamlining.
diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index 0aefd110331..7be7e1a83c7 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -7,7 +7,7 @@
Appendices
</th><td align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix A.  Contributing"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.contrib"/>
Contributing
- <a id="id699646" class="indexterm"/>
+ <a id="id608700" class="indexterm"/>
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
The GNU C++ Library follows an open development model. Active
contributors are assigned maintainer-ship responsibility, and given
diff --git a/libstdc++-v3/doc/html/manual/appendix_free.html b/libstdc++-v3/doc/html/manual/appendix_free.html
index 7174e48ae93..d8aba6b3f36 100644
--- a/libstdc++-v3/doc/html/manual/appendix_free.html
+++ b/libstdc++-v3/doc/html/manual/appendix_free.html
@@ -7,7 +7,7 @@
Appendices
</th><td align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix C.  Free Software Needs Free Documentation"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.free"/>
Free Software Needs Free Documentation
- <a id="id712010" class="indexterm"/>
+ <a id="id621207" class="indexterm"/>
</h1></div></div></div><p>
The biggest deficiency in free operating systems is not in the
software--it is the lack of good free manuals that we can include in
diff --git a/libstdc++-v3/doc/html/manual/appendix_gpl.html b/libstdc++-v3/doc/html/manual/appendix_gpl.html
index 348d6fad2ca..bc4036768f2 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gpl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gpl.html
@@ -78,7 +78,7 @@
</p><p>
The precise terms and conditions for copying, distribution and modification
follow.
- </p><h2><a id="id712349"/>
+ </p><h2><a id="id621546"/>
TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"/>
0. Definitions.
@@ -619,7 +619,7 @@
waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in
return for a fee.
- </p><h2><a id="id713173"/>
+ </p><h2><a id="id622370"/>
END OF TERMS AND CONDITIONS
</h2><h2><a id="HowToApply"/>
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 b2b0d387314..78733b7a02b 100644
--- a/libstdc++-v3/doc/html/manual/appendix_porting.html
+++ b/libstdc++-v3/doc/html/manual/appendix_porting.html
@@ -7,29 +7,29 @@
Appendices
</th><td align="right"> <a accesskey="n" href="documentation_hacking.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix B.  Porting and Maintenance"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.porting"/>
Porting and Maintenance
- <a id="id700765" class="indexterm"/>
+ <a id="id609819" class="indexterm"/>
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
Qualifying Exception Safety Guarantees
</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
Existing tests
</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
-C++0x Requirements Test Sequence Descriptions
-</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">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></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
- </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+C++11 Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first.ios_base">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.first.cout_cin">No <code class="code">cout</code> in <code class="filename">&lt;ostream.h&gt;</code>, no <code class="code">cin</code> in <code class="filename">&lt;istream.h&gt;</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.second.std">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iterators">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.isspace"><code class="code">isspace</code> from <code class="filename">&lt;cctype&gt;</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.at">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.eof">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringclear">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.ostreamform_istreamscan">
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringstreams">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.wchar">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iostream_templates">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.thread_safety">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.third.headers">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.hash">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.nocreate_noreplace">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.streamattach">
No <code class="code">stream::attach(int fd)</code>
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx98">
Support for C++98 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_tr1">
Support for C++TR1 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
-Support for C++0x dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
- Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx11">
+Support for C++11 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.iterator_type">
+ <code class="code">Container::iterator_type</code> is not necessarily <code class="code">Container::value_type*</code>
</a></span></dt></dl></dd></dl></dd></dl></div><div class="section" title="Configure and Build Hacking"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.build_hacking"/>Configure and Build Hacking</h2></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"/>Prerequisites</h3></div></div></div><p>
As noted <a class="link" href="http://gcc.gnu.org/install/prerequisites.html">previously</a>,
certain other tools are necessary for hacking on files that
@@ -41,7 +41,7 @@ Support for C++0x dialect.
in GCC try to stay in sync with each other in terms of versions of
the auto-tools used, so please try to play nicely with the
neighbors.
- </p></div><div class="section" title="Overview: What Comes from Where"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.map"/>Overview: What Comes from Where</h3></div></div></div><div class="figure"><a id="id700897"/><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/confdeps.png" style="text-align: middle" alt="Dependency Graph for Configure and Build Files"/></div></div></div><br class="figure-break"/><p>
+ </p></div><div class="section" title="Overview: What Comes from Where"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.map"/>Overview: What Comes from Where</h3></div></div></div><div class="figure"><a id="id609952"/><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/confdeps.png" style="text-align: middle" alt="Dependency Graph for Configure and Build Files"/></div></div></div><br class="figure-break"/><p>
Regenerate all generated files by using the command 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:
diff --git a/libstdc++-v3/doc/html/manual/atomics.html b/libstdc++-v3/doc/html/manual/atomics.html
index d22415ab3cd..efcb8f3c7c0 100644
--- a/libstdc++-v3/doc/html/manual/atomics.html
+++ b/libstdc++-v3/doc/html/manual/atomics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 14.  Atomics"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics"/>Chapter 14. 
Atomics
- <a id="id654041" class="indexterm"/>
+ <a id="id563096" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
Facilities for atomic operations.
</p><div class="section" title="API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics.api"/>API Reference</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index fa7d92cd311..48732f2ca46 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -17,15 +17,15 @@ ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
<span class="quote">“<span class="quote">obvious</span>â€</span> classes didn't get included.
-</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id710570"/>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="section" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id710603"/>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="section" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.first.ios_base"/>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="section" title="No cout in &lt;ostream.h&gt;, no cin in &lt;istream.h&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.first.cout_cin"/>No <code class="code">cout</code> in <code class="filename">&lt;ostream.h&gt;</code>, no <code class="code">cin</code> in <code class="filename">&lt;istream.h&gt;</code></h4></div></div></div><p>
In earlier versions of the standard,
- <code class="filename">fstream.h</code>,
- <code class="filename">ostream.h</code>
- and <code class="filename">istream.h</code>
+ <code class="filename">&lt;fstream.h&gt;</code>,
+ <code class="filename">&lt;ostream.h&gt;</code>
+ and <code class="filename">&lt;istream.h&gt;</code>
used to define
<code class="code">cout</code>, <code class="code">cin</code> and so on. ISO C++ specifies that one needs to include
- <code class="filename">iostream</code>
+ <code class="filename">&lt;iostream&gt;</code>
explicitly to get the required definitions.
</p><p> Some include adjustment may be required.</p><p>This project is no longer maintained or supported, and the sources
archived. For the desperate,
@@ -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="section" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id710706"/>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
+</p><div class="section" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.std"/>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>.
@@ -55,7 +55,7 @@ considered replaced and rewritten.
First, see if the compiler has a flag for this. Namespace
back-portability-issues are generally not a problem for g++
compilers that do not have libstdc++ in <code class="code">std::</code>, as the
- compilers use <code class="code">-fno-honor-std</code> (ignore
+ compilers use <code class="option">-fno-honor-std</code> (ignore
<code class="code">std::</code>, <code class="code">:: = std::</code>) by default. That is,
the responsibility for enabling or disabling <code class="code">std::</code> is
on the user; the maintainer does not have to care about it. This
@@ -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="section" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id710832"/>Illegal iterator usage</h4></div></div></div><p>
+</pre></div><div class="section" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.iterators"/>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
@@ -121,9 +121,9 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</p></li><li class="listitem"><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code>
- </p></li></ul></div></div><div class="section" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id710893"/><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </p></li></ul></div></div><div class="section" title="isspace from &lt;cctype&gt; is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.isspace"/><code class="code">isspace</code> from <code class="filename">&lt;cctype&gt;</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
+ Glibc 2.0.x and 2.1.x define <code class="filename">&lt;ctype.h&gt;</code> functionality as macros
(isspace, isalpha etc.).
</p><p>
This implementations of libstdc++, however, keep these functions
@@ -138,7 +138,7 @@ int main() { std::isspace('X'); }
std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
</pre><p>
A solution is to modify a header-file so that the compiler tells
- <code class="filename">ctype.h</code> to define functions
+ <code class="filename">&lt;ctype.h&gt;</code> to define functions
instead of macros:
</p><pre class="programlisting">
// This keeps isalnum, et al from being propagated as macros.
@@ -146,15 +146,16 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
# define __NO_CTYPE 1
#endif
</pre><p>
- Then, include <code class="filename">ctype.h</code>
+ Then, include <code class="filename">&lt;ctype.h&gt;</code>
</p><p>
Another problem arises if you put a <code class="code">using namespace
- std;</code> declaration at the top, and include <code class="filename">ctype.h</code>. This will result in
- ambiguities between the definitions in the global namespace
- (<code class="filename">ctype.h</code>) and the
+ std;</code> declaration at the top, and include
+ <code class="filename">&lt;ctype.h&gt;</code>. This will
+ result in ambiguities between the definitions in the global namespace
+ (<code class="filename">&lt;ctype.h&gt;</code>) and the
definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>).
-</p></div><div class="section" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id710989"/>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="section" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.at"/>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 +181,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="section" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id711028"/>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
+</p></div><div class="section" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.eof"/>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 +189,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else
#define CPP_EOF EOF
#endif
-</pre></div><div class="section" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id711046"/>No <code class="code">string::clear</code></h4></div></div></div><p>
+</pre></div><div class="section" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.stringclear"/>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,16 +207,16 @@ 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="section" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id711092"/>
+</p></div><div class="section" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.ostreamform_istreamscan"/>
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="section" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id711111"/>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
+</p></div><div class="section" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.stringstreams"/>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
+ provided, (<code class="filename">&lt;sstream&gt;</code>), for
compatibility with older implementations the pre-ISO
- <code class="code">i/ostrstream</code> (<code class="filename">strstream</code>) interface is also provided,
+ <code class="code">i/ostrstream</code> (<code class="filename">&lt;strstream&gt;</code>) interface is also provided,
with these caveats:
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
<code class="code">strstream</code> is considered to be deprecated
@@ -299,14 +300,14 @@ any = temp;
Another example of using stringstreams is in <a class="link" href="strings.html#strings.string.shrink" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in
particular <span class="quote">“<span class="quote">info iostream</span>â€</span>.
-</p></div><div class="section" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id711267"/>Little or no wide character support</h4></div></div></div><p>
+</p></div><div class="section" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.wchar"/>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="section" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id711285"/>No templatized iostreams</h4></div></div></div><p>
+ </p></div><div class="section" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.iostream_templates"/>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="section" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id711304"/>Thread safety issues</h4></div></div></div><p>
+ </p></div><div class="section" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.second.thread_safety"/>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,8 +365,9 @@ 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="section" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id711429"/>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
+ </p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.headers"/>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
+ (<code class="filename">&lt;iostream.h&gt;</code>,
+ <code class="filename">&lt;defalloc.h&gt;</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
</p><p>This compatibility layer is constructed by including the
@@ -432,21 +434,23 @@ AC_DEFUN([AC_HEADER_PRE_STDCXX], [
fi
])
</pre><p>Porting between pre-ISO headers and ISO headers is simple: headers
-like <code class="filename">vector.h</code> can be replaced with <code class="filename">vector</code> and a using
+like <code class="filename">&lt;vector.h&gt;</code> can be replaced with <code class="filename">&lt;vector&gt;</code> and a using
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="section" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id711514"/>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="section" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.hash"/>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
+ In particular, the <code class="classname">unordered_map</code> and
+ <code class="classname">unordered_set</code> containers of TR1 and C++ 2011
+ are suitable replacements for the non-standard
+ <code class="classname">hash_map</code> and <code class="classname">hash_set</code>
containers in the SGI STL.
- </p><p> Header files <code class="filename">hash_map</code> and <code class="filename">hash_set</code> moved
-to <code class="filename">ext/hash_map</code> and <code class="filename">ext/hash_set</code>,
+ </p><p> Header files <code class="filename">&lt;hash_map&gt;</code> and <code class="filename">&lt;hash_set&gt;</code> moved
+to <code class="filename">&lt;ext/hash_map&gt;</code> and <code class="filename">&lt;ext/hash_set&gt;</code>,
respectively. At the same time, all types in these files are enclosed
-in <code class="code">namespace __gnu_cxx</code>. Later versions move deprecate
-these files, and suggest using TR1's <code class="filename">unordered_map</code>
-and <code class="filename">unordered_set</code> instead.
+in <code class="code">namespace __gnu_cxx</code>. Later versions deprecate
+these files, and suggest using TR1's <code class="filename">&lt;unordered_map&gt;</code>
+and <code class="filename">&lt;unordered_set&gt;</code> instead.
</p><p>The extensions are no longer in the global or <code class="code">std</code>
namespaces, instead they are declared in the <code class="code">__gnu_cxx</code>
namespace. For maximum portability, consider defining a namespace
@@ -508,7 +512,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="section" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id711617"/>No <code class="code">ios::nocreate/ios::noreplace</code>.
+</pre></div><div class="section" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.nocreate_noreplace"/>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 +523,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="section" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id711664"/>
+</p></div><div class="section" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.streamattach"/>
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
@@ -534,7 +538,7 @@ No <code class="code">stream::attach(int fd)</code>
stream-constructor.
</p><p>
An extension is available that implements this.
- <code class="filename">ext/stdio_filebuf.h</code> contains a derived class called
+ <code class="filename">&lt;ext/stdio_filebuf.h&gt;</code> contains a derived class called
<a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code class="code">__gnu_cxx::stdio_filebuf</code></a>.
This class can be constructed from a C <code class="code">FILE*</code> or a file
descriptor, and provides the <code class="code">fd()</code> function.
@@ -542,7 +546,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to
<a class="link" href="http://www.josuttis.com/cppcode/fdstream.html">fdstream example</a>
by Nicolai Josuttis.
-</p></div><div class="section" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711732"/>
+</p></div><div class="section" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.support_cxx98"/>
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 +614,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="section" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711760"/>
+</pre></div><div class="section" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.support_tr1"/>
Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting">
@@ -687,21 +691,21 @@ 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="section" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711804"/>
-Support for C++0x dialect.
-</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
+</pre></div><div class="section" title="Support for C++11 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.support_cxx11"/>
+Support for C++11 dialect.
+</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++11 standard.
</p><pre class="programlisting">
-# AC_COMPILE_STDCXX_OX
-AC_DEFUN([AC_COMPILE_STDCXX_0X], [
- AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
- ac_cv_cxx_compile_cxx0x_native,
+# AC_COMPILE_STDCXX_11
+AC_DEFUN([AC_COMPILE_STDCXX_11], [
+ AC_CACHE_CHECK(if g++ supports C++11 features without additional flags,
+ ac_cv_cxx_compile_cxx11_native,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -710,23 +714,25 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_native=yes, ac_cv_cxx_compile_cxx11_native=no)
AC_LANG_RESTORE
])
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
- ac_cv_cxx_compile_cxx0x_cxx,
+ AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++11,
+ ac_cv_cxx_compile_cxx11_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++0x"
+ CXXFLAGS="$CXXFLAGS -std=c++11"
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -735,24 +741,26 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
- ac_cv_cxx_compile_cxx0x_gxx,
+ AC_CACHE_CHECK(if g++ supports C++11 features with -std=gnu++11,
+ ac_cv_cxx_compile_cxx11_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -761,30 +769,34 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_gxx=yes, ac_cv_cxx_compile_cxx11_gxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
- if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
- AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
+ if test "$ac_cv_cxx_compile_cxx11_native" = yes ||
+ test "$ac_cv_cxx_compile_cxx11_cxx" = yes ||
+ test "$ac_cv_cxx_compile_cxx11_gxx" = yes; then
+ AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
fi
])
-</pre><p>Check for library coverage of the C++0xstandard.
+</pre><p>Check for library coverage of the C++2011 standard.
+ (Some library headers are commented out in this check, they are
+ not currently provided by libstdc++).
</p><pre class="programlisting">
-# AC_HEADER_STDCXX_0X
-AC_DEFUN([AC_HEADER_STDCXX_0X], [
- AC_CACHE_CHECK(for ISO C++ 0x include files,
- ac_cv_cxx_stdcxx_0x,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+# AC_HEADER_STDCXX_11
+AC_DEFUN([AC_HEADER_STDCXX_11], [
+ AC_CACHE_CHECK(for ISO C++11 include files,
+ ac_cv_cxx_stdcxx_11,
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([
#include &lt;cassert&gt;
@@ -800,6 +812,7 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;cmath&gt;
#include &lt;csetjmp&gt;
#include &lt;csignal&gt;
+ // #include &lt;cstdalign&gt;
#include &lt;cstdarg&gt;
#include &lt;cstdbool&gt;
#include &lt;cstddef&gt;
@@ -809,21 +822,29 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;cstring&gt;
#include &lt;ctgmath&gt;
#include &lt;ctime&gt;
+ // #include &lt;cuchar&gt;
#include &lt;cwchar&gt;
#include &lt;cwctype&gt;
#include &lt;algorithm&gt;
#include &lt;array&gt;
+ #include &lt;atomic&gt;
#include &lt;bitset&gt;
+ #include &lt;chrono&gt;
+ // #include &lt;codecvt&gt;
#include &lt;complex&gt;
+ #include &lt;condition_variable&gt;
#include &lt;deque&gt;
#include &lt;exception&gt;
+ #include &lt;forward_list&gt;
#include &lt;fstream&gt;
#include &lt;functional&gt;
+ #include &lt;future&gt;
#include &lt;iomanip&gt;
#include &lt;ios&gt;
#include &lt;iosfwd&gt;
#include &lt;iostream&gt;
+ #include &lt;initializer_list&gt;
#include &lt;istream&gt;
#include &lt;iterator&gt;
#include &lt;limits&gt;
@@ -831,19 +852,25 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;locale&gt;
#include &lt;map&gt;
#include &lt;memory&gt;
+ #include &lt;mutex&gt;
#include &lt;new&gt;
#include &lt;numeric&gt;
#include &lt;ostream&gt;
#include &lt;queue&gt;
#include &lt;random&gt;
+ #include &lt;ratio&gt;
#include &lt;regex&gt;
+ #include &lt;scoped_allocator&gt;
#include &lt;set&gt;
#include &lt;sstream&gt;
#include &lt;stack&gt;
#include &lt;stdexcept&gt;
#include &lt;streambuf&gt;
#include &lt;string&gt;
+ #include &lt;system_error&gt;
+ #include &lt;thread&gt;
#include &lt;tuple&gt;
+ #include &lt;typeindex&gt;
#include &lt;typeinfo&gt;
#include &lt;type_traits&gt;
#include &lt;unordered_map&gt;
@@ -852,25 +879,26 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;valarray&gt;
#include &lt;vector&gt;
],,
- ac_cv_cxx_stdcxx_0x=yes, ac_cv_cxx_stdcxx_0x=no)
+ ac_cv_cxx_stdcxx_11=yes, ac_cv_cxx_stdcxx_11=no)
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
])
- if test "$ac_cv_cxx_stdcxx_0x" = yes; then
- AC_DEFINE(STDCXX_0X_HEADERS,,[Define if ISO C++ 0x header files are present. ])
+ if test "$ac_cv_cxx_stdcxx_11" = yes; then
+ AC_DEFINE(STDCXX_11_HEADERS,,[Define if ISO C++11 header files are present. ])
fi
])
-</pre><p>As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For &lt;unordered_map&gt;
+</pre><p>As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For
+<code class="filename">&lt;unordered_map&gt;</code>
</p><pre class="programlisting">
# AC_HEADER_UNORDERED_MAP
AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_CACHE_CHECK(for unordered_map,
ac_cv_cxx_unordered_map,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([#include &lt;unordered_map&gt;], [using std::unordered_map;],
ac_cv_cxx_unordered_map=yes, ac_cv_cxx_unordered_map=no)
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -885,11 +913,11 @@ AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_CACHE_CHECK(for unordered_set,
ac_cv_cxx_unordered_set,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([#include &lt;unordered_set&gt;], [using std::unordered_set;],
ac_cv_cxx_unordered_set=yes, ac_cv_cxx_unordered_set=no)
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -899,21 +927,29 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
-</pre></div><div class="section" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id711882"/>
- Container::iterator_type is not necessarily Container::value_type*
+</pre><p>
+ Some C++11 features first appeared in GCC 4.3 and could be enabled by
+ <code class="option">-std=c++0x</code> and <code class="option">-std=gnu++0x</code> for GCC
+ releases which pre-date the 2011 standard. Those C++11 features and GCC's
+ support for them were still changing until the 2011 standard was finished,
+ but the autoconf checks above could be extended to test for incomplete
+ C++11 support with <code class="option">-std=c++0x</code> and
+ <code class="option">-std=gnu++0x</code>.
+</p></div><div class="section" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.iterator_type"/>
+ <code class="code">Container::iterator_type</code> is not necessarily <code class="code">Container::value_type*</code>
</h4></div></div></div><p>
- This is a change in behavior from the previous version. Now, most
+ This is a change in behavior from older versions. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers.
-</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="Migrating to GCC 4.1"><a id="id711913"/><p><span class="title"><em>
+</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="Migrating to GCC 4.1"><a id="id621110"/><p><span class="title"><em>
<a class="link" href="http://www.kegel.com/gcc/gcc4.html">
Migrating to GCC 4.1
</a>
- </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry" title="Building the Whole Debian Archive with GCC 4.1: A Summary"><a id="id711936"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry" title="Building the Whole Debian Archive with GCC 4.1: A Summary"><a id="id621133"/><p><span class="title"><em>
<a class="link" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html">
Building the Whole Debian Archive with GCC 4.1: A Summary
</a>
- </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry" title="Migration guide for GCC-3.2"><a id="id711960"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry" title="Migration guide for GCC-3.2"><a id="id621157"/><p><span class="title"><em>
<a class="link" href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html">
Migration guide for GCC-3.2
</a>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02.html b/libstdc++-v3/doc/html/manual/bk01pt02.html
index 5c344b16857..bdd5c0e3f59 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02.html
@@ -13,13 +13,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
Utilities
-</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id542426">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id542456">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id542566">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id543565">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id543744">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id543814">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id543936">Dual C++11 and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id543992">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id556361">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id556391">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
Localization
-</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id558091">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html b/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
index 74c468d8800..e12ca2f310c 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
@@ -36,7 +36,7 @@
<code class="literal">-D_GLIBCXX_CONCEPT_CHECKS</code>.
</p><p>
Please note that the checks are based on the requirements in the original
- C++ standard, some of which have changed in the upcoming C++0x revision.
+ C++ standard, some of which have changed in the new C++11 revision.
Additionally, some correct code might be rejected by the concept checks,
for example template argument types may need to be complete when used in
a template definition, rather than at the point of instantiation.
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
index 4ad5743ca05..0518f10fd15 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
@@ -19,6 +19,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="id654877"/><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::bitset</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="classname">__gnu_debug::bitset</code></td><td style="text-align: left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::deque</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="classname">__gnu_debug::deque</code></td><td style="text-align: left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::list</code></td><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="classname">__gnu_debug::list</code></td><td style="text-align: left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::map</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::map</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multimap</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multiset</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::set</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::set</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::wstring</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::wstring</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::basic_string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::basic_string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::vector</code></td><td style="text-align: left"><code class="filename">vector</code></td><td style="text-align: left"><code class="classname">__gnu_debug::vector</code></td><td style="text-align: left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/><p>In addition, when compiling in C++0x mode, these additional
+</p><div class="table"><a id="id563932"/><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::bitset</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="classname">__gnu_debug::bitset</code></td><td style="text-align: left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::deque</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="classname">__gnu_debug::deque</code></td><td style="text-align: left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::list</code></td><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="classname">__gnu_debug::list</code></td><td style="text-align: left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::map</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::map</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multimap</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multiset</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::set</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::set</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::wstring</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::wstring</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::basic_string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::basic_string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::vector</code></td><td style="text-align: left"><code class="filename">vector</code></td><td style="text-align: left"><code class="classname">__gnu_debug::vector</code></td><td style="text-align: left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/><p>In addition, when compiling in C++11 mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="id655252"/><p class="title"><strong>Table 17.2. Debugging Containers C++0x</strong></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_map</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multimap</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_set</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_set</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multiset</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id564306"/><p class="title"><strong>Table 17.2. Debugging Containers C++11</strong></p><div class="table-contents"><table summary="Debugging Containers C++11" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_map</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multimap</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_set</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_set</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multiset</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
index a0a85b76dc1..1aa9f30a246 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
@@ -193,7 +193,7 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
and making the debug mode easier to incorporate into development
environments by minimizing dependencies.</p><p>Achieving link- and run-time coexistence is not a trivial
implementation task. To achieve this goal we required a small
- extension to the GNU C++ compiler (since incorporated into the C++0x language specification, described in the GCC Manual for the C++ language as
+ extension to the GNU C++ compiler (since incorporated into the C++11 language specification, described in the GCC Manual for the C++ language as
<a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html#Namespace-Association">namespace
association</a>), and a complex organization of debug- and
release-modes. The end result is that we have achieved per-use
@@ -224,7 +224,7 @@ namespace std
defined in the namespace <code class="code">__cxx1998</code>) and also the
debug-mode container. The debug-mode container is defined within the
namespace <code class="code">__debug</code>, which is associated with namespace
-<code class="code">std</code> via the C++0x namespace association language feature. This
+<code class="code">std</code> via the C++11 namespace association language feature. This
method allows the debug and release versions of the same component to
coexist at compile-time and link-time without causing an unreasonable
maintenance burden, while minimizing confusion. Again, this boils down
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
index 71b3de20a73..5bd27806aa6 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
@@ -63,4 +63,4 @@ Then compile this code with the prerequisite compiler flags
flags for atomic operations.)
</p><p> The following table provides the names and headers of all the
parallel algorithms that can be used in a similar manner:
-</p><div class="table"><a id="id656839"/><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Algorithm</th><th style="text-align: left">Header</th><th style="text-align: left">Parallel algorithm</th><th style="text-align: left">Parallel header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="function">std::accumulate</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::accumulate</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_difference</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::inner_product</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::inner_product</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sum</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sum</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::equal</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::equal</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_first_of</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_first_of</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::for_each</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::for_each</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::mismatch</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::mismatch</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::transform</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::transform</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::max_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::max_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::merge</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::merge</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::min_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::min_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::nth_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::nth_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partition</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partition</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::random_shuffle</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::random_shuffle</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_union</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_union</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_intersection</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_intersection</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::stable_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::stable_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::unique_copy</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::unique_copy</code></td><td style="text-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 align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id565894"/><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Algorithm</th><th style="text-align: left">Header</th><th style="text-align: left">Parallel algorithm</th><th style="text-align: left">Parallel header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="function">std::accumulate</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::accumulate</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_difference</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::inner_product</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::inner_product</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sum</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sum</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::equal</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::equal</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_first_of</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_first_of</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::for_each</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::for_each</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::mismatch</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::mismatch</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::transform</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::transform</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::max_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::max_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::merge</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::merge</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::min_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::min_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::nth_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::nth_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partition</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partition</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::random_shuffle</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::random_shuffle</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_union</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_union</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_intersection</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_intersection</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::stable_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::stable_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::unique_copy</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::unique_copy</code></td><td style="text-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 align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
index e8cf6a4b05d..a4d54e0b454 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="next" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.design"/>Design</h2></div></div></div><p>
-</p><div class="table"><a id="id658962"/><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Code Location</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/std/*</code></td><td style="text-align: left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/*</code></td><td style="text-align: left">Profile extension public headers (map, vector, ...).</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td style="text-align: left">Profile extension internals. Implementation files are
+</p><div class="table"><a id="id568017"/><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Code Location</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/std/*</code></td><td style="text-align: left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/*</code></td><td style="text-align: left">Profile extension public headers (map, vector, ...).</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td style="text-align: left">Profile extension internals. Implementation files are
only included from <code class="code">impl/profiler.h</code>, which is the only
file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break"/><p>
</p><div class="section" title="Wrapper Model"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"/>Wrapper Model</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
index 6548b8b8c41..f2f6cb6e769 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
@@ -18,7 +18,7 @@
A high accuracy means that the diagnostic is unlikely to be wrong.
These grades are not perfect. They are just meant to guide users with
specific needs or time budgets.
- </p><div class="table"><a id="id659844"/><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left">Group</th><th style="text-align: left">Flag</th><th style="text-align: left">Benefit</th><th style="text-align: left">Cost</th><th style="text-align: left">Freq.</th><th style="text-align: left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers" title="Containers">
+ </p><div class="table"><a id="id568899"/><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left">Group</th><th style="text-align: left">Flag</th><th style="text-align: left">Benefit</th><th style="text-align: left">Cost</th><th style="text-align: left">Freq.</th><th style="text-align: left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers" title="Containers">
CONTAINERS</a></td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small" title="Hashtable Too Small">
HASHTABLE_TOO_SMALL</a></td><td style="text-align: left">10</td><td style="text-align: left">1</td><td style="text-align: left"> </td><td style="text-align: left">10</td><td style="text-align: left">yes</td></tr><tr><td style="text-align: left"> </td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large" title="Hashtable Too Large">
HASHTABLE_TOO_LARGE</a></td><td style="text-align: left">5</td><td style="text-align: left">1</td><td style="text-align: left"> </td><td style="text-align: left">10</td><td style="text-align: left">yes</td></tr><tr><td style="text-align: left"> </td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash" title="Inefficient Hash">
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
index 5b62d1fbc72..a60f57b1d1a 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
@@ -76,7 +76,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="id663274"/><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left">268</td><td style="text-align: left">0</td><td style="text-align: left">4294967295</td><td style="text-align: left">4294967295</td><td style="text-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="id572329"/><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left">268</td><td style="text-align: left">0</td><td style="text-align: left">4294967295</td><td style="text-align: left">4294967295</td><td style="text-align: left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break"/><p>
The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch21s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch21s03.html
deleted file mode 100644
index 2f75d608b5e..00000000000
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch21s03.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Deprecated HP/SGI</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="ext_containers.html" title="Chapter 21. Containers"/><link rel="prev" href="bk01pt03ch21s02.html" title="HP/SGI"/><link rel="next" href="ext_utilities.html" title="Chapter 22. 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 align="left"><a accesskey="p" href="bk01pt03ch21s02.html">Prev</a> </td><th width="60%" align="center">Chapter 21. Containers</th><td align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr/></div><div class="section" title="Deprecated HP/SGI"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.deprecated_sgi"/>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,
- unordered_multimap containers in TR1 and the upcoming C++0x, and
- may be removed in future releases.
- </p><p>The SGI headers</p><pre class="programlisting">
- &lt;hash_map&gt;
- &lt;hash_set&gt;
- &lt;rope&gt;
- &lt;slist&gt;
- &lt;rb_tree&gt;
- </pre><p>are all here;
- <code class="code">&lt;hash_map&gt;</code> and <code class="code">&lt;hash_set&gt;</code>
- are deprecated but available as backwards-compatible extensions,
- as discussed further below. <code class="code">&lt;rope&gt;</code> is the
- SGI specialization for large strings ("rope,"
- "large strings," get it? Love that geeky humor.)
- <code class="code">&lt;slist&gt;</code> is a singly-linked list, for when the
- doubly-linked <code class="code">list&lt;&gt;</code> is too much space
- overhead, and <code class="code">&lt;rb_tree&gt;</code> exposes the red-black
- tree classes used in the implementation of the standard maps and
- sets.
- </p><p>Each of the associative containers map, multimap, set, and multiset
- have a counterpart which uses a
- <a class="link" href="http://www.sgi.com/tech/stl/HashFunction.html">hashing
- function</a> to do the arranging, instead of a strict weak ordering
- function. The classes take as one of their template parameters a
- function object that will return the hash value; by default, an
- instantiation of
- <a class="link" href="http://www.sgi.com/tech/stl/hash.html">hash</a>.
- You should specialize this functor for your class, or define your own,
- before trying to use one of the hashing classes.
- </p><p>The hashing classes support all the usual associative container
- functions, as well as some extra constructors specifying the number
- of buckets, etc.
- </p><p>Why would you want to use a hashing class instead of the
- <span class="quote">“<span class="quote">normal</span>â€</span>implementations? Matt Austern writes:
- </p><div class="blockquote"><blockquote class="blockquote"><p>
- <span class="emphasis"><em>[W]ith a well chosen hash function, hash tables
- generally provide much better average-case performance than
- binary search trees, and much worse worst-case performance. So
- if your implementation has hash_map, if you don't mind using
- nonstandard components, and if you aren't scared about the
- 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 align="left"><a accesskey="p" href="bk01pt03ch21s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td align="left" valign="top">HP/SGI </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 22. Utilities</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html
index 29d9f5d1db6..f1771e99c9e 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html
@@ -4,7 +4,7 @@
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,
- unordered_multimap containers in TR1 and the upcoming C++0x, and
+ unordered_multimap containers in TR1 and C++11, and
may be removed in future releases.
</p><p>The SGI headers</p><pre class="programlisting">
&lt;hash_map&gt;
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html
deleted file mode 100644
index 4350e20b19c..00000000000
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><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"/><link rel="up" href="ext_concurrency.html" title="Chapter 28. Concurrency"/><link rel="prev" href="ext_concurrency.html" title="Chapter 28. Concurrency"/><link rel="next" href="bk01pt03ch28s03.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 align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 28. Concurrency</th><td align="right"> <a accesskey="n" href="bk01pt03ch28s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.impl"/>Implementation</h2></div></div></div><div class="section" title="Using Builtin Atomic Functions"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"/>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,
-using them directly is problematic, and can result in undefined
-function calls. (An example of an undefined symbol from the use
-of <code class="code">__sync_fetch_and_add</code> on an unsupported host is a
-missing reference to <code class="code">__sync_fetch_and_add_4</code>.)
-</p><p>In addition, on some hosts the compiler intrinsics are enabled
-conditionally, via the <code class="code">-march</code> command line flag. This makes
-usage vary depending on the target hardware and the flags used during
-compile.
-</p><p>
-If builtins are possible for bool-sized integral types,
-<code class="code">_GLIBCXX_ATOMIC_BUILTINS_1</code> will be defined.
-If builtins are possible for int-sized integral types,
-<code class="code">_GLIBCXX_ATOMIC_BUILTINS_4</code> will be defined.
-</p><p>For the following hosts, intrinsics are enabled by default.
-</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>alpha</p></li><li class="listitem"><p>ia64</p></li><li class="listitem"><p>powerpc</p></li><li class="listitem"><p>s390</p></li></ul></div><p>For others, some form of <code class="code">-march</code> may work. On
-non-ancient x86 hardware, <code class="code">-march=native</code> usually does the
-trick.</p><p> For hosts without compiler intrinsics, but with capable
-hardware, hand-crafted assembly is selected. This is the case for the following hosts:
-</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>cris</p></li><li class="listitem"><p>hppa</p></li><li class="listitem"><p>i386</p></li><li class="listitem"><p>i486</p></li><li class="listitem"><p>m48k</p></li><li class="listitem"><p>mips</p></li><li class="listitem"><p>sparc</p></li></ul></div><p>And for the rest, a simulated atomic lock via pthreads.
-</p><p> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html"> documentation</a>.
-</p><p> More details on the library fallbacks from the porting <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">section</a>.
-</p></div><div class="section" title="Thread Abstraction"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.thread"/>Thread Abstraction</h3></div></div></div><p>A thin layer above IEEE 1003.1 (i.e. pthreads) is used to abstract
-the thread interface for GCC. This layer is called "gthread," and is
-comprised of one header file that wraps the host's default thread layer with
-a POSIX-like interface.
-</p><p> The file &lt;gthr-default.h&gt; points to the deduced wrapper for
-the current host. In libstdc++ implementation files,
-&lt;bits/gthr.h&gt; is used to select the proper gthreads file.
-</p><p>Within libstdc++ sources, all calls to underlying thread functionality
-use this layer. More detail as to the specific interface can be found in the source <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00883_source.html">documentation</a>.
-</p><p>By design, the gthread layer is interoperable with the types,
-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 align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch28s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 28. Concurrency </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Use</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch28s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch28s03.html
deleted file mode 100644
index b70d5a621ac..00000000000
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch28s03.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><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"/><link rel="up" href="ext_concurrency.html" title="Chapter 28. Concurrency"/><link rel="prev" href="bk01pt03ch28s02.html" title="Implementation"/><link rel="next" href="bk01pt04.html" title="Part IV.  Appendices"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch28s02.html">Prev</a> </td><th width="60%" align="center">Chapter 28. Concurrency</th><td align="right"> <a accesskey="n" href="bk01pt04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Use"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.use"/>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;
-
-namespace
-{
- __gnu_cxx::__mutex safe_base_mutex;
-} // anonymous namespace
-
-namespace other
-{
- void
- foo()
- {
- __gnu_cxx::__scoped_lock sentry(safe_base_mutex);
- for (int i = 0; i &lt; max; ++i)
- {
- _Safe_iterator_base* __old = __iter;
- __iter = __iter-&lt;_M_next;
- __old-&lt;_M_detach_single();
- }
-}
-</pre><p>In this sample code, an anonymous namespace is used to keep
-the <code class="code">__mutex</code> private to the compilation unit,
-and <code class="code">__scoped_lock</code> is used to guard access to the critical
-section within the for loop, locking the mutex on creation and freeing
-the mutex as control moves out of this block.
-</p><p>Several exception classes are used to keep track of
-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 align="left"><a accesskey="p" href="bk01pt03ch28s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt04.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Part IV. 
- Appendices
-</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
index 7e3eb4ac9dc..61dd4083a1e 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="extensions.html" title="Part III.  Extensions"/><link rel="next" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr/></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a id="id654345"/></h1></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr/></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a id="id563399"/></h1></div></div></div><p>
Here we will make an attempt at describing the non-Standard
extensions to the library. Some of these are from older versions of
standard library components, namely SGI's STL, and some of these are
diff --git a/libstdc++-v3/doc/html/manual/bk01pt04.html b/libstdc++-v3/doc/html/manual/bk01pt04.html
index a12cff854f4..df80167670a 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt04.html
@@ -16,22 +16,22 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
Existing tests
</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
-C++0x Requirements Test Sequence Descriptions
-</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">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></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
- </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+C++11 Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first.ios_base">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.first.cout_cin">No <code class="code">cout</code> in <code class="filename">&lt;ostream.h&gt;</code>, no <code class="code">cin</code> in <code class="filename">&lt;istream.h&gt;</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.second.std">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iterators">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.isspace"><code class="code">isspace</code> from <code class="filename">&lt;cctype&gt;</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.at">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.eof">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringclear">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.ostreamform_istreamscan">
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringstreams">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.wchar">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iostream_templates">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.thread_safety">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.third.headers">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.hash">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.nocreate_noreplace">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.streamattach">
No <code class="code">stream::attach(int fd)</code>
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx98">
Support for C++98 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_tr1">
Support for C++TR1 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
-Support for C++0x dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
- Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx11">
+Support for C++11 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.iterator_type">
+ <code class="code">Container::iterator_type</code> is not necessarily <code class="code">Container::value_type*</code>
</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
Free Software Needs Free Documentation
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index a3dcaaf94cf..91a4574b106 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -226,7 +226,7 @@
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#387">387</a>:
<span class="emphasis"><em>std::complex over-encapsulated</em></span>
</span></dt><dd><p>Add the <code class="code">real(T)</code> and <code class="code">imag(T)</code>
- members; in C++0x mode, also adjust the existing
+ members; in C++11 mode, also adjust the existing
<code class="code">real()</code> and <code class="code">imag()</code> members and
free functions.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#389">389</a>:
@@ -298,7 +298,7 @@
</span></dt><dd><p>Follow the straightforward proposed resolution.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#550">550</a>:
<span class="emphasis"><em>What should the return type of pow(float,int) be?</em></span>
- </span></dt><dd><p>In C++0x mode, remove the pow(float,int), etc., signatures.
+ </span></dt><dd><p>In C++11 mode, remove the pow(float,int), etc., signatures.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#586">586</a>:
<span class="emphasis"><em>string inserter not a formatted function</em></span>
</span></dt><dd><p>Change it to be a formatted output function (i.e. catch exceptions).
@@ -313,7 +313,7 @@
</span></dt><dd><p>Add the missing operations.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#691">691</a>:
<span class="emphasis"><em>const_local_iterator cbegin, cend missing from TR1</em></span>
- </span></dt><dd><p>In C++0x mode add cbegin(size_type) and cend(size_type)
+ </span></dt><dd><p>In C++11 mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#693">693</a>:
<span class="emphasis"><em>std::bitset::all() missing</em></span>
@@ -326,22 +326,22 @@
</span></dt><dd><p>Implement the straightforward resolution.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#761">761</a>:
<span class="emphasis"><em>unordered_map needs an at() member function</em></span>
- </span></dt><dd><p>In C++0x mode, add at() and at() const.
+ </span></dt><dd><p>In C++11 mode, add at() and at() const.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#775">775</a>:
<span class="emphasis"><em>Tuple indexing should be unsigned?</em></span>
</span></dt><dd><p>Implement the int -&gt; size_t replacements.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#776">776</a>:
<span class="emphasis"><em>Undescribed assign function of std::array</em></span>
- </span></dt><dd><p>In C++0x mode, remove assign, add fill.
+ </span></dt><dd><p>In C++11 mode, remove assign, add fill.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#781">781</a>:
<span class="emphasis"><em>std::complex should add missing C99 functions</em></span>
- </span></dt><dd><p>In C++0x mode, add std::proj.
+ </span></dt><dd><p>In C++11 mode, add std::proj.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#809">809</a>:
<span class="emphasis"><em>std::swap should be overloaded for array types</em></span>
</span></dt><dd><p>Add the overload.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#844">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.
+ </span></dt><dd><p>In C++11 mode, remove the pow(complex&lt;T&gt;, int) signature.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#853">853</a>:
<span class="emphasis"><em>to_string needs updating with zero and one</em></span>
</span></dt><dd><p>Update / add the signatures.
diff --git a/libstdc++-v3/doc/html/manual/concurrency.html b/libstdc++-v3/doc/html/manual/concurrency.html
index 7294c3ccd8d..945592cad0a 100644
--- a/libstdc++-v3/doc/html/manual/concurrency.html
+++ b/libstdc++-v3/doc/html/manual/concurrency.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 15.  Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency"/>Chapter 15. 
Concurrency
- <a id="id654161" class="indexterm"/>
+ <a id="id563216" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></div><p>
Facilities for concurrent operation, and control thereof.
</p><div class="section" title="API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency.api"/>API Reference</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 92809aa09e9..c2cf8d4c13a 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -88,7 +88,7 @@
</p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-time=OPTION</code></span></dt><dd><p>Enables link-type checks for the availability of the
clock_gettime clocks, used in the implementation of [time.clock],
and of the nanosleep and sched_yield functions, used in the
- implementation of [thread.thread.this] of the current C++0x draft.
+ implementation of [thread.thread.this] of the 2011 ISO C++ standard.
The choice OPTION=yes checks for the availability of the facilities
in libc and libposix4. In case of need the latter is also linked
to libstdc++ as part of the build process. OPTION=rt also searches
diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html
index b95e4805a52..7b7e373464e 100644
--- a/libstdc++-v3/doc/html/manual/containers.html
+++ b/libstdc++-v3/doc/html/manual/containers.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 9.  Containers"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"/>Chapter 9. 
Containers
- <a id="id651208" class="indexterm"/>
+ <a id="id560262" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section" title="Sequences"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers.sequences"/>Sequences</h2></div></div></div><div class="section" title="list"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"/>list</h3></div></div></div><div class="section" title="list::size() is O(n)"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"/>list::size() is O(n)</h4></div></div></div><p>
Yes it is, and that's okay. This is a decision that we preserved
when we imported SGI's STL implementation. The following is
diff --git a/libstdc++-v3/doc/html/manual/diagnostics.html b/libstdc++-v3/doc/html/manual/diagnostics.html
index 399d7719d07..5652a78c1c7 100644
--- a/libstdc++-v3/doc/html/manual/diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/diagnostics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="bk01pt02ch05s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 5.  Diagnostics"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics"/>Chapter 5. 
Diagnostics
- <a id="id632643" class="indexterm"/>
+ <a id="id541707" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></div><div class="section" title="Exceptions"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics.exceptions"/>Exceptions</h2></div></div></div><div class="section" title="API Reference"><div class="titlepage"><div><div><h3 class="title"><a id="std.diagnostics.exceptions.api"/>API Reference</h3></div></div></div><p>
All exception objects are defined in one of the standard header
files: <code class="filename">exception</code>,
diff --git a/libstdc++-v3/doc/html/manual/documentation_hacking.html b/libstdc++-v3/doc/html/manual/documentation_hacking.html
index 293d2a922d7..dfeface9583 100644
--- a/libstdc++-v3/doc/html/manual/documentation_hacking.html
+++ b/libstdc++-v3/doc/html/manual/documentation_hacking.html
@@ -117,7 +117,7 @@
supported, and are always aliased to dummy rules. These
unsupported formats are: <span class="emphasis"><em>info</em></span>,
<span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
- </p></div><div class="section" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"/>Doxygen</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id701803"/><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">coreutils</td><td style="text-align: center">8.5</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">bash</td><td style="text-align: center">4.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">doxygen</td><td style="text-align: center">1.7.0</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">graphviz</td><td style="text-align: center">2.26</td><td style="text-align: center">graphical hierarchies</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p></div><div class="section" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"/>Doxygen</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id610857"/><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">coreutils</td><td style="text-align: center">8.5</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">bash</td><td style="text-align: center">4.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">doxygen</td><td style="text-align: center">1.7.0</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">graphviz</td><td style="text-align: center">2.26</td><td style="text-align: center">graphical hierarchies</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr></tbody></table></div></div><br class="table-break"/><p>
Prerequisite tools are Bash 2.0 or later,
<a class="link" href="http://www.doxygen.org/">Doxygen</a>, and
the <a class="link" href="http://www.gnu.org/software/coreutils/">GNU
@@ -263,7 +263,7 @@
writing Doxygen comments. Single and double quotes, and
separators in filenames are two common trouble spots. When in
doubt, consult the following table.
- </p><div class="table"><a id="id702306"/><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Doxygen</th></tr></thead><tbody><tr><td style="text-align: left">\</td><td style="text-align: left">\\</td></tr><tr><td style="text-align: left">"</td><td style="text-align: left">\"</td></tr><tr><td style="text-align: left">'</td><td style="text-align: left">\'</td></tr><tr><td style="text-align: left">&lt;i&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;b&gt;</td><td style="text-align: left">@b word</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">@c word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="section" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"/>Docbook</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id702468"/><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">docbook5-style-xsl</td><td style="text-align: center">1.76.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xsltproc</td><td style="text-align: center">1.1.26</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xmllint</td><td style="text-align: center">2.7.7</td><td style="text-align: center">validation</td></tr><tr><td style="text-align: center">dblatex</td><td style="text-align: center">0.3</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">docbook2X</td><td style="text-align: center">0.8.8</td><td style="text-align: center">info output</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id611360"/><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Doxygen</th></tr></thead><tbody><tr><td style="text-align: left">\</td><td style="text-align: left">\\</td></tr><tr><td style="text-align: left">"</td><td style="text-align: left">\"</td></tr><tr><td style="text-align: left">'</td><td style="text-align: left">\'</td></tr><tr><td style="text-align: left">&lt;i&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;b&gt;</td><td style="text-align: left">@b word</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">@c word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="section" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"/>Docbook</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id611522"/><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">docbook5-style-xsl</td><td style="text-align: center">1.76.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xsltproc</td><td style="text-align: center">1.1.26</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xmllint</td><td style="text-align: center">2.7.7</td><td style="text-align: center">validation</td></tr><tr><td style="text-align: center">dblatex</td><td style="text-align: center">0.3</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">docbook2X</td><td style="text-align: center">0.8.8</td><td style="text-align: center">info output</td></tr></tbody></table></div></div><br class="table-break"/><p>
Editing the DocBook sources requires an XML editor. Many
exist: some notable options
include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
@@ -419,11 +419,11 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
<a class="link" href="http://www.docbook.org/tdg/en/html/part2.html">online</a>.
An incomplete reference for HTML to Docbook conversion is
detailed in the table below.
- </p><div class="table"><a id="id702945"/><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Docbook</th></tr></thead><tbody><tr><td style="text-align: left">&lt;p&gt;</td><td style="text-align: left">&lt;para&gt;</td></tr><tr><td style="text-align: left">&lt;pre&gt;</td><td style="text-align: left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
+ </p><div class="table"><a id="id612000"/><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Docbook</th></tr></thead><tbody><tr><td style="text-align: left">&lt;p&gt;</td><td style="text-align: left">&lt;para&gt;</td></tr><tr><td style="text-align: left">&lt;pre&gt;</td><td style="text-align: left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
&lt;literallayout&gt;</td></tr><tr><td style="text-align: left">&lt;ul&gt;</td><td style="text-align: left">&lt;itemizedlist&gt;</td></tr><tr><td style="text-align: left">&lt;ol&gt;</td><td style="text-align: left">&lt;orderedlist&gt;</td></tr><tr><td style="text-align: left">&lt;il&gt;</td><td style="text-align: left">&lt;listitem&gt;</td></tr><tr><td style="text-align: left">&lt;dl&gt;</td><td style="text-align: left">&lt;variablelist&gt;</td></tr><tr><td style="text-align: left">&lt;dt&gt;</td><td style="text-align: left">&lt;term&gt;</td></tr><tr><td style="text-align: left">&lt;dd&gt;</td><td style="text-align: left">&lt;listitem&gt;</td></tr><tr><td style="text-align: left">&lt;a href=""&gt;</td><td style="text-align: left">&lt;ulink url=""&gt;</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td style="text-align: left">&lt;strong&gt;</td><td style="text-align: left">&lt;emphasis&gt;</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;emphasis&gt;</td></tr><tr><td style="text-align: left">"</td><td style="text-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="id703147"/><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Element</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left">&lt;structname&gt;</td><td style="text-align: left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td style="text-align: left">&lt;classname&gt;</td><td style="text-align: left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td style="text-align: left">&lt;function&gt;</td><td style="text-align: left">
+</p><div class="table"><a id="id612201"/><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Element</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left">&lt;structname&gt;</td><td style="text-align: left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td style="text-align: left">&lt;classname&gt;</td><td style="text-align: left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td style="text-align: left">&lt;function&gt;</td><td style="text-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 style="text-align: left">&lt;type&gt;</td><td style="text-align: left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td style="text-align: left">&lt;varname&gt;</td><td style="text-align: left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td style="text-align: left">&lt;literal&gt;</td><td style="text-align: left">
diff --git a/libstdc++-v3/doc/html/manual/extensions.html b/libstdc++-v3/doc/html/manual/extensions.html
index 4e6a01495c3..0d5474ac211 100644
--- a/libstdc++-v3/doc/html/manual/extensions.html
+++ b/libstdc++-v3/doc/html/manual/extensions.html
@@ -5,7 +5,7 @@
</th></tr><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part III.  Extensions"><div class="titlepage"><div><div><h1 class="title"><a id="manual.ext"/>Part III. 
Extensions
- <a id="id654326" class="indexterm"/>
+ <a id="id563381" class="indexterm"/>
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="preface"><a href="bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.link">Link- and run-time coexistence of release- and
debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="mt_allocator.html">20. The mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s02.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s02.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s03.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s04.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s05.html">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="bitmap_allocator.html">21. The bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="policy_data_structures.html">22. Policy-Based Data Structures</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
Configuring via Template Parameters
diff --git a/libstdc++-v3/doc/html/manual/facets.html b/libstdc++-v3/doc/html/manual/facets.html
index 33350cd5914..1da98823ffd 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><title>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="localization.html" title="Chapter 8.  Localization"/><link rel="prev" href="localization.html" title="Chapter 8.  Localization"/><link rel="next" href="containers.html" title="Chapter 9.  Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Facets</th></tr><tr><td align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Chapter 8. 
Localization
-</th><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.facet"/>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"/>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"/>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id649036"/>Specializations</h5></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.facet"/>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"/>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"/>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id558091"/>Specializations</h5></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
@@ -50,24 +50,24 @@ characters.
</p></li><li class="listitem"><p>
Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id649161"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id558216"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
- </em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id649201"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id558255"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id649227"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id558281"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id649246"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id558300"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id649265"/><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id558319"/><p><span class="title"><em>
<a class="link" href="http://www.unix.org/version3/ieee_std.html">
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</a>
</em>. </span><span class="copyright">Copyright © 1999
- The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="id649292"/><p><span class="citetitle"><em class="citetitle">
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="id558346"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id649330"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id558385"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
@@ -410,42 +410,42 @@ codecvt usage.
</p></li><li class="listitem"><p>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id649980"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id559035"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id650020"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id559074"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id650046"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id559100"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id650065"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id559119"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id650084"/><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id559138"/><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id650111"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id559165"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id650149"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id559204"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry" title="A brief description of Normative Addendum 1"><a id="id650196"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="A brief description of Normative Addendum 1"><a id="id559251"/><p><span class="title"><em>
<a class="link" href="http://www.lysator.liu.se/c/na1.html">
A brief description of Normative Addendum 1
</a>
- </em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry" title="The Unicode HOWTO"><a id="id650223"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry" title="The Unicode HOWTO"><a id="id559278"/><p><span class="title"><em>
<a class="link" href="http://tldp.org/HOWTO/Unicode-HOWTO.html">
The Unicode HOWTO
</a>
- </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry" title="UTF-8 and Unicode FAQ for Unix/Linux"><a id="id650247"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry" title="UTF-8 and Unicode FAQ for Unix/Linux"><a id="id559301"/><p><span class="title"><em>
<a class="link" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html">
UTF-8 and Unicode FAQ for Unix/Linux
</a>
@@ -690,39 +690,39 @@ void test01()
model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext
package.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id650918"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id559972"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id650958"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id560012"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id650984"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id560038"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id651003"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id560057"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id651022"/><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id560076"/><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id651049"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id560103"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id651087"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id560141"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry" title="API Specifications, Java Platform"><a id="id651134"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="API Specifications, Java Platform"><a id="id560188"/><p><span class="title"><em>
<a class="link" href="http://java.sun.com/reference/api/index.html">
API Specifications, Java Platform
</a>
</em>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
- . </span></p></div><div class="biblioentry" title="GNU gettext tools, version 0.10.38, Native Language Support Library and Tools."><a id="id651154"/><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry" title="GNU gettext tools, version 0.10.38, Native Language Support Library and Tools."><a id="id560208"/><p><span class="title"><em>
<a class="link" href="http://www.gnu.org/software/gettext">
GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
diff --git a/libstdc++-v3/doc/html/manual/index.html b/libstdc++-v3/doc/html/manual/index.html
index d2108b00eca..2a815bacc6e 100644
--- a/libstdc++-v3/doc/html/manual/index.html
+++ b/libstdc++-v3/doc/html/manual/index.html
@@ -5,7 +5,7 @@
</p></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="part"><a href="intro.html">I.
Introduction
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt02.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="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt02.html">II.
Standard Contents
</a></span></dt><dd><dl><dt><span class="chapter"><a href="support.html">4.
Support
@@ -16,13 +16,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
Utilities
-</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id542426">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id542456">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id542566">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id543565">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id543744">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id543814">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id543936">Dual C++11 and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id543992">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id556361">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id556391">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
Localization
-</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id558091">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
@@ -125,40 +125,40 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
Existing tests
</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
-C++0x Requirements Test Sequence Descriptions
-</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">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></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
- </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+C++11 Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first.ios_base">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.first.cout_cin">No <code class="code">cout</code> in <code class="filename">&lt;ostream.h&gt;</code>, no <code class="code">cin</code> in <code class="filename">&lt;istream.h&gt;</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.second.std">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iterators">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.isspace"><code class="code">isspace</code> from <code class="filename">&lt;cctype&gt;</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.at">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.eof">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringclear">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.ostreamform_istreamscan">
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.stringstreams">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.wchar">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.iostream_templates">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second.thread_safety">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.third.headers">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.hash">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.nocreate_noreplace">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.streamattach">
No <code class="code">stream::attach(int fd)</code>
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx98">
Support for C++98 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_tr1">
Support for C++TR1 dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
-Support for C++0x dialect.
-</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
- Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.support_cxx11">
+Support for C++11 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third.iterator_type">
+ <code class="code">Container::iterator_type</code> is not necessarily <code class="code">Container::value_type*</code>
</a></span></dt></dl></dd></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.
<acronym class="acronym">GNU</acronym> General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><strong>List of Figures</strong></p><dl><dt>22.1. <a href="policy_data_structures.html#id664217">Node Invariants</a></dt><dt>22.2. <a href="policy_data_structures.html#id664273">Underlying Associative Data Structures</a></dt><dt>22.3. <a href="policy_data_structures.html#id664536">Range Iteration in Different Data Structures</a></dt><dt>22.4. <a href="policy_data_structures.html#id664661">Point Iteration in Hash Data Structures</a></dt><dt>22.5. <a href="policy_data_structures.html#id664738">Effect of erase in different underlying data structures</a></dt><dt>22.6. <a href="policy_data_structures.html#id665301">Underlying Priority Queue Data Structures</a></dt><dt>22.7. <a href="policy_data_structures_using.html#id665824">Exception Hierarchy</a></dt><dt>22.8. <a href="policy_data_structures_design.html#id667445">Non-unique Mapping Standard Containers</a></dt><dt>22.9. <a href="policy_data_structures_design.html#fig.pbds_embedded_lists_2">
+ </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><strong>List of Figures</strong></p><dl><dt>22.1. <a href="policy_data_structures.html#id573272">Node Invariants</a></dt><dt>22.2. <a href="policy_data_structures.html#id573328">Underlying Associative Data Structures</a></dt><dt>22.3. <a href="policy_data_structures.html#id573591">Range Iteration in Different Data Structures</a></dt><dt>22.4. <a href="policy_data_structures.html#id573715">Point Iteration in Hash Data Structures</a></dt><dt>22.5. <a href="policy_data_structures.html#id573793">Effect of erase in different underlying data structures</a></dt><dt>22.6. <a href="policy_data_structures.html#id574356">Underlying Priority Queue Data Structures</a></dt><dt>22.7. <a href="policy_data_structures_using.html#id574878">Exception Hierarchy</a></dt><dt>22.8. <a href="policy_data_structures_design.html#id576499">Non-unique Mapping Standard Containers</a></dt><dt>22.9. <a href="policy_data_structures_design.html#fig.pbds_embedded_lists_2">
Effect of embedded lists in
<code class="classname">std::multimap</code>
- </a></dt><dt>22.10. <a href="policy_data_structures_design.html#id667640">Non-unique Mapping Containers</a></dt><dt>22.11. <a href="policy_data_structures_design.html#id667806">Point Iterator Hierarchy</a></dt><dt>22.12. <a href="policy_data_structures_design.html#id667917">Invalidation Guarantee Tags Hierarchy</a></dt><dt>22.13. <a href="policy_data_structures_design.html#id668169">Container Tag Hierarchy</a></dt><dt>22.14. <a href="policy_data_structures_design.html#id668502">Hash functions, ranged-hash functions, and
- range-hashing functions</a></dt><dt>22.15. <a href="policy_data_structures_design.html#id669038">Insert hash sequence diagram</a></dt><dt>22.16. <a href="policy_data_structures_design.html#id669097">Insert hash sequence diagram with a null policy</a></dt><dt>22.17. <a href="policy_data_structures_design.html#id669237">Hash policy class diagram</a></dt><dt>22.18. <a href="policy_data_structures_design.html#id669396">Balls and bins</a></dt><dt>22.19. <a href="policy_data_structures_design.html#id669652">Insert resize sequence diagram</a></dt><dt>22.20. <a href="policy_data_structures_design.html#id669717">Standard resize policy trigger sequence
- diagram</a></dt><dt>22.21. <a href="policy_data_structures_design.html#id669752">Standard resize policy size sequence
- diagram</a></dt><dt>22.22. <a href="policy_data_structures_design.html#id670401">Tree node invariants</a></dt><dt>22.23. <a href="policy_data_structures_design.html#id670480">Tree node invalidation</a></dt><dt>22.24. <a href="policy_data_structures_design.html#id670590">A tree and its update policy</a></dt><dt>22.25. <a href="policy_data_structures_design.html#id670687">Restoring node invariants</a></dt><dt>22.26. <a href="policy_data_structures_design.html#id670755">Insert update sequence</a></dt><dt>22.27. <a href="policy_data_structures_design.html#id670941">Useless update path</a></dt><dt>22.28. <a href="policy_data_structures_design.html#id671313">A PATRICIA trie</a></dt><dt>22.29. <a href="policy_data_structures_design.html#id671400">A trie and its update policy</a></dt><dt>22.30. <a href="policy_data_structures_design.html#id671655">A simple list</a></dt><dt>22.31. <a href="policy_data_structures_design.html#id671702">The counter algorithm</a></dt><dt>22.32. <a href="policy_data_structures_design.html#id672233">Underlying Priority-Queue Data-Structures.</a></dt><dt>22.33. <a href="policy_data_structures_design.html#id672525">Priority-Queue Data-Structure Tags.</a></dt><dt>B.1. <a href="appendix_porting.html#id700897">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#id598677">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id596384">C++ 200x Implementation Status</a></dt><dt>1.3. <a href="status.html#id588207">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id622095">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id626203">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id626432">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id626736">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id626942">C++ 200x Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id627370">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id627620">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id627761">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id627936">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id627982">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id628036">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id628333">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id628456">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id628568">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id654877">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id655252">Debugging Containers C++0x</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id656839">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id658962">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id659844">Profile Diagnostics</a></dt><dt>21.1. <a href="bk01pt03ch21s02.html#id663274">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#id701803">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#id702306">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#id702468">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#id702945">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#id703147">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#id708847">Extension Allocators</a></dt><dt>B.7. <a href="api.html#id709077">Extension Allocators Continued</a></dt></dl></div><div class="list-of-equations"><p><strong>List of Equations</strong></p><dl><dt>22.1. <a href="policy_data_structures_design.html#id668617">Ranged Hash Function</a></dt><dt>22.2. <a href="policy_data_structures_design.html#id668666">Range-Hashing, Division Method</a></dt><dt>22.3. <a href="policy_data_structures_design.html#id668703">Division via Prime Modulo</a></dt><dt>22.4. <a href="policy_data_structures_design.html#id668718">Division via Bit Mask</a></dt><dt>22.5. <a href="policy_data_structures_design.html#id668799">
+ </a></dt><dt>22.10. <a href="policy_data_structures_design.html#id576695">Non-unique Mapping Containers</a></dt><dt>22.11. <a href="policy_data_structures_design.html#id576861">Point Iterator Hierarchy</a></dt><dt>22.12. <a href="policy_data_structures_design.html#id576972">Invalidation Guarantee Tags Hierarchy</a></dt><dt>22.13. <a href="policy_data_structures_design.html#id577224">Container Tag Hierarchy</a></dt><dt>22.14. <a href="policy_data_structures_design.html#id577556">Hash functions, ranged-hash functions, and
+ range-hashing functions</a></dt><dt>22.15. <a href="policy_data_structures_design.html#id578093">Insert hash sequence diagram</a></dt><dt>22.16. <a href="policy_data_structures_design.html#id578152">Insert hash sequence diagram with a null policy</a></dt><dt>22.17. <a href="policy_data_structures_design.html#id578292">Hash policy class diagram</a></dt><dt>22.18. <a href="policy_data_structures_design.html#id578450">Balls and bins</a></dt><dt>22.19. <a href="policy_data_structures_design.html#id578707">Insert resize sequence diagram</a></dt><dt>22.20. <a href="policy_data_structures_design.html#id578772">Standard resize policy trigger sequence
+ diagram</a></dt><dt>22.21. <a href="policy_data_structures_design.html#id578806">Standard resize policy size sequence
+ diagram</a></dt><dt>22.22. <a href="policy_data_structures_design.html#id579456">Tree node invariants</a></dt><dt>22.23. <a href="policy_data_structures_design.html#id579535">Tree node invalidation</a></dt><dt>22.24. <a href="policy_data_structures_design.html#id579644">A tree and its update policy</a></dt><dt>22.25. <a href="policy_data_structures_design.html#id579742">Restoring node invariants</a></dt><dt>22.26. <a href="policy_data_structures_design.html#id579810">Insert update sequence</a></dt><dt>22.27. <a href="policy_data_structures_design.html#id579995">Useless update path</a></dt><dt>22.28. <a href="policy_data_structures_design.html#id580368">A PATRICIA trie</a></dt><dt>22.29. <a href="policy_data_structures_design.html#id580455">A trie and its update policy</a></dt><dt>22.30. <a href="policy_data_structures_design.html#id580710">A simple list</a></dt><dt>22.31. <a href="policy_data_structures_design.html#id580756">The counter algorithm</a></dt><dt>22.32. <a href="policy_data_structures_design.html#id581288">Underlying Priority-Queue Data-Structures.</a></dt><dt>22.33. <a href="policy_data_structures_design.html#id581579">Priority-Queue Data-Structure Tags.</a></dt><dt>B.1. <a href="appendix_porting.html#id609952">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#id457093">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id488280">C++ 2011 Implementation Status</a></dt><dt>1.3. <a href="status.html#id490902">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id531074">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id535140">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id535369">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id535673">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id535879">C++ 2011 Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id536308">C++ 2011 Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id536557">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id536698">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id536874">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id536920">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id536973">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id537271">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id537394">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id537505">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id563932">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id564306">Debugging Containers C++11</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id565894">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id568017">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id568899">Profile Diagnostics</a></dt><dt>21.1. <a href="bk01pt03ch21s02.html#id572329">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#id610857">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#id611360">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#id611522">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#id612000">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#id612201">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#id617901">Extension Allocators</a></dt><dt>B.7. <a href="api.html#id618132">Extension Allocators Continued</a></dt></dl></div><div class="list-of-equations"><p><strong>List of Equations</strong></p><dl><dt>22.1. <a href="policy_data_structures_design.html#id577671">Ranged Hash Function</a></dt><dt>22.2. <a href="policy_data_structures_design.html#id577720">Range-Hashing, Division Method</a></dt><dt>22.3. <a href="policy_data_structures_design.html#id577758">Division via Prime Modulo</a></dt><dt>22.4. <a href="policy_data_structures_design.html#id577773">Division via Bit Mask</a></dt><dt>22.5. <a href="policy_data_structures_design.html#id577853">
A Standard String Hash Function
- </a></dt><dt>22.6. <a href="policy_data_structures_design.html#id668850">
+ </a></dt><dt>22.6. <a href="policy_data_structures_design.html#id577905">
Only k String DNA Hash
- </a></dt><dt>22.7. <a href="policy_data_structures_design.html#id669441">
+ </a></dt><dt>22.7. <a href="policy_data_structures_design.html#id578496">
Probability of Probe Sequence of Length k
- </a></dt><dt>22.8. <a href="policy_data_structures_design.html#id669498">
+ </a></dt><dt>22.8. <a href="policy_data_structures_design.html#id578552">
Probability Probe Sequence in Some Bin
</a></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="../index.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Part I. 
Introduction
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index f0bc8ce6ea2..b6a8192a035 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 align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part I.  Introduction"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"/>Part I. 
Introduction
- <a id="id520964" class="indexterm"/>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="index.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library Manual </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
+ <a id="id434635" class="indexterm"/>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="index.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library Manual </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td 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 d2544ae1295..658024a0ae1 100644
--- a/libstdc++-v3/doc/html/manual/io.html
+++ b/libstdc++-v3/doc/html/manual/io.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 13.  Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="std.io"/>Chapter 13. 
Input and Output
- <a id="id652930" class="indexterm"/>
+ <a id="id561984" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="section" title="Iostream Objects"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.objects"/>Iostream Objects</h2></div></div></div><p>To minimize the time you have to wait on the compiler, it's good to
only include the headers you really need. Many people simply include
&lt;iostream&gt; when they don't need to -- and that can <span class="emphasis"><em>penalize
diff --git a/libstdc++-v3/doc/html/manual/iterators.html b/libstdc++-v3/doc/html/manual/iterators.html
index d47ca9bf0e3..bc614bedea9 100644
--- a/libstdc++-v3/doc/html/manual/iterators.html
+++ b/libstdc++-v3/doc/html/manual/iterators.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 10.  Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators"/>Chapter 10. 
Iterators
- <a id="id652095" class="indexterm"/>
+ <a id="id561149" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="section" title="Predefined"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators.predefined"/>Predefined</h2></div></div></div><div class="section" title="Iterators vs. Pointers"><div class="titlepage"><div><div><h3 class="title"><a id="iterators.predefined.vs_pointers"/>Iterators vs. Pointers</h3></div></div></div><p>
The following
FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="7.1.">entry</a> points out that
diff --git a/libstdc++-v3/doc/html/manual/localization.html b/libstdc++-v3/doc/html/manual/localization.html
index a9171a98797..3572f10e842 100644
--- a/libstdc++-v3/doc/html/manual/localization.html
+++ b/libstdc++-v3/doc/html/manual/localization.html
@@ -7,8 +7,8 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 8.  Localization"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization"/>Chapter 8. 
Localization
- <a id="id648384" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section" title="Locales"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.locales"/>Locales</h2></div></div></div><div class="section" title="locale"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"/>locale</h3></div></div></div><p>
+ <a id="id557439" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id558091">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section" title="Locales"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.locales"/>Locales</h2></div></div></div><div class="section" title="locale"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"/>locale</h3></div></div></div><p>
Describes the basic locale object, including nested
classes id, facet, and the reference-counted implementation object,
class _Impl.
@@ -403,29 +403,29 @@ global locale" (emphasis Paolo), that is:
What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users
provide specializations?
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id648747"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id557801"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and
Internationalization
- . </span></p></div><div class="biblioentry"><a id="id648786"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id557841"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id648812"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id557867"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id648831"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id557886"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id648850"/><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id557905"/><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin/">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id648877"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id557932"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id648916"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id557970"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index 8a1129bc6af..24f7381b7bb 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -93,7 +93,7 @@
or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"/>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id633362"/>Interface Design</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"/>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id542426"/>Interface Design</h5></div></div></div><p>
The only allocator interface that
is supported is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have
@@ -106,7 +106,7 @@
</p><p>
The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable.
-</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id633392"/>Selecting Default Allocation Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id542456"/>Selecting Default Allocation Policy</h5></div></div></div><p>
It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure
@@ -143,7 +143,7 @@
The current default choice for
<code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>.
- </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id633502"/>Disabling Memory Caching</h5></div></div></div><p>
+ </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id542566"/>Disabling Memory Caching</h5></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's
@@ -308,33 +308,33 @@
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="Chapter 21. The bitmap_allocator">here</a>.
- </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id633953"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id543017"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
</em>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry" title="The Standard Librarian: What Are Allocators Good For?"><a id="id633968"/><p><span class="title"><em>
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry" title="The Standard Librarian: What Are Allocators Good For?"><a id="id543032"/><p><span class="title"><em>
<a class="link" href="http://www.drdobbs.com/cpp/184403759">
The Standard Librarian: What Are Allocators Good For?
</a>
</em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry" title="The Hoard Memory Allocator"><a id="id633999"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="The Hoard Memory Allocator"><a id="id543063"/><p><span class="title"><em>
<a class="link" href="http://www.cs.umass.edu/~emery/hoard">
The Hoard Memory Allocator
</a>
- </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry" title="Reconsidering Custom Memory Allocation"><a id="id634022"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry" title="Reconsidering Custom Memory Allocation"><a id="id543087"/><p><span class="title"><em>
<a class="link" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf">
Reconsidering Custom Memory Allocation
</a>
- </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry" title="Allocator Types"><a id="id634074"/><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry" title="Allocator Types"><a id="id543138"/><p><span class="title"><em>
<a class="link" href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html">
Allocator Types
</a>
</em>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry"><a id="id634113"/><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
+ . </span></span></p></div><div class="biblioentry"><a id="id543177"/><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id634150"/><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"/>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"/>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
+ . </span></span></p></div><div class="biblioentry"><a id="id543214"/><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"/>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"/>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
happen with misuse of the <code class="classname">auto_ptr</code> class
template (called <acronym class="acronym">AP</acronym> here) would take some
time. Suffice it to say that the use of <acronym class="acronym">AP</acronym>
@@ -430,12 +430,6 @@ and implements shared ownership semantics.
implementation, allowing other techniques such as a
circular-linked-list.
</p><p>
- At the time of writing the C++0x working paper doesn't mention how
- threads affect shared_ptr, but it is likely to follow the existing
- practice set by <code class="classname">boost::shared_ptr</code>. The
- shared_ptr in libstdc++ is derived from Boost's, so the same rules
- apply.
- </p><p>
</p></div><div class="section" title="Design Issues"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.design_issues"/>Design Issues</h4></div></div></div><p>
The <code class="classname">shared_ptr</code> code is kindly donated to GCC by the Boost
project and the original authors of the code. The basic design and
@@ -450,7 +444,7 @@ drops to zero.
Derived classes override those functions to destroy resources in a context
where the correct dynamic type is known. This is an application of the
technique known as type erasure.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"/>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id634511"/>Class Hierarchy</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"/>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id543565"/>Class Hierarchy</h5></div></div></div><p>
A <code class="classname">shared_ptr&lt;T&gt;</code> contains a pointer of
type <span class="type">T*</span> and an object of type
<code class="classname">__shared_count</code>. The shared_count contains a
@@ -492,11 +486,11 @@ be forwarded to <span class="type">Tp</span>'s constructor.
Unlike the other <code class="classname">_Sp_counted_*</code> classes, this one is parameterized on the
type of object, not the type of pointer; this is purely a convenience
that simplifies the implementation slightly.
- </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id634689"/>Thread Safety</h5></div></div></div><p>
-C++0x-only features are: rvalue-ref/move support, allocator support,
+ </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id543744"/>Thread Safety</h5></div></div></div><p>
+C++11-only features are: rvalue-ref/move support, allocator support,
aliasing constructor, make_shared &amp; allocate_shared. Additionally,
the constructors taking <code class="classname">auto_ptr</code> parameters are
-deprecated in C++0x mode.
+deprecated in C++11 mode.
</p><p>
The
<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety">Thread
@@ -542,7 +536,7 @@ compiler, standard library, platform etc. For the version of
shared_ptr in libstdc++ the compiler and library are fixed, which
makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
-</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id634759"/>Selecting Lock Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id543814"/>Selecting Lock Policy</h5></div></div></div><p>
</p><p>
There is a single <code class="classname">_Sp_counted_base</code> class,
which is a template parameterized on the enum
@@ -583,30 +577,30 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
<code class="filename">ext/atomicity.h</code>, which detect if the program
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
- </p></div><div class="section" title="Dual C++0x and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id634881"/>Dual C++0x and TR1 Implementation</h5></div></div></div><p>
-The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
+ </p></div><div class="section" title="Dual C++11 and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id543936"/>Dual C++11 and TR1 Implementation</h5></div></div></div><p>
+The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++11
with support for rvalue-references and the other features from N2351.
The <code class="classname">_Sp_counted_base</code> base class is implemented in
<code class="filename">tr1/boost_sp_shared_count.h</code> and is common to the TR1
-and C++0x versions of <code class="classname">shared_ptr</code>.
+and C++11 versions of <code class="classname">shared_ptr</code>.
</p><p>
The classes derived from <code class="classname">_Sp_counted_base</code> (see Class Hierarchy
-above) and <code class="classname">__shared_count</code> are implemented separately for C++0x
+above) and <code class="classname">__shared_count</code> are implemented separately for C++11
and TR1, in <code class="filename">bits/shared_ptr.h</code> and
<code class="filename">tr1/shared_ptr.h</code> respectively.
</p><p>
The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
-C++0x and TR1 modes needs to diverge further then it might be necessary to
+C++11 and TR1 versions needs to diverge further then it might be necessary to
duplicate <code class="classname">_Sp_counted_base</code> and only make changes to
-the C++0x version.
-</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id634937"/>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+the C++11 version.
+</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id543992"/>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
<code class="code">const_pointer_cast</code></span></dt><dd><p>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
-in C++0x mode, so in TR1 mode these casts rely on three non-standard
+in C++11 mode, so in TR1 mode these casts rely on three non-standard
constructors in shared_ptr and __shared_ptr.
-In C++0x mode these constructors and the related tag types are not needed.
+In C++11 mode these constructors and the related tag types are not needed.
</p></dd><dt><span class="term"><code class="code">enable_shared_from_this</code></span></dt><dd><p>
The clever overload to detect a base class of type
<code class="code">enable_shared_from_this</code> comes straight from Boost.
@@ -633,15 +627,15 @@ is called. Users should not try to use this.
As well as the extra constructors, this implementation also needs some
members of _Sp_counted_deleter to be protected where they could otherwise
be private.
- </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"/>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id635086"/>Examples</h5></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"/>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id556361"/>Examples</h5></div></div></div><p>
Examples of use can be found in the testsuite, under
<code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>,
<code class="filename">testsuite/20_util/shared_ptr</code>
and
<code class="filename">testsuite/20_util/weak_ptr</code>.
- </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id635116"/>Unresolved Issues</h5></div></div></div><p>
+ </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id556391"/>Unresolved Issues</h5></div></div></div><p>
The <span class="emphasis"><em><code class="classname">shared_ptr</code> atomic access</em></span>
- clause in the C++0x working draft is not implemented in GCC.
+ clause in the C++11 standard is not implemented in GCC.
</p><p>
The <span class="type">_S_single</span> policy uses atomics when used in MT
code, because it uses the same dispatcher functions that check
@@ -651,7 +645,7 @@ be private.
</p><p>
Unlike Boost, this implementation does not use separate classes
for the pointer+deleter and pointer+deleter+allocator cases in
- C++0x mode, combining both into _Sp_counted_deleter and using
+ C++11 mode, combining both into _Sp_counted_deleter and using
<code class="classname">allocator</code> when the user doesn't specify
an allocator. If it was found to be beneficial an additional
class could easily be added. With the current implementation,
@@ -680,25 +674,25 @@ be private.
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
- </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry" title="Improving shared_ptr for C++0x, Revision 2"><a id="id635209"/><p><span class="title"><em>
+ </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry" title="Improving shared_ptr for C++0x, Revision 2"><a id="id556484"/><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm">
Improving shared_ptr for C++0x, Revision 2
</a>
</em>. </span><span class="subtitle">
N2351
- . </span></p></div><div class="biblioentry" title="C++ Standard Library Active Issues List"><a id="id635228"/><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry" title="C++ Standard Library Active Issues List"><a id="id556504"/><p><span class="title"><em>
<a class="link" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html">
C++ Standard Library Active Issues List
</a>
</em>. </span><span class="subtitle">
N2456
- . </span></p></div><div class="biblioentry" title="Working Draft, Standard for Programming Language C++"><a id="id635248"/><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry" title="Working Draft, Standard for Programming Language C++"><a id="id556523"/><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf">
Working Draft, Standard for Programming Language C++
</a>
</em>. </span><span class="subtitle">
N2461
- . </span></p></div><div class="biblioentry" title="Boost C++ Libraries documentation, shared_ptr"><a id="id635267"/><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry" title="Boost C++ Libraries documentation, shared_ptr"><a id="id556542"/><p><span class="title"><em>
<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm">
Boost C++ Libraries documentation, shared_ptr
</a>
diff --git a/libstdc++-v3/doc/html/manual/numerics.html b/libstdc++-v3/doc/html/manual/numerics.html
index 4fe23e34bb0..93088e5d9ac 100644
--- a/libstdc++-v3/doc/html/manual/numerics.html
+++ b/libstdc++-v3/doc/html/manual/numerics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 12.  Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"/>Chapter 12. 
Numerics
- <a id="id652583" class="indexterm"/>
+ <a id="id561638" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section" title="Complex"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics.complex"/>Complex</h2></div></div></div><p>
</p><div class="section" title="complex Processing"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.complex.processing"/>complex Processing</h3></div></div></div><p>
</p><p>Using <code class="code">complex&lt;&gt;</code> becomes even more comple- er, sorry,
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index b85e408591e..3408e18e4fa 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="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.intro"/>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::accumulate</code></p></li><li class="listitem"><p><code class="function">std::adjacent_difference</code></p></li><li class="listitem"><p><code class="function">std::inner_product</code></p></li><li class="listitem"><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
-<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id658507"/><p><span class="citetitle"><em class="citetitle">
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id567562"/><p><span class="citetitle"><em class="citetitle">
Parallelization of Bulk Operations for STL Dictionaries
</em>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
- . </span></span></p></div><div class="biblioentry"><a id="id658549"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id567604"/><p><span class="citetitle"><em class="citetitle">
The Multi-Core Standard Template Library
</em>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641)
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures.html b/libstdc++-v3/doc/html/manual/policy_data_structures.html
index c6c32943f72..e3d2a5d169d 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures.html
@@ -251,7 +251,7 @@
these invariants, one must supply some policy that is aware
of these changes. Without this, it would be better to use a
linked list (in itself very efficient for these purposes).
- </p></li></ol></div><div class="figure"><a id="id664217"/><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_node_invariants.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/></div><div class="section" title="Underlying Data Structures"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"/>Underlying Data Structures</h5></div></div></div><p>
+ </p></li></ol></div><div class="figure"><a id="id573272"/><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_node_invariants.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/></div><div class="section" title="Underlying Data Structures"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"/>Underlying Data Structures</h5></div></div></div><p>
The standard C++ library contains associative containers based on
red-black trees and collision-chaining hash tables. These are
very useful, but they are not ideal for all types of
@@ -259,7 +259,7 @@
</p><p>
The figure below shows the different underlying data structures
currently supported in this library.
- </p><div class="figure"><a id="id664273"/><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_1.png" style="text-align: middle" alt="Underlying Associative Data Structures"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id573328"/><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_1.png" style="text-align: middle" alt="Underlying Associative Data Structures"/></div></div></div><br class="figure-break"/><p>
A shows a collision-chaining hash-table, B shows a probing
hash-table, C shows a red-black tree, D shows a splay tree, E shows
a tree based on an ordered vector(implicit in the order of the
@@ -378,7 +378,7 @@
no guarantee that the elements traversed will coincide with the
<span class="emphasis"><em>logical</em></span> elements between 1 and 5, as in
label B.
- </p><div class="figure"><a id="id664536"/><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_1.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id573591"/><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_1.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/><p>
In our opinion, this problem is not caused just because
red-black trees are order preserving while
collision-chaining hash tables are (generally) not - it
@@ -429,7 +429,7 @@
list, as in the graphic below, label B. Here the iterators are as
light as can be, but the hash-table's operations are more
complicated.
- </p><div class="figure"><a id="id664661"/><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_2.png" style="text-align: middle" alt="Point Iteration in Hash Data Structures"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id573715"/><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_2.png" style="text-align: middle" alt="Point Iteration in Hash Data Structures"/></div></div></div><br class="figure-break"/><p>
It should be noted that containers based on collision-chaining
hash-tables are not the only ones with this type of behavior;
many other self-organizing data structures display it as well.
@@ -445,7 +445,7 @@
container. The graphic below shows three cases: A1 and A2 show
a red-black tree; B1 and B2 show a probing hash-table; C1 and C2
show a collision-chaining hash table.
- </p><div class="figure"><a id="id664738"/><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_guarantee_erase.png" style="text-align: middle" alt="Effect of erase in different underlying data structures"/></div></div></div><br class="figure-break"/><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ </p><div class="figure"><a id="id573793"/><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_guarantee_erase.png" style="text-align: middle" alt="Effect of erase in different underlying data structures"/></div></div></div><br class="figure-break"/><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
Erasing 5 from A1 yields A2. Clearly, an iterator to 3 can
be de-referenced and incremented. The sequence of iterators
changed, but in a way that is well-defined by the interface.
@@ -681,7 +681,7 @@
typically less structured than an associative container's tree;
the third simply uses an associative container. These are
shown in the figure below with labels A1 and A2, B, and C.
- </p><div class="figure"><a id="id665301"/><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_2.png" style="text-align: middle" alt="Underlying Priority Queue Data Structures"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id574356"/><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_2.png" style="text-align: middle" alt="Underlying Priority Queue Data Structures"/></div></div></div><br class="figure-break"/><p>
No single implementation can completely replace any of the
others. Some have better <code class="function">push</code>
and <code class="function">pop</code> amortized performance, some have
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_design.html b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
index 71e80a993eb..25808634a06 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
@@ -171,7 +171,7 @@
naturally; collision-chaining hash tables (label B) store
equivalent-key values in the same bucket, the bucket can be
arranged so that equivalent-key values are consecutive.
- </p><div class="figure"><a id="id667445"/><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_1.png" style="text-align: middle" alt="Non-unique Mapping Standard Containers"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id576499"/><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_1.png" style="text-align: middle" alt="Non-unique Mapping Standard Containers"/></div></div></div><br class="figure-break"/><p>
Put differently, the standards' non-unique mapping
associative-containers are associative containers that map
primary keys to linked lists that are embedded into the
@@ -253,7 +253,7 @@
first graphic above. Labels A and B, respectively. Each shaded
box represents some size-type or secondary
associative-container.
- </p><div class="figure"><a id="id667640"/><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_3.png" style="text-align: middle" alt="Non-unique Mapping Containers"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id576695"/><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_3.png" style="text-align: middle" alt="Non-unique Mapping Containers"/></div></div></div><br class="figure-break"/><p>
In the first example above, then, one would use an associative
container mapping each user to an associative container which
maps each application id to a start time (see
@@ -306,7 +306,7 @@
shows invariants for order-preserving containers: point-type
iterators are synonymous with range-type iterators.
Orthogonally, <span class="emphasis"><em>C</em></span>shows invariants for "set"
- containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="id667806"/><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterator_hierarchy.png" style="text-align: middle" alt="Point Iterator Hierarchy"/></div></div></div><br class="figure-break"/><p>Note that point-type iterators in self-organizing containers
+ containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="id576861"/><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterator_hierarchy.png" style="text-align: middle" alt="Point Iterator Hierarchy"/></div></div></div><br class="figure-break"/><p>Note that point-type iterators in self-organizing containers
(hash-based associative containers) lack movement
operators, such as <code class="literal">operator++</code> - in fact, this
is the reason why this library differentiates from the standard C++ librarys
@@ -345,7 +345,7 @@
to the question of whether point-type iterators and range-type
iterators are valid. The graphic below shows tags corresponding to
different types of invalidation guarantees.
- </p><div class="figure"><a id="id667917"/><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_tag_hierarchy.png" style="text-align: middle" alt="Invalidation Guarantee Tags Hierarchy"/></div></div></div><br class="figure-break"/><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ </p><div class="figure"><a id="id576972"/><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_tag_hierarchy.png" style="text-align: middle" alt="Invalidation Guarantee Tags Hierarchy"/></div></div></div><br class="figure-break"/><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
<code class="classname">basic_invalidation_guarantee</code>
corresponds to a basic guarantee that a point-type iterator,
a found pointer, or a found reference, remains valid as long
@@ -429,7 +429,7 @@
</p><p>
This library contains a container tag hierarchy corresponding to the
diagram below.
- </p><div class="figure"><a id="id668169"/><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_container_tag_hierarchy.png" style="text-align: middle" alt="Container Tag Hierarchy"/></div></div></div><br class="figure-break"/><p>
+ </p><div class="figure"><a id="id577224"/><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_container_tag_hierarchy.png" style="text-align: middle" alt="Container Tag Hierarchy"/></div></div></div><br class="figure-break"/><p>
Given any container <span class="type">Cntnr</span>, the tag of
the underlying data structure can be found via <code class="literal">typename
Cntnr::container_category</code>.
@@ -488,7 +488,7 @@
collision-chaining container, except for the following.</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Comb_Probe_Fn</code> describes how to transform a probe
sequence into a sequence of positions within the table.</p></li><li class="listitem"><p><code class="classname">Probe_Fn</code> describes a probe sequence policy.</p></li></ol></div><p>Some of the default template values depend on the values of
other parameters, and are explained below.</p></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.hash.details"/>Details</h5></div></div></div><div class="section" title="Hash Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.hash_policies"/>Hash Policies</h6></div></div></div><div class="section" title="General"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.general"/>General</h6></div></div></div><p>Following is an explanation of some functions which hashing
- involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="id668502"/><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
+ involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="id577556"/><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
range-hashing functions</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_ranged_hash_range_hashing_fns.png" style="text-align: middle" alt="Hash functions, ranged-hash functions, and range-hashing functions"/></div></div></div><br class="figure-break"/><p>Let U be a domain (e.g., the integers, or the
strings of 3 characters). A hash-table algorithm needs to map
elements of U "uniformly" into the range [0,..., m -
@@ -505,7 +505,7 @@
Z<sub>+</sub>,</p><p>which maps a non-negative hash value, and a non-negative
range upper-bound into a non-negative integral in the range
between 0 (inclusive) and the range upper bound (exclusive),
- i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="id668617"/><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
+ i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="id577671"/><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
f(u , m) = g(h(u), m)
</span></div></div><br class="equation-break"/><p>From the above, it is obvious that given g and
h, f can always be composed (however the converse
@@ -525,7 +525,7 @@
transforming the sequence of hash values into a sequence of
positions.</p></div><div class="section" title="Range Hashing"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.range"/>Range Hashing</h6></div></div></div><p>Some common choices for range-hashing functions are the
division, multiplication, and middle-square methods (<a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>), defined
- as</p><div class="equation"><a id="id668666"/><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
+ as</p><div class="equation"><a id="id577720"/><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r mod m
</span></div></div><br class="equation-break"/><p>g(r, m) = ⌈ u/v ( a r mod v ) ⌉</p><p>and</p><p>g(r, m) = ⌈ u/v ( r<sup>2</sup> mod v ) ⌉</p><p>respectively, for some positive integrals u and
v (typically powers of 2), and some a. Each of
@@ -536,9 +536,9 @@
implement using the low
level % (modulo) operation (for any m), or the
low level &amp; (bit-mask) operation (for the case where
- m is a power of 2), i.e.,</p><div class="equation"><a id="id668703"/><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
+ m is a power of 2), i.e.,</p><div class="equation"><a id="id577758"/><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r % m
- </span></div></div><br class="equation-break"/><p>and</p><div class="equation"><a id="id668718"/><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
+ </span></div></div><br class="equation-break"/><p>and</p><div class="equation"><a id="id577773"/><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r &amp; m - 1, (with m =
2<sup>k</sup> for some k)
</span></div></div><br class="equation-break"/><p>respectively.</p><p>The % (modulo) implementation has the advantage that for
@@ -564,7 +564,7 @@
s = [ s<sub>0</sub>,..., s<sub>t - 1</sub>]
</p><p>be a string of t characters, each of which is from
domain S. Consider the following ranged-hash
- function:</p><div class="equation"><a id="id668799"/><p class="title"><strong>Equation 22.5. 
+ function:</p><div class="equation"><a id="id577853"/><p class="title"><strong>Equation 22.5. 
A Standard String Hash Function
</strong></p><div class="equation-contents"><span class="mathphrase">
f<sub>1</sub>(s, m) = ∑ <sub>i =
@@ -576,7 +576,7 @@
of a long DNA sequence (and so S = {'A', 'C', 'G',
'T'}). In this case, scanning the entire string might be
prohibitively expensive. A possible alternative might be to use
- only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="id668850"/><p class="title"><strong>Equation 22.6. 
+ only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="id577905"/><p class="title"><strong>Equation 22.6. 
Only k String DNA Hash
</strong></p><div class="equation-contents"><span class="mathphrase">
f<sub>2</sub>(s, m) = ∑ <sub>i
@@ -607,12 +607,12 @@
the container transforms the key into a non-negative integral
using the hash functor (points B and C), and transforms the
result into a position using the combining functor (points D
- and E).</p><div class="figure"><a id="id669038"/><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" style="text-align: middle" alt="Insert hash sequence diagram"/></div></div></div><br class="figure-break"/><p>If <code class="classname">cc_hash_table</code>'s
+ and E).</p><div class="figure"><a id="id578093"/><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" style="text-align: middle" alt="Insert hash sequence diagram"/></div></div></div><br class="figure-break"/><p>If <code class="classname">cc_hash_table</code>'s
hash-functor, <code class="classname">Hash_Fn</code> is instantiated by <code class="classname">null_type</code> , then <code class="classname">Comb_Hash_Fn</code> is taken to be
a ranged-hash function. The graphic below shows an <code class="function">insert</code> sequence
diagram. The user inserts an element (point A), the container
transforms the key into a position using the combining functor
- (points B and C).</p><div class="figure"><a id="id669097"/><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" style="text-align: middle" alt="Insert hash sequence diagram with a null policy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Probing tables"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"/>
+ (points B and C).</p><div class="figure"><a id="id578152"/><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" style="text-align: middle" alt="Insert hash sequence diagram with a null policy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Probing tables"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"/>
Probing tables
</h6></div></div></div><p><code class="classname">gp_hash_table</code> is parametrized by
<code class="classname">Hash_Fn</code>, <code class="classname">Probe_Fn</code>,
@@ -635,7 +635,7 @@
a linear probe and a quadratic probe function,
respectively.</p></li></ol></div><p>
The graphic below shows the relationships.
- </p><div class="figure"><a id="id669237"/><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_policy_cd.png" style="text-align: middle" alt="Hash policy class diagram"/></div></div></div><br class="figure-break"/></div></div></div><div class="section" title="Resize Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"/>Resize Policies</h6></div></div></div><div class="section" title="General"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"/>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
+ </p><div class="figure"><a id="id578292"/><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_policy_cd.png" style="text-align: middle" alt="Hash policy class diagram"/></div></div></div><br class="figure-break"/></div></div></div><div class="section" title="Resize Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"/>Resize Policies</h6></div></div></div><div class="section" title="General"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"/>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
shrink. It is necessary to specify policies to determine how
and when a hash table should change its size. Usually, resize
policies can be decomposed into orthogonal policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>A size policy indicating how a hash table
@@ -668,10 +668,10 @@
and some load factor be denoted by Α. We would like to
calculate the minimal length of k, such that if there were Α
m elements in the hash table, a probe sequence of length k would
- be found with probability at most 1/m.</p><div class="figure"><a id="id669396"/><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_balls_and_bins.png" style="text-align: middle" alt="Balls and bins"/></div></div></div><br class="figure-break"/><p>Denote the probability that a probe sequence of length
+ be found with probability at most 1/m.</p><div class="figure"><a id="id578450"/><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_balls_and_bins.png" style="text-align: middle" alt="Balls and bins"/></div></div></div><br class="figure-break"/><p>Denote the probability that a probe sequence of length
k appears in bin i by p<sub>i</sub>, the
length of the probe sequence of bin i by
- l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="id669441"/><p class="title"><strong>Equation 22.7. 
+ l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="id578496"/><p class="title"><strong>Equation 22.7. 
Probability of Probe Sequence of Length k
</strong></p><div class="equation-contents"><span class="mathphrase">
p<sub>1</sub> =
@@ -685,7 +685,7 @@
l<sub>i</sub> are negatively-dependent
(<a class="xref" href="policy_data_structures.html#biblio.dubhashi98neg" title="Balls and bins: A study in negative dependence">[biblio.dubhashi98neg]</a>)
. Let
- I(.) denote the indicator function. Then</p><div class="equation"><a id="id669498"/><p class="title"><strong>Equation 22.8. 
+ I(.) denote the indicator function. Then</p><div class="equation"><a id="id578552"/><p class="title"><strong>Equation 22.8. 
Probability Probe Sequence in Some Bin
</strong></p><div class="equation-contents"><span class="mathphrase">
P( exists<sub>i</sub> l<sub>i</sub> ≥ k ) =
@@ -724,7 +724,7 @@
a resize is needed, and if so, what is the new size (points D
to G); following the resize, it notifies the policy that a
resize has completed (point H); finally, the element is
- inserted, and the policy notified (point I).</p><div class="figure"><a id="id669652"/><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" style="text-align: middle" alt="Insert resize sequence diagram"/></div></div></div><br class="figure-break"/><p>In practice, a resize policy can be usually orthogonally
+ inserted, and the policy notified (point I).</p><div class="figure"><a id="id578707"/><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" style="text-align: middle" alt="Insert resize sequence diagram"/></div></div></div><br class="figure-break"/><p>In practice, a resize policy can be usually orthogonally
decomposed to a size policy and a trigger policy. Consequently,
the library contains a single class for instantiating a resize
policy: <code class="classname">hash_standard_resize_policy</code>
@@ -733,8 +733,8 @@
both, and acts as a standard delegate (<a class="xref" href="policy_data_structures.html#biblio.gof" title="Design Patterns - Elements of Reusable Object-Oriented Software">[biblio.gof]</a>)
to these policies.</p><p>The two graphics immediately below show sequence diagrams
illustrating the interaction between the standard resize policy
- and its trigger and size policies, respectively.</p><div class="figure"><a id="id669717"/><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
- diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" style="text-align: middle" alt="Standard resize policy trigger sequence diagram"/></div></div></div><br class="figure-break"/><div class="figure"><a id="id669752"/><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
+ and its trigger and size policies, respectively.</p><div class="figure"><a id="id578772"/><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
+ diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" style="text-align: middle" alt="Standard resize policy trigger sequence diagram"/></div></div></div><br class="figure-break"/><div class="figure"><a id="id578806"/><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram3.png" style="text-align: middle" alt="Standard resize policy size sequence diagram"/></div></div></div><br class="figure-break"/></div><div class="section" title="Predefined Policies"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.predefined"/>Predefined Policies</h6></div></div></div><p>The library includes the following
instantiations of size and trigger policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">hash_load_check_resize_trigger</code>
implements a load check trigger policy.</p></li><li class="listitem"><p><code class="classname">cc_hash_max_collision_check_resize_trigger</code>
@@ -877,7 +877,7 @@
each node, and maintains node invariants (see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>.) The first stores in
each node the size of the sub-tree rooted at the node; the
second stores at each node the maximal endpoint of the
- intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="id670401"/><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invariants.png" style="text-align: middle" alt="Tree node invariants"/></div></div></div><br class="figure-break"/><p>Supporting such trees is difficult for a number of
+ intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="id579456"/><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invariants.png" style="text-align: middle" alt="Tree node invariants"/></div></div></div><br class="figure-break"/><p>Supporting such trees is difficult for a number of
reasons:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>There must be a way to specify what a node's metadata
should be (if any).</p></li><li class="listitem"><p>Various operations can invalidate node
invariants. The graphic below shows how a right rotation,
@@ -891,7 +891,7 @@
metadata.</p></li><li class="listitem"><p>It is not feasible to know in advance which methods trees
can support. Besides the usual <code class="classname">find</code> method, the
first tree can support a <code class="classname">find_by_order</code> method, while
- the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="id670480"/><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invalidations.png" style="text-align: middle" alt="Tree node invalidation"/></div></div></div><br class="figure-break"/><p>These problems are solved by a combination of two means:
+ the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="id579535"/><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invalidations.png" style="text-align: middle" alt="Tree node invalidation"/></div></div></div><br class="figure-break"/><p>These problems are solved by a combination of two means:
node iterators, and template-template node updater
parameters.</p><div class="section" title="Node Iterators"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node.iterators"/>Node Iterators</h6></div></div></div><p>Each tree-based container defines two additional iterator
types, <code class="classname">const_node_iterator</code>
@@ -920,7 +920,7 @@
<code class="classname">node_update</code> class, and publicly subclasses
<code class="classname">node_update</code>. The graphic below shows this
scheme, as well as some predefined policies (which are explained
- below).</p><div class="figure"><a id="id670590"/><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_updator_policy_cd.png" style="text-align: middle" alt="A tree and its update policy"/></div></div></div><br class="figure-break"/><p><code class="classname">node_update</code> (an instantiation of
+ below).</p><div class="figure"><a id="id579644"/><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_updator_policy_cd.png" style="text-align: middle" alt="A tree and its update policy"/></div></div></div><br class="figure-break"/><p><code class="classname">node_update</code> (an instantiation of
<code class="classname">Node_Update</code>) must define <code class="classname">metadata_type</code> as
the type of metadata it requires. For order statistics,
e.g., <code class="classname">metadata_type</code> might be <code class="classname">size_t</code>.
@@ -939,7 +939,7 @@
<code class="classname">nd_it</code>. For example, say node x in the
graphic below label A has an invalid invariant, but its' children,
y and z have valid invariants. After the invocation, all three
- nodes should have valid invariants, as in label B.</p><div class="figure"><a id="id670687"/><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_restoring_node_invariants.png" style="text-align: middle" alt="Restoring node invariants"/></div></div></div><br class="figure-break"/><p>When a tree operation might invalidate some node invariant,
+ nodes should have valid invariants, as in label B.</p><div class="figure"><a id="id579742"/><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_restoring_node_invariants.png" style="text-align: middle" alt="Restoring node invariants"/></div></div></div><br class="figure-break"/><p>When a tree operation might invalidate some node invariant,
it invokes this method in its <code class="classname">node_update</code> base to
restore the invariant. For example, the graphic below shows
an <code class="function">insert</code> operation (point A); the tree performs some
@@ -947,7 +947,7 @@
C, and D). (It is well known that any <code class="function">insert</code>,
<code class="function">erase</code>, <code class="function">split</code> or <code class="function">join</code>, can restore
all node invariants by a small number of node invariant updates (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>)
- .</p><div class="figure"><a id="id670755"/><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_update_seq_diagram.png" style="text-align: middle" alt="Insert update sequence"/></div></div></div><br class="figure-break"/><p>To complete the description of the scheme, three questions
+ .</p><div class="figure"><a id="id579810"/><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_update_seq_diagram.png" style="text-align: middle" alt="Insert update sequence"/></div></div></div><br class="figure-break"/><p>To complete the description of the scheme, three questions
need to be answered:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>How can a tree which supports order statistics define a
method such as <code class="classname">find_by_order</code>?</p></li><li class="listitem"><p>How can the node updater base access methods of the
tree?</p></li><li class="listitem"><p>How can the following cyclic dependency be resolved?
@@ -989,7 +989,7 @@
node's metadata (this is halting reducible). In the graphic
below, assume the shaded node is inserted. The tree would have
to traverse the useless path shown to the root, applying
- redundant updates all the way.</p></li></ol></div><div class="figure"><a id="id670941"/><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_rationale_null_node_updator.png" style="text-align: middle" alt="Useless update path"/></div></div></div><br class="figure-break"/><p>A null policy class, <code class="classname">null_node_update</code>
+ redundant updates all the way.</p></li></ol></div><div class="figure"><a id="id579995"/><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_rationale_null_node_updator.png" style="text-align: middle" alt="Useless update path"/></div></div></div><br class="figure-break"/><p>A null policy class, <code class="classname">null_node_update</code>
solves both these problems. The tree detects that node
invariants are irrelevant, and defines all accordingly.</p></div></div><div class="section" title="Split and Join"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.details.split"/>Split and Join</h6></div></div></div><p>Tree-based containers support split and join methods.
It is possible to split a tree so that it passes
@@ -1072,7 +1072,7 @@
sub-tree with leafs "a" and "as". The maximal common prefix is
"a". The internal node contains, consequently, to const
iterators, one pointing to <code class="varname">'a'</code>, and the other to
- <code class="varname">'s'</code>.</p><div class="figure"><a id="id671313"/><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pat_trie.png" style="text-align: middle" alt="A PATRICIA trie"/></div></div></div><br class="figure-break"/></div><div class="section" title="Node Invariants"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"/>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
+ <code class="varname">'s'</code>.</p><div class="figure"><a id="id580368"/><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pat_trie.png" style="text-align: middle" alt="A PATRICIA trie"/></div></div></div><br class="figure-break"/></div><div class="section" title="Node Invariants"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"/>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
tree-based containers. There are two minor
differences, though, which, unfortunately, thwart sharing them
sharing the same node-updating policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>A trie's <code class="classname">Node_Update</code> template-template
@@ -1081,7 +1081,7 @@
parametrized by <code class="classname">Cmp_Fn</code>.</p></li><li class="listitem"><p>Tree-based containers store values in all nodes, while
trie-based containers (at least in this implementation) store
values in leafs.</p></li></ol></div><p>The graphic below shows the scheme, as well as some predefined
- policies (which are explained below).</p><div class="figure"><a id="id671400"/><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_trie_node_updator_policy_cd.png" style="text-align: middle" alt="A trie and its update policy"/></div></div></div><br class="figure-break"/><p>This library offers the following pre-defined trie node
+ policies (which are explained below).</p><div class="figure"><a id="id580455"/><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_trie_node_updator_policy_cd.png" style="text-align: middle" alt="A trie and its update policy"/></div></div></div><br class="figure-break"/><p>This library offers the following pre-defined trie node
updating policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
<code class="classname">trie_order_statistics_node_update</code>
supports order statistics.
@@ -1129,7 +1129,7 @@
simple list of integer keys. If we search for the integer 6, we
are paying an overhead: the link with key 6 is only the fifth
link; if it were the first link, it could be accessed
- faster.</p><div class="figure"><a id="id671655"/><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_simple_list.png" style="text-align: middle" alt="A simple list"/></div></div></div><br class="figure-break"/><p>List-update algorithms reorder lists as elements are
+ faster.</p><div class="figure"><a id="id580710"/><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_simple_list.png" style="text-align: middle" alt="A simple list"/></div></div></div><br class="figure-break"/><p>List-update algorithms reorder lists as elements are
accessed. They try to determine, by the access history, which
keys to move to the front of the list. Some of these algorithms
require adding some metadata alongside each entry.</p><p>For example, in the graphic below label A shows the counter
@@ -1139,7 +1139,7 @@
predetermined value, say 10, as shown in label C, the count is set
to 0 and the node is moved to the front of the list, as in label
D.
- </p><div class="figure"><a id="id671702"/><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_list_update.png" style="text-align: middle" alt="The counter algorithm"/></div></div></div><br class="figure-break"/></div><div class="section" title="Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"/>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
+ </p><div class="figure"><a id="id580756"/><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_list_update.png" style="text-align: middle" alt="The counter algorithm"/></div></div></div><br class="figure-break"/></div><div class="section" title="Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"/>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
implementing any algorithm moving nodes to the front of the
list (policies implementing algorithms interchanging nodes are
unsupported).</p><p>Associative containers based on lists are parametrized by a
@@ -1311,7 +1311,7 @@
sequence; the second uses a tree (or forest of trees), which is
typically less structured than an associative container's tree;
the third simply uses an associative container. These are
- shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="id672233"/><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" style="text-align: middle" alt="Underlying Priority-Queue Data-Structures."/></div></div></div><br class="figure-break"/><p>Roughly speaking, any value that is both pushed and popped
+ shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="id581288"/><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" style="text-align: middle" alt="Underlying Priority-Queue Data-Structures."/></div></div></div><br class="figure-break"/><p>Roughly speaking, any value that is both pushed and popped
from a priority queue must incur a logarithmic expense (in the
amortized sense). Any priority queue implementation that would
avoid this, would violate known bounds on comparison-based
@@ -1391,7 +1391,7 @@
container <code class="classname">Cntnr</code>, the tag of the underlying
data structure can be found via <code class="classname">typename
Cntnr::container_category</code>; this is one of the possible tags shown in the graphic below.
- </p><div class="figure"><a id="id672525"/><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" style="text-align: middle" alt="Priority-Queue Data-Structure Tags."/></div></div></div><br class="figure-break"/><p>Additionally, a traits mechanism can be used to query a
+ </p><div class="figure"><a id="id581579"/><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" style="text-align: middle" alt="Priority-Queue Data-Structure Tags."/></div></div></div><br class="figure-break"/><p>Additionally, a traits mechanism can be used to query a
container type for its attributes. Given any container
<code class="classname">Cntnr</code>, then </p><pre class="programlisting">__gnu_pbds::container_traits&lt;Cntnr&gt;</pre><p>
is a traits class identifying the properties of the
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_using.html b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
index 0e2fdb3d1c4..519973fabd7 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
@@ -62,7 +62,7 @@
In addition, there are the following diagnostics classes,
used to report errors specific to this library's data
structures.
- </p><div class="figure"><a id="id665824"/><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_exception_hierarchy.png" style="text-align: middle" alt="Exception Hierarchy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Tutorial"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"/>Tutorial</h3></div></div></div><div class="section" title="Basic Use"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"/>Basic Use</h4></div></div></div><p>
+ </p><div class="figure"><a id="id574878"/><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_exception_hierarchy.png" style="text-align: middle" alt="Exception Hierarchy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Tutorial"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"/>Tutorial</h3></div></div></div><div class="section" title="Basic Use"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"/>Basic Use</h4></div></div></div><p>
For the most part, the policy-based containers containers in
namespace <code class="literal">__gnu_pbds</code> have the same interface as
the equivalent containers in the standard C++ library, except for
@@ -83,7 +83,7 @@
<code class="classname">__gnu_pbds::cc_hash_table</code> instead of
<code class="classname">std::unordered_map</code>, since <span class="quote">“<span class="quote">unordered
map</span>â€</span> does not necessarily mean a hash-based map as implied by
- the C++ library (C++0x or TR1). For example, list-based associative
+ the C++ library (C++11 or TR1). For example, list-based associative
containers, which are very useful for the construction of
"multimaps," are also unordered.
</p><p>This snippet shows a red-black tree based container:</p><pre class="programlisting">
diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html
index 2543fdb0c86..fc00a8a668d 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode.html
@@ -138,7 +138,7 @@ vector-size: improvement = 3: call stack = 0x804842c ...
call context.
(Environment variable not supported.)
</p></li></ul></div><p>
- </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id662399"/><p><span class="citetitle"><em class="citetitle">
+ </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id571454"/><p><span class="citetitle"><em class="citetitle">
Perflint: A Context Sensitive Performance Advisor for C++ Programs
</em>. </span><span class="author"><span class="firstname">Lixia</span> <span class="surname">Liu</span>. </span><span class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span>. </span><span class="copyright">Copyright © 2009 . </span><span class="publisher"><span class="publishername">
Proceedings of the 2009 International Symposium on Code Generation
diff --git a/libstdc++-v3/doc/html/manual/setup.html b/libstdc++-v3/doc/html/manual/setup.html
index 6615390b526..5ce28a4508f 100644
--- a/libstdc++-v3/doc/html/manual/setup.html
+++ b/libstdc++-v3/doc/html/manual/setup.html
@@ -46,9 +46,9 @@
</p><p>
Finally, a few system-specific requirements:
</p><div class="variablelist"><dl><dt><span class="term">linux</span></dt><dd><p>
- If gcc 3.1.0 or later on is being used on linux, an attempt
+ If GCC 3.1.0 or later on is being used on GNU/Linux, an attempt
will be made to use "C" library functionality necessary for
- C++ named locale support. For gcc 4.6.0 and later, this
+ C++ named locale support. For GCC 4.6.0 and later, this
means that glibc 2.3 or later is required.
</p><p>
If the 'gnu' locale model is being used, the following
@@ -87,16 +87,7 @@ zh_TW BIG5
libstdc++ after "C" locales are installed is not necessary.
</p><p>
To install support for locales, do only one of the following:
- </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>install all locales</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>with RedHat Linux:
- </p><p> <code class="code"> export LC_ALL=C </code>
- </p><p> <code class="code"> rpm -e glibc-common --nodeps </code>
- </p><p>
- <code class="code"> rpm -i --define "_install_langs all"
- glibc-common-2.2.5-34.i386.rpm
- </code>
- </p></li><li class="listitem"><p>
- Instructions for other operating systems solicited.
- </p></li></ul></div></li><li class="listitem"><p>install just the necessary locales</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>with Debian Linux:</p><p> Add the above list, as shown, to the file
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>install all locales</p></li><li class="listitem"><p>install just the necessary locales</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>with Debian GNU/Linux:</p><p> Add the above list, as shown, to the file
<code class="code">/etc/locale.gen</code> </p><p> run <code class="code">/usr/sbin/locale-gen</code> </p></li><li class="listitem"><p>on most Unix-like operating systems:</p><p><code class="code"> localedef -i de_DE -f ISO-8859-1 de_DE </code></p><p>(repeat for each entry in the above list) </p></li><li class="listitem"><p>
Instructions for other operating systems solicited.
</p></li></ul></div></li></ul></div></dd></dl></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr><tr><td align="left" valign="top">Bugs </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Configure</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 8e68bb29fc5..3ca20267fb6 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><title>Chapter 1. Status</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="intro.html" title="Part I.  Introduction"/><link rel="next" href="license.html" title="License"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 1. Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"/>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.iso"/>Implementation Status</h2></div></div></div><div class="section" title="C++ 1998/2003"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"/>C++ 1998/2003</h3></div></div></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"/>Implementation Status</h4></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 1. Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"/>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.iso"/>Implementation Status</h2></div></div></div><div class="section" title="C++ 1998/2003"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"/>C++ 1998/2003</h3></div></div></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"/>Implementation Status</h4></div></div></div><p>
This status table is based on the table of contents of ISO/IEC 14882:2003.
</p><p>
This page describes the C++ support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id598677"/><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id457093"/><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Language support</em></span>
@@ -142,26 +142,26 @@ particular release.
<a class="link" href="io.html" title="Chapter 13.  Input and Output">in this chapter</a>.
</p><p><span class="emphasis"><em>[27.8.1.4]/16</em></span> Calling <code class="code">fstream::sync</code> when
a get area exists will... whatever <code class="code">fflush()</code> does, I think.
- </p></div></div><div class="section" title="C++ 200x"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.200x"/>C++ 200x</h3></div></div></div><p>
+ </p></div></div><div class="section" title="C++ 2011"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.2011"/>C++ 2011</h3></div></div></div><p>
This table is based on the table of contents of ISO/IEC
JTC1 SC22 WG21 Doc No: N3290 Date: 2011-04-11
Final Draft International Standard, Standard for Programming Language C++
</p><p>
-In this implementation <code class="literal">-std=gnu++0x</code> or
-<code class="literal">-std=c++0x</code> flags must be used to enable language
+In this implementation <code class="literal">-std=gnu++11</code> or
+<code class="literal">-std=c++11</code> flags must be used to enable language
and library
features. See <a class="link" href="using.html#manual.intro.using.flags" title="Command Options">dialect</a>
options. The pre-defined symbol
<code class="constant">__GXX_EXPERIMENTAL_CXX0X__</code> is used to check for the
presence of the required flag.
</p><p>
-This page describes the C++0x support in mainline GCC SVN, not in any
+This page describes the C++11 support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id596384"/><p class="title"><strong>Table 1.2. C++ 200x Implementation Status</strong></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id488280"/><p class="title"><strong>Table 1.2. C++ 2011 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 2011 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Language support</em></span>
- </td></tr><tr><td style="text-align: left">18.1</td><td style="text-align: left">General</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">18.2</td><td style="text-align: left">Types</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing offsetof, max_align_t</td></tr><tr><td style="text-align: left">18.3</td><td style="text-align: left">Implementation properties</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2</td><td style="text-align: left">Numeric Limits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.3</td><td style="text-align: left">Class template <code class="code">numeric_limits</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.4</td><td style="text-align: left"><code class="code">numeric_limits</code> members</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">18.3.2.5</td><td style="text-align: left"><code class="code">float_round_style</code></td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">18.3.2.6</td><td style="text-align: left"><code class="code">float_denorm_style</code></td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.7</td><td style="text-align: left"><code class="code">numeric_limits</code> specializations</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.3</td><td style="text-align: left">C Library</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.4</td><td style="text-align: left">Integer types</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.4.1</td><td style="text-align: left">Header <code class="code">&lt;cstdint&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">18.5</td><td style="text-align: left">Start and termination</td><td style="text-align: left">Partial</td><td style="text-align: left">C library dependency for quick_exit, at_quick_exit</td></tr><tr><td style="text-align: left">18.6</td><td style="text-align: left">Dynamic memory management</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7</td><td style="text-align: left">Type identification</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.1</td><td style="text-align: left">Class type_info</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.2</td><td style="text-align: left">Class bad_cast</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.3</td><td style="text-align: left">Class bad_typeid</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8</td><td style="text-align: left">Exception handling</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.1</td><td style="text-align: left">Class exception</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.2</td><td style="text-align: left">Class bad_exception</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.3</td><td style="text-align: left">Abnormal termination</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.4</td><td style="text-align: left"><code class="code">uncaught_exception</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.5</td><td style="text-align: left">Exception Propagation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.6</td><td style="text-align: left"><code class="code">nested_exception</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9</td><td style="text-align: left">Initializer lists</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.1</td><td style="text-align: left">Initializer list constructors</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.2</td><td style="text-align: left">Initializer list access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.3</td><td style="text-align: left">Initializer list range access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.10</td><td style="text-align: left">Other runtime support</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ </td></tr><tr><td style="text-align: left">18.1</td><td style="text-align: left">General</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">18.2</td><td style="text-align: left">Types</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing offsetof, max_align_t</td></tr><tr><td style="text-align: left">18.3</td><td style="text-align: left">Implementation properties</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2</td><td style="text-align: left">Numeric Limits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.3</td><td style="text-align: left">Class template <code class="code">numeric_limits</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.4</td><td style="text-align: left"><code class="code">numeric_limits</code> members</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">18.3.2.5</td><td style="text-align: left"><code class="code">float_round_style</code></td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">18.3.2.6</td><td style="text-align: left"><code class="code">float_denorm_style</code></td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.2.7</td><td style="text-align: left"><code class="code">numeric_limits</code> specializations</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.3.3</td><td style="text-align: left">C Library</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.4</td><td style="text-align: left">Integer types</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.4.1</td><td style="text-align: left">Header <code class="code">&lt;cstdint&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">18.5</td><td style="text-align: left">Start and termination</td><td style="text-align: left">Partial</td><td style="text-align: left">C library dependency for quick_exit, at_quick_exit</td></tr><tr><td style="text-align: left">18.6</td><td style="text-align: left">Dynamic memory management</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7</td><td style="text-align: left">Type identification</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.1</td><td style="text-align: left">Class type_info</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.2</td><td style="text-align: left">Class bad_cast</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.7.3</td><td style="text-align: left">Class bad_typeid</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8</td><td style="text-align: left">Exception handling</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.1</td><td style="text-align: left">Class exception</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.2</td><td style="text-align: left">Class bad_exception</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.3</td><td style="text-align: left">Abnormal termination</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.4</td><td style="text-align: left"><code class="code">uncaught_exception</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.5</td><td style="text-align: left">Exception Propagation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.8.6</td><td style="text-align: left"><code class="code">nested_exception</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9</td><td style="text-align: left">Initializer lists</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.1</td><td style="text-align: left">Initializer list constructors</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.2</td><td style="text-align: left">Initializer list access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">18.9.3</td><td style="text-align: left">Initializer list range access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">18.10</td><td style="text-align: left">Other runtime support</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing <code class="filename">&lt;cstdalign&gt;</code> </td></tr><tr><td style="text-align: left">
<span class="emphasis"><em>19</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Diagnostics</em></span>
@@ -188,7 +188,9 @@ particular release.
<span class="emphasis"><em>21</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Strings</em></span>
- </td></tr><tr><td style="text-align: left">21.1</td><td style="text-align: left">General</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2</td><td style="text-align: left">Character traits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.1</td><td style="text-align: left">Character traits requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.2</td><td style="text-align: left">traits typedefs</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.3</td><td style="text-align: left"><code class="code">char_traits</code> specializations</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.2.3.1</td><td style="text-align: left">struct <code class="code">char_traits&lt;char&gt;</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr</td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.2.3.2</td><td style="text-align: left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr</td></tr><tr><td style="text-align: left">21.2.3.3</td><td style="text-align: left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.3.4</td><td style="text-align: left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.3</td><td style="text-align: left">String classes</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.4</td><td style="text-align: left">Class template <code class="code">basic_string</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.5</td><td style="text-align: left">Numeric Conversions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.6</td><td style="text-align: left">Hash support</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.7</td><td style="text-align: left">Null-terminated sequence utilities</td><td style="text-align: left">Y</td><td style="text-align: left">C library dependency</td></tr><tr><td style="text-align: left">
+ </td></tr><tr><td style="text-align: left">21.1</td><td style="text-align: left">General</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2</td><td style="text-align: left">Character traits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.1</td><td style="text-align: left">Character traits requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.2</td><td style="text-align: left">traits typedefs</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.3</td><td style="text-align: left"><code class="code">char_traits</code> specializations</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.2.3.1</td><td style="text-align: left">struct <code class="code">char_traits&lt;char&gt;</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr</td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.2.3.2</td><td style="text-align: left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr</td></tr><tr><td style="text-align: left">21.2.3.3</td><td style="text-align: left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.2.3.4</td><td style="text-align: left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.3</td><td style="text-align: left">String classes</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.4</td><td style="text-align: left">Class template <code class="code">basic_string</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing pop_back</td></tr><tr><td style="text-align: left">21.5</td><td style="text-align: left">Numeric Conversions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">21.6</td><td style="text-align: left">Hash support</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">21.7</td><td style="text-align: left">Null-terminated sequence utilities</td><td style="text-align: left">Partial</td><td style="text-align: left">C library dependency.
+ Missing <code class="filename">&lt;cuchar&gt;</code>
+ </td></tr><tr><td style="text-align: left">
<span class="emphasis"><em>22</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Localization</em></span>
@@ -196,7 +198,7 @@ particular release.
<span class="emphasis"><em>23</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Containers</em></span>
- </td></tr><tr><td style="text-align: left">23.1</td><td style="text-align: left">General</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2</td><td style="text-align: left">Container requirements</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.1</td><td style="text-align: left">General container requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.2</td><td style="text-align: left">Container data races</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.3</td><td style="text-align: left">Sequence containers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.4</td><td style="text-align: left">Associative containers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.5</td><td style="text-align: left">Unordered associative containers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3</td><td style="text-align: left">Sequence containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.2</td><td style="text-align: left">Class template <code class="code">array</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.3</td><td style="text-align: left">Class template <code class="code">deque</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.4</td><td style="text-align: left">Class template <code class="code">forward_list</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.5</td><td style="text-align: left">Class template <code class="code">list</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.6</td><td style="text-align: left">Class template <code class="code">vector</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.7</td><td style="text-align: left">Class <code class="code">vector&lt;bool&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4</td><td style="text-align: left">Associative containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.4</td><td style="text-align: left">Class template <code class="code">map</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.5</td><td style="text-align: left">Class template <code class="code">multimap</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.6</td><td style="text-align: left">Class template <code class="code">set</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.7</td><td style="text-align: left">Class template <code class="code">multiset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5</td><td style="text-align: left">Unordered associative containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.4</td><td style="text-align: left">Class template <code class="code">unordered_map</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.5</td><td style="text-align: left">Class template <code class="code">unordered_multimap</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.6</td><td style="text-align: left">Class template <code class="code">unordered_set</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.7</td><td style="text-align: left">Class template <code class="code">unordered_multiset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6</td><td style="text-align: left">Container adaptors</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.1</td><td style="text-align: left">Class template <code class="code">queue</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.2</td><td style="text-align: left">Class template <code class="code">priority_queue</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.3</td><td style="text-align: left">Class template <code class="code">stack</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ </td></tr><tr><td style="text-align: left">23.1</td><td style="text-align: left">General</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2</td><td style="text-align: left">Container requirements</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.1</td><td style="text-align: left">General container requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.2</td><td style="text-align: left">Container data races</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.2.3</td><td style="text-align: left">Sequence containers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">23.2.4</td><td style="text-align: left">Associative containers</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing emplace members</td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">23.2.5</td><td style="text-align: left">Unordered associative containers</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing emplace members</td></tr><tr><td style="text-align: left">23.3</td><td style="text-align: left">Sequence containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.2</td><td style="text-align: left">Class template <code class="code">array</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.3</td><td style="text-align: left">Class template <code class="code">deque</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.4</td><td style="text-align: left">Class template <code class="code">forward_list</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.5</td><td style="text-align: left">Class template <code class="code">list</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.6</td><td style="text-align: left">Class template <code class="code">vector</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.3.7</td><td style="text-align: left">Class <code class="code">vector&lt;bool&gt;</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4</td><td style="text-align: left">Associative containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.4</td><td style="text-align: left">Class template <code class="code">map</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.5</td><td style="text-align: left">Class template <code class="code">multimap</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.6</td><td style="text-align: left">Class template <code class="code">set</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.4.7</td><td style="text-align: left">Class template <code class="code">multiset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5</td><td style="text-align: left">Unordered associative containers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.4</td><td style="text-align: left">Class template <code class="code">unordered_map</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.5</td><td style="text-align: left">Class template <code class="code">unordered_multimap</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.6</td><td style="text-align: left">Class template <code class="code">unordered_set</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.5.7</td><td style="text-align: left">Class template <code class="code">unordered_multiset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6</td><td style="text-align: left">Container adaptors</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.1</td><td style="text-align: left">Class template <code class="code">queue</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.2</td><td style="text-align: left">Class template <code class="code">priority_queue</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">23.6.3</td><td style="text-align: left">Class template <code class="code">stack</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">
<span class="emphasis"><em>24</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Iterators</em></span>
@@ -245,7 +247,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="id588207"/><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left"><span class="emphasis"><em>2</em></span></td><td colspan="3" style="text-align: left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td style="text-align: left">2.1</td><td style="text-align: left">Reference wrappers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.1</td><td style="text-align: left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2</td><td style="text-align: left">Class template <code class="code">reference_wrapper</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.1</td><td style="text-align: left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.2</td><td style="text-align: left"><code class="code">reference_wrapper</code> assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.3</td><td style="text-align: left"><code class="code">reference_wrapper</code> access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.4</td><td style="text-align: left"><code class="code">reference_wrapper</code> invocation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.5</td><td style="text-align: left"><code class="code">reference_wrapper</code> helper functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.1</td><td style="text-align: left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.2</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.3</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left"> </td><td style="text-align: left">
+</p><div class="table"><a id="id490902"/><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left"><span class="emphasis"><em>2</em></span></td><td colspan="3" style="text-align: left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td style="text-align: left">2.1</td><td style="text-align: left">Reference wrappers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.1</td><td style="text-align: left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2</td><td style="text-align: left">Class template <code class="code">reference_wrapper</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.1</td><td style="text-align: left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.2</td><td style="text-align: left"><code class="code">reference_wrapper</code> assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.3</td><td style="text-align: left"><code class="code">reference_wrapper</code> access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.4</td><td style="text-align: left"><code class="code">reference_wrapper</code> invocation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.5</td><td style="text-align: left"><code class="code">reference_wrapper</code> helper functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.1</td><td style="text-align: left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.2</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.3</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left"> </td><td style="text-align: left">
<p>
Uses code from
<a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</a>.
@@ -258,7 +260,7 @@ decimal floating-point arithmetic
</p><p>
This page describes the TR 24733 support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id622095"/><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id531074"/><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>0</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Introduction</em></span>
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index 6e4adf23d7c..5eabed2067f 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 7.  Strings"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings"/>Chapter 7. 
Strings
- <a id="id647564" class="indexterm"/>
+ <a id="id556618" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="section" title="String Classes"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings.string"/>String Classes</h2></div></div></div><div class="section" title="Simple Transformations"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.simple"/>Simple Transformations</h3></div></div></div><p>
Here are Standard, simple, and portable ways to perform common
transformations on a <code class="code">string</code> instance, such as
@@ -269,7 +269,7 @@ stringtok(Container &amp;container, string const &amp;in,
(see <a class="link" href="../faq.html#faq.size_equals_capacity" title="7.8.">this FAQ
entry</a>) but the regular copy constructor cannot be used
because libstdc++'s <code class="code">string</code> is Copy-On-Write.
- </p><p>In <a class="link" href="status.html#status.iso.200x" title="C++ 200x">C++0x</a> mode you can call
+ </p><p>In <a class="link" href="status.html#status.iso.2011" title="C++ 2011">C++11</a> mode you can call
<code class="code">s.shrink_to_fit()</code> to achieve the same effect as
<code class="code">s.reserve(s.size())</code>.
</p></div><div class="section" title="CString (MFC)"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.Cstring"/>CString (MFC)</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html
index 7a978473fb7..1017aa36b48 100644
--- a/libstdc++-v3/doc/html/manual/support.html
+++ b/libstdc++-v3/doc/html/manual/support.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 4.  Support"><div class="titlepage"><div><div><h2 class="title"><a id="std.support"/>Chapter 4. 
Support
- <a id="id631894" class="indexterm"/>
+ <a id="id540958" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div><p>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 802d4159a07..19c51d26ffb 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -392,10 +392,10 @@ Example 1: Testing compilation only
// { dg-do compile }
Example 2: Testing for expected warnings on line 36, which all targets fail
-// { dg-warning "string literals" "" { xfail *-*-* } 36
+// { dg-warning "string literals" "" { xfail *-*-* } 36 }
Example 3: Testing for expected warnings on line 36
-// { dg-warning "string literals" "" { target *-*-* } 36
+// { dg-warning "string literals" "" { target *-*-* } 36 }
Example 4: Testing for compilation errors on line 41
// { dg-do compile }
@@ -493,7 +493,7 @@ only default variables.
reporting functions including:
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>time_counter</p></li><li class="listitem"><p>resource_counter</p></li><li class="listitem"><p>report_performance</p></li></ul></div></li></ul></div></div></div><div class="section" title="Special Topics"><div class="titlepage"><div><div><h3 class="title"><a id="test.special"/>Special Topics</h3></div></div></div><div class="section" title="Qualifying Exception Safety Guarantees"><div class="titlepage"><div><div><h4 class="title"><a id="test.exception.safety"/>
Qualifying Exception Safety Guarantees
- <a id="id705405" class="indexterm"/>
+ <a id="id614459" class="indexterm"/>
</h4></div></div></div><div class="section" title="Overview"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.overview"/>Overview</h5></div></div></div><p>
Testing is composed of running a particular test sequence,
and looking at what happens to the surrounding code when
@@ -548,7 +548,7 @@ container uses an extension
allocator, <code class="classname">__gnu_cxx::throw_allocator_random</code>,
as the allocator type.
</p></li><li class="listitem"><p>
- C++0x Container Requirements.
+ C++11 Container Requirements.
</p><p>
Coverage is currently limited to testing container
requirements for exception safety,
@@ -563,8 +563,8 @@ as the allocator type.
instrumentation to <code class="classname">iterator</code>
and <code class="classname">const_iterator</code> types that throw
conditionally on iterator operations.
- </p></li></ul></div></div><div class="section" title="C++0x Requirements Test Sequence Descriptions"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.containers"/>
-C++0x Requirements Test Sequence Descriptions
+ </p></li></ul></div></div><div class="section" title="C++11 Requirements Test Sequence Descriptions"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.containers"/>
+C++11 Requirements Test Sequence Descriptions
</h5></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
Basic
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index 529577e5eb6..29905cd7cc6 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -6,10 +6,10 @@
</th><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 3. Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"/>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section" title="Command Options"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.flags"/>Command Options</h2></div></div></div><p>
The set of features available in the GNU C++ library is shaped
by
- several <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Invoking-GCC.html">GCC
+ several <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html">GCC
Command Options</a>. Options that impact libstdc++ are
enumerated and detailed in the table below.
</p><p>
By default, <span class="command"><strong>g++</strong></span> is equivalent to <span class="command"><strong>g++ -std=gnu++98</strong></span>. The standard library also defaults to this dialect.
- </p><div class="table"><a id="id626203"/><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Option Flags</th><th style="text-align: left">Description</th></tr></thead><tbody><tr><td style="text-align: left"><code class="literal">-std=c++98</code></td><td style="text-align: left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++98</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-std=c++0x</code></td><td style="text-align: left">Use the working draft of the upcoming ISO C++0x standard.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++0x</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-fexceptions</code></td><td style="text-align: left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td style="text-align: left"><code class="literal">-frtti</code></td><td style="text-align: left">As above, but RTTI-free dialect.</td></tr><tr><td style="text-align: left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td style="text-align: left">For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
+ </p><div class="table"><a id="id535140"/><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Option Flags</th><th style="text-align: left">Description</th></tr></thead><tbody><tr><td style="text-align: left"><code class="literal">-std=c++98</code></td><td style="text-align: left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++98</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-std=c++11</code></td><td style="text-align: left">Use the 2011 ISO C++ standard.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++11</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-fexceptions</code></td><td style="text-align: left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td style="text-align: left"><code class="literal">-frtti</code></td><td style="text-align: left">As above, but RTTI-free dialect.</td></tr><tr><td style="text-align: left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td style="text-align: left">For ISO C++11 &lt;thread&gt;, &lt;future&gt;,
&lt;mutex&gt;, or &lt;condition_variable&gt;.</td></tr><tr><td style="text-align: left"><code class="literal">-fopenmp</code></td><td style="text-align: left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="make.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td align="left" valign="top">Make </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Headers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_concurrency.html b/libstdc++-v3/doc/html/manual/using_concurrency.html
index 671ebdd3a4b..e0c729263cd 100644
--- a/libstdc++-v3/doc/html/manual/using_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/using_concurrency.html
@@ -34,7 +34,15 @@
AFAIK, none of this is properly documented anywhere other than
in ``gcc -dumpspecs'' (look at lib and cpp entries).
</p></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.concurrency.thread_safety"/>Thread Safety</h3></div></div></div><p>
-We currently use the <a class="link" href="http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</a> definition of thread safety.
+In the terms of the 2011 C++ standard a thread-safe program is one which
+does not perform any conflicting non-atomic operations on memory locations
+and so does not contain any data races.
+The standard places requirements on the library to ensure that no data
+races are caused by the library itself or by programs which use the
+library correctly (as described below).
+The C++11 memory model and library requirements are a more formal version
+of the <a class="link" href="http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</a> definition of thread safety, which the library used
+prior to the 2011 standard.
</p><p>The library strives to be thread-safe when all of the following
conditions are met:
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>The system's libc is itself thread-safe,
@@ -58,37 +66,96 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
</p></li><li class="listitem"><p>
An implementation of atomicity.h functions
exists for the architecture in question. See the internals documentation for more <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">details</a>.
- </p></li></ul></div><p>The user-code must guard against concurrent method calls which may
- access any particular library object's state. Typically, the
- application programmer may infer what object locks must be held
- based on the objects referenced in a method call. Without getting
+ </p></li></ul></div><p>The user code must guard against concurrent function calls which
+ access any particular library object's state when one or more of
+ those accesses modifies the state. An object will be modified by
+ invoking a non-const member function on it or passing it as a
+ non-const argument to a library function. An object will not be
+ modified by invoking a const member function on it or passing it to
+ a function as a pointer- or reference-to-const.
+ Typically, the application
+ programmer may infer what object locks must be held based on the
+ objects referenced in a function call and whether the objects are
+ accessed as const or non-const. Without getting
into great detail, here is an example which requires user-level
locks:
</p><pre class="programlisting">
library_class_a shared_object_a;
- thread_main () {
+ void thread_main () {
library_class_b *object_b = new library_class_b;
shared_object_a.add_b (object_b); // must hold lock for shared_object_a
shared_object_a.mutate (); // must hold lock for shared_object_a
}
// Multiple copies of thread_main() are started in independent threads.</pre><p>Under the assumption that object_a and object_b are never exposed to
- another thread, here is an example that should not require any
+ another thread, here is an example that does not require any
user-level locks:
</p><pre class="programlisting">
- thread_main () {
+ void thread_main () {
library_class_a object_a;
library_class_b *object_b = new library_class_b;
object_a.add_b (object_b);
object_a.mutate ();
- } </pre><p>All library objects are safe to use in a multithreaded program as
- long as each thread carefully locks out access by any other
- thread while it uses any object visible to another thread, i.e.,
- treat library objects like any other shared resource. In general,
- this requirement includes both read and write access to objects;
- unless otherwise documented as safe, do not assume that two threads
- may access a shared standard library object at the same time.
+ } </pre><p>All library types are safe to use in a multithreaded program
+ if objects are not shared between threads or as
+ long each thread carefully locks out access by any other
+ thread while it modifies any object visible to another thread.
+ Unless otherwise documented, the only exceptions to these rules
+ are atomic operations on the types in
+ <code class="filename">&lt;atomic&gt;</code>
+ and lock/unlock operations on the standard mutex types in
+ <code class="filename">&lt;mutex&gt;</code>. These
+ atomic operations allow concurrent accesses to the same object
+ without introducing data races.
+ </p><p>The following member functions of standard containers can be
+ considered to be const for the purposes of avoiding data races:
+ <code class="code">begin</code>, <code class="code">end</code>, <code class="code">rbegin</code>, <code class="code">rend</code>,
+ <code class="code">front</code>, <code class="code">back</code>, <code class="code">data</code>,
+ <code class="code">find</code>, <code class="code">lower_bound</code>, <code class="code">upper_bound</code>,
+ <code class="code">equal_range</code>, <code class="code">at</code>
+ and, except in associative or unordered associative containers,
+ <code class="code">operator[]</code>. In other words, although they are non-const
+ so that they can return mutable iterators, those member functions
+ will not modify the container.
+ Accessing an iterator might cause a non-modifying access to
+ the container the iterator refers to (for example incrementing a
+ list iterator must access the pointers between nodes, which are part
+ of the container and so conflict with other accesses to the container).
+ </p><p>Programs which follow the rules above will not encounter data
+ races in library code, even when using library types which share
+ state between distinct objects. In the example below the
+ <code class="code">shared_ptr</code> objects share a reference count, but
+ because the code does not perform any non-const operations on the
+ globally-visible object, the library ensures that the reference
+ count updates are atomic and do not introduce data races:
+ </p><pre class="programlisting">
+ std::shared_ptr&lt;int&gt; global_sp;
+
+ void thread_main() {
+ auto local_sp = global_sp; // OK, copy constructor's parameter is reference-to-const
+
+ int i = *global_sp; // OK, operator* is const
+ int j = *local_sp; // OK, does not operate on global_sp
+
+ // *global_sp = 2; // NOT OK, modifies int visible to other threads
+ // *local_sp = 2; // NOT OK, modifies int visible to other threads
+
+ // global_sp.reset(); // NOT OK, reset is non-const
+ local_sp.reset(); // OK, does not operate on global_sp
+ }
+
+ int main() {
+ global_sp.reset(new int(1));
+ std::thread t1(thread_main);
+ std::thread t2(thread_main);
+ t1.join();
+ t2.join();
+ }
+ </pre><p>For further details of the C++11 memory model see Hans-J. Boehm's
+ <a class="link" href="http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/user-faq.html">Threads
+ and memory model for C++</a> pages, particularly the <a class="link" href="http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/threadsintro.html">introduction</a>
+ and <a class="link" href="http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/user-faq.html">FAQ</a>.
</p></div><div class="section" title="Atomics"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.concurrency.atomics"/>Atomics</h3></div></div></div><p>
</p></div><div class="section" title="IO"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.concurrency.io"/>IO</h3></div></div></div><p>This gets a bit tricky. Please read carefully, and bear with me.
</p><div class="section" title="Structure"><div class="titlepage"><div><div><h4 class="title"><a id="concurrency.io.structure"/>Structure</h4></div></div></div><p>A wrapper
diff --git a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
index 9796e4e8a60..4d1d6745b73 100644
--- a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
+++ b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
@@ -26,7 +26,7 @@
<code class="filename">cxxabi.h</code>.
</p></li></ul></div><p>
In the
- C++0x <a class="link" href="using.html#manual.intro.using.flags" title="Command Options">dialect</a> add
+ C++11 <a class="link" href="using.html#manual.intro.using.flags" title="Command Options">dialect</a> add
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
<code class="filename">initializer_list</code>
</p></li><li class="listitem"><p>
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index 19c72cdb113..ad340b234d3 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -266,7 +266,7 @@ is called.
}
catch(...)
{ this-&gt;_M_setstate(ios_base::badbit); }
-</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id631052"/><p><span class="title"><em>
+</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id540116"/><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
@@ -275,39 +275,39 @@ is called.
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry" title="Error and Exception Handling"><a id="id631082"/><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry" title="Error and Exception Handling"><a id="id540147"/><p><span class="title"><em>
<a class="link" href="http://www.boost.org/community/error_handling.html">
Error and Exception Handling
</a>
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams </span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry" title="Exception-Safety in Generic Components"><a id="id631113"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="Exception-Safety in Generic Components"><a id="id540177"/><p><span class="title"><em>
<a class="link" href="http://www.boost.org/community/exception_safety.html">
Exception-Safety in Generic Components
</a>
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams</span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry" title="Standard Library Exception Policy"><a id="id631144"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="Standard Library Exception Policy"><a id="id540208"/><p><span class="title"><em>
<a class="link" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf">
Standard Library Exception Policy
</a>
</em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
WG21 N1077
- . </span></span></p></div><div class="biblioentry" title="ia64 c++ abi exception handling"><a id="id631175"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="ia64 c++ abi exception handling"><a id="id540239"/><p><span class="title"><em>
<a class="link" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html">
ia64 c++ abi exception handling
</a>
</em>. </span><span class="author"><span class="firstname">Richard</span> <span class="surname">Henderson</span>. </span><span class="publisher"><span class="publishername">
GNU
- . </span></span></p></div><div class="biblioentry" title="Appendix E: Standard-Library Exception Safety"><a id="id631206"/><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry" title="Appendix E: Standard-Library Exception Safety"><a id="id540270"/><p><span class="title"><em>
<a class="link" href="http://www.research.att.com/~bs/3rd_safe.pdf">
Appendix E: Standard-Library Exception Safety
</a>
- </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="id631229"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="id540294"/><p><span class="citetitle"><em class="citetitle">
Exceptional C++
</em>. </span><span class="pagenums">
Exception-Safety Issues and Techniques
- . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry" title="GCC Bug 25191: exception_defines.h #defines try/catch"><a id="id631249"/><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry" title="GCC Bug 25191: exception_defines.h #defines try/catch"><a id="id540313"/><p><span class="title"><em>
<a class="link" href="http://gcc.gnu.org/PR25191">
GCC Bug 25191: exception_defines.h #defines try/catch
</a>
diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html
index 71fee7de525..2b843bbef55 100644
--- a/libstdc++-v3/doc/html/manual/using_headers.html
+++ b/libstdc++-v3/doc/html/manual/using_headers.html
@@ -16,45 +16,44 @@
Headers), and all others (TR1, C++ ABI, and Extensions).
</p><p>
Two dialects of standard headers are supported, corresponding to
- the 1998 standard as updated for 2003, and the draft of the
- upcoming 200x standard.
+ the 1998 standard as updated for 2003, and the current 2011 standard.
</p><p>
C++98/03 include files. These are available in the default compilation mode, i.e. <code class="code">-std=c++98</code> or <code class="code">-std=gnu++98</code>.
- </p><div class="table"><a id="id626432"/><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">complex</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td></tr><tr><td style="text-align: left"><code class="filename">fstream</code></td><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td><td style="text-align: left"><code class="filename">iosfwd</code></td></tr><tr><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td><td style="text-align: left"><code class="filename">list</code></td></tr><tr><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td></tr><tr><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td></tr><tr><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-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/><div class="table"><a id="id626736"/><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">ciso646</code></td></tr><tr><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td></tr><tr><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-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/><div class="table"><a id="id626942"/><p class="title"><strong>Table 3.4. C++ 200x Library Headers</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">array</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">chrono</code></td><td style="text-align: left"><code class="filename">complex</code></td></tr><tr><td style="text-align: left"><code class="filename">condition_variable</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td><td style="text-align: left"><code class="filename">forward_list</code></td><td style="text-align: left"><code class="filename">fstream</code></td></tr><tr><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">future</code></td><td style="text-align: left"><code class="filename">initalizer_list</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td></tr><tr><td style="text-align: left"><code class="filename">iosfwd</code></td><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td></tr><tr><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">mutex</code></td></tr><tr><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">random</code></td></tr><tr><td style="text-align: left"><code class="filename">ratio</code></td><td style="text-align: left"><code class="filename">regex</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">system_error</code></td><td style="text-align: left"><code class="filename">thread</code></td></tr><tr><td style="text-align: left"><code class="filename">tuple</code></td><td style="text-align: left"><code class="filename">type_traits</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-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/><div class="table"><a id="id627370"/><p class="title"><strong>Table 3.5. C++ 200x Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">ccomplex</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cfenv</code></td></tr><tr><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">cinttypes</code></td><td style="text-align: left"><code class="filename">ciso646</code></td><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td></tr><tr><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstdbool</code></td></tr><tr><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdint</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctgmath</code></td><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cuchar</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id535369"/><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">complex</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td></tr><tr><td style="text-align: left"><code class="filename">fstream</code></td><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td><td style="text-align: left"><code class="filename">iosfwd</code></td></tr><tr><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td><td style="text-align: left"><code class="filename">list</code></td></tr><tr><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td></tr><tr><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td></tr><tr><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-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/><div class="table"><a id="id535673"/><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">ciso646</code></td></tr><tr><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td></tr><tr><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p>
+C++11 include files. These are only available in C++11 compilation
+mode, i.e. <code class="literal">-std=c++11</code> or <code class="literal">-std=gnu++11</code>.
+</p><p/><div class="table"><a id="id535879"/><p class="title"><strong>Table 3.4. C++ 2011 Library Headers</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">array</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">chrono</code></td><td style="text-align: left"><code class="filename">complex</code></td></tr><tr><td style="text-align: left"><code class="filename">condition_variable</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td><td style="text-align: left"><code class="filename">forward_list</code></td><td style="text-align: left"><code class="filename">fstream</code></td></tr><tr><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">future</code></td><td style="text-align: left"><code class="filename">initalizer_list</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td></tr><tr><td style="text-align: left"><code class="filename">iosfwd</code></td><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td></tr><tr><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">mutex</code></td></tr><tr><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">random</code></td></tr><tr><td style="text-align: left"><code class="filename">ratio</code></td><td style="text-align: left"><code class="filename">regex</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">system_error</code></td><td style="text-align: left"><code class="filename">thread</code></td></tr><tr><td style="text-align: left"><code class="filename">tuple</code></td><td style="text-align: left"><code class="filename">type_traits</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-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/><div class="table"><a id="id536308"/><p class="title"><strong>Table 3.5. C++ 2011 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">ccomplex</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cfenv</code></td></tr><tr><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">cinttypes</code></td><td style="text-align: left"><code class="filename">ciso646</code></td><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td></tr><tr><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstdbool</code></td></tr><tr><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdint</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctgmath</code></td><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cuchar</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="id627620"/><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/array</code></td><td style="text-align: left"><code class="filename">tr1/complex</code></td><td style="text-align: left"><code class="filename">tr1/memory</code></td><td style="text-align: left"><code class="filename">tr1/functional</code></td><td style="text-align: left"><code class="filename">tr1/random</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/regex</code></td><td style="text-align: left"><code class="filename">tr1/tuple</code></td><td style="text-align: left"><code class="filename">tr1/type_traits</code></td><td style="text-align: left"><code class="filename">tr1/unordered_map</code></td><td style="text-align: left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td style="text-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/><div class="table"><a id="id627761"/><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/ccomplex</code></td><td style="text-align: left"><code class="filename">tr1/cfenv</code></td><td style="text-align: left"><code class="filename">tr1/cfloat</code></td><td style="text-align: left"><code class="filename">tr1/cmath</code></td><td style="text-align: left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/climits</code></td><td style="text-align: left"><code class="filename">tr1/cstdarg</code></td><td style="text-align: left"><code class="filename">tr1/cstdbool</code></td><td style="text-align: left"><code class="filename">tr1/cstdint</code></td><td style="text-align: left"><code class="filename">tr1/cstdio</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/cstdlib</code></td><td style="text-align: left"><code class="filename">tr1/ctgmath</code></td><td style="text-align: left"><code class="filename">tr1/ctime</code></td><td style="text-align: left"><code class="filename">tr1/cwchar</code></td><td style="text-align: left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>Decimal floating-point arithmetic is available if the C++
+</p><div class="table"><a id="id536557"/><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/array</code></td><td style="text-align: left"><code class="filename">tr1/complex</code></td><td style="text-align: left"><code class="filename">tr1/memory</code></td><td style="text-align: left"><code class="filename">tr1/functional</code></td><td style="text-align: left"><code class="filename">tr1/random</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/regex</code></td><td style="text-align: left"><code class="filename">tr1/tuple</code></td><td style="text-align: left"><code class="filename">tr1/type_traits</code></td><td style="text-align: left"><code class="filename">tr1/unordered_map</code></td><td style="text-align: left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td style="text-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/><div class="table"><a id="id536698"/><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/ccomplex</code></td><td style="text-align: left"><code class="filename">tr1/cfenv</code></td><td style="text-align: left"><code class="filename">tr1/cfloat</code></td><td style="text-align: left"><code class="filename">tr1/cmath</code></td><td style="text-align: left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/climits</code></td><td style="text-align: left"><code class="filename">tr1/cstdarg</code></td><td style="text-align: left"><code class="filename">tr1/cstdbool</code></td><td style="text-align: left"><code class="filename">tr1/cstdint</code></td><td style="text-align: left"><code class="filename">tr1/cstdio</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/cstdlib</code></td><td style="text-align: left"><code class="filename">tr1/ctgmath</code></td><td style="text-align: left"><code class="filename">tr1/ctime</code></td><td style="text-align: left"><code class="filename">tr1/cwchar</code></td><td style="text-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="id627936"/><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col style="text-align: left" class="c1"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
+</p><div class="table"><a id="id536874"/><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col style="text-align: left" class="c1"/></colgroup><tbody><tr><td style="text-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="id627982"/><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cxxabi.h</code></td><td style="text-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="id536920"/><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cxxabi.h</code></td><td style="text-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="id628036"/><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">ext/algorithm</code></td><td style="text-align: left"><code class="filename">ext/atomicity.h</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/cast.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/codecvt_specializations.h</code></td><td style="text-align: left"><code class="filename">ext/concurrence.h</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/enc_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/functional</code></td><td style="text-align: left"><code class="filename">ext/iterator</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/memory</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/numeric</code></td><td style="text-align: left"><code class="filename">ext/numeric_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/pod_char_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/rb_tree</code></td><td style="text-align: left"><code class="filename">ext/rope</code></td><td style="text-align: left"><code class="filename">ext/slist</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/stdio_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/typelist.h</code></td><td style="text-align: left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td style="text-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/><div class="table"><a id="id628333"/><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">debug/bitset</code></td><td style="text-align: left"><code class="filename">debug/deque</code></td><td style="text-align: left"><code class="filename">debug/list</code></td><td style="text-align: left"><code class="filename">debug/map</code></td><td style="text-align: left"><code class="filename">debug/set</code></td></tr><tr><td style="text-align: left"><code class="filename">debug/string</code></td><td style="text-align: left"><code class="filename">debug/unordered_map</code></td><td style="text-align: left"><code class="filename">debug/unordered_set</code></td><td style="text-align: left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id628456"/><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">profile/bitset</code></td><td style="text-align: left"><code class="filename">profile/deque</code></td><td style="text-align: left"><code class="filename">profile/list</code></td><td style="text-align: left"><code class="filename">profile/map</code></td></tr><tr><td style="text-align: left"><code class="filename">profile/set</code></td><td style="text-align: left"><code class="filename">profile/unordered_map</code></td><td style="text-align: left"><code class="filename">profile/unordered_set</code></td><td style="text-align: left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id628568"/><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">parallel/algorithm</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break"/></div><div class="section" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"/>Mixing Headers</h3></div></div></div><p> A few simple rules.
+</p><div class="table"><a id="id536973"/><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">ext/algorithm</code></td><td style="text-align: left"><code class="filename">ext/atomicity.h</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/cast.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/codecvt_specializations.h</code></td><td style="text-align: left"><code class="filename">ext/concurrence.h</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/enc_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/functional</code></td><td style="text-align: left"><code class="filename">ext/iterator</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/memory</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/numeric</code></td><td style="text-align: left"><code class="filename">ext/numeric_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/pod_char_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/rb_tree</code></td><td style="text-align: left"><code class="filename">ext/rope</code></td><td style="text-align: left"><code class="filename">ext/slist</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/stdio_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/typelist.h</code></td><td style="text-align: left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td style="text-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/><div class="table"><a id="id537271"/><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">debug/bitset</code></td><td style="text-align: left"><code class="filename">debug/deque</code></td><td style="text-align: left"><code class="filename">debug/list</code></td><td style="text-align: left"><code class="filename">debug/map</code></td><td style="text-align: left"><code class="filename">debug/set</code></td></tr><tr><td style="text-align: left"><code class="filename">debug/string</code></td><td style="text-align: left"><code class="filename">debug/unordered_map</code></td><td style="text-align: left"><code class="filename">debug/unordered_set</code></td><td style="text-align: left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id537394"/><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">profile/bitset</code></td><td style="text-align: left"><code class="filename">profile/deque</code></td><td style="text-align: left"><code class="filename">profile/list</code></td><td style="text-align: left"><code class="filename">profile/map</code></td></tr><tr><td style="text-align: left"><code class="filename">profile/set</code></td><td style="text-align: left"><code class="filename">profile/unordered_map</code></td><td style="text-align: left"><code class="filename">profile/unordered_set</code></td><td style="text-align: left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id537505"/><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">parallel/algorithm</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break"/></div><div class="section" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"/>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">
#include &lt;array&gt;
#include &lt;functional&gt;
-</pre><p>Implies C++0x mode. To use the entities in &lt;array&gt;, the C++0x
-compilation mode must be used, which implies the C++0x functionality
+</pre><p>Implies C++11 mode. To use the entities in &lt;array&gt;, the C++11
+compilation mode must be used, which implies the C++11 functionality
(and deprecations) in &lt;functional&gt; will be present.
</p><p>Second, the other headers can be included with either dialect of
-the standard headers, although features and types specific to C++0x
-are still only enabled when in C++0x compilation mode. So, to use
+the standard headers, although features and types specific to C++11
+are still only enabled when in C++11 compilation mode. So, to use
rvalue references with <code class="code">__gnu_cxx::vstring</code>, or to use the
debug-mode versions of <code class="code">std::unordered_map</code>, one must use
-the <code class="code">std=gnu++0x</code> compiler flag. (Or <code class="code">std=c++0x</code>, of course.)
-</p><p>A special case of the second rule is the mixing of TR1 and C++0x
+the <code class="code">std=gnu++11</code> compiler flag. (Or <code class="code">std=c++11</code>, of course.)
+</p><p>A special case of the second rule is the mixing of TR1 and C++11
facilities. It is possible (although not especially prudent) to
-include both the TR1 version and the C++0x version of header in the
+include both the TR1 version and the C++11 version of header in the
same translation unit:
</p><pre class="programlisting">
#include &lt;tr1/type_traits&gt;
#include &lt;type_traits&gt;
-</pre><p> Several parts of C++0x diverge quite substantially from TR1 predecessors.
+</pre><p> Several parts of C++11 diverge quite substantially from TR1 predecessors.
</p></div><div class="section" title="The C Headers and namespace std"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.cheaders"/>The C Headers and <code class="code">namespace std</code></h3></div></div></div><p>
The standard specifies that if one includes the C-style header
(&lt;math.h&gt; in this case), the symbols will be available
diff --git a/libstdc++-v3/doc/html/manual/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html
index 6fdd4bd8af0..8e35d01a7a5 100644
--- a/libstdc++-v3/doc/html/manual/using_macros.html
+++ b/libstdc++-v3/doc/html/manual/using_macros.html
@@ -45,7 +45,7 @@
removes older ARM-style iostreams code, and other anachronisms
from the API. This macro is dependent on the version of the
standard being tracked, and as a result may give different results for
- <code class="code">-std=c++98</code> and <code class="code">-std=c++0x</code>. This may
+ <code class="code">-std=c++98</code> and <code class="code">-std=c++11</code>. This may
be useful in updating old C++ code which no longer meet the
requirements of the language, or for checking current code
against new language standards.
diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html
index 8b718138812..7534a18cb4e 100644
--- a/libstdc++-v3/doc/html/manual/utilities.html
+++ b/libstdc++-v3/doc/html/manual/utilities.html
@@ -7,8 +7,8 @@
Standard Contents
</th><td align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 6.  Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="std.util"/>Chapter 6. 
Utilities
- <a id="id632871" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section" title="Functors"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.functors"/>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
+ <a id="id541935" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id542426">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id542456">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id542566">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id543565">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id543744">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id543814">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id543936">Dual C++11 and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id543992">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id556361">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id556391">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section" title="Functors"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.functors"/>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as chapter of their STL, in
diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml
index 4be79df6762..af9b6da82fe 100644
--- a/libstdc++-v3/doc/xml/faq.xml
+++ b/libstdc++-v3/doc/xml/faq.xml
@@ -694,7 +694,7 @@
Long answer: See the implementation status pages for
<link linkend="status.iso.1998">C++98</link>,
<link linkend="status.iso.tr1">TR1</link>, and
- <link linkend="status.iso.200x">C++0x</link>.
+ <link linkend="status.iso.2011">C++11</link>.
</para>
</answer>
</qandaentry>
diff --git a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
index 41193bb549d..525157f1814 100644
--- a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
+++ b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
@@ -42,24 +42,24 @@ Committee couldn't include everything, and so a lot of those
<para>Portability notes and known implementation limitations are as follows.</para>
-<section><info><title>No <code>ios_base</code></title></info>
+<section xml:id="backwards.first.ios_base"><info><title>No <code>ios_base</code></title></info>
<para> At least some older implementations don't have <code>std::ios_base</code>, so you should use <code>std::ios::badbit</code>, <code>std::ios::failbit</code> and <code>std::ios::eofbit</code> and <code>std::ios::goodbit</code>.
</para>
</section>
-<section><info><title>No <code>cout</code> in <code>ostream.h</code>, no <code>cin</code> in <code>istream.h</code></title></info>
+<section xml:id="backwards.first.cout_cin"><info><title>No <code>cout</code> in <filename class="headerfile">&lt;ostream.h&gt;</filename>, no <code>cin</code> in <filename class="headerfile">&lt;istream.h&gt;</filename></title></info>
<para>
In earlier versions of the standard,
- <filename class="headerfile">fstream.h</filename>,
- <filename class="headerfile">ostream.h</filename>
- and <filename class="headerfile">istream.h</filename>
+ <filename class="headerfile">&lt;fstream.h&gt;</filename>,
+ <filename class="headerfile">&lt;ostream.h&gt;</filename>
+ and <filename class="headerfile">&lt;istream.h&gt;</filename>
used to define
<code>cout</code>, <code>cin</code> and so on. ISO C++ specifies that one needs to include
- <filename class="headerfile">iostream</filename>
+ <filename class="headerfile">&lt;iostream&gt;</filename>
explicitly to get the required definitions.
</para>
<para> Some include adjustment may be required.</para>
@@ -96,7 +96,7 @@ considered replaced and rewritten.
Portability notes and known implementation limitations are as follows.
</para>
-<section><info><title>Namespace <code>std::</code> not supported</title></info>
+<section xml:id="backwards.second.std"><info><title>Namespace <code>std::</code> not supported</title></info>
<para>
@@ -114,7 +114,7 @@ considered replaced and rewritten.
First, see if the compiler has a flag for this. Namespace
back-portability-issues are generally not a problem for g++
compilers that do not have libstdc++ in <code>std::</code>, as the
- compilers use <code>-fno-honor-std</code> (ignore
+ compilers use <option>-fno-honor-std</option> (ignore
<code>std::</code>, <code>:: = std::</code>) by default. That is,
the responsibility for enabling or disabling <code>std::</code> is
on the user; the maintainer does not have to care about it. This
@@ -182,7 +182,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</programlisting>
</section>
-<section><info><title>Illegal iterator usage</title></info>
+<section xml:id="backwards.second.iterators"><info><title>Illegal iterator usage</title></info>
<para>
The following illustrate implementation-allowed illegal iterator
@@ -212,12 +212,12 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</itemizedlist>
</section>
-<section><info><title><code>isspace</code> from <filename class="headerfile">cctype</filename> is a macro
+<section xml:id="backwards.second.isspace"><info><title><code>isspace</code> from <filename class="headerfile">&lt;cctype&gt;</filename> is a macro
</title></info>
<para>
- Glibc 2.0.x and 2.1.x define <filename class="headerfile">ctype.h</filename> functionality as macros
+ Glibc 2.0.x and 2.1.x define <filename class="headerfile">&lt;ctype.h&gt;</filename> functionality as macros
(isspace, isalpha etc.).
</para>
@@ -242,7 +242,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
<para>
A solution is to modify a header-file so that the compiler tells
- <filename class="headerfile">ctype.h</filename> to define functions
+ <filename class="headerfile">&lt;ctype.h&gt;</filename> to define functions
instead of macros:
</para>
@@ -254,20 +254,21 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
</programlisting>
<para>
- Then, include <filename class="headerfile">ctype.h</filename>
+ Then, include <filename class="headerfile">&lt;ctype.h&gt;</filename>
</para>
<para>
Another problem arises if you put a <code>using namespace
- std;</code> declaration at the top, and include <filename class="headerfile">ctype.h</filename>. This will result in
- ambiguities between the definitions in the global namespace
- (<filename class="headerfile">ctype.h</filename>) and the
+ std;</code> declaration at the top, and include
+ <filename class="headerfile">&lt;ctype.h&gt;</filename>. This will
+ result in ambiguities between the definitions in the global namespace
+ (<filename class="headerfile">&lt;ctype.h&gt;</filename>) and the
definitions in namespace <code>std::</code>
(<code>&lt;cctype&gt;</code>).
</para>
</section>
-<section><info><title>No <code>vector::at</code>, <code>deque::at</code>, <code>string::at</code></title></info>
+<section xml:id="backwards.second.at"><info><title>No <code>vector::at</code>, <code>deque::at</code>, <code>string::at</code></title></info>
<para>
@@ -304,7 +305,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</section>
-<section><info><title>No <code>std::char_traits&lt;char&gt;::eof</code></title></info>
+<section xml:id="backwards.second.eof"><info><title>No <code>std::char_traits&lt;char&gt;::eof</code></title></info>
<para>
@@ -321,7 +322,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</section>
-<section><info><title>No <code>string::clear</code></title></info>
+<section xml:id="backwards.second.stringclear"><info><title>No <code>string::clear</code></title></info>
<para>
@@ -351,7 +352,7 @@ erase(size_type __pos = 0, size_type __n = npos)
</para>
</section>
-<section><info><title>
+<section xml:id="backwards.second.ostreamform_istreamscan"><info><title>
Removal of <code>ostream::form</code> and <code>istream::scan</code>
extensions
</title></info>
@@ -362,14 +363,14 @@ erase(size_type __pos = 0, size_type __n = npos)
</para>
</section>
-<section><info><title>No <code>basic_stringbuf</code>, <code>basic_stringstream</code></title></info>
+<section xml:id="backwards.second.stringstreams"><info><title>No <code>basic_stringbuf</code>, <code>basic_stringstream</code></title></info>
<para>
Although the ISO standard <code>i/ostringstream</code>-classes are
- provided, (<filename class="headerfile">sstream</filename>), for
+ provided, (<filename class="headerfile">&lt;sstream&gt;</filename>), for
compatibility with older implementations the pre-ISO
- <code>i/ostrstream</code> (<filename class="headerfile">strstream</filename>) interface is also provided,
+ <code>i/ostrstream</code> (<filename class="headerfile">&lt;strstream&gt;</filename>) interface is also provided,
with these caveats:
</para>
@@ -490,7 +491,7 @@ particular <quote>info iostream</quote>.
</para>
</section>
-<section><info><title>Little or no wide character support</title></info>
+<section xml:id="backwards.second.wchar"><info><title>Little or no wide character support</title></info>
<para>
Classes <classname>wstring</classname> and
@@ -499,7 +500,7 @@ particular <quote>info iostream</quote>.
</para>
</section>
-<section><info><title>No templatized iostreams</title></info>
+<section xml:id="backwards.second.iostream_templates"><info><title>No templatized iostreams</title></info>
<para>
Classes <classname>wfilebuf</classname> and
@@ -507,7 +508,7 @@ particular <quote>info iostream</quote>.
</para>
</section>
-<section><info><title>Thread safety issues</title></info>
+<section xml:id="backwards.second.thread_safety"><info><title>Thread safety issues</title></info>
<para>
@@ -601,11 +602,12 @@ libstdc++-v3.
<para>Portability notes and known implementation limitations are as follows.</para>
-<section><info><title>Pre-ISO headers moved to backwards or removed</title></info>
+<section xml:id="backwards.third.headers"><info><title>Pre-ISO headers moved to backwards or removed</title></info>
<para> The pre-ISO C++ headers
- (<code>iostream.h</code>, <code>defalloc.h</code> etc.) are
+ (<filename class="headerfile">&lt;iostream.h&gt;</filename>,
+ <filename class="headerfile">&lt;defalloc.h&gt;</filename> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
</para>
@@ -681,28 +683,30 @@ AC_DEFUN([AC_HEADER_PRE_STDCXX], [
</programlisting>
<para>Porting between pre-ISO headers and ISO headers is simple: headers
-like <filename class="headerfile">vector.h</filename> can be replaced with <filename class="headerfile">vector</filename> and a using
+like <filename class="headerfile">&lt;vector.h&gt;</filename> can be replaced with <filename class="headerfile">&lt;vector&gt;</filename> and a using
directive <code>using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
</para>
</section>
-<section><info><title>Extension headers hash_map, hash_set moved to ext or backwards</title></info>
+<section xml:id="backwards.third.hash"><info><title>Extension headers hash_map, hash_set moved to ext or backwards</title></info>
<para>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
+ In particular, the <classname>unordered_map</classname> and
+ <classname>unordered_set</classname> containers of TR1 and C++ 2011
+ are suitable replacements for the non-standard
+ <classname>hash_map</classname> and <classname>hash_set</classname>
containers in the SGI STL.
</para>
-<para> Header files <filename class="headerfile">hash_map</filename> and <filename class="headerfile">hash_set</filename> moved
-to <filename class="headerfile">ext/hash_map</filename> and <filename class="headerfile">ext/hash_set</filename>,
+<para> Header files <filename class="headerfile">&lt;hash_map&gt;</filename> and <filename class="headerfile">&lt;hash_set&gt;</filename> moved
+to <filename class="headerfile">&lt;ext/hash_map&gt;</filename> and <filename class="headerfile">&lt;ext/hash_set&gt;</filename>,
respectively. At the same time, all types in these files are enclosed
-in <code>namespace __gnu_cxx</code>. Later versions move deprecate
-these files, and suggest using TR1's <filename class="headerfile">unordered_map</filename>
-and <filename class="headerfile">unordered_set</filename> instead.
+in <code>namespace __gnu_cxx</code>. Later versions deprecate
+these files, and suggest using TR1's <filename class="headerfile">&lt;unordered_map&gt;</filename>
+and <filename class="headerfile">&lt;unordered_set&gt;</filename> instead.
</para>
<para>The extensions are no longer in the global or <code>std</code>
@@ -778,7 +782,7 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
</programlisting>
</section>
-<section><info><title>No <code>ios::nocreate/ios::noreplace</code>.
+<section xml:id="backwards.third.nocreate_noreplace"><info><title>No <code>ios::nocreate/ios::noreplace</code>.
</title></info>
@@ -797,7 +801,7 @@ and <code>trunc</code> (except for <code>app</code> ?).
</para>
</section>
-<section><info><title>
+<section xml:id="backwards.third.streamattach"><info><title>
No <code>stream::attach(int fd)</code>
</title></info>
@@ -819,7 +823,7 @@ No <code>stream::attach(int fd)</code>
<para>
An extension is available that implements this.
- <filename class="headerfile">ext/stdio_filebuf.h</filename> contains a derived class called
+ <filename class="headerfile">&lt;ext/stdio_filebuf.h&gt;</filename> contains a derived class called
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></link>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
@@ -832,7 +836,7 @@ No <code>stream::attach(int fd)</code>
</para>
</section>
-<section><info><title>
+<section xml:id="backwards.third.support_cxx98"><info><title>
Support for C++98 dialect.
</title></info>
@@ -908,7 +912,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
</programlisting>
</section>
-<section><info><title>
+<section xml:id="backwards.third.support_tr1"><info><title>
Support for C++TR1 dialect.
</title></info>
@@ -1000,26 +1004,26 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
</section>
-<section><info><title>
-Support for C++0x dialect.
+<section xml:id="backwards.third.support_cxx11"><info><title>
+Support for C++11 dialect.
</title></info>
-<para>Check for baseline language coverage in the compiler for the C++0xstandard.
+<para>Check for baseline language coverage in the compiler for the C++11 standard.
</para>
<programlisting>
-# AC_COMPILE_STDCXX_OX
-AC_DEFUN([AC_COMPILE_STDCXX_0X], [
- AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
- ac_cv_cxx_compile_cxx0x_native,
+# AC_COMPILE_STDCXX_11
+AC_DEFUN([AC_COMPILE_STDCXX_11], [
+ AC_CACHE_CHECK(if g++ supports C++11 features without additional flags,
+ ac_cv_cxx_compile_cxx11_native,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -1028,23 +1032,25 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_native=yes, ac_cv_cxx_compile_cxx11_native=no)
AC_LANG_RESTORE
])
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
- ac_cv_cxx_compile_cxx0x_cxx,
+ AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++11,
+ ac_cv_cxx_compile_cxx11_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++0x"
+ CXXFLAGS="$CXXFLAGS -std=c++11"
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -1053,24 +1059,26 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
- ac_cv_cxx_compile_cxx0x_gxx,
+ AC_CACHE_CHECK(if g++ supports C++11 features with -std=gnu++11,
+ ac_cv_cxx_compile_cxx11_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([
template &lt;typename T&gt;
- struct check
+ struct check final
{
- static_assert(sizeof(int) &lt;= sizeof(T), "not big enough");
+ static constexpr T value{ __cplusplus };
};
typedef check&lt;check&lt;bool&gt;&gt; right_angle_brackets;
@@ -1079,35 +1087,39 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
decltype(a) b;
typedef check&lt;int&gt; check_type;
- check_type c;
- check_type&amp;&amp; cr = c;],,
- ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
+ check_type c{};
+ check_type&amp;&amp; cr = static_cast&lt;check_type&amp;&amp;&gt;(c);
+
+ static_assert(check_type::value == 201103L, "C++11 compiler");],,
+ ac_cv_cxx_compile_cxx11_gxx=yes, ac_cv_cxx_compile_cxx11_gxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
- if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
- AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
+ if test "$ac_cv_cxx_compile_cxx11_native" = yes ||
+ test "$ac_cv_cxx_compile_cxx11_cxx" = yes ||
+ test "$ac_cv_cxx_compile_cxx11_gxx" = yes; then
+ AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
fi
])
</programlisting>
-<para>Check for library coverage of the C++0xstandard.
+<para>Check for library coverage of the C++2011 standard.
+ (Some library headers are commented out in this check, they are
+ not currently provided by libstdc++).
</para>
<programlisting>
-# AC_HEADER_STDCXX_0X
-AC_DEFUN([AC_HEADER_STDCXX_0X], [
- AC_CACHE_CHECK(for ISO C++ 0x include files,
- ac_cv_cxx_stdcxx_0x,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+# AC_HEADER_STDCXX_11
+AC_DEFUN([AC_HEADER_STDCXX_11], [
+ AC_CACHE_CHECK(for ISO C++11 include files,
+ ac_cv_cxx_stdcxx_11,
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([
#include &lt;cassert&gt;
@@ -1123,6 +1135,7 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;cmath&gt;
#include &lt;csetjmp&gt;
#include &lt;csignal&gt;
+ #include &lt;cstdalign&gt;
#include &lt;cstdarg&gt;
#include &lt;cstdbool&gt;
#include &lt;cstddef&gt;
@@ -1132,21 +1145,29 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;cstring&gt;
#include &lt;ctgmath&gt;
#include &lt;ctime&gt;
+ // #include &lt;cuchar&gt;
#include &lt;cwchar&gt;
#include &lt;cwctype&gt;
#include &lt;algorithm&gt;
#include &lt;array&gt;
+ #include &lt;atomic&gt;
#include &lt;bitset&gt;
+ #include &lt;chrono&gt;
+ // #include &lt;codecvt&gt;
#include &lt;complex&gt;
+ #include &lt;condition_variable&gt;
#include &lt;deque&gt;
#include &lt;exception&gt;
+ #include &lt;forward_list&gt;
#include &lt;fstream&gt;
#include &lt;functional&gt;
+ #include &lt;future&gt;
#include &lt;iomanip&gt;
#include &lt;ios&gt;
#include &lt;iosfwd&gt;
#include &lt;iostream&gt;
+ #include &lt;initializer_list&gt;
#include &lt;istream&gt;
#include &lt;iterator&gt;
#include &lt;limits&gt;
@@ -1154,19 +1175,25 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;locale&gt;
#include &lt;map&gt;
#include &lt;memory&gt;
+ #include &lt;mutex&gt;
#include &lt;new&gt;
#include &lt;numeric&gt;
#include &lt;ostream&gt;
#include &lt;queue&gt;
#include &lt;random&gt;
+ #include &lt;ratio&gt;
#include &lt;regex&gt;
+ #include &lt;scoped_allocator&gt;
#include &lt;set&gt;
#include &lt;sstream&gt;
#include &lt;stack&gt;
#include &lt;stdexcept&gt;
#include &lt;streambuf&gt;
#include &lt;string&gt;
+ #include &lt;system_error&gt;
+ #include &lt;thread&gt;
#include &lt;tuple&gt;
+ #include &lt;typeindex&gt;
#include &lt;typeinfo&gt;
#include &lt;type_traits&gt;
#include &lt;unordered_map&gt;
@@ -1175,17 +1202,18 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
#include &lt;valarray&gt;
#include &lt;vector&gt;
],,
- ac_cv_cxx_stdcxx_0x=yes, ac_cv_cxx_stdcxx_0x=no)
+ ac_cv_cxx_stdcxx_11=yes, ac_cv_cxx_stdcxx_11=no)
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
])
- if test "$ac_cv_cxx_stdcxx_0x" = yes; then
- AC_DEFINE(STDCXX_0X_HEADERS,,[Define if ISO C++ 0x header files are present. ])
+ if test "$ac_cv_cxx_stdcxx_11" = yes; then
+ AC_DEFINE(STDCXX_11_HEADERS,,[Define if ISO C++11 header files are present. ])
fi
])
</programlisting>
-<para>As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For &lt;unordered_map&gt;
+<para>As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For
+<filename class="headerfile">&lt;unordered_map&gt;</filename>
</para>
<programlisting>
@@ -1193,11 +1221,11 @@ AC_DEFUN([AC_HEADER_STDCXX_0X], [
AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_CACHE_CHECK(for unordered_map,
ac_cv_cxx_unordered_map,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([#include &lt;unordered_map&gt;], [using std::unordered_map;],
ac_cv_cxx_unordered_map=yes, ac_cv_cxx_unordered_map=no)
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -1214,11 +1242,11 @@ AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_CACHE_CHECK(for unordered_set,
ac_cv_cxx_unordered_set,
- [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ [AC_REQUIRE([AC_COMPILE_STDCXX_11])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
AC_TRY_COMPILE([#include &lt;unordered_set&gt;], [using std::unordered_set;],
ac_cv_cxx_unordered_set=yes, ac_cv_cxx_unordered_set=no)
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -1229,15 +1257,26 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
fi
])
</programlisting>
+
+<para>
+ Some C++11 features first appeared in GCC 4.3 and could be enabled by
+ <option>-std=c++0x</option> and <option>-std=gnu++0x</option> for GCC
+ releases which pre-date the 2011 standard. Those C++11 features and GCC's
+ support for them were still changing until the 2011 standard was finished,
+ but the autoconf checks above could be extended to test for incomplete
+ C++11 support with <option>-std=c++0x</option> and
+ <option>-std=gnu++0x</option>.
+</para>
+
</section>
-<section><info><title>
- Container::iterator_type is not necessarily Container::value_type*
+<section xml:id="backwards.third.iterator_type"><info><title>
+ <code>Container::iterator_type</code> is not necessarily <code>Container::value_type*</code>
</title></info>
<para>
- This is a change in behavior from the previous version. Now, most
+ This is a change in behavior from older versions. Now, most
<type>iterator_type</type> typedefs in container classes are POD
objects, not <type>value_type</type> pointers.
</para>
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index 6b1efa8006e..5d893d7a1be 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -172,7 +172,7 @@
<listitem><para>Enables link-type checks for the availability of the
clock_gettime clocks, used in the implementation of [time.clock],
and of the nanosleep and sched_yield functions, used in the
- implementation of [thread.thread.this] of the current C++0x draft.
+ implementation of [thread.thread.this] of the 2011 ISO C++ standard.
The choice OPTION=yes checks for the availability of the facilities
in libc and libposix4. In case of need the latter is also linked
to libstdc++ as part of the build process. OPTION=rt also searches
diff --git a/libstdc++-v3/doc/xml/manual/debug_mode.xml b/libstdc++-v3/doc/xml/manual/debug_mode.xml
index c58bde34065..89b2c31b811 100644
--- a/libstdc++-v3/doc/xml/manual/debug_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/debug_mode.xml
@@ -267,12 +267,12 @@ which always works correctly.
</tgroup>
</table>
-<para>In addition, when compiling in C++0x mode, these additional
+<para>In addition, when compiling in C++11 mode, these additional
containers have additional debug capability.
</para>
<table frame="all">
-<title>Debugging Containers C++0x</title>
+<title>Debugging Containers C++11</title>
<tgroup cols="4" align="left" colsep="1" rowsep="1">
<colspec colname="c1"/>
@@ -588,7 +588,7 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
<para>Achieving link- and run-time coexistence is not a trivial
implementation task. To achieve this goal we required a small
- extension to the GNU C++ compiler (since incorporated into the C++0x language specification, described in the GCC Manual for the C++ language as
+ extension to the GNU C++ compiler (since incorporated into the C++11 language specification, described in the GCC Manual for the C++ language as
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html#Namespace-Association">namespace
association</link>), and a complex organization of debug- and
release-modes. The end result is that we have achieved per-use
@@ -630,7 +630,7 @@ namespace std
defined in the namespace <code>__cxx1998</code>) and also the
debug-mode container. The debug-mode container is defined within the
namespace <code>__debug</code>, which is associated with namespace
-<code>std</code> via the C++0x namespace association language feature. This
+<code>std</code> via the C++11 namespace association language feature. This
method allows the debug and release versions of the same component to
coexist at compile-time and link-time without causing an unreasonable
maintenance burden, while minimizing confusion. Again, this boils down
diff --git a/libstdc++-v3/doc/xml/manual/diagnostics.xml b/libstdc++-v3/doc/xml/manual/diagnostics.xml
index 1a6a3f17dc2..fd21442b992 100644
--- a/libstdc++-v3/doc/xml/manual/diagnostics.xml
+++ b/libstdc++-v3/doc/xml/manual/diagnostics.xml
@@ -117,7 +117,7 @@
<para>
Please note that the checks are based on the requirements in the original
- C++ standard, some of which have changed in the upcoming C++0x revision.
+ C++ standard, some of which have changed in the new C++11 revision.
Additionally, some correct code might be rejected by the concept checks,
for example template argument types may need to be complete when used in
a template definition, rather than at the point of instantiation.
diff --git a/libstdc++-v3/doc/xml/manual/evolution.xml b/libstdc++-v3/doc/xml/manual/evolution.xml
index 08876deb18a..145c11f28cc 100644
--- a/libstdc++-v3/doc/xml/manual/evolution.xml
+++ b/libstdc++-v3/doc/xml/manual/evolution.xml
@@ -399,7 +399,7 @@ Backward include edit.
</para>
</listitem>
<listitem>
- <para>Added in C++0x</para>
+ <para>Added in C++11</para>
<para>
<filename class="headerfile">auto_ptr.h</filename> and <filename class="headerfile">binders.h</filename>
</para>
diff --git a/libstdc++-v3/doc/xml/manual/extensions.xml b/libstdc++-v3/doc/xml/manual/extensions.xml
index fb2f5ca83e8..9932a020dd9 100644
--- a/libstdc++-v3/doc/xml/manual/extensions.xml
+++ b/libstdc++-v3/doc/xml/manual/extensions.xml
@@ -201,7 +201,7 @@ extensions, be aware of two things:
The SGI hashing classes <classname>hash_set</classname> and
<classname>hash_set</classname> have been deprecated by the
unordered_set, unordered_multiset, unordered_map,
- unordered_multimap containers in TR1 and the upcoming C++0x, and
+ unordered_multimap containers in TR1 and C++11, and
may be removed in future releases.
</para>
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index 36e07b4370f..7621de9c2b1 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -29,8 +29,8 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx1998.xml">
</xi:include>
- <!-- Section 01.2 : Status C++ 200x -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx200x.xml">
+ <!-- Section 01.2 : Status C++ 2011 -->
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx2011.xml">
</xi:include>
<!-- Section 01.3 : Status C++ TR1 -->
@@ -577,7 +577,7 @@ requirements of the license of GCC.
<emphasis>std::complex over-encapsulated</emphasis>
</term>
<listitem><para>Add the <code>real(T)</code> and <code>imag(T)</code>
- members; in C++0x mode, also adjust the existing
+ members; in C++11 mode, also adjust the existing
<code>real()</code> and <code>imag()</code> members and
free functions.
</para></listitem></varlistentry>
@@ -709,7 +709,7 @@ requirements of the license of GCC.
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#550">550</link>:
<emphasis>What should the return type of pow(float,int) be?</emphasis>
</term>
- <listitem><para>In C++0x mode, remove the pow(float,int), etc., signatures.
+ <listitem><para>In C++11 mode, remove the pow(float,int), etc., signatures.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#586">586</link>:
@@ -739,7 +739,7 @@ requirements of the license of GCC.
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#691">691</link>:
<emphasis>const_local_iterator cbegin, cend missing from TR1</emphasis>
</term>
- <listitem><para>In C++0x mode add cbegin(size_type) and cend(size_type)
+ <listitem><para>In C++11 mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
</para></listitem></varlistentry>
@@ -764,7 +764,7 @@ requirements of the license of GCC.
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#761">761</link>:
<emphasis>unordered_map needs an at() member function</emphasis>
</term>
- <listitem><para>In C++0x mode, add at() and at() const.
+ <listitem><para>In C++11 mode, add at() and at() const.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#775">775</link>:
@@ -776,13 +776,13 @@ requirements of the license of GCC.
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#776">776</link>:
<emphasis>Undescribed assign function of std::array</emphasis>
</term>
- <listitem><para>In C++0x mode, remove assign, add fill.
+ <listitem><para>In C++11 mode, remove assign, add fill.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#781">781</link>:
<emphasis>std::complex should add missing C99 functions</emphasis>
</term>
- <listitem><para>In C++0x mode, add std::proj.
+ <listitem><para>In C++11 mode, add std::proj.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#809">809</link>:
@@ -794,7 +794,7 @@ requirements of the license of GCC.
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#844">844</link>:
<emphasis>complex pow return type is ambiguous</emphasis>
</term>
- <listitem><para>In C++0x mode, remove the pow(complex&lt;T&gt;, int) signature.
+ <listitem><para>In C++11 mode, remove the pow(complex&lt;T&gt;, int) signature.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#853">853</link>:
diff --git a/libstdc++-v3/doc/xml/manual/policy_data_structures.xml b/libstdc++-v3/doc/xml/manual/policy_data_structures.xml
index 4ecb933a0e5..11fad5e018d 100644
--- a/libstdc++-v3/doc/xml/manual/policy_data_structures.xml
+++ b/libstdc++-v3/doc/xml/manual/policy_data_structures.xml
@@ -1365,7 +1365,7 @@
<classname>__gnu_pbds::cc_hash_table</classname> instead of
<classname>std::unordered_map</classname>, since <quote>unordered
map</quote> does not necessarily mean a hash-based map as implied by
- the C++ library (C++0x or TR1). For example, list-based associative
+ the C++ library (C++11 or TR1). For example, list-based associative
containers, which are very useful for the construction of
"multimaps," are also unordered.
</para>
diff --git a/libstdc++-v3/doc/xml/manual/shared_ptr.xml b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
index 78cc8c4ba83..6e3392f88ee 100644
--- a/libstdc++-v3/doc/xml/manual/shared_ptr.xml
+++ b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
@@ -33,14 +33,6 @@ and implements shared ownership semantics.
</para>
<para>
- At the time of writing the C++0x working paper doesn't mention how
- threads affect shared_ptr, but it is likely to follow the existing
- practice set by <classname>boost::shared_ptr</classname>. The
- shared_ptr in libstdc++ is derived from Boost's, so the same rules
- apply.
- </para>
-
- <para>
</para>
</section>
@@ -163,10 +155,10 @@ that simplifies the implementation slightly.
<para>
-C++0x-only features are: rvalue-ref/move support, allocator support,
+C++11-only features are: rvalue-ref/move support, allocator support,
aliasing constructor, make_shared &amp; allocate_shared. Additionally,
the constructors taking <classname>auto_ptr</classname> parameters are
-deprecated in C++0x mode.
+deprecated in C++11 mode.
</para>
<para>
@@ -293,20 +285,20 @@ used when libstdc++ is built without <literal>--enable-threads</literal>.
</para>
</section>
- <section><info><title>Dual C++0x and TR1 Implementation</title></info>
+ <section><info><title>Dual C++11 and TR1 Implementation</title></info>
<para>
-The interface of <classname>tr1::shared_ptr</classname> was extended for C++0x
+The interface of <classname>tr1::shared_ptr</classname> was extended for C++11
with support for rvalue-references and the other features from N2351.
The <classname>_Sp_counted_base</classname> base class is implemented in
<filename>tr1/boost_sp_shared_count.h</filename> and is common to the TR1
-and C++0x versions of <classname>shared_ptr</classname>.
+and C++11 versions of <classname>shared_ptr</classname>.
</para>
<para>
The classes derived from <classname>_Sp_counted_base</classname> (see Class Hierarchy
-above) and <classname>__shared_count</classname> are implemented separately for C++0x
+above) and <classname>__shared_count</classname> are implemented separately for C++11
and TR1, in <filename>bits/shared_ptr.h</filename> and
<filename>tr1/shared_ptr.h</filename> respectively.
</para>
@@ -314,9 +306,9 @@ and TR1, in <filename>bits/shared_ptr.h</filename> and
<para>
The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
-C++0x and TR1 modes needs to diverge further then it might be necessary to
+C++11 and TR1 versions needs to diverge further then it might be necessary to
duplicate <classname>_Sp_counted_base</classname> and only make changes to
-the C++0x version.
+the C++11 version.
</para>
</section>
@@ -332,9 +324,9 @@ the C++0x version.
<para>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
-in C++0x mode, so in TR1 mode these casts rely on three non-standard
+in C++11 mode, so in TR1 mode these casts rely on three non-standard
constructors in shared_ptr and __shared_ptr.
-In C++0x mode these constructors and the related tag types are not needed.
+In C++11 mode these constructors and the related tag types are not needed.
</para>
</listitem>
</varlistentry>
@@ -431,7 +423,7 @@ the following types, depending on how the shared_ptr is constructed.
<para>
The <emphasis><classname>shared_ptr</classname> atomic access</emphasis>
- clause in the C++0x working draft is not implemented in GCC.
+ clause in the C++11 standard is not implemented in GCC.
</para>
<para>
@@ -445,7 +437,7 @@ the following types, depending on how the shared_ptr is constructed.
<para>
Unlike Boost, this implementation does not use separate classes
for the pointer+deleter and pointer+deleter+allocator cases in
- C++0x mode, combining both into _Sp_counted_deleter and using
+ C++11 mode, combining both into _Sp_counted_deleter and using
<classname>allocator</classname> when the user doesn't specify
an allocator. If it was found to be beneficial an additional
class could easily be added. With the current implementation,
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
index 3922dff8307..2715b2a77ab 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
@@ -1,14 +1,14 @@
<section xmlns="http://docbook.org/ns/docbook" version="5.0"
- xml:id="status.iso.200x" xreflabel="Status C++ 200x">
-<?dbhtml filename="status_iso_cxx200x.html"?>
+ xml:id="status.iso.2011" xreflabel="Status C++ 2011">
+<?dbhtml filename="status_iso_cxx2011.html"?>
-<info><title>C++ 200x</title>
+<info><title>C++ 2011</title>
<keywordset>
<keyword>
ISO C++
</keyword>
<keyword>
- 200x
+ 2011
</keyword>
</keywordset>
</info>
@@ -20,8 +20,8 @@ Final Draft International Standard, Standard for Programming Language C++
</para>
<para>
-In this implementation <literal>-std=gnu++0x</literal> or
-<literal>-std=c++0x</literal> flags must be used to enable language
+In this implementation <literal>-std=gnu++11</literal> or
+<literal>-std=c++11</literal> flags must be used to enable language
and library
features. See <link linkend="manual.intro.using.flags">dialect</link>
options. The pre-defined symbol
@@ -30,7 +30,7 @@ presence of the required flag.
</para>
<para>
-This page describes the C++0x support in mainline GCC SVN, not in any
+This page describes the C++11 support in mainline GCC SVN, not in any
particular release.
</para>
@@ -44,7 +44,7 @@ particular release.
<?dbhtml bgcolor="#B0B0B0" ?>
-->
<table frame="all">
-<title>C++ 200x Implementation Status</title>
+<title>C++ 2011 Implementation Status</title>
<tgroup cols="4" align="left" colsep="0" rowsep="1">
<colspec colname="c1"/>
@@ -1122,10 +1122,11 @@ particular release.
<entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>21.4</entry>
<entry>Class template <code>basic_string</code></entry>
- <entry>Y</entry>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing pop_back</entry>
</row>
<row>
<entry>21.5</entry>
@@ -1140,10 +1141,13 @@ particular release.
<entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>21.7</entry>
<entry>Null-terminated sequence utilities</entry>
- <entry>Y</entry>
- <entry>C library dependency</entry>
+ <entry>Partial</entry>
+ <entry>C library dependency.
+ Missing <filename class="headerfile">&lt;cuchar&gt;</filename>
+ </entry>
</row>
<row>
<entry>
@@ -1387,16 +1391,18 @@ particular release.
<entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>23.2.4</entry>
<entry>Associative containers</entry>
- <entry>Y</entry>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing emplace members</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>23.2.5</entry>
<entry>Unordered associative containers</entry>
- <entry>Y</entry>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing emplace members</entry>
</row>
<row>
<entry>23.3</entry>
diff --git a/libstdc++-v3/doc/xml/manual/strings.xml b/libstdc++-v3/doc/xml/manual/strings.xml
index 4d9fc64f766..1387189ece4 100644
--- a/libstdc++-v3/doc/xml/manual/strings.xml
+++ b/libstdc++-v3/doc/xml/manual/strings.xml
@@ -359,7 +359,7 @@ stringtok(Container &amp;container, string const &amp;in,
entry</link>) but the regular copy constructor cannot be used
because libstdc++'s <code>string</code> is Copy-On-Write.
</para>
- <para>In <link linkend="status.iso.200x">C++0x</link> mode you can call
+ <para>In <link linkend="status.iso.2011">C++11</link> mode you can call
<code>s.shrink_to_fit()</code> to achieve the same effect as
<code>s.reserve(s.size())</code>.
</para>
diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml
index 006ff332086..88bf14dffef 100644
--- a/libstdc++-v3/doc/xml/manual/test.xml
+++ b/libstdc++-v3/doc/xml/manual/test.xml
@@ -609,10 +609,10 @@ Example 1: Testing compilation only
// { dg-do compile }
Example 2: Testing for expected warnings on line 36, which all targets fail
-// { dg-warning "string literals" "" { xfail *-*-* } 36
+// { dg-warning "string literals" "" { xfail *-*-* } 36 }
Example 3: Testing for expected warnings on line 36
-// { dg-warning "string literals" "" { target *-*-* } 36
+// { dg-warning "string literals" "" { target *-*-* } 36 }
Example 4: Testing for compilation errors on line 41
// { dg-do compile }
@@ -896,7 +896,7 @@ as the allocator type.
<listitem>
<para>
- C++0x Container Requirements.
+ C++11 Container Requirements.
</para>
<para>
@@ -924,7 +924,7 @@ as the allocator type.
<section xml:id="test.exception.safety.containers"><info><title>
-C++0x Requirements Test Sequence Descriptions
+C++11 Requirements Test Sequence Descriptions
</title></info>
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 49541165868..f081ed4bc44 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -8,7 +8,7 @@
<para>
The set of features available in the GNU C++ library is shaped
by
- several <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Invoking-GCC.html">GCC
+ several <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html">GCC
Command Options</link>. Options that impact libstdc++ are
enumerated and detailed in the table below.
</para>
@@ -43,12 +43,12 @@
</row>
<row>
- <entry><literal>-std=c++0x</literal></entry>
- <entry>Use the working draft of the upcoming ISO C++0x standard.</entry>
+ <entry><literal>-std=c++11</literal></entry>
+ <entry>Use the 2011 ISO C++ standard.</entry>
</row>
<row>
- <entry><literal>-std=gnu++0x</literal></entry>
+ <entry><literal>-std=gnu++11</literal></entry>
<entry>As directly above, with GNU extensions.</entry>
</row>
@@ -64,7 +64,7 @@
<row>
<entry><literal>-pthread</literal> or <literal>-pthreads</literal></entry>
- <entry>For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
+ <entry>For ISO C++11 &lt;thread&gt;, &lt;future&gt;,
&lt;mutex&gt;, or &lt;condition_variable&gt;.</entry>
</row>
@@ -108,8 +108,7 @@
<para>
Two dialects of standard headers are supported, corresponding to
- the 1998 standard as updated for 2003, and the draft of the
- upcoming 200x standard.
+ the 1998 standard as updated for 2003, and the current 2011 standard.
</para>
<para>
@@ -218,13 +217,13 @@
</table>
<para>
-C++0x include files. These are only available in C++0x compilation
-mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
+C++11 include files. These are only available in C++11 compilation
+mode, i.e. <literal>-std=c++11</literal> or <literal>-std=gnu++11</literal>.
</para>
<para/>
<table frame="all">
-<title>C++ 200x Library Headers</title>
+<title>C++ 2011 Library Headers</title>
<tgroup cols="5" align="left" colsep="1" rowsep="1">
<colspec colname="c1"/>
@@ -310,7 +309,7 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
<para/>
<table frame="all">
-<title>C++ 200x Library Headers for C Library Facilities</title>
+<title>C++ 2011 Library Headers for C Library Facilities</title>
<tgroup cols="5" align="left" colsep="1" rowsep="1">
<colspec colname="c1"/>
@@ -632,22 +631,22 @@ possible. It's an all-or-nothing affair. Thus, code like
#include &lt;functional&gt;
</programlisting>
-<para>Implies C++0x mode. To use the entities in &lt;array&gt;, the C++0x
-compilation mode must be used, which implies the C++0x functionality
+<para>Implies C++11 mode. To use the entities in &lt;array&gt;, the C++11
+compilation mode must be used, which implies the C++11 functionality
(and deprecations) in &lt;functional&gt; will be present.
</para>
<para>Second, the other headers can be included with either dialect of
-the standard headers, although features and types specific to C++0x
-are still only enabled when in C++0x compilation mode. So, to use
+the standard headers, although features and types specific to C++11
+are still only enabled when in C++11 compilation mode. So, to use
rvalue references with <code>__gnu_cxx::vstring</code>, or to use the
debug-mode versions of <code>std::unordered_map</code>, one must use
-the <code>std=gnu++0x</code> compiler flag. (Or <code>std=c++0x</code>, of course.)
+the <code>std=gnu++11</code> compiler flag. (Or <code>std=c++11</code>, of course.)
</para>
-<para>A special case of the second rule is the mixing of TR1 and C++0x
+<para>A special case of the second rule is the mixing of TR1 and C++11
facilities. It is possible (although not especially prudent) to
-include both the TR1 version and the C++0x version of header in the
+include both the TR1 version and the C++11 version of header in the
same translation unit:
</para>
@@ -656,7 +655,7 @@ same translation unit:
#include &lt;type_traits&gt;
</programlisting>
-<para> Several parts of C++0x diverge quite substantially from TR1 predecessors.
+<para> Several parts of C++11 diverge quite substantially from TR1 predecessors.
</para>
</section>
@@ -841,7 +840,7 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
removes older ARM-style iostreams code, and other anachronisms
from the API. This macro is dependent on the version of the
standard being tracked, and as a result may give different results for
- <code>-std=c++98</code> and <code>-std=c++0x</code>. This may
+ <code>-std=c++98</code> and <code>-std=c++11</code>. This may
be useful in updating old C++ code which no longer meet the
requirements of the language, or for checking current code
against new language standards.
@@ -1093,7 +1092,7 @@ namespace gtk
<para>
In the
- C++0x <link linkend="manual.intro.using.flags">dialect</link> add
+ C++11 <link linkend="manual.intro.using.flags">dialect</link> add
</para>
<itemizedlist>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 74acbf0c88a..121a6427ec2 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -83,8 +83,6 @@ bits_headers = \
${bits_srcdir}/alloc_traits.h \
${bits_srcdir}/allocator.h \
${bits_srcdir}/atomic_base.h \
- ${bits_srcdir}/atomic_0.h \
- ${bits_srcdir}/atomic_2.h \
${bits_srcdir}/basic_ios.h \
${bits_srcdir}/basic_ios.tcc \
${bits_srcdir}/basic_string.h \
@@ -636,6 +634,7 @@ c_base_headers = \
${c_base_srcdir}/cmath \
${c_base_srcdir}/csetjmp \
${c_base_srcdir}/csignal \
+ ${c_base_srcdir}/cstdalign \
${c_base_srcdir}/cstdarg \
${c_base_srcdir}/cstdbool \
${c_base_srcdir}/cstddef \
@@ -855,7 +854,6 @@ thread_host_headers = \
${host_builddir}/gthr.h \
${host_builddir}/gthr-single.h \
${host_builddir}/gthr-posix.h \
- ${host_builddir}/gthr-tpf.h \
${host_builddir}/gthr-default.h
@@ -1122,43 +1120,35 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
# Host includes for threads
uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
+${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
sed -e '/^#pragma/b' \
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/gthr.h > $@
+ < $< > $@
-${host_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
+${host_builddir}/gthr-single.h: ${toplevel_srcdir}/libgcc/gthr-single.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-single.h > $@
+ < $< > $@
-${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
+${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/libgcc/gthr-posix.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
+ < $< > $@
-${host_builddir}/gthr-tpf.h: ${toplevel_srcdir}/gcc/gthr-tpf.h \
- stamp-${host_alias}
- sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
- -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
- -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-tpf.h > $@
-
-${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
+${host_builddir}/gthr-default.h: ${toplevel_builddir}/libgcc/gthr-default.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
+ < $< > $@
# Build two precompiled C++ includes, stdc++.h.gch/*.gch
${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 8b805ba9acb..70c0781d513 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -213,7 +213,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -253,6 +252,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
@@ -335,8 +335,6 @@ bits_headers = \
${bits_srcdir}/alloc_traits.h \
${bits_srcdir}/allocator.h \
${bits_srcdir}/atomic_base.h \
- ${bits_srcdir}/atomic_0.h \
- ${bits_srcdir}/atomic_2.h \
${bits_srcdir}/basic_ios.h \
${bits_srcdir}/basic_ios.tcc \
${bits_srcdir}/basic_string.h \
@@ -887,6 +885,7 @@ c_base_headers = \
${c_base_srcdir}/cmath \
${c_base_srcdir}/csetjmp \
${c_base_srcdir}/csignal \
+ ${c_base_srcdir}/cstdalign \
${c_base_srcdir}/cstdarg \
${c_base_srcdir}/cstdbool \
${c_base_srcdir}/cstddef \
@@ -1099,7 +1098,6 @@ thread_host_headers = \
${host_builddir}/gthr.h \
${host_builddir}/gthr-single.h \
${host_builddir}/gthr-posix.h \
- ${host_builddir}/gthr-tpf.h \
${host_builddir}/gthr-default.h
pch1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h
@@ -1510,43 +1508,35 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
echo "" >> $@ ;\
echo "#endif // _GLIBCXX_CXX_CONFIG_H" >> $@
-${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
+${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
sed -e '/^#pragma/b' \
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/gthr.h > $@
+ < $< > $@
-${host_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
+${host_builddir}/gthr-single.h: ${toplevel_srcdir}/libgcc/gthr-single.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-single.h > $@
+ < $< > $@
-${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
+${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/libgcc/gthr-posix.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
+ < $< > $@
-${host_builddir}/gthr-tpf.h: ${toplevel_srcdir}/gcc/gthr-tpf.h \
- stamp-${host_alias}
- sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
- -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
- -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-tpf.h > $@
-
-${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
+${host_builddir}/gthr-default.h: ${toplevel_builddir}/libgcc/gthr-default.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
+ < $< > $@
# Build two precompiled C++ includes, stdc++.h.gch/*.gch
${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
diff --git a/libstdc++-v3/include/backward/hashtable.h b/libstdc++-v3/include/backward/hashtable.h
index 91b0c602cec..dbba097d130 100644
--- a/libstdc++-v3/include/backward/hashtable.h
+++ b/libstdc++-v3/include/backward/hashtable.h
@@ -209,7 +209,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Note: assumes long is at least 32 bits.
enum { _S_num_primes = 29 };
- static const unsigned long __stl_prime_list[_S_num_primes] =
+ template<typename _PrimeType>
+ struct _Hashtable_prime_list
+ {
+ static const _PrimeType __stl_prime_list[_S_num_primes];
+
+ static const _PrimeType*
+ _S_get_prime_list();
+ };
+
+ template<typename _PrimeType> const _PrimeType
+ _Hashtable_prime_list<_PrimeType>::__stl_prime_list[_S_num_primes] =
{
5ul, 53ul, 97ul, 193ul, 389ul,
769ul, 1543ul, 3079ul, 6151ul, 12289ul,
@@ -219,11 +229,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
805306457ul, 1610612741ul, 3221225473ul, 4294967291ul
};
+ template<class _PrimeType> inline const _PrimeType*
+ _Hashtable_prime_list<_PrimeType>::_S_get_prime_list()
+ {
+ return __stl_prime_list;
+ }
+
inline unsigned long
__stl_next_prime(unsigned long __n)
{
- const unsigned long* __first = __stl_prime_list;
- const unsigned long* __last = __stl_prime_list + (int)_S_num_primes;
+ const unsigned long* __first = _Hashtable_prime_list<unsigned long>::_S_get_prime_list();
+ const unsigned long* __last = __first + (int)_S_num_primes;
const unsigned long* pos = std::lower_bound(__first, __last, __n);
return pos == __last ? *(__last - 1) : *pos;
}
@@ -417,7 +433,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
size_type
max_bucket_count() const
- { return __stl_prime_list[(int)_S_num_primes - 1]; }
+ { return _Hashtable_prime_list<unsigned long>::
+ _S_get_prime_list()[(int)_S_num_primes - 1];
+ }
size_type
elems_in_bucket(size_type __bucket) const
diff --git a/libstdc++-v3/include/bits/atomic_0.h b/libstdc++-v3/include/bits/atomic_0.h
deleted file mode 100644
index 4f8b0929f16..00000000000
--- a/libstdc++-v3/include/bits/atomic_0.h
+++ /dev/null
@@ -1,677 +0,0 @@
-// -*- C++ -*- header.
-
-// Copyright (C) 2008, 2009, 2010, 2011
-// 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/atomic_0.h
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{atomic}
- */
-
-#ifndef _GLIBCXX_ATOMIC_0_H
-#define _GLIBCXX_ATOMIC_0_H 1
-
-#pragma GCC system_header
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-// 0 == __atomic0 == Never lock-free
-namespace __atomic0
-{
- _GLIBCXX_BEGIN_EXTERN_C
-
- void
- atomic_flag_clear_explicit(__atomic_flag_base*, memory_order)
- _GLIBCXX_NOTHROW;
-
- void
- __atomic_flag_wait_explicit(__atomic_flag_base*, memory_order)
- _GLIBCXX_NOTHROW;
-
- _GLIBCXX_CONST __atomic_flag_base*
- __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW;
-
- _GLIBCXX_END_EXTERN_C
-
- // Implementation specific defines.
-#define _ATOMIC_MEMBER_ _M_i
-
- // Implementation specific defines.
-#define _ATOMIC_LOAD_(__a, __x) \
- ({typedef __typeof__(_ATOMIC_MEMBER_) __i_type; \
- __i_type* __p = &_ATOMIC_MEMBER_; \
- __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
- __atomic_flag_wait_explicit(__g, __x); \
- __i_type __r = *__p; \
- atomic_flag_clear_explicit(__g, __x); \
- __r; })
-
-#define _ATOMIC_STORE_(__a, __n, __x) \
- ({typedef __typeof__(_ATOMIC_MEMBER_) __i_type; \
- __i_type* __p = &_ATOMIC_MEMBER_; \
- __typeof__(__n) __w = (__n); \
- __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
- __atomic_flag_wait_explicit(__g, __x); \
- *__p = __w; \
- atomic_flag_clear_explicit(__g, __x); \
- __w; })
-
-#define _ATOMIC_MODIFY_(__a, __o, __n, __x) \
- ({typedef __typeof__(_ATOMIC_MEMBER_) __i_type; \
- __i_type* __p = &_ATOMIC_MEMBER_; \
- __typeof__(__n) __w = (__n); \
- __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
- __atomic_flag_wait_explicit(__g, __x); \
- __i_type __r = *__p; \
- *__p __o __w; \
- atomic_flag_clear_explicit(__g, __x); \
- __r; })
-
-#define _ATOMIC_CMPEXCHNG_(__a, __e, __n, __x) \
- ({typedef __typeof__(_ATOMIC_MEMBER_) __i_type; \
- __i_type* __p = &_ATOMIC_MEMBER_; \
- __typeof__(__e) __q = (__e); \
- __typeof__(__n) __w = (__n); \
- bool __r; \
- __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
- __atomic_flag_wait_explicit(__g, __x); \
- __i_type __t = *__p; \
- if (*__q == __t) \
- { \
- *__p = (__i_type)__w; \
- __r = true; \
- } \
- else { *__q = __t; __r = false; } \
- atomic_flag_clear_explicit(__g, __x); \
- __r; })
-
-
- /// atomic_flag
- struct atomic_flag : public __atomic_flag_base
- {
- atomic_flag() noexcept = default;
- ~atomic_flag() noexcept = default;
- atomic_flag(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) volatile = delete;
-
- // Conversion to ATOMIC_FLAG_INIT.
- atomic_flag(bool __i) noexcept : __atomic_flag_base({ __i }) { }
-
- bool
- test_and_set(memory_order __m = memory_order_seq_cst) noexcept;
-
- bool
- test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept;
-
- void
- clear(memory_order __m = memory_order_seq_cst) noexcept;
-
- void
- clear(memory_order __m = memory_order_seq_cst) volatile noexcept;
- };
-
-
- /// Base class for atomic integrals.
- //
- // For each of the integral types, define atomic_[integral type] struct
- //
- // atomic_bool bool
- // atomic_char char
- // atomic_schar signed char
- // atomic_uchar unsigned char
- // atomic_short short
- // atomic_ushort unsigned short
- // atomic_int int
- // atomic_uint unsigned int
- // atomic_long long
- // atomic_ulong unsigned long
- // atomic_llong long long
- // atomic_ullong unsigned long long
- // atomic_char16_t char16_t
- // atomic_char32_t char32_t
- // atomic_wchar_t wchar_t
-
- // Base type.
- // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or 8 bytes,
- // since that is what GCC built-in functions for atomic memory access work on.
- template<typename _ITp>
- struct __atomic_base
- {
- private:
- typedef _ITp __int_type;
-
- __int_type _M_i;
-
- public:
- __atomic_base() noexcept = default;
- ~__atomic_base() noexcept = default;
- __atomic_base(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) volatile = delete;
-
- // Requires __int_type convertible to _M_base._M_i.
- constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
-
- operator __int_type() const noexcept
- { return load(); }
-
- operator __int_type() const volatile noexcept
- { return load(); }
-
- __int_type
- operator=(__int_type __i) noexcept
- {
- store(__i);
- return __i;
- }
-
- __int_type
- operator=(__int_type __i) volatile noexcept
- {
- store(__i);
- return __i;
- }
-
- __int_type
- operator++(int) noexcept
- { return fetch_add(1); }
-
- __int_type
- operator++(int) volatile noexcept
- { return fetch_add(1); }
-
- __int_type
- operator--(int) noexcept
- { return fetch_sub(1); }
-
- __int_type
- operator--(int) volatile noexcept
- { return fetch_sub(1); }
-
- __int_type
- operator++() noexcept
- { return fetch_add(1) + 1; }
-
- __int_type
- operator++() volatile noexcept
- { return fetch_add(1) + 1; }
-
- __int_type
- operator--() noexcept
- { return fetch_sub(1) - 1; }
-
- __int_type
- operator--() volatile noexcept
- { return fetch_sub(1) - 1; }
-
- __int_type
- operator+=(__int_type __i) noexcept
- { return fetch_add(__i) + __i; }
-
- __int_type
- operator+=(__int_type __i) volatile noexcept
- { return fetch_add(__i) + __i; }
-
- __int_type
- operator-=(__int_type __i) noexcept
- { return fetch_sub(__i) - __i; }
-
- __int_type
- operator-=(__int_type __i) volatile noexcept
- { return fetch_sub(__i) - __i; }
-
- __int_type
- operator&=(__int_type __i) noexcept
- { return fetch_and(__i) & __i; }
-
- __int_type
- operator&=(__int_type __i) volatile noexcept
- { return fetch_and(__i) & __i; }
-
- __int_type
- operator|=(__int_type __i) noexcept
- { return fetch_or(__i) | __i; }
-
- __int_type
- operator|=(__int_type __i) volatile noexcept
- { return fetch_or(__i) | __i; }
-
- __int_type
- operator^=(__int_type __i) noexcept
- { return fetch_xor(__i) ^ __i; }
-
- __int_type
- operator^=(__int_type __i) volatile noexcept
- { return fetch_xor(__i) ^ __i; }
-
- bool
- is_lock_free() const noexcept
- { return false; }
-
- bool
- is_lock_free() const volatile noexcept
- { return false; }
-
- void
- store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
- _ATOMIC_STORE_(this, __i, __m);
- }
-
- void
- store(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
- _ATOMIC_STORE_(this, __i, __m);
- }
-
- __int_type
- load(memory_order __m = memory_order_seq_cst) const noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
- return _ATOMIC_LOAD_(this, __m);
- }
-
- __int_type
- load(memory_order __m = memory_order_seq_cst) const volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
- return _ATOMIC_LOAD_(this, __m);
- }
-
- __int_type
- exchange(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, =, __i, __m); }
-
- __int_type
- exchange(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, =, __i, __m); }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m1, memory_order __m2) noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
- }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
- }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- return compare_exchange_weak(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- return compare_exchange_weak(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m1, memory_order __m2) noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- return compare_exchange_strong(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- return compare_exchange_strong(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- __int_type
- fetch_add(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, +=, __i, __m); }
-
- __int_type
- fetch_add(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, +=, __i, __m); }
-
- __int_type
- fetch_sub(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, -=, __i, __m); }
-
- __int_type
- fetch_sub(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, -=, __i, __m); }
-
- __int_type
- fetch_and(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, &=, __i, __m); }
-
- __int_type
- fetch_and(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, &=, __i, __m); }
-
- __int_type
- fetch_or(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, |=, __i, __m); }
-
- __int_type
- fetch_or(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, |=, __i, __m); }
-
- __int_type
- fetch_xor(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return _ATOMIC_MODIFY_(this, ^=, __i, __m); }
-
- __int_type
- fetch_xor(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return _ATOMIC_MODIFY_(this, ^=, __i, __m); }
- };
-
-
- /// Partial specialization for pointer types.
- template<typename _PTp>
- struct __atomic_base<_PTp*>
- {
- private:
- typedef _PTp* __return_pointer_type;
- typedef void* __pointer_type;
- __pointer_type _M_i;
-
- public:
- __atomic_base() noexcept = default;
- ~__atomic_base() noexcept = default;
- __atomic_base(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) volatile = delete;
-
- // Requires __pointer_type convertible to _M_i.
- constexpr __atomic_base(__return_pointer_type __p) noexcept
- : _M_i (__p) { }
-
- operator __return_pointer_type() const noexcept
- { return reinterpret_cast<__return_pointer_type>(load()); }
-
- operator __return_pointer_type() const volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(load()); }
-
- __return_pointer_type
- operator=(__pointer_type __p) noexcept
- {
- store(__p);
- return reinterpret_cast<__return_pointer_type>(__p);
- }
-
- __return_pointer_type
- operator=(__pointer_type __p) volatile noexcept
- {
- store(__p);
- return reinterpret_cast<__return_pointer_type>(__p);
- }
-
- __return_pointer_type
- operator++(int) noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(1)); }
-
- __return_pointer_type
- operator++(int) volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(1)); }
-
- __return_pointer_type
- operator--(int) noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(1)); }
-
- __return_pointer_type
- operator--(int) volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(1)); }
-
- __return_pointer_type
- operator++() noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(1) + 1); }
-
- __return_pointer_type
- operator++() volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(1) + 1); }
-
- __return_pointer_type
- operator--() noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(1) - 1); }
-
- __return_pointer_type
- operator--() volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(1) - 1); }
-
- __return_pointer_type
- operator+=(ptrdiff_t __d) noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(__d) + __d); }
-
- __return_pointer_type
- operator+=(ptrdiff_t __d) volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_add(__d) + __d); }
-
- __return_pointer_type
- operator-=(ptrdiff_t __d) noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(__d) - __d); }
-
- __return_pointer_type
- operator-=(ptrdiff_t __d) volatile noexcept
- { return reinterpret_cast<__return_pointer_type>(fetch_sub(__d) - __d); }
-
- bool
- is_lock_free() const noexcept
- { return true; }
-
- bool
- is_lock_free() const volatile noexcept
- { return true; }
-
- void
- store(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
- _ATOMIC_STORE_(this, __p, __m);
- }
-
- void
- store(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
- volatile __pointer_type* __p2 = &_M_i;
- __typeof__(__p) __w = (__p);
- __atomic_flag_base* __g = __atomic_flag_for_address(__p2);
- __atomic_flag_wait_explicit(__g, __m);
- *__p2 = reinterpret_cast<__pointer_type>(__w);
- atomic_flag_clear_explicit(__g, __m);
- __w;
- }
-
- __return_pointer_type
- load(memory_order __m = memory_order_seq_cst) const noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
- void* __v = _ATOMIC_LOAD_(this, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- load(memory_order __m = memory_order_seq_cst) const volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
- void* __v = _ATOMIC_LOAD_(this, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- exchange(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- void* __v = _ATOMIC_MODIFY_(this, =, __p, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- exchange(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- volatile __pointer_type* __p2 = &_M_i;
- __typeof__(__p) __w = (__p);
- __atomic_flag_base* __g = __atomic_flag_for_address(__p2);
- __atomic_flag_wait_explicit(__g, __m);
- __pointer_type __r = *__p2;
- *__p2 = __w;
- atomic_flag_clear_explicit(__g, __m);
- __r;
- return reinterpret_cast<__return_pointer_type>(_M_i);
- }
-
- bool
- compare_exchange_strong(__return_pointer_type& __rp1, __pointer_type __p2,
- memory_order __m1, memory_order __m2) noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- __pointer_type& __p1 = reinterpret_cast<void*&>(__rp1);
- return _ATOMIC_CMPEXCHNG_(this, &__p1, __p2, __m1);
- }
-
- bool
- compare_exchange_strong(__return_pointer_type& __rp1, __pointer_type __p2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
- __pointer_type& __p1 = reinterpret_cast<void*&>(__rp1);
- return _ATOMIC_CMPEXCHNG_(this, &__p1, __p2, __m1);
- }
-
- __return_pointer_type
- fetch_add(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- void* __v = _ATOMIC_MODIFY_(this, +=, __d, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- fetch_add(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- void* __v = _ATOMIC_MODIFY_(this, +=, __d, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- fetch_sub(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- void* __v = _ATOMIC_MODIFY_(this, -=, __d, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
-
- __return_pointer_type
- fetch_sub(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- void* __v = _ATOMIC_MODIFY_(this, -=, __d, __m);
- return reinterpret_cast<__return_pointer_type>(__v);
- }
- };
-
-#undef _ATOMIC_LOAD_
-#undef _ATOMIC_STORE_
-#undef _ATOMIC_MODIFY_
-#undef _ATOMIC_CMPEXCHNG_
-} // namespace __atomic0
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
-
-#endif
diff --git a/libstdc++-v3/include/bits/atomic_2.h b/libstdc++-v3/include/bits/atomic_2.h
deleted file mode 100644
index 072e82a0a9f..00000000000
--- a/libstdc++-v3/include/bits/atomic_2.h
+++ /dev/null
@@ -1,685 +0,0 @@
-// -*- C++ -*- header.
-
-// Copyright (C) 2008, 2009, 2010, 2011
-// 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/atomic_2.h
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{atomic}
- */
-
-#ifndef _GLIBCXX_ATOMIC_2_H
-#define _GLIBCXX_ATOMIC_2_H 1
-
-#pragma GCC system_header
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-// 2 == __atomic2 == Always lock-free
-// Assumed:
-// _GLIBCXX_ATOMIC_BUILTINS_1
-// _GLIBCXX_ATOMIC_BUILTINS_2
-// _GLIBCXX_ATOMIC_BUILTINS_4
-// _GLIBCXX_ATOMIC_BUILTINS_8
-namespace __atomic2
-{
- /// atomic_flag
- struct atomic_flag : public __atomic_flag_base
- {
- atomic_flag() noexcept = default;
- ~atomic_flag() noexcept = default;
- atomic_flag(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) volatile = delete;
-
- // Conversion to ATOMIC_FLAG_INIT.
- atomic_flag(bool __i) noexcept : __atomic_flag_base({ __i }) { }
-
- bool
- test_and_set(memory_order __m = memory_order_seq_cst) noexcept
- {
- // Redundant synchronize if built-in for lock is a full barrier.
- if (__m != memory_order_acquire && __m != memory_order_acq_rel)
- __sync_synchronize();
- return __sync_lock_test_and_set(&_M_i, 1);
- }
-
- bool
- test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- // Redundant synchronize if built-in for lock is a full barrier.
- if (__m != memory_order_acquire && __m != memory_order_acq_rel)
- __sync_synchronize();
- return __sync_lock_test_and_set(&_M_i, 1);
- }
-
- void
- clear(memory_order __m = memory_order_seq_cst) noexcept
- {
- __glibcxx_assert(__m != memory_order_consume);
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_lock_release(&_M_i);
- if (__m != memory_order_acquire && __m != memory_order_acq_rel)
- __sync_synchronize();
- }
-
- void
- clear(memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_consume);
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_lock_release(&_M_i);
- if (__m != memory_order_acquire && __m != memory_order_acq_rel)
- __sync_synchronize();
- }
- };
-
-
- /// Base class for atomic integrals.
- //
- // For each of the integral types, define atomic_[integral type] struct
- //
- // atomic_bool bool
- // atomic_char char
- // atomic_schar signed char
- // atomic_uchar unsigned char
- // atomic_short short
- // atomic_ushort unsigned short
- // atomic_int int
- // atomic_uint unsigned int
- // atomic_long long
- // atomic_ulong unsigned long
- // atomic_llong long long
- // atomic_ullong unsigned long long
- // atomic_char16_t char16_t
- // atomic_char32_t char32_t
- // atomic_wchar_t wchar_t
- //
- // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or
- // 8 bytes, since that is what GCC built-in functions for atomic
- // memory access expect.
- template<typename _ITp>
- struct __atomic_base
- {
- private:
- typedef _ITp __int_type;
-
- __int_type _M_i;
-
- public:
- __atomic_base() noexcept = default;
- ~__atomic_base() noexcept = default;
- __atomic_base(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) volatile = delete;
-
- // Requires __int_type convertible to _M_i.
- constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
-
- operator __int_type() const noexcept
- { return load(); }
-
- operator __int_type() const volatile noexcept
- { return load(); }
-
- __int_type
- operator=(__int_type __i) noexcept
- {
- store(__i);
- return __i;
- }
-
- __int_type
- operator=(__int_type __i) volatile noexcept
- {
- store(__i);
- return __i;
- }
-
- __int_type
- operator++(int) noexcept
- { return fetch_add(1); }
-
- __int_type
- operator++(int) volatile noexcept
- { return fetch_add(1); }
-
- __int_type
- operator--(int) noexcept
- { return fetch_sub(1); }
-
- __int_type
- operator--(int) volatile noexcept
- { return fetch_sub(1); }
-
- __int_type
- operator++() noexcept
- { return __sync_add_and_fetch(&_M_i, 1); }
-
- __int_type
- operator++() volatile noexcept
- { return __sync_add_and_fetch(&_M_i, 1); }
-
- __int_type
- operator--() noexcept
- { return __sync_sub_and_fetch(&_M_i, 1); }
-
- __int_type
- operator--() volatile noexcept
- { return __sync_sub_and_fetch(&_M_i, 1); }
-
- __int_type
- operator+=(__int_type __i) noexcept
- { return __sync_add_and_fetch(&_M_i, __i); }
-
- __int_type
- operator+=(__int_type __i) volatile noexcept
- { return __sync_add_and_fetch(&_M_i, __i); }
-
- __int_type
- operator-=(__int_type __i) noexcept
- { return __sync_sub_and_fetch(&_M_i, __i); }
-
- __int_type
- operator-=(__int_type __i) volatile noexcept
- { return __sync_sub_and_fetch(&_M_i, __i); }
-
- __int_type
- operator&=(__int_type __i) noexcept
- { return __sync_and_and_fetch(&_M_i, __i); }
-
- __int_type
- operator&=(__int_type __i) volatile noexcept
- { return __sync_and_and_fetch(&_M_i, __i); }
-
- __int_type
- operator|=(__int_type __i) noexcept
- { return __sync_or_and_fetch(&_M_i, __i); }
-
- __int_type
- operator|=(__int_type __i) volatile noexcept
- { return __sync_or_and_fetch(&_M_i, __i); }
-
- __int_type
- operator^=(__int_type __i) noexcept
- { return __sync_xor_and_fetch(&_M_i, __i); }
-
- __int_type
- operator^=(__int_type __i) volatile noexcept
- { return __sync_xor_and_fetch(&_M_i, __i); }
-
- bool
- is_lock_free() const noexcept
- { return true; }
-
- bool
- is_lock_free() const volatile noexcept
- { return true; }
-
- void
- store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
-
- if (__m == memory_order_relaxed)
- _M_i = __i;
- else
- {
- // write_mem_barrier();
- _M_i = __i;
- if (__m == memory_order_seq_cst)
- __sync_synchronize();
- }
- }
-
- void
- store(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
-
- if (__m == memory_order_relaxed)
- _M_i = __i;
- else
- {
- // write_mem_barrier();
- _M_i = __i;
- if (__m == memory_order_seq_cst)
- __sync_synchronize();
- }
- }
-
- __int_type
- load(memory_order __m = memory_order_seq_cst) const noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_synchronize();
- __int_type __ret = _M_i;
- __sync_synchronize();
- return __ret;
- }
-
- __int_type
- load(memory_order __m = memory_order_seq_cst) const volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_synchronize();
- __int_type __ret = _M_i;
- __sync_synchronize();
- return __ret;
- }
-
- __int_type
- exchange(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- // XXX built-in assumes memory_order_acquire.
- return __sync_lock_test_and_set(&_M_i, __i);
- }
-
-
- __int_type
- exchange(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- // XXX built-in assumes memory_order_acquire.
- return __sync_lock_test_and_set(&_M_i, __i);
- }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m1, memory_order __m2) noexcept
- { return compare_exchange_strong(__i1, __i2, __m1, __m2); }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- { return compare_exchange_strong(__i1, __i2, __m1, __m2); }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- return compare_exchange_weak(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_weak(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- return compare_exchange_weak(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m1, memory_order __m2) noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
-
- __int_type __i1o = __i1;
- __int_type __i1n = __sync_val_compare_and_swap(&_M_i, __i1o, __i2);
-
- // Assume extra stores (of same value) allowed in true case.
- __i1 = __i1n;
- return __i1o == __i1n;
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
-
- __int_type __i1o = __i1;
- __int_type __i1n = __sync_val_compare_and_swap(&_M_i, __i1o, __i2);
-
- // Assume extra stores (of same value) allowed in true case.
- __i1 = __i1n;
- return __i1o == __i1n;
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- return compare_exchange_strong(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- bool
- compare_exchange_strong(__int_type& __i1, __int_type __i2,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- return compare_exchange_strong(__i1, __i2, __m,
- __calculate_memory_order(__m));
- }
-
- __int_type
- fetch_add(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_add(&_M_i, __i); }
-
- __int_type
- fetch_add(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_add(&_M_i, __i); }
-
- __int_type
- fetch_sub(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_sub(&_M_i, __i); }
-
- __int_type
- fetch_sub(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_sub(&_M_i, __i); }
-
- __int_type
- fetch_and(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_and(&_M_i, __i); }
-
- __int_type
- fetch_and(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_and(&_M_i, __i); }
-
- __int_type
- fetch_or(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_or(&_M_i, __i); }
-
- __int_type
- fetch_or(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_or(&_M_i, __i); }
-
- __int_type
- fetch_xor(__int_type __i,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_xor(&_M_i, __i); }
-
- __int_type
- fetch_xor(__int_type __i,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_xor(&_M_i, __i); }
- };
-
-
- /// Partial specialization for pointer types.
- template<typename _PTp>
- struct __atomic_base<_PTp*>
- {
- private:
- typedef _PTp* __pointer_type;
-
- __pointer_type _M_p;
-
- public:
- __atomic_base() noexcept = default;
- ~__atomic_base() noexcept = default;
- __atomic_base(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) volatile = delete;
-
- // Requires __pointer_type convertible to _M_p.
- constexpr __atomic_base(__pointer_type __p) noexcept : _M_p (__p) { }
-
- operator __pointer_type() const noexcept
- { return load(); }
-
- operator __pointer_type() const volatile noexcept
- { return load(); }
-
- __pointer_type
- operator=(__pointer_type __p) noexcept
- {
- store(__p);
- return __p;
- }
-
- __pointer_type
- operator=(__pointer_type __p) volatile noexcept
- {
- store(__p);
- return __p;
- }
-
- __pointer_type
- operator++(int) noexcept
- { return fetch_add(1); }
-
- __pointer_type
- operator++(int) volatile noexcept
- { return fetch_add(1); }
-
- __pointer_type
- operator--(int) noexcept
- { return fetch_sub(1); }
-
- __pointer_type
- operator--(int) volatile noexcept
- { return fetch_sub(1); }
-
- __pointer_type
- operator++() noexcept
- { return fetch_add(1) + 1; }
-
- __pointer_type
- operator++() volatile noexcept
- { return fetch_add(1) + 1; }
-
- __pointer_type
- operator--() noexcept
- { return fetch_sub(1) -1; }
-
- __pointer_type
- operator--() volatile noexcept
- { return fetch_sub(1) -1; }
-
- __pointer_type
- operator+=(ptrdiff_t __d) noexcept
- { return fetch_add(__d) + __d; }
-
- __pointer_type
- operator+=(ptrdiff_t __d) volatile noexcept
- { return fetch_add(__d) + __d; }
-
- __pointer_type
- operator-=(ptrdiff_t __d) noexcept
- { return fetch_sub(__d) - __d; }
-
- __pointer_type
- operator-=(ptrdiff_t __d) volatile noexcept
- { return fetch_sub(__d) - __d; }
-
- bool
- is_lock_free() const noexcept
- { return true; }
-
- bool
- is_lock_free() const volatile noexcept
- { return true; }
-
- void
- store(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
-
- if (__m == memory_order_relaxed)
- _M_p = __p;
- else
- {
- // write_mem_barrier();
- _M_p = __p;
- if (__m == memory_order_seq_cst)
- __sync_synchronize();
- }
- }
-
- void
- store(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_acquire);
- __glibcxx_assert(__m != memory_order_acq_rel);
- __glibcxx_assert(__m != memory_order_consume);
-
- if (__m == memory_order_relaxed)
- _M_p = __p;
- else
- {
- // write_mem_barrier();
- _M_p = __p;
- if (__m == memory_order_seq_cst)
- __sync_synchronize();
- }
- }
-
- __pointer_type
- load(memory_order __m = memory_order_seq_cst) const noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_synchronize();
- __pointer_type __ret = _M_p;
- __sync_synchronize();
- return __ret;
- }
-
- __pointer_type
- load(memory_order __m = memory_order_seq_cst) const volatile noexcept
- {
- __glibcxx_assert(__m != memory_order_release);
- __glibcxx_assert(__m != memory_order_acq_rel);
-
- __sync_synchronize();
- __pointer_type __ret = _M_p;
- __sync_synchronize();
- return __ret;
- }
-
- __pointer_type
- exchange(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) noexcept
- {
- // XXX built-in assumes memory_order_acquire.
- return __sync_lock_test_and_set(&_M_p, __p);
- }
-
-
- __pointer_type
- exchange(__pointer_type __p,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- // XXX built-in assumes memory_order_acquire.
- return __sync_lock_test_and_set(&_M_p, __p);
- }
-
- bool
- compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
- memory_order __m1,
- memory_order __m2) noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
-
- __pointer_type __p1o = __p1;
- __pointer_type __p1n = __sync_val_compare_and_swap(&_M_p, __p1o, __p2);
-
- // Assume extra stores (of same value) allowed in true case.
- __p1 = __p1n;
- return __p1o == __p1n;
- }
-
- bool
- compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
- memory_order __m1,
- memory_order __m2) volatile noexcept
- {
- __glibcxx_assert(__m2 != memory_order_release);
- __glibcxx_assert(__m2 != memory_order_acq_rel);
- __glibcxx_assert(__m2 <= __m1);
-
- __pointer_type __p1o = __p1;
- __pointer_type __p1n = __sync_val_compare_and_swap(&_M_p, __p1o, __p2);
-
- // Assume extra stores (of same value) allowed in true case.
- __p1 = __p1n;
- return __p1o == __p1n;
- }
-
- __pointer_type
- fetch_add(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_add(&_M_p, __d); }
-
- __pointer_type
- fetch_add(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_add(&_M_p, __d); }
-
- __pointer_type
- fetch_sub(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) noexcept
- { return __sync_fetch_and_sub(&_M_p, __d); }
-
- __pointer_type
- fetch_sub(ptrdiff_t __d,
- memory_order __m = memory_order_seq_cst) volatile noexcept
- { return __sync_fetch_and_sub(&_M_p, __d); }
- };
-
-} // namespace __atomic2
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
-
-#endif
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index ebb7d58ac72..5327c1bfa21 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -69,10 +69,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
void
- atomic_thread_fence(memory_order) noexcept;
+ atomic_thread_fence(memory_order __m) noexcept;
void
- atomic_signal_fence(memory_order) noexcept;
+ atomic_signal_fence(memory_order __m) noexcept;
/// kill_dependency
template<typename _Tp>
@@ -83,86 +83,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __ret;
}
- /**
- * @brief Base type for atomic_flag.
- *
- * Base type is POD with data, allowing atomic_flag to derive from
- * it and meet the standard layout type requirement. In addition to
- * compatibilty with a C interface, this allows different
- * implementations of atomic_flag to use the same atomic operation
- * functions, via a standard conversion to the __atomic_flag_base
- * argument.
- */
- _GLIBCXX_BEGIN_EXTERN_C
+ /// Lock-free Property
- struct __atomic_flag_base
- {
- bool _M_i;
- };
+#define LOCKFREE_PROP(T) (__atomic_always_lock_free (sizeof (T), 0) ? 2 : 1)
- _GLIBCXX_END_EXTERN_C
-
-#define ATOMIC_FLAG_INIT { false }
+#define ATOMIC_CHAR_LOCK_FREE LOCKFREE_PROP (char)
+#define ATOMIC_CHAR16_T_LOCK_FREE LOCKFREE_PROP (char16_t)
+#define ATOMIC_CHAR32_T_LOCK_FREE LOCKFREE_PROP (char32_t)
+#define ATOMIC_WCHAR_T_LOCK_FREE LOCKFREE_PROP (wchar_t)
+#define ATOMIC_SHORT_LOCK_FREE LOCKFREE_PROP (short)
+#define ATOMIC_INT_LOCK_FREE LOCKFREE_PROP (int)
+#define ATOMIC_LONG_LOCK_FREE LOCKFREE_PROP (long)
+#define ATOMIC_LLONG_LOCK_FREE LOCKFREE_PROP (long long)
// Base types for atomics.
- //
- // Three nested namespaces for atomic implementation details.
- //
- // The nested namespace inlined into std:: is determined by the value
- // of the _GLIBCXX_ATOMIC_PROPERTY macro and the resulting
- // ATOMIC_*_LOCK_FREE macros.
- //
- // 0 == __atomic0 == Never lock-free
- // 1 == __atomic1 == Best available, sometimes lock-free
- // 2 == __atomic2 == Always lock-free
-
- namespace __atomic0
- {
- struct atomic_flag;
-
- template<typename _IntTp>
- struct __atomic_base;
- }
-
- namespace __atomic2
- {
- struct atomic_flag;
-
- template<typename _IntTp>
- struct __atomic_base;
- }
-
- namespace __atomic1
- {
- using __atomic2::atomic_flag;
- using __atomic0::__atomic_base;
- }
-
- /// Lock-free Property
-#if defined(_GLIBCXX_ATOMIC_BUILTINS_1) && defined(_GLIBCXX_ATOMIC_BUILTINS_2) \
- && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_ATOMIC_BUILTINS_8)
-# define _GLIBCXX_ATOMIC_PROPERTY 2
-# define _GLIBCXX_ATOMIC_NAMESPACE __atomic2
-#elif defined(_GLIBCXX_ATOMIC_BUILTINS_1)
-# define _GLIBCXX_ATOMIC_PROPERTY 1
-# define _GLIBCXX_ATOMIC_NAMESPACE __atomic1
-#else
-# define _GLIBCXX_ATOMIC_PROPERTY 0
-# define _GLIBCXX_ATOMIC_NAMESPACE __atomic0
-#endif
-
-#define ATOMIC_CHAR_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_CHAR16_T_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_CHAR32_T_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_WCHAR_T_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_SHORT_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_INT_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_LONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-#define ATOMIC_LLONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
-
- inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
-
+ template<typename _IntTp>
+ struct __atomic_base;
/// atomic_char
typedef __atomic_base<char> atomic_char;
@@ -287,6 +224,636 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
struct atomic<_Tp*>;
+
+ /**
+ * @brief Base type for atomic_flag.
+ *
+ * Base type is POD with data, allowing atomic_flag to derive from
+ * it and meet the standard layout type requirement. In addition to
+ * compatibilty with a C interface, this allows different
+ * implementations of atomic_flag to use the same atomic operation
+ * functions, via a standard conversion to the __atomic_flag_base
+ * argument.
+ */
+ _GLIBCXX_BEGIN_EXTERN_C
+
+ struct __atomic_flag_base
+ {
+ bool _M_i;
+ };
+
+ _GLIBCXX_END_EXTERN_C
+
+#define ATOMIC_FLAG_INIT { false }
+
+ /// atomic_flag
+ struct atomic_flag : public __atomic_flag_base
+ {
+ atomic_flag() noexcept = default;
+ ~atomic_flag() noexcept = default;
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) volatile = delete;
+
+ // Conversion to ATOMIC_FLAG_INIT.
+ atomic_flag(bool __i) noexcept : __atomic_flag_base({ __i }) { }
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) noexcept
+ {
+ /* The standard *requires* this to be lock free. If exchange is not
+ always lock free, the resort to the old test_and_set. */
+ if (__atomic_always_lock_free (sizeof (_M_i), 0))
+ return __atomic_exchange_n(&_M_i, 1, __m);
+ else
+ {
+ /* Sync test and set is only guaranteed to be acquire. */
+ if (__m == memory_order_seq_cst || __m == memory_order_release
+ || __m == memory_order_acq_rel)
+ atomic_thread_fence (__m);
+ return __sync_lock_test_and_set (&_M_i, 1);
+ }
+ }
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ /* The standard *requires* this to be lock free. If exchange is not
+ always lock free, the resort to the old test_and_set. */
+ if (__atomic_always_lock_free (sizeof (_M_i), 0))
+ return __atomic_exchange_n(&_M_i, 1, __m);
+ else
+ {
+ /* Sync test and set is only guaranteed to be acquire. */
+ if (__m == memory_order_seq_cst || __m == memory_order_release
+ || __m == memory_order_acq_rel)
+ atomic_thread_fence (__m);
+ return __sync_lock_test_and_set (&_M_i, 1);
+ }
+ }
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) noexcept
+ {
+ __glibcxx_assert(__m != memory_order_consume);
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ /* The standard *requires* this to be lock free. If store is not always
+ lock free, the resort to the old style __sync_lock_release. */
+ if (__atomic_always_lock_free (sizeof (_M_i), 0))
+ __atomic_store_n(&_M_i, 0, __m);
+ else
+ {
+ __sync_lock_release (&_M_i, 0);
+ /* __sync_lock_release is only guaranteed to be a release barrier. */
+ if (__m == memory_order_seq_cst)
+ atomic_thread_fence (__m);
+ }
+ }
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ __glibcxx_assert(__m != memory_order_consume);
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ /* The standard *requires* this to be lock free. If store is not always
+ lock free, the resort to the old style __sync_lock_release. */
+ if (__atomic_always_lock_free (sizeof (_M_i), 0))
+ __atomic_store_n(&_M_i, 0, __m);
+ else
+ {
+ __sync_lock_release (&_M_i, 0);
+ /* __sync_lock_release is only guaranteed to be a release barrier. */
+ if (__m == memory_order_seq_cst)
+ atomic_thread_fence (__m);
+ }
+ }
+ };
+
+
+ /// Base class for atomic integrals.
+ //
+ // For each of the integral types, define atomic_[integral type] struct
+ //
+ // atomic_bool bool
+ // atomic_char char
+ // atomic_schar signed char
+ // atomic_uchar unsigned char
+ // atomic_short short
+ // atomic_ushort unsigned short
+ // atomic_int int
+ // atomic_uint unsigned int
+ // atomic_long long
+ // atomic_ulong unsigned long
+ // atomic_llong long long
+ // atomic_ullong unsigned long long
+ // atomic_char16_t char16_t
+ // atomic_char32_t char32_t
+ // atomic_wchar_t wchar_t
+ //
+ // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or
+ // 8 bytes, since that is what GCC built-in functions for atomic
+ // memory access expect.
+ template<typename _ITp>
+ struct __atomic_base
+ {
+ private:
+ typedef _ITp __int_type;
+
+ __int_type _M_i;
+
+ public:
+ __atomic_base() noexcept = default;
+ ~__atomic_base() noexcept = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+ // Requires __int_type convertible to _M_i.
+ constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
+
+ operator __int_type() const noexcept
+ { return load(); }
+
+ operator __int_type() const volatile noexcept
+ { return load(); }
+
+ __int_type
+ operator=(__int_type __i) noexcept
+ {
+ store(__i);
+ return __i;
+ }
+
+ __int_type
+ operator=(__int_type __i) volatile noexcept
+ {
+ store(__i);
+ return __i;
+ }
+
+ __int_type
+ operator++(int) noexcept
+ { return fetch_add(1); }
+
+ __int_type
+ operator++(int) volatile noexcept
+ { return fetch_add(1); }
+
+ __int_type
+ operator--(int) noexcept
+ { return fetch_sub(1); }
+
+ __int_type
+ operator--(int) volatile noexcept
+ { return fetch_sub(1); }
+
+ __int_type
+ operator++() noexcept
+ { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+ __int_type
+ operator++() volatile noexcept
+ { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+ __int_type
+ operator--() noexcept
+ { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+ __int_type
+ operator--() volatile noexcept
+ { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+ __int_type
+ operator+=(__int_type __i) noexcept
+ { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator+=(__int_type __i) volatile noexcept
+ { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator-=(__int_type __i) noexcept
+ { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator-=(__int_type __i) volatile noexcept
+ { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator&=(__int_type __i) noexcept
+ { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator&=(__int_type __i) volatile noexcept
+ { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator|=(__int_type __i) noexcept
+ { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator|=(__int_type __i) volatile noexcept
+ { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator^=(__int_type __i) noexcept
+ { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ __int_type
+ operator^=(__int_type __i) volatile noexcept
+ { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+ bool
+ is_lock_free() const noexcept
+ { return __atomic_is_lock_free (sizeof (_M_i), &_M_i); }
+
+ bool
+ is_lock_free() const volatile noexcept
+ { return __atomic_is_lock_free (sizeof (_M_i), &_M_i); }
+
+ void
+ store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ __atomic_store_n(&_M_i, __i, __m);
+ }
+
+ void
+ store(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ __atomic_store_n(&_M_i, __i, __m);
+ }
+
+ __int_type
+ load(memory_order __m = memory_order_seq_cst) const noexcept
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ return __atomic_load_n(&_M_i, __m);
+ }
+
+ __int_type
+ load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ return __atomic_load_n(&_M_i, __m);
+ }
+
+ __int_type
+ exchange(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ {
+ return __atomic_exchange_n(&_M_i, __i, __m);
+ }
+
+
+ __int_type
+ exchange(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ return __atomic_exchange_n(&_M_i, __i, __m);
+ }
+
+ bool
+ compare_exchange_weak(__int_type& __i1, __int_type __i2,
+ memory_order __m1, memory_order __m2) noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+ }
+
+ bool
+ compare_exchange_weak(__int_type& __i1, __int_type __i2,
+ memory_order __m1,
+ memory_order __m2) volatile noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+ }
+
+ bool
+ compare_exchange_weak(__int_type& __i1, __int_type __i2,
+ memory_order __m = memory_order_seq_cst) noexcept
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_weak(__int_type& __i1, __int_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__int_type& __i1, __int_type __i2,
+ memory_order __m1, memory_order __m2) noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+ }
+
+ bool
+ compare_exchange_strong(__int_type& __i1, __int_type __i2,
+ memory_order __m1,
+ memory_order __m2) volatile noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+ }
+
+ bool
+ compare_exchange_strong(__int_type& __i1, __int_type __i2,
+ memory_order __m = memory_order_seq_cst) noexcept
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__int_type& __i1, __int_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ __int_type
+ fetch_add(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_add(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_sub(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_sub(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_and(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_and(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_or(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_or(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_xor(__int_type __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_xor(&_M_i, __i, __m); }
+
+ __int_type
+ fetch_xor(__int_type __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_xor(&_M_i, __i, __m); }
+ };
+
+
+ /// Partial specialization for pointer types.
+ template<typename _PTp>
+ struct __atomic_base<_PTp*>
+ {
+ private:
+ typedef _PTp* __pointer_type;
+
+ __pointer_type _M_p;
+
+ public:
+ __atomic_base() noexcept = default;
+ ~__atomic_base() noexcept = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+ // Requires __pointer_type convertible to _M_p.
+ constexpr __atomic_base(__pointer_type __p) noexcept : _M_p (__p) { }
+
+ operator __pointer_type() const noexcept
+ { return load(); }
+
+ operator __pointer_type() const volatile noexcept
+ { return load(); }
+
+ __pointer_type
+ operator=(__pointer_type __p) noexcept
+ {
+ store(__p);
+ return __p;
+ }
+
+ __pointer_type
+ operator=(__pointer_type __p) volatile noexcept
+ {
+ store(__p);
+ return __p;
+ }
+
+ __pointer_type
+ operator++(int) noexcept
+ { return fetch_add(1); }
+
+ __pointer_type
+ operator++(int) volatile noexcept
+ { return fetch_add(1); }
+
+ __pointer_type
+ operator--(int) noexcept
+ { return fetch_sub(1); }
+
+ __pointer_type
+ operator--(int) volatile noexcept
+ { return fetch_sub(1); }
+
+ __pointer_type
+ operator++() noexcept
+ { return __atomic_add_fetch(&_M_p, 1, memory_order_seq_cst); }
+
+ __pointer_type
+ operator++() volatile noexcept
+ { return __atomic_add_fetch(&_M_p, 1, memory_order_seq_cst); }
+
+ __pointer_type
+ operator--() noexcept
+ { return __atomic_sub_fetch(&_M_p, 1, memory_order_seq_cst); }
+
+ __pointer_type
+ operator--() volatile noexcept
+ { return __atomic_sub_fetch(&_M_p, 1, memory_order_seq_cst); }
+
+ __pointer_type
+ operator+=(ptrdiff_t __d) noexcept
+ { return __atomic_add_fetch(&_M_p, __d, memory_order_seq_cst); }
+
+ __pointer_type
+ operator+=(ptrdiff_t __d) volatile noexcept
+ { return __atomic_add_fetch(&_M_p, __d, memory_order_seq_cst); }
+
+ __pointer_type
+ operator-=(ptrdiff_t __d) noexcept
+ { return __atomic_sub_fetch(&_M_p, __d, memory_order_seq_cst); }
+
+ __pointer_type
+ operator-=(ptrdiff_t __d) volatile noexcept
+ { return __atomic_sub_fetch(&_M_p, __d, memory_order_seq_cst); }
+
+ bool
+ is_lock_free() const noexcept
+ { return __atomic_is_lock_free (sizeof (_M_p), &_M_p); }
+
+ bool
+ is_lock_free() const volatile noexcept
+ { return __atomic_is_lock_free (sizeof (_M_p), &_M_p); }
+
+ void
+ store(__pointer_type __p,
+ memory_order __m = memory_order_seq_cst) noexcept
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ __atomic_store_n(&_M_p, __p, __m);
+ }
+
+ void
+ store(__pointer_type __p,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ __atomic_store_n(&_M_p, __p, __m);
+ }
+
+ __pointer_type
+ load(memory_order __m = memory_order_seq_cst) const noexcept
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ return __atomic_load_n(&_M_p, __m);
+ }
+
+ __pointer_type
+ load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ return __atomic_load_n(&_M_p, __m);
+ }
+
+ __pointer_type
+ exchange(__pointer_type __p,
+ memory_order __m = memory_order_seq_cst) noexcept
+ {
+ return __atomic_exchange_n(&_M_p, __p, __m);
+ }
+
+
+ __pointer_type
+ exchange(__pointer_type __p,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ return __atomic_exchange_n(&_M_p, __p, __m);
+ }
+
+ bool
+ compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+ memory_order __m1,
+ memory_order __m2) noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+ }
+
+ bool
+ compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+ memory_order __m1,
+ memory_order __m2) volatile noexcept
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+ }
+
+ __pointer_type
+ fetch_add(ptrdiff_t __d,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_add(&_M_p, __d, __m); }
+
+ __pointer_type
+ fetch_add(ptrdiff_t __d,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_add(&_M_p, __d, __m); }
+
+ __pointer_type
+ fetch_sub(ptrdiff_t __d,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return __atomic_fetch_sub(&_M_p, __d, __m); }
+
+ __pointer_type
+ fetch_sub(ptrdiff_t __d,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return __atomic_fetch_sub(&_M_p, __d, __m); }
+ };
+
// @} group atomics
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 0edb8b2f8df..00f9bccd419 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -865,6 +865,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return _M_data()[__n];
}
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param __n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails. Success results in
+ * unsharing the string.
+ */
+ reference
+ at(size_type __n)
+ {
+ if (__n >= size())
+ __throw_out_of_range(__N("basic_string::at"));
+ _M_leak();
+ return _M_data()[__n];
+ }
+
#ifdef __GXX_EXPERIMENTAL_CXX0X__
/**
* Returns a read/write reference to the data at the first
@@ -899,26 +919,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return operator[](this->size() - 1); }
#endif
- /**
- * @brief Provides access to the data contained in the %string.
- * @param __n The index of the character to access.
- * @return Read/write reference to the character.
- * @throw std::out_of_range If @a n is an invalid index.
- *
- * This function provides for safer data access. The parameter is
- * first checked that it is in the range of the string. The function
- * throws out_of_range if the check fails. Success results in
- * unsharing the string.
- */
- reference
- at(size_type __n)
- {
- if (__n >= size())
- __throw_out_of_range(__N("basic_string::at"));
- _M_leak();
- return _M_data()[__n];
- }
-
// Modifiers:
/**
* @brief Append a string to this string.
@@ -1394,6 +1394,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
iterator
erase(iterator __first, iterator __last);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Remove the last character.
+ *
+ * The string must be non-empty.
+ */
+ void
+ pop_back()
+ { erase(size()-1, 1); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Replace characters with value from another string.
* @param __pos Index of first character to replace.
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index f77da5ee1a7..e76e7423021 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -148,6 +148,8 @@
namespace __detail { }
}
+ namespace tr2 { }
+
namespace decimal { }
namespace chrono { }
@@ -197,6 +199,9 @@ namespace std
namespace __detail { inline namespace __7 { } }
}
+ namespace tr2
+ { inline namespace __7 { } }
+
namespace decimal { inline namespace __7 { } }
namespace chrono { inline namespace __7 { } }
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 7c66d633863..d109224d1bf 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -491,7 +491,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
friend bool
operator==(const mersenne_twister_engine& __lhs,
const mersenne_twister_engine& __rhs)
- { return std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x); }
+ { return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
+ && __lhs._M_p == __rhs._M_p); }
/**
* @brief Inserts the current state of a % mersenne_twister_engine
@@ -705,7 +706,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
friend bool
operator==(const subtract_with_carry_engine& __lhs,
const subtract_with_carry_engine& __rhs)
- { return std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x); }
+ { return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
+ && __lhs._M_carry == __rhs._M_carry
+ && __lhs._M_p == __rhs._M_p); }
/**
* @brief Inserts the current state of a % subtract_with_carry_engine
@@ -1370,7 +1373,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
friend bool
operator==(const shuffle_order_engine& __lhs,
const shuffle_order_engine& __rhs)
- { return __lhs._M_b == __rhs._M_b; }
+ { return (__lhs._M_b == __rhs._M_b
+ && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
+ && __lhs._M_y == __rhs._M_y); }
/**
* @brief Inserts the current state of a %shuffle_order_engine random
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 0e74848ff3c..8936a62316a 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -471,9 +471,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
__os.fill(__space);
- for (size_t __i = 0; __i < __n - 1; ++__i)
+ for (size_t __i = 0; __i < __n; ++__i)
__os << __x._M_x[__i] << __space;
- __os << __x._M_x[__n - 1];
+ __os << __x._M_p;
__os.flags(__flags);
__os.fill(__fill);
@@ -498,6 +498,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
for (size_t __i = 0; __i < __n; ++__i)
__is >> __x._M_x[__i];
+ __is >> __x._M_p;
__is.flags(__flags);
return __is;
@@ -627,7 +628,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
for (size_t __i = 0; __i < __r; ++__i)
__os << __x._M_x[__i] << __space;
- __os << __x._M_carry;
+ __os << __x._M_carry << __space << __x._M_p;
__os.flags(__flags);
__os.fill(__fill);
@@ -649,6 +650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
for (size_t __i = 0; __i < __r; ++__i)
__is >> __x._M_x[__i];
__is >> __x._M_carry;
+ __is >> __x._M_p;
__is.flags(__flags);
return __is;
diff --git a/libstdc++-v3/include/c_global/cstdalign b/libstdc++-v3/include/c_global/cstdalign
new file mode 100644
index 00000000000..31f0c1b384e
--- /dev/null
+++ b/libstdc++-v3/include/c_global/cstdalign
@@ -0,0 +1,44 @@
+// <cstdalign> -*- C++ -*-
+
+// Copyright (C) 2011 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/cstdalign
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CSTDALIGN
+#define _GLIBCXX_CSTDALIGN 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <bits/c++0x_warning.h>
+#else
+# include <bits/c++config.h>
+# if _GLIBCXX_HAVE_STDALIGN_H
+# include <stdalign.h>
+# endif
+#endif
+
+#endif
+
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
index 7856b240b86..6350f6de5e5 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -580,6 +580,16 @@ namespace __gnu_debug
return iterator(__res, this);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ _Base::pop_back();
+ this->_M_invalidate_all();
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
replace(size_type __pos1, size_type __n1, const basic_string& __str)
{
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index 5720daf3919..a613e364d3a 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -1140,6 +1140,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return iterator(this->_M_data() + __pos);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Remove the last character.
+ *
+ * The string must be non-empty.
+ */
+ void
+ pop_back()
+ { this->_M_erase(size()-1, 1); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Replace characters with value from another string.
* @param __pos Index of first character to replace.
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic
index b3fa7d8120b..70f613f5c50 100644
--- a/libstdc++-v3/include/std/atomic
+++ b/libstdc++-v3/include/std/atomic
@@ -39,8 +39,6 @@
#endif
#include <bits/atomic_base.h>
-#include <bits/atomic_0.h>
-#include <bits/atomic_2.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -167,69 +165,116 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr atomic(_Tp __i) noexcept : _M_i(__i) { }
- operator _Tp() const noexcept;
+ operator _Tp() const noexcept
+ { return load(); }
- operator _Tp() const volatile noexcept;
+ operator _Tp() const volatile noexcept
+ { return load(); }
_Tp
- operator=(_Tp __i) noexcept { store(__i); return __i; }
+ operator=(_Tp __i) noexcept
+ { store(__i); return __i; }
_Tp
- operator=(_Tp __i) volatile noexcept { store(__i); return __i; }
+ operator=(_Tp __i) volatile noexcept
+ { store(__i); return __i; }
bool
- is_lock_free() const noexcept;
+ is_lock_free() const noexcept
+ { return __atomic_is_lock_free(sizeof(_M_i), &_M_i); }
bool
- is_lock_free() const volatile noexcept;
+ is_lock_free() const volatile noexcept
+ { return __atomic_is_lock_free(sizeof(_M_i), &_M_i); }
void
- store(_Tp, memory_order = memory_order_seq_cst) noexcept;
+ store(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept
+ { __atomic_store(&_M_i, &__i, _m); }
void
- store(_Tp, memory_order = memory_order_seq_cst) volatile noexcept;
+ store(_Tp __i, memory_order _m = memory_order_seq_cst) volatile noexcept
+ { __atomic_store(&_M_i, &__i, _m); }
_Tp
- load(memory_order = memory_order_seq_cst) const noexcept;
+ load(memory_order _m = memory_order_seq_cst) const noexcept
+ {
+ _Tp tmp;
+ __atomic_load(&_M_i, &tmp, _m);
+ return tmp;
+ }
_Tp
- load(memory_order = memory_order_seq_cst) const volatile noexcept;
+ load(memory_order _m = memory_order_seq_cst) const volatile noexcept
+ {
+ _Tp tmp;
+ __atomic_load(&_M_i, &tmp, _m);
+ return tmp;
+ }
_Tp
- exchange(_Tp __i, memory_order = memory_order_seq_cst) noexcept;
+ exchange(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept
+ {
+ _Tp tmp;
+ __atomic_exchange(&_M_i, &__i, &tmp, _m);
+ return tmp;
+ }
_Tp
- exchange(_Tp __i, memory_order = memory_order_seq_cst) volatile noexcept;
+ exchange(_Tp __i,
+ memory_order _m = memory_order_seq_cst) volatile noexcept
+ {
+ _Tp tmp;
+ __atomic_exchange(&_M_i, &__i, &tmp, _m);
+ return tmp;
+ }
bool
- compare_exchange_weak(_Tp&, _Tp, memory_order, memory_order) noexcept;
+ compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+ memory_order __f) noexcept
+ {
+ return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f);
+ }
bool
- compare_exchange_weak(_Tp&, _Tp, memory_order,
- memory_order) volatile noexcept;
+ compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+ memory_order __f) volatile noexcept
+ {
+ return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f);
+ }
bool
- compare_exchange_weak(_Tp&, _Tp,
- memory_order = memory_order_seq_cst) noexcept;
+ compare_exchange_weak(_Tp& __e, _Tp __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return compare_exchange_weak(__e, __i, __m, __m); }
bool
- compare_exchange_weak(_Tp&, _Tp,
- memory_order = memory_order_seq_cst) volatile noexcept;
+ compare_exchange_weak(_Tp& __e, _Tp __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return compare_exchange_weak(__e, __i, __m, __m); }
bool
- compare_exchange_strong(_Tp&, _Tp, memory_order, memory_order) noexcept;
+ compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+ memory_order __f) noexcept
+ {
+ return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f);
+ }
bool
- compare_exchange_strong(_Tp&, _Tp, memory_order,
- memory_order) volatile noexcept;
+ compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+ memory_order __f) volatile noexcept
+ {
+ return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f);
+ }
bool
- compare_exchange_strong(_Tp&, _Tp,
- memory_order = memory_order_seq_cst) noexcept;
+ compare_exchange_strong(_Tp& __e, _Tp __i,
+ memory_order __m = memory_order_seq_cst) noexcept
+ { return compare_exchange_strong(__e, __i, __m, __m); }
bool
- compare_exchange_strong(_Tp&, _Tp,
- memory_order = memory_order_seq_cst) volatile noexcept;
+ compare_exchange_strong(_Tp& __e, _Tp __i,
+ memory_order __m = memory_order_seq_cst) volatile noexcept
+ { return compare_exchange_strong(__e, __i, __m, __m); }
};
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 3c41b483cd2..d7423433803 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1686,14 +1686,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::complex<_Tp>
__complex_acosh(const std::complex<_Tp>& __z)
{
- std::complex<_Tp> __t((__z.real() - __z.imag())
- * (__z.real() + __z.imag()) - _Tp(1.0),
- _Tp(2.0) * __z.real() * __z.imag());
- __t = std::sqrt(__t);
- if (__z.real() < _Tp())
- __t = -__t;
-
- return std::log(__t + __z);
+ // Kahan's formula.
+ return _Tp(2.0) * std::log(std::sqrt(_Tp(0.5) * (__z + _Tp(1.0)))
+ + std::sqrt(_Tp(0.5) * (__z - _Tp(1.0))));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index 497b964833f..cc8779b40b3 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -955,6 +955,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_storage(__future_base::_S_allocate_result<_Res>(__a))
{ }
+ template<typename _Allocator>
+ promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
+ : _M_future(std::move(__rhs._M_future)),
+ _M_storage(std::move(__rhs._M_storage))
+ { }
+
promise(const promise&) = delete;
~promise()
@@ -1047,6 +1053,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_storage(__future_base::_S_allocate_result<_Res&>(__a))
{ }
+ template<typename _Allocator>
+ promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
+ : _M_future(std::move(__rhs._M_future)),
+ _M_storage(std::move(__rhs._M_storage))
+ { }
+
promise(const promise&) = delete;
~promise()
@@ -1122,6 +1134,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_storage(__future_base::_S_allocate_result<void>(__a))
{ }
+ template<typename _Allocator>
+ promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
+ : _M_future(std::move(__rhs._M_future)),
+ _M_storage(std::move(__rhs._M_storage))
+ { }
+
promise(const promise&) = delete;
~promise()
@@ -1270,6 +1288,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return std::forward<_Tp>(__t); }
};
+ template<typename _Task, typename _Fn, bool
+ = is_same<_Task, typename remove_reference<_Fn>::type>::value>
+ struct __is_same_pkgdtask
+ { typedef void __type; };
+
+ template<typename _Task, typename _Fn>
+ struct __is_same_pkgdtask<_Task, _Fn, true>
+ { };
+
/// packaged_task
template<typename _Res, typename... _ArgTypes>
class packaged_task<_Res(_ArgTypes...)>
@@ -1281,13 +1308,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Construction and destruction
packaged_task() noexcept { }
- template<typename _Fn>
+ template<typename _Allocator>
+ explicit
+ packaged_task(allocator_arg_t, const _Allocator& __a) noexcept
+ { }
+
+ template<typename _Fn, typename = typename
+ __is_same_pkgdtask<packaged_task, _Fn>::__type>
explicit
packaged_task(_Fn&& __fn)
: _M_state(std::make_shared<_State_type>(std::forward<_Fn>(__fn)))
{ }
- template<typename _Fn, typename _Allocator>
+ template<typename _Fn, typename _Allocator, typename = typename
+ __is_same_pkgdtask<packaged_task, _Fn>::__type>
explicit
packaged_task(allocator_arg_t, const _Allocator& __a, _Fn&& __fn)
: _M_state(std::allocate_shared<_State_type>(__a,
@@ -1301,13 +1335,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// No copy
- packaged_task(packaged_task&) = delete;
- packaged_task& operator=(packaged_task&) = delete;
+ packaged_task(const packaged_task&) = delete;
+ packaged_task& operator=(const packaged_task&) = delete;
+
+ template<typename _Allocator>
+ explicit
+ packaged_task(allocator_arg_t, const _Allocator&,
+ const packaged_task&) = delete;
// Move support
packaged_task(packaged_task&& __other) noexcept
{ this->swap(__other); }
+ template<typename _Allocator>
+ explicit
+ packaged_task(allocator_arg_t, const _Allocator&,
+ packaged_task&& __other) noexcept
+ { this->swap(__other); }
+
packaged_task& operator=(packaged_task&& __other) noexcept
{
packaged_task(std::move(__other)).swap(*this);
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 4d154ff6f0c..bc2675b2b68 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -760,11 +760,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
private:
typedef __gthread_once_t __native_type;
- __native_type _M_once;
+ __native_type _M_once = __GTHREAD_ONCE_INIT;
public:
/// Constructor
- constexpr once_flag() noexcept : _M_once(__GTHREAD_ONCE_INIT) { }
+ constexpr once_flag() noexcept = default;
/// Deleted copy constructor
once_flag(const once_flag&) = delete;
@@ -796,7 +796,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__get_once_mutex();
#endif
- extern "C" void __once_proxy();
+ extern "C" void __once_proxy(void);
/// call_once
template<typename _Callable, typename... _Args>
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex
index d831eeb0146..689ea167ba2 100644
--- a/libstdc++-v3/include/tr1/complex
+++ b/libstdc++-v3/include/tr1/complex
@@ -185,14 +185,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::complex<_Tp>
__complex_acosh(const std::complex<_Tp>& __z)
{
- std::complex<_Tp> __t((__z.real() - __z.imag())
- * (__z.real() + __z.imag()) - _Tp(1.0),
- _Tp(2.0) * __z.real() * __z.imag());
- __t = std::sqrt(__t);
- if (__z.real() < _Tp())
- __t = -__t;
-
- return std::log(__t + __z);
+ // Kahan's formula.
+ return _Tp(2.0) * std::log(std::sqrt(_Tp(0.5) * (__z + _Tp(1.0)))
+ + std::sqrt(_Tp(0.5) * (__z - _Tp(1.0))));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
diff --git a/libstdc++-v3/include/tr2/bool_set b/libstdc++-v3/include/tr2/bool_set
index fe322675991..f577ed0c76c 100644
--- a/libstdc++-v3/include/tr2/bool_set
+++ b/libstdc++-v3/include/tr2/bool_set
@@ -26,16 +26,6 @@
* This is a TR2 C++ Library header.
*/
-//
-// Sort of an implementation of bool_set in n2136 Hervé Brönnimann,
-// Guillaume Melquiond, Sylvain Pion.
-//
-// The implicit conversion to bool is slippery! I may use the new
-// explicit conversion. This has been specialized in the language so
-// that in contexts requiring a bool the conversion happens
-// implicitly. Thus most objections should be eliminated.
-//
-
#ifndef _GLIBCXX_TR2_BOOL_SET
#define _GLIBCXX_TR2_BOOL_SET 1
@@ -50,6 +40,17 @@ namespace tr2
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ /**
+ * bool_set
+ *
+ * See N2136, Bool_set: multi-valued logic
+ * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
+ *
+ * The implicit conversion to bool is slippery! I may use the new
+ * explicit conversion. This has been specialized in the language
+ * so that in contexts requiring a bool the conversion happens
+ * implicitly. Thus most objections should be eliminated.
+ */
class bool_set
{
public:
@@ -60,7 +61,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Constructor from bool.
bool_set(bool __t) : _M_b(_Bool_set_val(__t)) { }
- ///
// I'm not sure about this.
bool contains(bool_set __b) const
{ return this->is_singleton() && this->equals(__b); }
diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset
index 5a4b7943bbe..b5c3bf3fcc8 100644
--- a/libstdc++-v3/include/tr2/dynamic_bitset
+++ b/libstdc++-v3/include/tr2/dynamic_bitset
@@ -120,11 +120,11 @@ public:
}
void
- _M_assign(const __dynamic_bitset_base<block_type, allocator_type>& __b)
+ _M_assign(const __dynamic_bitset_base& __b)
{ this->_M_w = __b._M_w; }
void
- _M_swap(__dynamic_bitset_base<block_type, allocator_type>& __b)
+ _M_swap(__dynamic_bitset_base& __b)
{ this->_M_w.swap(__b._M_w); }
void
@@ -178,7 +178,7 @@ public:
{ return this->_M_w[_M_w.size() - 1]; }
void
- _M_do_and(const __dynamic_bitset_base<block_type, allocator_type>& __x)
+ _M_do_and(const __dynamic_bitset_base& __x)
{
if (__x._M_w.size() == this->_M_w.size())
for (size_t __i = 0; __i < this->_M_w.size(); ++__i)
@@ -188,7 +188,7 @@ public:
}
void
- _M_do_or(const __dynamic_bitset_base<block_type, allocator_type>& __x)
+ _M_do_or(const __dynamic_bitset_base& __x)
{
if (__x._M_w.size() == this->_M_w.size())
for (size_t __i = 0; __i < this->_M_w.size(); ++__i)
@@ -198,7 +198,7 @@ public:
}
void
- _M_do_xor(const __dynamic_bitset_base<block_type, allocator_type>& __x)
+ _M_do_xor(const __dynamic_bitset_base& __x)
{
if (__x._M_w.size() == this->_M_w.size())
for (size_t __i = 0; __i < this->_M_w.size(); ++__i)
@@ -208,7 +208,7 @@ public:
}
void
- _M_do_dif(const __dynamic_bitset_base<block_type, allocator_type>& __x)
+ _M_do_dif(const __dynamic_bitset_base& __x)
{
if (__x._M_w.size() == this->_M_w.size())
for (size_t __i = 0; __i < this->_M_w.size(); ++__i)
@@ -245,7 +245,7 @@ public:
}
bool
- _M_is_equal(const __dynamic_bitset_base<block_type, allocator_type>& __x) const
+ _M_is_equal(const __dynamic_bitset_base& __x) const
{
if (__x.size() == this->size())
{
@@ -259,7 +259,7 @@ public:
}
bool
- _M_is_less(const __dynamic_bitset_base<block_type, allocator_type>& __x) const
+ _M_is_less(const __dynamic_bitset_base& __x) const
{
if (__x.size() == this->size())
{
@@ -296,7 +296,7 @@ public:
}
bool
- _M_is_subset_of(const __dynamic_bitset_base<block_type, allocator_type>& __b)
+ _M_is_subset_of(const __dynamic_bitset_base& __b)
{
if (__b.size() == this->size())
{
@@ -310,7 +310,7 @@ public:
}
bool
- _M_is_proper_subset_of(const __dynamic_bitset_base<block_type, allocator_type>& __b) const
+ _M_is_proper_subset_of(const __dynamic_bitset_base& __b) const
{
if (this->is_subset_of(__b))
{
@@ -387,7 +387,7 @@ public:
this->_M_w[__wshift] = this->_M_w[0] << __offset;
}
- ////std::fill(this->_M_w.begin(), this->_M_w.begin() + __wshift,
+ //// std::fill(this->_M_w.begin(), this->_M_w.begin() + __wshift,
//// static_cast<_WordT>(0));
}
}
diff --git a/libstdc++-v3/include/tr2/type_traits b/libstdc++-v3/include/tr2/type_traits
index 73edf1137e4..4ec41181047 100644
--- a/libstdc++-v3/include/tr2/type_traits
+++ b/libstdc++-v3/include/tr2/type_traits
@@ -43,19 +43,28 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @defgroup metaprogramming Type Traits
* @ingroup utilities
*
- * Compile time type transformation and information.
* @{
*/
+ /**
+ * See N2965: Type traits and base classes
+ * by Michael Spertus
+ */
+
+ /**
+ * Simple typelist. Compile-time list of types.
+ */
template<typename... _Elements>
struct typelist;
+ /// Specialization for an empty typelist.
template<>
struct typelist<>
{
typedef std::true_type empty;
};
+ /// Partial specialization.
template<typename _First, typename... _Rest>
struct typelist<_First, _Rest...>
{
@@ -72,23 +81,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
};
- // Sequence abstraction metafunctions default to looking in the type
+ /// Sequence abstraction metafunctions for manipulating a typelist.
+
+
+ /// Return the first type in a typelist.
template<typename _Tp>
struct first : public _Tp::first { };
+ /// Return the typelist minus the first type.
template<typename _Tp>
struct rest : public _Tp::rest { };
+ /// Query to see if a typelist is empty.
template<typename _Tp>
struct empty : public _Tp::empty { };
+ /// Enumerate all the base classes of a class. Form of a typelist.
template<typename _Tp>
struct bases
{
typedef typelist<__bases(_Tp)...> type;
};
+ /// Enumerate all the direct base classes of a class. Form of a typelist.
template<typename _Tp>
struct direct_bases
{
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 8caec327067..191bd281e3d 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -273,7 +273,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -313,6 +312,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 09092677b04..0226b894a6e 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -213,7 +213,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -253,6 +252,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
index 01bcddbe1c6..ca046cf0a33 100644
--- a/libstdc++-v3/python/Makefile.in
+++ b/libstdc++-v3/python/Makefile.in
@@ -237,7 +237,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -277,6 +276,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
diff --git a/libstdc++-v3/scripts/run_doxygen b/libstdc++-v3/scripts/run_doxygen
index 48b17249737..7b601bce0a8 100644
--- a/libstdc++-v3/scripts/run_doxygen
+++ b/libstdc++-v3/scripts/run_doxygen
@@ -261,7 +261,7 @@ for f in $problematic; do
# this is also slow, but safe and easy to debug
oldh=`sed -n '/fC#include </s/.*<\(.*\)>.*/\1/p' $f`
newh=`echo $oldh | ./stdheader`
- sed "s=${oldh}=${newh}=" $f > TEMP
+ sed 's=${oldh}=${newh}=' $f > TEMP
mv TEMP $f
done
rm stdheader
@@ -339,6 +339,10 @@ for f in std_tr1_*; do
newname=`echo $f | sed 's/^std_tr1_/std::tr1::/'`
mv $f $newname
done
+for f in std_tr2_*; do
+ newname=`echo $f | sed 's/^std_tr2_/std::tr2::/'`
+ mv $f $newname
+done
for f in std_*; do
newname=`echo $f | sed 's/^std_/std::/'`
mv $f $newname
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 5a6cb970822..eefa6e269a0 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -190,13 +190,13 @@ endif
# Sources present in the src directory, always present.
sources = \
- atomic.cc \
bitmap_allocator.cc \
pool_allocator.cc \
mt_allocator.cc \
codecvt.cc \
compatibility.cc \
compatibility-c++0x.cc \
+ compatibility-atomic-c++0x.cc \
compatibility-debug_list.cc \
compatibility-debug_list-2.cc \
compatibility-list.cc \
@@ -323,6 +323,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc
compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
functional.lo: functional.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
functional.o: functional.cc
@@ -343,11 +348,6 @@ limits.lo: limits.cc
limits.o: limits.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
-atomic.lo: atomic.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
-atomic.o: atomic.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
-
fstream-inst.lo: fstream-inst.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
fstream-inst.o: fstream-inst.cc
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 5d31fb20c41..4b2646e4a05 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -105,9 +105,9 @@ am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \
@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.lo
am__objects_5 = basic_file.lo c++locale.lo $(am__objects_2) \
$(am__objects_3) $(am__objects_4)
-am__objects_6 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
- mt_allocator.lo codecvt.lo compatibility.lo \
- compatibility-c++0x.lo compatibility-debug_list.lo \
+am__objects_6 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
+ codecvt.lo compatibility.lo compatibility-c++0x.lo \
+ compatibility-atomic-c++0x.lo compatibility-debug_list.lo \
compatibility-debug_list-2.lo compatibility-list.lo \
compatibility-list-2.lo complex_io.lo ctype.lo debug.lo \
functexcept.lo functional.lo globals_io.lo hash_c++0x.lo \
@@ -277,7 +277,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -317,6 +316,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
@@ -407,13 +407,13 @@ host_sources_extra = \
# Sources present in the src directory, always present.
sources = \
- atomic.cc \
bitmap_allocator.cc \
pool_allocator.cc \
mt_allocator.cc \
codecvt.cc \
compatibility.cc \
compatibility-c++0x.cc \
+ compatibility-atomic-c++0x.cc \
compatibility-debug_list.cc \
compatibility-debug_list-2.cc \
compatibility-list.cc \
@@ -917,6 +917,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc
compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
functional.lo: functional.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
functional.o: functional.cc
@@ -937,11 +942,6 @@ limits.lo: limits.cc
limits.o: limits.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
-atomic.lo: atomic.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
-atomic.o: atomic.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
-
fstream-inst.lo: fstream-inst.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
fstream-inst.o: fstream-inst.cc
diff --git a/libstdc++-v3/src/atomic.cc b/libstdc++-v3/src/compatibility-atomic-c++0x.cc
index 5752d39feed..1ee0d7e35a8 100644
--- a/libstdc++-v3/src/atomic.cc
+++ b/libstdc++-v3/src/compatibility-atomic-c++0x.cc
@@ -1,4 +1,4 @@
-// Support for atomic operations -*- C++ -*-
+// <atomic> compatibility -*- C++ -*-
// Copyright (C) 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
@@ -27,6 +27,9 @@
#include <atomic>
#include <mutex>
+// XXX GLIBCXX_ABI Deprecated
+// gcc-4.7.0
+
#define LOGSIZE 4
namespace
@@ -55,6 +58,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __atomic0
{
+
+ struct atomic_flag : public __atomic_flag_base
+ {
+ bool
+ test_and_set(memory_order) noexcept;
+
+ void
+ clear(memory_order) noexcept;
+ };
+
bool
atomic_flag::test_and_set(memory_order) noexcept
{
@@ -74,6 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
_M_i = false;
}
+ } // namespace __atomic0
_GLIBCXX_BEGIN_EXTERN_C
@@ -116,10 +130,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_EXTERN_C
- } // namespace __atomic0
-
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
// XXX GLIBCXX_ABI Deprecated
diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc
index 09e7fc5909d..ff034b16143 100644
--- a/libstdc++-v3/src/thread.cc
+++ b/libstdc++-v3/src/thread.cc
@@ -30,9 +30,27 @@
#if defined(_GLIBCXX_USE_GET_NPROCS)
# include <sys/sysinfo.h>
# define _GLIBCXX_NPROCS get_nprocs()
+#elif defined(_GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP)
+# define _GLIBCXX_NPROCS pthread_num_processors_np()
+#elif defined(_GLIBCXX_USE_SYSCTL_HW_NCPU)
+# include <stddef.h>
+# include <sys/sysctl.h>
+static inline int get_nprocs()
+{
+ int count;
+ size_t size = sizeof(count);
+ int mib[] = { CTL_HW, HW_NCPU };
+ if (!sysctl(mib, 2, &count, &size, NULL, 0))
+ return count;
+ return 0;
+}
+# define _GLIBCXX_NPROCS get_nprocs()
#elif defined(_GLIBCXX_USE_SC_NPROCESSORS_ONLN)
# include <unistd.h>
# define _GLIBCXX_NPROCS sysconf(_SC_NPROCESSORS_ONLN)
+#elif defined(_GLIBCXX_USE_SC_NPROC_ONLN)
+# include <unistd.h>
+# define _GLIBCXX_NPROCS sysconf(_SC_NPROC_ONLN)
#else
# define _GLIBCXX_NPROCS 0
#endif
diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc b/libstdc++-v3/testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc
new file mode 100644
index 00000000000..a72d65faf73
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++98" }
+
+// Copyright (C) 2011 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 <cstdalign>
+
+// { dg-error "ISO C.. 2011" "" { target *-*-* } 32 }
+
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/char/pop_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/char/pop_back.cc
new file mode 100644
index 00000000000..1f0f3d884fb
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/char/pop_back.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2011 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/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const std::string cstr("Badger");
+ std::string str = cstr;
+ str.pop_back();
+ VERIFY( str.size() == cstr.size() - 1 );
+
+ str += cstr.back();
+ VERIFY( str == cstr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/wchar_t/pop_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/wchar_t/pop_back.cc
new file mode 100644
index 00000000000..fb5db8c1380
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/wchar_t/pop_back.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2011 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/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const std::wstring cstr(L"Badger");
+ std::wstring str = cstr;
+ str.pop_back();
+ VERIFY( str.size() == cstr.size() - 1 );
+
+ str += cstr.back();
+ VERIFY( str == cstr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/range_access/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/range_access/char/1.cc
new file mode 100644
index 00000000000..458bf53e2c5
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/range_access/char/1.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010, 2011 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/>.
+
+// 24.6.5, range access [iterator.range]
+
+#include <string>
+
+void
+test01()
+{
+ std::string s("Hello, World!");
+ std::begin(s);
+ std::end(s);
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/range_access.cc b/libstdc++-v3/testsuite/21_strings/basic_string/range_access/wchar_t/1.cc
index 1ce386cbe96..e300b092389 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/range_access.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/range_access/wchar_t/1.cc
@@ -1,7 +1,7 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010. 2011 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
@@ -25,10 +25,6 @@
void
test01()
{
- std::string s("Hello, World!");
- std::begin(s);
- std::end(s);
-
#ifdef _GLIBCXX_USE_WCHAR_T
std::wstring ws(L"Hello, World!");
std::begin(ws);
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 7aec649c03b..4249d975a82 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
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -46,6 +46,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
index 332931addfa..32a5157608c 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -44,6 +44,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
index 8b67e5f3a33..a83b22ef651 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -33,15 +33,29 @@ test01()
bool test __attribute__((unused)) = true;
std::stringstream str;
- std::minstd_rand0 a;
- std::minstd_rand0 b;
+ std::minstd_rand0 u;
+ std::minstd_rand0 v;
- a(); // advance
- str << a;
- VERIFY( !(a == b) );
+ u(); // advance
+ str << u;
+ VERIFY( !(u == v) );
- str >> b;
- VERIFY( a == b );
+ str >> v;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
index 03fb8b04fa1..7c90e3d390f 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -47,6 +47,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
index 578e4959371..c7b15d1ba15 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -46,6 +46,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
index e4129fc8df5..1e2e53ac593 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -43,6 +43,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc
index 4ace9f0cd63..6053efca902 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
-// { dg-do link { xfail *-*-* } }
+// { dg-do link }
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2011 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
@@ -29,7 +29,7 @@ struct dwordp
void atomics()
{
std::atomic<dwordp> a;
- bool b = a.is_lock_free(); // { dg-excess-errors "undefined reference to" }
+ bool b = a.is_lock_free();
}
int main()
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc
index 72bd5dd3a97..690f1215352 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic/requirements/explicit_instantiation/1.cc
@@ -23,5 +23,5 @@
#include <atomic>
#include <testsuite_character.h>
-template class std::atomic<__gnu_test::pod_char>;
+template class std::atomic<__gnu_test::pod_state>;
template class std::atomic<__gnu_test::pod_char*>;
diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
index e2461a1113e..450fb6c2cc7 100644
--- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
+++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
@@ -20,78 +20,36 @@
#include <atomic>
-namespace gnu
-{
#ifndef ATOMIC_CHAR_LOCK_FREE
# error "ATOMIC_CHAR_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_CHAR_LOCK_FREE != 0 \
- && ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2
-# error "ATOMIC_CHAR_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_CHAR16_T_LOCK_FREE
# error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_CHAR16_T_LOCK_FREE != 0 \
- && ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2
-# error "ATOMIC_CHAR16_T_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_CHAR32_T_LOCK_FREE
# error "ATOMIC_CHAR32_T_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_CHAR32_T_LOCK_FREE != 0 \
- && ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2
-# error "ATOMIC_CHAR32_T_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_WCHAR_T_LOCK_FREE
# error "ATOMIC_WCHAR_T_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_WCHAR_T_LOCK_FREE != 0 \
- && ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2
-# error "ATOMIC_WCHAR_T_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_SHORT_LOCK_FREE
# error "ATOMIC_SHORT_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_SHORT_LOCK_FREE != 0 \
- && ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2
-# error "ATOMIC_SHORT_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_INT_LOCK_FREE
# error "ATOMIC_INT_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_INT_LOCK_FREE != 0 \
- && ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2
-# error "ATOMIC_INT_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_LONG_LOCK_FREE
# error "ATOMIC_LONG_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_LONG_LOCK_FREE != 0 \
- && ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2
-# error "ATOMIC_LONG_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_LLONG_LOCK_FREE
# error "ATOMIC_LLONG_LOCK_FREE must be a macro"
-#else
-# if ATOMIC_LLONG_LOCK_FREE != 0 \
- && ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2
-# error "ATOMIC_LLONG_LOCK_FREE must be 0, 1, or 2"
-# endif
#endif
#ifndef ATOMIC_FLAG_INIT
@@ -101,4 +59,41 @@ namespace gnu
#ifndef ATOMIC_VAR_INIT
#error "ATOMIC_VAR_INIT_must_be_a_macro"
#endif
+
+
+extern void abort(void);
+
+main ()
+{
+ if (ATOMIC_CHAR_LOCK_FREE != 0 && ATOMIC_CHAR_LOCK_FREE != 1
+ && ATOMIC_CHAR_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_CHAR16_T_LOCK_FREE != 0 && ATOMIC_CHAR16_T_LOCK_FREE != 1
+ && ATOMIC_CHAR16_T_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_CHAR32_T_LOCK_FREE != 0 && ATOMIC_CHAR32_T_LOCK_FREE != 1
+ && ATOMIC_CHAR32_T_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_WCHAR_T_LOCK_FREE != 0 && ATOMIC_WCHAR_T_LOCK_FREE != 1
+ && ATOMIC_WCHAR_T_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_SHORT_LOCK_FREE != 0 && ATOMIC_SHORT_LOCK_FREE != 1
+ && ATOMIC_SHORT_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_INT_LOCK_FREE != 0 && ATOMIC_INT_LOCK_FREE != 1
+ && ATOMIC_INT_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_LONG_LOCK_FREE != 0 && ATOMIC_LONG_LOCK_FREE != 1
+ && ATOMIC_LONG_LOCK_FREE != 2)
+ abort ();
+
+ if (ATOMIC_LLONG_LOCK_FREE != 0 && ATOMIC_LLONG_LOCK_FREE != 1
+ && ATOMIC_LLONG_LOCK_FREE != 2)
+ abort ();
}
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
new file mode 100644
index 00000000000..24ca72085fc
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
@@ -0,0 +1,56 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2011 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/>.
+
+// LWG 2067. packaged_task should have deleted copy c'tor with const parameter
+
+#include <future>
+#include <thread>
+#include <testsuite_hooks.h>
+
+template<typename F>
+std::future<typename std::result_of<F()>::type> spawn_task(F f)
+{
+ typedef typename std::result_of<F()>::type result_type;
+ std::packaged_task<result_type()> task(std::move(f));
+ std::future<result_type> res(task.get_future());
+ std::thread(std::move(task)).detach();
+ return res;
+}
+
+int get_res()
+{
+ return 42;
+}
+
+void test01()
+{
+ auto f = spawn_task(get_res);
+ VERIFY( f.get() == get_res() );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
new file mode 100644
index 00000000000..40d30705a63
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
@@ -0,0 +1,40 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2011 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/>.
+
+// Test that packaged_task can be default-constructed or move-constructed
+// in a context that does uses-allocator construction.
+
+#include <future>
+#include <memory>
+#include <tuple>
+
+using std::packaged_task;
+using std::allocator_arg;
+using std::allocator;
+using std::tuple;
+
+typedef packaged_task<void()> task;
+allocator<task> a;
+
+tuple<task> t1{ allocator_arg, a };
+tuple<task> t2{ allocator_arg, a, task{} };
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
new file mode 100644
index 00000000000..a22fd203438
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
@@ -0,0 +1,42 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2011 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/>.
+
+// Test that promise can be default-constructed or move-constructed
+// in a context that does uses-allocator construction.
+
+#include <future>
+#include <memory>
+#include <tuple>
+
+using std::promise;
+using std::allocator_arg;
+using std::allocator;
+using std::tuple;
+
+typedef promise<int> p;
+typedef promise<int&> pr;
+typedef promise<void> pv;
+allocator<p> a;
+
+tuple<p, pr, pv> t1{ allocator_arg, a };
+tuple<p, pr, pv> t2{ allocator_arg, a, p{}, pr{}, pv{} };
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index 37e8a3cf675..af161ea5d26 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -213,7 +213,6 @@ glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
@@ -253,6 +252,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = nostdinc
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
index 4e2d071b833..c6e6feac6c0 100644
--- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
@@ -25,4 +25,4 @@
#include <vector>
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 258 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 263 }
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc
new file mode 100644
index 00000000000..4dfa2f6fed8
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc
@@ -0,0 +1,45 @@
+// Copyright (C) 2011 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/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+template<typename StrT>
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const StrT cstr("Badger");
+ StrT str = cstr;
+ str.pop_back();
+ VERIFY( str.size() == cstr.size() - 1 );
+
+ str += cstr.back();
+ VERIFY( str == cstr );
+
+ return test;
+}
+
+int main()
+{
+ test01<__gnu_cxx::__sso_string>();
+ test01<__gnu_cxx::__rc_string>();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc
new file mode 100644
index 00000000000..ae607b61de3
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc
@@ -0,0 +1,45 @@
+// Copyright (C) 2011 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/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+template<typename StrT>
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const StrT cstr(L"Badger");
+ StrT str = cstr;
+ str.pop_back();
+ VERIFY( str.size() == cstr.size() - 1 );
+
+ str += cstr.back();
+ VERIFY( str == cstr );
+
+ return test;
+}
+
+int main()
+{
+ test01<__gnu_cxx::__wsso_string>();
+ test01<__gnu_cxx::__wrc_string>();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index b510c06126f..e4191925546 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1673,13 +1673,12 @@ proc check_v3_target_nprocs { } {
set f [open $src "w"]
puts $f "#include <bits/c++config.h>"
puts $f "#if defined(_GLIBCXX_USE_GET_NPROCS)"
- puts $f "#elif defined(_GLIBCXX_USE_SYSCONF)"
- puts $f "# include <unistd.h>"
- puts $f "# if !defined(_SC_NPROCESSORS_ONLN)"
- puts $f "# error No sysconf option"
- puts $f "# endif"
+ puts $f "#elif defined(_GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP)"
+ puts $f "#elif defined(_GLIBCXX_USE_SYSCTL_HW_NCPU)"
+ puts $f "#elif defined(_GLIBCXX_USE_SC_NPROCESSORS_ONLN)"
+ puts $f "#elif defined(_GLIBCXX_USE_SC_NPROC_ONLN)"
puts $f "#else"
- puts $f "# error No get_nprocs or sysconf"
+ puts $f "# error hardware_concurrency not implemented"
puts $f "#endif"
close $f
diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/41975.cc b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/41975.cc
index 30fc105c272..a5dae41dc60 100644
--- a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/41975.cc
+++ b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/41975.cc
@@ -17,56 +17,167 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-#include <cassert>
+#include <sstream>
#include <unordered_set>
#include <testsuite_performance.h>
-int main()
+namespace
{
- using namespace __gnu_test;
+ // Bench using an unordered_set<int>. Hash functor for int is quite
+ // predictable so it helps bench very specific use cases.
+ template<bool use_cache>
+ void bench()
+ {
+ using namespace __gnu_test;
+ std::ostringstream ostr;
+ ostr << "unordered_set<int> " << (use_cache ? "with" : "without")
+ << " cache";
+ const std::string desc = ostr.str();
+
+ time_counter time;
+ resource_counter resource;
+
+ const int nb = 200000;
+ start_counters(time, resource);
+
+ std::__unordered_set<int, std::hash<int>, std::equal_to<int>,
+ std::allocator<int>, use_cache> us;
+ for (int i = 0; i != nb; ++i)
+ us.insert(i);
+
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": first insert";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
+
+ start_counters(time, resource);
+
+ // Here is the worst erase use case when hashtable implementation was
+ // something like vector<forward_list<>>. Erasing from the end was very
+ // costly because we need to return the iterator following the erased
+ // one, as the hashtable is getting emptier at each step there are
+ // more and more empty bucket to loop through to reach the end of the
+ // container and find out that it was in fact the last element.
+ for (int j = nb - 1; j >= 0; --j)
+ {
+ auto it = us.find(j);
+ if (it != us.end())
+ us.erase(it);
+ }
- time_counter time;
- resource_counter resource;
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": erase from iterator";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
- start_counters(time, resource);
+ start_counters(time, resource);
- std::unordered_set<int> us;
- for (int i = 0; i != 5000000; ++i)
- us.insert(i);
+ // This is a worst insertion use case for the current implementation as
+ // we insert an element at the begining of the hashtable and then we
+ // insert starting at the end so that each time we need to seek up to the
+ // first bucket to find the first non-empty one.
+ us.insert(0);
+ for (int i = nb - 1; i >= 0; --i)
+ us.insert(i);
- stop_counters(time, resource);
- report_performance(__FILE__, "Container generation", time, resource);
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": second insert";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
- start_counters(time, resource);
+ start_counters(time, resource);
- for (int j = 100; j != 0; --j)
+ for (int j = nb - 1; j >= 0; --j)
+ us.erase(j);
+
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": erase from key";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
+ }
+
+ // Bench using unordered_set<string> that show how important it is to cache
+ // hash code as computing string hash code is quite expensive compared to
+ // computing it for int.
+ template<bool use_cache>
+ void bench_str()
{
- auto it = us.begin();
- while (it != us.end())
+ using namespace __gnu_test;
+ std::ostringstream ostr;
+ ostr << "unordered_set<string> " << (use_cache ? "with" : "without")
+ << " cache";
+ const std::string desc = ostr.str();
+
+ time_counter time;
+ resource_counter resource;
+
+ const int nb = 200000;
+ // First generate once strings that are going to be used throughout the
+ // bench:
+ std::vector<std::string> strs;
+ strs.reserve(nb);
+ for (int i = 0; i != nb; ++i)
+ {
+ ostr.str("");
+ ostr << "string #" << i;
+ strs.push_back(ostr.str());
+ }
+
+ start_counters(time, resource);
+
+ std::__unordered_set<std::string, std::hash<std::string>,
+ std::equal_to<std::string>,
+ std::allocator<std::string>, use_cache> us;
+ for (int i = 0; i != nb; ++i)
+ us.insert(strs[i]);
+
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": first insert";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
+
+ start_counters(time, resource);
+
+ for (int j = nb - 1; j >= 0; --j)
{
- if ((*it % j) == 0)
- it = us.erase(it);
- else
- ++it;
+ auto it = us.find(strs[j]);
+ if (it != us.end())
+ us.erase(it);
}
- }
- stop_counters(time, resource);
- report_performance(__FILE__, "Container erase", time, resource);
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": erase from iterator";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
- start_counters(time, resource);
+ start_counters(time, resource);
- us.insert(0);
+ us.insert(strs[0]);
+ for (int i = nb - 1; i >= 0; --i)
+ us.insert(strs[i]);
- for (int i = 0; i != 500; ++i)
- {
- auto it = us.begin();
- ++it;
- assert( it == us.end() );
- }
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": second insert";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
+
+ start_counters(time, resource);
+
+ for (int j = nb - 1; j >= 0; --j)
+ us.erase(strs[j]);
- stop_counters(time, resource);
- report_performance(__FILE__, "Container iteration", time, resource);
+ stop_counters(time, resource);
+ ostr.str("");
+ ostr << desc << ": erase from key";
+ report_performance(__FILE__, ostr.str().c_str(), time, resource);
+ }
+}
+int main()
+{
+ bench<false>();
+ bench<true>();
+ bench_str<false>();
+ bench_str<true>();
return 0;
}