From 25cb81a9275beabb03b621a43bfc108f1d83332b Mon Sep 17 00:00:00 2001 From: spop Date: Fri, 24 Sep 2010 05:37:19 +0000 Subject: [PATCH] Merge from mainline (163495:164578). 2010-09-24 Sebastian Pop * Merge from mainline (163495:164578). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@164580 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 28 + ChangeLog.graphite | 4 + MAINTAINERS | 4 +- config/ChangeLog | 24 + config/bootstrap-lto.mk | 4 +- config/dfp.m4 | 56 + configure | 14 +- configure.ac | 14 +- contrib/ChangeLog | 16 + contrib/check_GNU_style.sh | 7 +- contrib/gcc_update | 160 +- contrib/texi2pod.pl | 9 +- fixincludes/ChangeLog | 5 + fixincludes/fixincl.x | 6 +- fixincludes/inclhack.def | 2 +- gcc/ChangeLog | 3643 +++++++++++++++++++- gcc/DATESTAMP | 2 +- gcc/Makefile.in | 31 +- gcc/aclocal.m4 | 1 + gcc/ada/ChangeLog | 1236 +++++++ gcc/ada/Make-generated.in | 8 + gcc/ada/a-calfor.adb | 24 +- gcc/ada/a-cdlili.adb | 40 +- gcc/ada/a-chtgke.adb | 16 +- gcc/ada/a-chtgop.adb | 8 +- gcc/ada/a-cidlli.adb | 40 +- gcc/ada/a-cihama.adb | 12 +- gcc/ada/a-cihase.adb | 16 +- gcc/ada/a-ciorma.adb | 8 +- gcc/ada/a-ciormu.adb | 4 +- gcc/ada/a-ciorse.adb | 12 +- gcc/ada/a-cohama.adb | 12 +- gcc/ada/a-cohase.adb | 16 +- gcc/ada/a-coinve.adb | 30 +- gcc/ada/a-convec.adb | 34 +- gcc/ada/a-coorma.adb | 8 +- gcc/ada/a-coormu.adb | 4 +- gcc/ada/a-coorse.adb | 12 +- gcc/ada/a-dirval.adb | 4 +- gcc/ada/a-strunb-shared.ads | 12 +- gcc/ada/a-ststio.adb | 6 +- gcc/ada/adaint.c | 23 +- gcc/ada/adaint.h | 3 +- gcc/ada/ali-util.adb | 15 +- gcc/ada/atree.adb | 8 +- gcc/ada/binde.adb | 7 +- gcc/ada/bindgen.adb | 118 +- gcc/ada/casing.ads | 5 +- gcc/ada/checks.adb | 33 +- gcc/ada/clean.adb | 1 - gcc/ada/cstand.adb | 4 + gcc/ada/debug.adb | 4 +- gcc/ada/einfo.adb | 37 +- gcc/ada/einfo.ads | 33 + gcc/ada/errout.ads | 7 - gcc/ada/exp_aggr.adb | 2 +- gcc/ada/exp_attr.adb | 21 +- gcc/ada/exp_cg.adb | 94 +- gcc/ada/exp_ch11.adb | 2 +- gcc/ada/exp_ch3.adb | 381 +- gcc/ada/exp_ch4.adb | 50 +- gcc/ada/exp_ch5.adb | 67 +- gcc/ada/exp_ch6.adb | 133 +- gcc/ada/exp_ch7.adb | 2 +- gcc/ada/exp_ch8.adb | 77 +- gcc/ada/exp_ch9.adb | 90 +- gcc/ada/exp_ch9.ads | 9 + gcc/ada/exp_dbug.ads | 362 +- gcc/ada/exp_disp.adb | 30 +- gcc/ada/exp_dist.adb | 73 +- gcc/ada/exp_intr.adb | 4 + gcc/ada/exp_pakd.adb | 8 + gcc/ada/exp_prag.adb | 4 +- gcc/ada/exp_util.adb | 23 +- gcc/ada/freeze.adb | 4 +- gcc/ada/frontend.adb | 17 +- gcc/ada/g-calend.ads | 13 +- gcc/ada/g-comver.adb | 5 +- gcc/ada/g-expect.ads | 3 + gcc/ada/g-pehage.adb | 62 +- gcc/ada/g-pehage.ads | 11 +- gcc/ada/gcc-interface/Make-lang.in | 401 ++- gcc/ada/gcc-interface/Makefile.in | 28 +- gcc/ada/gcc-interface/decl.c | 133 +- gcc/ada/gcc-interface/gigi.h | 7 + gcc/ada/gcc-interface/lang.opt | 20 +- gcc/ada/gcc-interface/misc.c | 44 +- gcc/ada/gcc-interface/trans.c | 206 +- gcc/ada/gcc-interface/utils.c | 130 +- gcc/ada/gcc-interface/utils2.c | 20 +- gcc/ada/gnat1drv.adb | 6 - gcc/ada/gnat_rm.texi | 149 +- gcc/ada/gnat_ugn.texi | 527 +-- gcc/ada/gnatbind.adb | 8 +- gcc/ada/gnatcmd.adb | 26 +- gcc/ada/gnatlbr.adb | 346 -- gcc/ada/gnatlink.adb | 61 +- gcc/ada/gnatls.adb | 13 +- gcc/ada/gnatvsn.ads | 6 +- gcc/ada/gprep.adb | 17 +- gcc/ada/i-cexten.ads | 19 +- gcc/ada/impunit.adb | 3 +- gcc/ada/lib-load.adb | 49 +- gcc/ada/lib-load.ads | 8 +- gcc/ada/lib.adb | 16 +- gcc/ada/lib.ads | 12 +- gcc/ada/make.adb | 873 ++--- gcc/ada/makeutl.adb | 178 + gcc/ada/makeutl.ads | 11 + gcc/ada/mlib-prj.adb | 30 +- gcc/ada/mlib-tgt.adb | 4 +- gcc/ada/namet.adb | 61 +- gcc/ada/namet.ads | 14 +- gcc/ada/nlists.adb | 243 +- gcc/ada/nlists.ads | 129 +- gcc/ada/opt.adb | 4 + gcc/ada/opt.ads | 29 + gcc/ada/osint.adb | 23 +- gcc/ada/osint.ads | 17 + gcc/ada/output.adb | 12 +- gcc/ada/par-ch2.adb | 17 +- gcc/ada/par-ch3.adb | 1 - gcc/ada/par-ch4.adb | 59 +- gcc/ada/par-ch5.adb | 48 +- gcc/ada/par-ch6.adb | 2 +- gcc/ada/par-ch9.adb | 4 +- gcc/ada/par-labl.adb | 8 +- gcc/ada/par-load.adb | 13 +- gcc/ada/par-prag.adb | 4 +- gcc/ada/par.adb | 7 + gcc/ada/prj-attr.adb | 2 + gcc/ada/prj-attr.ads | 14 +- gcc/ada/prj-conf.adb | 4 +- gcc/ada/prj-dect.adb | 23 +- gcc/ada/prj-env.adb | 8 +- gcc/ada/prj-err.adb | 12 +- gcc/ada/prj-err.ads | 18 +- gcc/ada/prj-ext.adb | 16 +- gcc/ada/prj-makr.adb | 3 +- gcc/ada/prj-nmsc.adb | 29 +- gcc/ada/prj-proc.adb | 33 +- gcc/ada/prj-strt.adb | 3 +- gcc/ada/prj-tree.ads | 8 +- gcc/ada/prj-util.adb | 95 +- gcc/ada/prj-util.ads | 29 +- gcc/ada/prj.adb | 20 +- gcc/ada/prj.ads | 1 + gcc/ada/projects.texi | 39 +- gcc/ada/repinfo.adb | 37 +- gcc/ada/restrict.adb | 41 +- gcc/ada/restrict.ads | 20 +- gcc/ada/rtsfind.ads | 12 +- gcc/ada/s-bitops.adb | 7 +- gcc/ada/s-direio.adb | 6 +- gcc/ada/s-fatgen.adb | 39 +- gcc/ada/s-ficobl.ads | 3 +- gcc/ada/s-fileio.adb | 6 +- gcc/ada/s-os_lib.ads | 94 +- gcc/ada/s-pooglo.ads | 6 +- gcc/ada/s-stratt-xdr.adb | 1891 ++++++++++ gcc/ada/s-stratt.ads | 10 +- gcc/ada/s-strxdr.adb | 1891 ---------- gcc/ada/s-taenca.adb | 9 +- gcc/ada/s-taprop-linux.adb | 6 +- gcc/ada/s-taskin.ads | 41 +- gcc/ada/s-tasren.adb | 4 +- gcc/ada/s-tpobop.adb | 42 +- gcc/ada/s-tporft.adb | 18 +- gcc/ada/scans.ads | 29 +- gcc/ada/scn.adb | 105 +- gcc/ada/scn.ads | 23 +- gcc/ada/scng.adb | 44 +- gcc/ada/scng.ads | 13 +- gcc/ada/scos.ads | 48 +- gcc/ada/sem.adb | 207 +- gcc/ada/sem_aggr.adb | 20 +- gcc/ada/sem_attr.adb | 17 +- gcc/ada/sem_aux.ads | 3 +- gcc/ada/sem_ch10.adb | 2 +- gcc/ada/sem_ch12.adb | 68 +- gcc/ada/sem_ch13.adb | 878 +++-- gcc/ada/sem_ch3.adb | 158 +- gcc/ada/sem_ch4.adb | 50 +- gcc/ada/sem_ch6.adb | 116 +- gcc/ada/sem_ch6.ads | 12 +- gcc/ada/sem_ch8.adb | 24 +- gcc/ada/sem_ch9.adb | 22 +- gcc/ada/sem_disp.adb | 101 +- gcc/ada/sem_disp.ads | 8 + gcc/ada/sem_elab.adb | 4 +- gcc/ada/sem_eval.adb | 14 +- gcc/ada/sem_prag.adb | 120 +- gcc/ada/sem_res.adb | 277 +- gcc/ada/sem_type.adb | 42 +- gcc/ada/sem_type.ads | 10 +- gcc/ada/sem_util.adb | 28 +- gcc/ada/sem_warn.adb | 36 +- gcc/ada/sem_warn.ads | 22 +- gcc/ada/sinfo.ads | 9 + gcc/ada/sinput-l.adb | 7 +- gcc/ada/sinput-p.adb | 8 +- gcc/ada/sinput-p.ads | 4 +- gcc/ada/snames.ads-tmpl | 6 + gcc/ada/socket.c | 8 +- gcc/ada/sprint.adb | 14 +- gcc/ada/sprint.ads | 2 +- gcc/ada/style.ads | 2 +- gcc/ada/styleg.adb | 1 + gcc/ada/styleg.ads | 2 +- gcc/ada/stylesw.adb | 7 +- gcc/ada/stylesw.ads | 2 +- gcc/ada/switch-m.adb | 3 + gcc/ada/symbols-processing-vms-alpha.adb | 85 +- gcc/ada/sysdep.c | 2 +- gcc/ada/types.ads | 14 +- gcc/ada/ug_words | 10 +- gcc/ada/uintp.adb | 4 +- gcc/ada/urealp.adb | 164 +- gcc/ada/urealp.ads | 21 +- gcc/ada/usage.adb | 6 + gcc/ada/vms_cmds.ads | 52 + gcc/ada/vms_conv.adb | 10 +- gcc/ada/vms_conv.ads | 26 +- gcc/ada/vms_data.ads | 43 +- gcc/ada/xref_lib.adb | 2 +- gcc/alias.c | 72 + gcc/basic-block.h | 8 +- gcc/bb-reorder.c | 38 +- gcc/builtins.c | 159 +- gcc/c-decl.c | 42 +- gcc/c-family/ChangeLog | 86 + gcc/c-family/c-common.c | 138 +- gcc/c-family/c-common.h | 7 +- gcc/c-family/c-opts.c | 54 - gcc/c-family/c.opt | 226 +- gcc/c-family/stub-objc.c | 9 +- gcc/c-lang.h | 2 +- gcc/c-parser.c | 58 +- gcc/c-tree.h | 3 +- gcc/c-typeck.c | 40 +- gcc/calls.c | 58 +- gcc/cfgcleanup.c | 293 +- gcc/cfgexpand.c | 64 +- gcc/cfglayout.c | 4 +- gcc/cfgloop.h | 2 +- gcc/cfgrtl.c | 5 +- gcc/cgraph.h | 3 + gcc/cgraphunit.c | 20 +- gcc/cif-code.def | 2 + gcc/collect2.c | 85 +- gcc/combine.c | 133 +- gcc/common.opt | 281 +- gcc/config.gcc | 8 +- gcc/config.in | 3 + gcc/config/alpha/alpha-modes.def | 4 +- gcc/config/alpha/alpha-protos.h | 3 +- gcc/config/alpha/alpha.c | 127 +- gcc/config/alpha/alpha.h | 11 - gcc/config/alpha/osf5-unwind.h | 329 ++ gcc/config/alpha/osf5.h | 2 + gcc/config/alpha/vms.h | 11 +- gcc/config/arc/arc-protos.h | 3 +- gcc/config/arc/arc.c | 13 +- gcc/config/arc/arc.h | 19 +- gcc/config/arm/arm-cores.def | 1 + gcc/config/arm/arm-protos.h | 14 +- gcc/config/arm/arm-tune.md | 2 +- gcc/config/arm/arm.c | 192 +- gcc/config/arm/arm.h | 51 +- gcc/config/arm/arm.md | 293 +- gcc/config/arm/bpabi.h | 2 +- gcc/config/arm/constraints.md | 8 +- gcc/config/arm/cortex-a5.md | 297 ++ gcc/config/arm/cortex-a8-neon.md | 1546 ++++----- gcc/config/arm/cortex-a9-neon.md | 1237 +++++++ gcc/config/arm/cortex-a9.md | 5 +- gcc/config/arm/cortex-m4-fpu.md | 111 + gcc/config/arm/cortex-m4.md | 111 + gcc/config/arm/iterators.md | 36 +- gcc/config/arm/linux-atomic.c | 9 +- gcc/config/arm/neon-schedgen.ml | 198 +- gcc/config/arm/neon.md | 580 +++- gcc/config/arm/predicates.md | 63 + gcc/config/arm/sync.md | 48 +- gcc/config/arm/thumb2.md | 139 - gcc/config/arm/vfp.md | 6 +- gcc/config/arm/vxworks.h | 12 +- gcc/config/avr/avr-protos.h | 1 - gcc/config/avr/avr.c | 8 +- gcc/config/avr/avr.h | 2 - gcc/config/bfin/bfin-protos.h | 4 +- gcc/config/bfin/bfin.c | 37 +- gcc/config/bfin/bfin.h | 20 - gcc/config/cris/cris-protos.h | 4 +- gcc/config/cris/cris.c | 26 +- gcc/config/cris/cris.h | 13 +- gcc/config/crx/crx.c | 17 +- gcc/config/crx/crx.h | 10 +- gcc/config/darwin-driver.c | 64 +- gcc/config/darwin.h | 5 +- gcc/config/fr30/fr30.c | 5 +- gcc/config/frv/frv-protos.h | 6 +- gcc/config/frv/frv.c | 112 +- gcc/config/frv/frv.h | 75 +- gcc/config/h8300/h8300-protos.h | 4 +- gcc/config/h8300/h8300.c | 22 +- gcc/config/h8300/h8300.h | 21 +- gcc/config/i386/cygming.h | 6 + gcc/config/i386/cygwin.h | 9 +- gcc/config/i386/cygwin1.c | 42 +- gcc/config/i386/darwin.h | 12 +- gcc/config/i386/darwin.opt | 22 + gcc/config/i386/freebsd.h | 11 + gcc/config/i386/i386-protos.h | 42 +- gcc/config/i386/i386.c | 1885 ++++++++-- gcc/config/i386/i386.h | 144 +- gcc/config/i386/i386.md | 2255 +++++------- gcc/config/i386/i386.opt | 21 +- gcc/config/i386/linux-unwind.h | 2 +- gcc/config/i386/linux64.h | 3 +- gcc/config/i386/mingw32.h | 10 +- gcc/config/i386/mmx.md | 114 +- gcc/config/i386/predicates.md | 280 +- gcc/config/i386/sse.md | 531 +-- gcc/config/i386/t-cygwin | 6 +- gcc/config/i386/t-darwin | 1 + gcc/config/i386/t-mingw-w32 | 2 +- gcc/config/i386/t-mingw-w64 | 2 +- gcc/config/i386/t-mingw32 | 2 +- gcc/config/ia64/div.md | 48 +- gcc/config/ia64/ia64-protos.h | 2 - gcc/config/ia64/ia64.c | 50 +- gcc/config/ia64/ia64.h | 16 +- gcc/config/ia64/ia64.md | 29 +- gcc/config/ia64/vms.h | 5 +- gcc/config/iq2000/iq2000-protos.h | 3 +- gcc/config/iq2000/iq2000.c | 9 +- gcc/config/iq2000/iq2000.h | 2 - gcc/config/linux.h | 2 +- gcc/config/lm32/lm32-protos.h | 3 +- gcc/config/lm32/lm32.c | 7 +- gcc/config/lm32/lm32.h | 2 - gcc/config/m32c/m32c-protos.h | 10 - gcc/config/m32c/m32c.c | 137 +- gcc/config/m32c/m32c.h | 14 - gcc/config/m32r/m32r.c | 170 +- gcc/config/m32r/m32r.h | 119 +- gcc/config/m68hc11/m68hc11-protos.h | 2 - gcc/config/m68hc11/m68hc11.c | 9 +- gcc/config/m68hc11/m68hc11.h | 11 - gcc/config/m68k/m68k-protos.h | 3 +- gcc/config/m68k/m68k.c | 17 +- gcc/config/m68k/m68k.h | 4 +- gcc/config/mcore/mcore-protos.h | 3 +- gcc/config/mcore/mcore.c | 46 +- gcc/config/mcore/mcore.h | 32 +- gcc/config/mcore/mcore.opt | 5 +- gcc/config/mep/mep-pragma.c | 37 +- gcc/config/mep/mep-protos.h | 14 +- gcc/config/mep/mep.c | 202 +- gcc/config/mep/mep.h | 8 +- gcc/config/mep/t-mep | 4 +- gcc/config/mips/loongson.md | 6 +- gcc/config/mips/mips-protos.h | 6 +- gcc/config/mips/mips.c | 61 +- gcc/config/mips/mips.h | 37 +- gcc/config/mips/sde.h | 9 +- gcc/config/mips/sde.opt | 28 + gcc/config/mmix/mmix-protos.h | 1 - gcc/config/mmix/mmix.c | 25 +- gcc/config/mmix/mmix.h | 15 - gcc/config/mn10300/mn10300-protos.h | 4 +- gcc/config/mn10300/mn10300.c | 9 +- gcc/config/mn10300/mn10300.h | 2 - gcc/config/moxie/moxie-protos.h | 1 - gcc/config/moxie/moxie.c | 9 +- gcc/config/moxie/moxie.h | 2 - gcc/config/pa/pa-protos.h | 5 +- gcc/config/pa/pa.c | 172 +- gcc/config/pa/pa.h | 94 +- gcc/config/pa/pa.md | 19 +- gcc/config/pa/pa32-regs.h | 24 +- gcc/config/pa/pa64-regs.h | 26 +- gcc/config/pdp11/pdp11-protos.h | 5 +- gcc/config/pdp11/pdp11.c | 20 +- gcc/config/pdp11/pdp11.h | 24 +- gcc/config/picochip/picochip-protos.h | 5 +- gcc/config/picochip/picochip.c | 105 +- gcc/config/picochip/picochip.h | 8 +- gcc/config/picochip/picochip.md | 38 +- gcc/config/rs6000/aix43.h | 12 +- gcc/config/rs6000/aix51.h | 12 +- gcc/config/rs6000/aix52.h | 12 +- gcc/config/rs6000/aix53.h | 12 +- gcc/config/rs6000/aix61.h | 12 +- gcc/config/rs6000/linux64.h | 10 +- gcc/config/rs6000/rs6000-modes.def | 4 +- gcc/config/rs6000/rs6000-protos.h | 11 +- gcc/config/rs6000/rs6000.c | 320 +- gcc/config/rs6000/rs6000.h | 88 +- gcc/config/rs6000/rs6000.md | 784 +++-- gcc/config/rs6000/rs6000.opt | 7 +- gcc/config/rs6000/sysv4.h | 10 +- gcc/config/rs6000/vsx.md | 25 +- gcc/config/rx/rx-modes.def | 9 +- gcc/config/rx/rx-protos.h | 6 - gcc/config/rx/rx.c | 73 +- gcc/config/rx/rx.h | 8 - gcc/config/rx/rx.md | 14 +- gcc/config/s390/s390-protos.h | 4 +- gcc/config/s390/s390.c | 49 +- gcc/config/s390/s390.h | 6 +- gcc/config/s390/s390.md | 33 +- gcc/config/score/score-protos.h | 3 +- gcc/config/score/score.c | 16 +- gcc/config/score/score.h | 6 +- gcc/config/score/score3.c | 6 +- gcc/config/score/score3.h | 4 +- gcc/config/score/score7.c | 6 +- gcc/config/score/score7.h | 4 +- gcc/config/sh/sh-protos.h | 7 - gcc/config/sh/sh.c | 146 +- gcc/config/sh/sh.h | 16 +- gcc/config/sh/sh.md | 33 + gcc/config/sparc/constraints.md | 4 +- gcc/config/sparc/linux.h | 3 +- gcc/config/sparc/linux64.h | 3 +- gcc/config/sparc/sparc.c | 26 +- gcc/config/sparc/sparc.h | 6 - gcc/config/sparc/vxworks.h | 12 +- gcc/config/spu/spu-protos.h | 2 - gcc/config/spu/spu.c | 21 +- gcc/config/spu/spu.h | 4 - gcc/config/stormy16/stormy16.c | 161 +- gcc/config/t-darwin | 2 +- gcc/config/v850/v850-protos.h | 5 +- gcc/config/v850/v850.c | 305 +- gcc/config/v850/v850.h | 75 +- gcc/config/vax/elf.h | 10 +- gcc/config/vax/vax-protos.h | 5 +- gcc/config/vax/vax.c | 14 +- gcc/config/vax/vax.h | 4 +- gcc/config/vxworks.c | 4 +- gcc/config/vxworks.h | 4 +- gcc/config/xtensa/xtensa-protos.h | 6 +- gcc/config/xtensa/xtensa.c | 64 +- gcc/config/xtensa/xtensa.h | 28 +- gcc/configure | 177 +- gcc/configure.ac | 144 +- gcc/cp/ChangeLog | 166 + gcc/cp/call.c | 66 +- gcc/cp/class.c | 18 +- gcc/cp/cp-tree.def | 5 + gcc/cp/cp-tree.h | 19 +- gcc/cp/cxx-pretty-print.c | 17 + gcc/cp/decl.c | 39 +- gcc/cp/decl2.c | 4 + gcc/cp/dump.c | 7 + gcc/cp/error.c | 5 + gcc/cp/lex.c | 21 +- gcc/cp/mangle.c | 2 +- gcc/cp/method.c | 49 +- gcc/cp/name-lookup.c | 7 +- gcc/cp/name-lookup.h | 2 +- gcc/cp/parser.c | 340 +- gcc/cp/pt.c | 67 +- gcc/cp/semantics.c | 72 +- gcc/cp/tree.c | 5 + gcc/cp/typeck.c | 25 +- gcc/cse.c | 4 +- gcc/cselib.c | 9 + gcc/dbxout.c | 28 +- gcc/defaults.h | 12 +- gcc/df-core.c | 1 + gcc/df-problems.c | 316 ++ gcc/df-scan.c | 344 +- gcc/df.h | 25 +- gcc/doc/contrib.texi | 2 +- gcc/doc/cppopts.texi | 8 +- gcc/doc/extend.texi | 92 +- gcc/doc/install.texi | 28 +- gcc/doc/invoke.texi | 232 +- gcc/doc/md.texi | 32 +- gcc/doc/objc.texi | 2 +- gcc/doc/options.texi | 57 + gcc/doc/sourcebuild.texi | 5 + gcc/doc/standards.texi | 6 +- gcc/doc/tm.texi | 83 +- gcc/doc/tm.texi.in | 79 +- gcc/doc/trouble.texi | 2 +- gcc/dse.c | 9 +- gcc/dwarf2out.c | 425 ++- gcc/dwarf2out.h | 1 + gcc/emit-rtl.c | 17 +- gcc/except.c | 37 +- gcc/explow.c | 123 +- gcc/expr.c | 230 +- gcc/expr.h | 5 +- gcc/final.c | 19 +- gcc/flags.h | 8 - gcc/fold-const.c | 20 +- gcc/fortran/ChangeLog | 842 ++++- gcc/fortran/Make-lang.in | 1 + gcc/fortran/arith.c | 2 +- gcc/fortran/check.c | 208 +- gcc/fortran/class.c | 31 +- gcc/fortran/convert.c | 9 +- gcc/fortran/data.c | 8 +- gcc/fortran/dependency.c | 117 +- gcc/fortran/dump-parse-tree.c | 14 + gcc/fortran/expr.c | 239 +- gcc/fortran/f95-lang.c | 32 +- gcc/fortran/frontend-passes.c | 627 ++-- gcc/fortran/gfortran.h | 49 +- gcc/fortran/gfortran.texi | 4 +- gcc/fortran/gfortranspec.c | 4 +- gcc/fortran/interface.c | 65 +- gcc/fortran/intrinsic.c | 553 +-- gcc/fortran/intrinsic.h | 39 + gcc/fortran/intrinsic.texi | 1148 +++++- gcc/fortran/invoke.texi | 44 +- gcc/fortran/iresolve.c | 188 +- gcc/fortran/lang.opt | 90 + gcc/fortran/match.c | 89 +- gcc/fortran/mathbuiltins.def | 27 +- gcc/fortran/openmp.c | 3 +- gcc/fortran/parse.c | 7 + gcc/fortran/parse.h | 2 +- gcc/fortran/primary.c | 51 +- gcc/fortran/resolve.c | 557 +-- gcc/fortran/simplify.c | 643 +++- gcc/fortran/trans-array.c | 1105 +++--- gcc/fortran/trans-array.h | 2 + gcc/fortran/trans-common.c | 5 +- gcc/fortran/trans-const.c | 52 +- gcc/fortran/trans-const.h | 4 + gcc/fortran/trans-decl.c | 131 +- gcc/fortran/trans-expr.c | 629 ++-- gcc/fortran/trans-intrinsic.c | 1638 ++++++--- gcc/fortran/trans-io.c | 135 +- gcc/fortran/trans-openmp.c | 169 +- gcc/fortran/trans-stmt.c | 555 +-- gcc/fortran/trans-types.c | 93 +- gcc/fortran/trans-types.h | 7 + gcc/fortran/trans.c | 226 +- gcc/fortran/trans.h | 81 +- gcc/function.c | 29 +- gcc/function.h | 34 + gcc/fwprop.c | 22 +- gcc/gcc.c | 553 +-- gcc/gcse.c | 10 +- gcc/genautomata.c | 10 +- gcc/gengtype.c | 2 +- gcc/genmodes.c | 4 +- gcc/gimple-fold.c | 154 +- gcc/gimple.c | 164 +- gcc/gimple.h | 2 + gcc/gimplify.c | 113 +- gcc/graphite-dependences.c | 4 +- gcc/graphite-poly.c | 2 +- gcc/graphite-scop-detection.c | 4 +- gcc/gthr-posix.h | 3 +- gcc/gthr-posix95.h | 3 +- gcc/haifa-sched.c | 84 +- gcc/hooks.c | 20 + gcc/hooks.h | 3 + gcc/ifcvt.c | 152 +- gcc/incpath.c | 2 +- gcc/ipa-cp.c | 22 +- gcc/ipa-inline.c | 17 +- gcc/ipa-prop.c | 122 +- gcc/ipa-prop.h | 4 +- gcc/ipa-split.c | 4 +- gcc/ipa.c | 62 +- gcc/ira-color.c | 10 +- gcc/ira-conflicts.c | 3 +- gcc/ira.c | 12 +- gcc/java/ChangeLog | 36 + gcc/java/jcf-parse.c | 17 +- gcc/java/jvgenmain.c | 4 +- gcc/java/jvspec.c | 21 +- gcc/java/lang.c | 1 - gcc/java/lang.opt | 56 +- gcc/langhooks-def.h | 4 +- gcc/langhooks.h | 5 - gcc/libgcc-std.ver | 5 + gcc/lto-cgraph.c | 52 +- gcc/lto-streamer-in.c | 59 +- gcc/lto-streamer-out.c | 58 +- gcc/lto-streamer.c | 4 +- gcc/lto-streamer.h | 1 + gcc/lto-wrapper.c | 44 +- gcc/lto/ChangeLog | 45 + gcc/lto/lang.opt | 2 +- gcc/lto/lto-elf.c | 8 +- gcc/lto/lto-tree.h | 2 +- gcc/lto/lto.c | 27 +- gcc/machmode.def | 4 +- gcc/mode-switching.c | 2 +- gcc/objc/ChangeLog | 51 + gcc/objc/objc-act.c | 112 +- gcc/objcp/ChangeLog | 6 + gcc/objcp/objcp-decl.c | 34 + gcc/opt-functions.awk | 8 +- gcc/optc-gen.awk | 66 +- gcc/opth-gen.awk | 32 +- gcc/opts-common.c | 615 +++- gcc/opts.c | 65 +- gcc/opts.h | 24 +- gcc/output.h | 3 + gcc/passes.c | 17 +- gcc/po/ChangeLog | 5 + gcc/po/exgettext | 17 +- gcc/postreload.c | 8 +- gcc/print-rtl.c | 10 +- gcc/regmove.c | 8 +- gcc/regs.h | 6 - gcc/reload.c | 21 +- gcc/reload1.c | 154 - gcc/reorg.c | 38 +- gcc/rtl.c | 8 + gcc/rtl.def | 4 + gcc/rtl.h | 3 + gcc/rtlanal.c | 8 +- gcc/sched-int.h | 9 + gcc/sched-rgn.c | 10 +- gcc/sel-sched.c | 70 +- gcc/simplify-rtx.c | 4 +- gcc/stor-layout.c | 4 +- gcc/system.h | 5 +- gcc/target.def | 57 +- gcc/targhooks.c | 29 +- gcc/targhooks.h | 2 + gcc/testsuite/ChangeLog | 1297 ++++++- gcc/testsuite/c-c++-common/Wunused-var-12.c | 1 + gcc/testsuite/c-c++-common/cpp/pr45457.c | 18 + gcc/testsuite/c-c++-common/uninit-17.c | 4 +- gcc/testsuite/g++.dg/cpp0x/auto19.C | 8 + gcc/testsuite/g++.dg/cpp0x/implicit9.C | 12 + gcc/testsuite/g++.dg/cpp0x/initlist42.C | 13 + gcc/testsuite/g++.dg/cpp0x/initlist43.C | 7 + gcc/testsuite/g++.dg/cpp0x/initlist44.C | 5 + gcc/testsuite/g++.dg/cpp0x/inline-ns3.C | 2 + gcc/testsuite/g++.dg/cpp0x/inline-ns4.C | 2 + gcc/testsuite/g++.dg/cpp0x/inline-ns5.C | 2 + gcc/testsuite/g++.dg/cpp0x/range-for1.C | 17 + gcc/testsuite/g++.dg/cpp0x/range-for2.C | 41 + gcc/testsuite/g++.dg/cpp0x/range-for3.C | 42 + gcc/testsuite/g++.dg/cpp0x/range-for4.C | 119 + gcc/testsuite/g++.dg/cpp0x/range-for5.C | 54 + gcc/testsuite/g++.dg/cpp0x/range-for6.C | 29 + gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C | 11 + .../g++.dg/debug/dwarf2/global-used-types-1.C | 26 +- gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C | 8 +- gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C | 2 +- gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C | 10 +- .../g++.dg/debug/dwarf2/template-func-params-4.C | 4 +- .../g++.dg/debug/dwarf2/template-func-params-7.C | 18 +- .../g++.dg/debug/dwarf2/template-params-4.C | 4 +- .../g++.dg/debug/dwarf2/template-params-6.C | 4 +- .../g++.dg/debug/dwarf2/template-params-7.C | 2 +- gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C | 10 +- gcc/testsuite/g++.dg/debug/pr45660.C | 16 + gcc/testsuite/g++.dg/eh/pr45569.C | 23 + gcc/testsuite/g++.dg/ext/attr-ifunc-1.C | 34 + gcc/testsuite/g++.dg/ext/attr-ifunc-2.C | 38 + gcc/testsuite/g++.dg/ext/attr-ifunc-3.C | 39 + gcc/testsuite/g++.dg/ext/attr-ifunc-4.C | 44 + gcc/testsuite/g++.dg/gomp/atomic-11.C | 306 ++ gcc/testsuite/g++.dg/gomp/atomic-12.C | 9 + gcc/testsuite/g++.dg/gomp/atomic-13.C | 43 + gcc/testsuite/g++.dg/gomp/atomic-14.C | 19 + gcc/testsuite/g++.dg/inherit/covariant7.C | 16 +- gcc/testsuite/g++.dg/ipa/pr45565.C | 29 + gcc/testsuite/g++.dg/lookup/strong-using-1.C | 1 + gcc/testsuite/g++.dg/lookup/strong-using-2.C | 1 + gcc/testsuite/g++.dg/lookup/strong-using-3.C | 1 + gcc/testsuite/g++.dg/lookup/strong-using-5.C | 2 + gcc/testsuite/g++.dg/lto/pr45679-1_0.C | 28 + gcc/testsuite/g++.dg/lto/pr45679-1_1.C | 77 + gcc/testsuite/g++.dg/lto/pr45679-2_0.C | 119 + gcc/testsuite/g++.dg/lto/pr45679-2_1.C | 100 + gcc/testsuite/g++.dg/opt/pr44919.C | 253 ++ gcc/testsuite/g++.dg/opt/pr45316.C | 28 + gcc/testsuite/g++.dg/opt/pr45412.C | 26 + gcc/testsuite/g++.dg/other/i386-8.C | 23 + gcc/testsuite/g++.dg/parse/defarg15.C | 5 + .../g++.dg/parse/parameter-declaration-2.C | 1 + gcc/testsuite/g++.dg/parse/redef2.C | 7 + gcc/testsuite/g++.dg/template/char1.C | 2 +- gcc/testsuite/g++.dg/template/crash102.C | 5 + gcc/testsuite/g++.dg/template/crash103.C | 4 + gcc/testsuite/g++.dg/template/nontype10.C | 2 +- gcc/testsuite/g++.dg/template/sfinae25.C | 14 + gcc/testsuite/g++.dg/template/typedef34.C | 37 + gcc/testsuite/g++.dg/template/typedef35.C | 41 + gcc/testsuite/g++.dg/torture/pr34850.C | 2 +- gcc/testsuite/g++.dg/torture/pr44972.C | 142 + gcc/testsuite/g++.dg/torture/pr45393.C | 38 + gcc/testsuite/g++.dg/torture/pr45580.C | 50 + gcc/testsuite/g++.dg/torture/pr45709-2.C | 20 + gcc/testsuite/g++.dg/torture/pr45709.C | 19 + gcc/testsuite/g++.dg/tree-prof/partition2.C | 15 + gcc/testsuite/g++.dg/tree-ssa/pr45453.C | 19 + gcc/testsuite/g++.dg/tree-ssa/pr45605.C | 37 + gcc/testsuite/g++.dg/vect/pr45470-a.cc | 24 + gcc/testsuite/g++.dg/vect/pr45470-b.cc | 52 + gcc/testsuite/g++.dg/warn/Wdouble-promotion.C | 99 + gcc/testsuite/g++.dg/warn/Wunused-var-15.C | 29 + gcc/testsuite/gcc.c-torture/compile/20100907.c | 9 + gcc/testsuite/gcc.c-torture/compile/20100915-1.c | 82 + .../gcc.c-torture/compile/limits-fnargs.c | 1 + gcc/testsuite/gcc.c-torture/compile/pr44246.c | 5 + gcc/testsuite/gcc.c-torture/compile/pr44937.c | 30 + gcc/testsuite/gcc.c-torture/compile/pr45059.c | 23 + gcc/testsuite/gcc.c-torture/compile/pr45412.c | 22 + gcc/testsuite/gcc.c-torture/compile/pr45535.c | 38 + gcc/testsuite/gcc.c-torture/compile/pr45728.c | 17 + gcc/testsuite/gcc.c-torture/execute/20100827-1.c | 23 + gcc/testsuite/gcc.c-torture/execute/pr40386.c | 99 + gcc/testsuite/gcc.c-torture/execute/pr40386.x | 2 + gcc/testsuite/gcc.c-torture/execute/pr44858.c | 28 + gcc/testsuite/gcc.c-torture/execute/pr45695.c | 32 + gcc/testsuite/gcc.dg/20100906-1.c | 48 + gcc/testsuite/gcc.dg/Wdouble-promotion.c | 104 + gcc/testsuite/gcc.dg/alias-8.c | 2 +- gcc/testsuite/gcc.dg/attr-ifunc-1.c | 23 + gcc/testsuite/gcc.dg/attr-ifunc-2.c | 28 + gcc/testsuite/gcc.dg/attr-ifunc-3.c | 27 + gcc/testsuite/gcc.dg/attr-ifunc-4.c | 23 + gcc/testsuite/gcc.dg/attr-ifunc-5.c | 23 + gcc/testsuite/gcc.dg/attr-isr.c | 3 +- gcc/testsuite/gcc.dg/const-uniq-1.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-comments-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/warn-comments-3.c | 7 + gcc/testsuite/gcc.dg/cpp/warn-comments.c | 4 +- .../gcc.dg/debug/dwarf2/global-used-types.c | 28 +- gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c | 4 +- gcc/testsuite/gcc.dg/debug/pr41893-1.c | 5 +- gcc/testsuite/gcc.dg/gomp/atomic-12.c | 306 ++ gcc/testsuite/gcc.dg/gomp/atomic-13.c | 9 + gcc/testsuite/gcc.dg/gomp/atomic-14.c | 43 + gcc/testsuite/gcc.dg/graphite/id-27.c | 17 + gcc/testsuite/gcc.dg/graphite/pr44391.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-0.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-1.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-2.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-20.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-21.c | 2 +- gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c | 3 +- gcc/testsuite/gcc.dg/ipa/pr45644.c | 35 + gcc/testsuite/gcc.dg/lto/20100825-1_0.c | 57 + gcc/testsuite/gcc.dg/matrix/matrix-3.c | 2 - gcc/testsuite/gcc.dg/matrix/matrix-4.c | 2 - gcc/testsuite/gcc.dg/matrix/matrix.exp | 4 +- gcc/testsuite/gcc.dg/nested-func-8.c | 57 + gcc/testsuite/gcc.dg/opts-1.c | 4 +- gcc/testsuite/gcc.dg/opts-4.c | 9 + gcc/testsuite/gcc.dg/pr27898.c | 5 +- gcc/testsuite/gcc.dg/pr28706.c | 5 +- gcc/testsuite/gcc.dg/pr28712.c | 5 +- gcc/testsuite/gcc.dg/pr30762-1.c | 5 +- gcc/testsuite/gcc.dg/pr31529-1.c | 5 +- gcc/testsuite/gcc.dg/pr34457-1.c | 5 +- gcc/testsuite/gcc.dg/pr34668-1.c | 5 +- gcc/testsuite/gcc.dg/pr34989-1.c | 5 +- gcc/testsuite/gcc.dg/pr43557-1.c | 5 +- gcc/testsuite/gcc.dg/pr44485.c | 31 + gcc/testsuite/gcc.dg/pr45415.c | 68 + gcc/testsuite/gcc.dg/pr45449.c | 22 + gcc/testsuite/gcc.dg/pr45461.c | 18 + gcc/testsuite/gcc.dg/pr45506.c | 47 + gcc/testsuite/gcc.dg/pr45567.c | 9 + gcc/testsuite/gcc.dg/pr45750.c | 16 + gcc/testsuite/gcc.dg/stack-usage-1.c | 43 + gcc/testsuite/gcc.dg/struct/struct-reorg.exp | 4 +- gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c | 2 - .../gcc.dg/struct/wo_prof_escape_arg_to_local.c | 2 - .../gcc.dg/struct/wo_prof_escape_return.c | 2 - gcc/testsuite/gcc.dg/tls/thr-init-2.c | 1 + gcc/testsuite/gcc.dg/torture/pr23821.c | 2 +- gcc/testsuite/gcc.dg/torture/pr44806.c | 1 + gcc/testsuite/gcc.dg/torture/pr45623.c | 28 + gcc/testsuite/gcc.dg/torture/pr45678-1.c | 16 + gcc/testsuite/gcc.dg/torture/pr45678-2.c | 16 + gcc/testsuite/gcc.dg/torture/pr45704.c | 15 + gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c | 2 +- gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c | 32 + gcc/testsuite/gcc.dg/torture/tls/thr-init-1.c | 1 + gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c | 26 + gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c | 58 + gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c | 76 + gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c | 13 + gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c | 41 +- gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c | 53 + gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c | 24 + gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c | 29 + gcc/testsuite/gcc.dg/tree-ssa/loop-19.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr45144.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr45427.c | 29 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c | 19 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c | 40 + gcc/testsuite/gcc.dg/tree-ssa/vrp54.c | 34 + gcc/testsuite/gcc.dg/vect/bb-slp-8.c | 10 +- gcc/testsuite/gcc.dg/vect/bb-slp-8a.c | 53 + gcc/testsuite/gcc.dg/vect/bb-slp-8b.c | 55 + gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c | 2 +- .../gcc.dg/vect/no-section-anchors-vect-64.c | 4 +- gcc/testsuite/gcc.dg/vect/pr43430-1.c | 2 +- gcc/testsuite/gcc.dg/vect/pr43430-2.c | 17 + gcc/testsuite/gcc.dg/vect/pr43432.c | 14 + gcc/testsuite/gcc.dg/vect/pr45633.c | 15 + gcc/testsuite/gcc.dg/vect/slp-25.c | 4 +- gcc/testsuite/gcc.dg/vect/slp-perm-8.c | 4 +- gcc/testsuite/gcc.dg/vect/slp-perm-9.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-114.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-15.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-64.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-91.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-cond-4.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-outer-fir.c | 7 +- gcc/testsuite/gcc.dg/vect/vect-peel-1.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-peel-2.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-peel-3.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-peel-4.c | 6 +- gcc/testsuite/gcc.target/arm/headmerge-1.c | 14 + gcc/testsuite/gcc.target/arm/headmerge-2.c | 35 + gcc/testsuite/gcc.target/arm/pr43137.c | 9 + gcc/testsuite/gcc.target/arm/sync-1.c | 25 + gcc/testsuite/gcc.target/i386/20060821-1.c | 2 +- .../gcc.target/i386/builtin-unreachable.c | 2 +- gcc/testsuite/gcc.target/i386/combine-mul.c | 23 + gcc/testsuite/gcc.target/i386/divmod-1.c | 30 + gcc/testsuite/gcc.target/i386/divmod-2.c | 11 + gcc/testsuite/gcc.target/i386/divmod-3.c | 11 + gcc/testsuite/gcc.target/i386/divmod-4.c | 14 + gcc/testsuite/gcc.target/i386/divmod-4a.c | 14 + gcc/testsuite/gcc.target/i386/divmod-5.c | 13 + gcc/testsuite/gcc.target/i386/divmod-6.c | 30 + gcc/testsuite/gcc.target/i386/divmod-7.c | 15 + gcc/testsuite/gcc.target/i386/divmod-8.c | 15 + gcc/testsuite/gcc.target/i386/float128-1.c | 2 +- gcc/testsuite/gcc.target/i386/float128-2.c | 2 +- gcc/testsuite/gcc.target/i386/fma4-256-vector.c | 2 +- gcc/testsuite/gcc.target/i386/fma4-vector.c | 2 +- gcc/testsuite/gcc.target/i386/funcspec-1.c | 6 +- gcc/testsuite/gcc.target/i386/headmerge-1.c | 14 + gcc/testsuite/gcc.target/i386/headmerge-2.c | 35 + gcc/testsuite/gcc.target/i386/pad-1.c | 9 + gcc/testsuite/gcc.target/i386/pad-10.c | 18 + gcc/testsuite/gcc.target/i386/pad-2.c | 9 + gcc/testsuite/gcc.target/i386/pad-3.c | 15 + gcc/testsuite/gcc.target/i386/pad-4.c | 15 + gcc/testsuite/gcc.target/i386/pad-5a.c | 11 + gcc/testsuite/gcc.target/i386/pad-5b.c | 11 + gcc/testsuite/gcc.target/i386/pad-6a.c | 11 + gcc/testsuite/gcc.target/i386/pad-6b.c | 11 + gcc/testsuite/gcc.target/i386/pad-7.c | 11 + gcc/testsuite/gcc.target/i386/pad-8.c | 10 + gcc/testsuite/gcc.target/i386/pad-9.c | 14 + gcc/testsuite/gcc.target/i386/pr22152.c | 4 +- gcc/testsuite/gcc.target/i386/pr36502.c | 7 + gcc/testsuite/gcc.target/i386/pr36992-1.c | 2 +- gcc/testsuite/gcc.target/i386/pr36992-2.c | 2 +- gcc/testsuite/gcc.target/i386/pr45206.c | 16 + gcc/testsuite/gcc.target/i386/pr45500.c | 6 + gcc/testsuite/gcc.target/i386/pr45617.c | 22 + gcc/testsuite/gcc.target/i386/pr45739.c | 24 + .../gcc.target/i386/stack-usage-realign.c | 21 + gcc/testsuite/gcc.target/i386/udivmod-1.c | 31 + gcc/testsuite/gcc.target/i386/udivmod-2.c | 11 + gcc/testsuite/gcc.target/i386/udivmod-3.c | 11 + gcc/testsuite/gcc.target/i386/udivmod-4.c | 14 + gcc/testsuite/gcc.target/i386/udivmod-4a.c | 14 + gcc/testsuite/gcc.target/i386/udivmod-5.c | 14 + gcc/testsuite/gcc.target/i386/udivmod-6.c | 32 + gcc/testsuite/gcc.target/i386/udivmod-7.c | 16 + gcc/testsuite/gcc.target/i386/udivmod-8.c | 16 + gcc/testsuite/gcc.target/i386/vect-double-1.c | 35 + gcc/testsuite/gcc.target/i386/vect-double-1a.c | 8 + gcc/testsuite/gcc.target/i386/vect-double-2.c | 35 + gcc/testsuite/gcc.target/i386/vect-double-2a.c | 8 + gcc/testsuite/gcc.target/i386/vectorize2.c | 2 +- gcc/testsuite/gcc.target/i386/vectorize4.c | 2 +- gcc/testsuite/gcc.target/i386/vectorize5.c | 2 +- gcc/testsuite/gcc.target/i386/vectorize6.c | 2 +- gcc/testsuite/gcc.target/i386/vectorize8.c | 2 +- gcc/testsuite/gcc.target/i386/volatile-2.c | 37 +- gcc/testsuite/gcc.target/i386/zee.c | 2 +- .../mips/loongson-shift-count-truncated-1.c | 35 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-1.c | 50 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-10.c | 11 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-11.c | 10 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-2.c | 51 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-3.c | 51 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-4.c | 51 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-5.c | 22 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-6.c | 22 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-7.c | 22 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-8.c | 22 + gcc/testsuite/gcc.target/powerpc/ppc-fpconv-9.c | 11 + gcc/testsuite/gcc.target/sh/sh4a-memmovua.c | 2 +- gcc/testsuite/gcc.target/sparc/mnofpu.c | 90 + .../gcc.target/x86_64/abi/avx/abi-avx.exp | 13 +- gcc/testsuite/gfortran.dg/achar_4.f90 | 1 + gcc/testsuite/gfortran.dg/allocatable_dummy_2.f90 | 4 +- .../gfortran.dg/allocate_alloc_opt_10.f90 | 24 +- .../gfortran.dg/allocate_alloc_opt_12.f90 | 19 + gcc/testsuite/gfortran.dg/allocate_alloc_opt_2.f90 | 6 +- gcc/testsuite/gfortran.dg/allocate_derived_4.f90 | 19 + gcc/testsuite/gfortran.dg/array_memcpy_3.f90 | 2 +- gcc/testsuite/gfortran.dg/associate_5.f03 | 25 +- gcc/testsuite/gfortran.dg/associate_8.f03 | 37 + gcc/testsuite/gfortran.dg/bessel_7.f90 | 4 +- gcc/testsuite/gfortran.dg/bit_comparison_1.F90 | 153 + gcc/testsuite/gfortran.dg/bit_comparison_2.F90 | 48 + gcc/testsuite/gfortran.dg/char_expr_2.f90 | 2 +- gcc/testsuite/gfortran.dg/char_length_17.f90 | 15 + gcc/testsuite/gfortran.dg/char_length_18.f90 | 9 + gcc/testsuite/gfortran.dg/class_dummy_1.f03 | 43 + gcc/testsuite/gfortran.dg/class_dummy_2.f03 | 33 + gcc/testsuite/gfortran.dg/cray_pointers_2.f90 | 7 +- .../gfortran.dg/deallocate_alloc_opt_2.f90 | 6 +- gcc/testsuite/gfortran.dg/dependency_33.f90 | 11 + gcc/testsuite/gfortran.dg/dependency_34.f90 | 22 + gcc/testsuite/gfortran.dg/dependency_35.f90 | 24 + gcc/testsuite/gfortran.dg/dependency_36.f90 | 28 + gcc/testsuite/gfortran.dg/der_io_4.f90 | 9 + .../gfortran.dg/derived_array_intrinisics_1.f90 | 30 + gcc/testsuite/gfortran.dg/dshift_1.F90 | 177 + gcc/testsuite/gfortran.dg/dshift_2.F90 | 59 + gcc/testsuite/gfortran.dg/dummy_optional_arg.f90 | 18 + gcc/testsuite/gfortran.dg/dummy_procedure_1.f90 | 3 +- gcc/testsuite/gfortran.dg/dynamic_dispatch_11.f03 | 35 + gcc/testsuite/gfortran.dg/enum_2.f90 | 2 + gcc/testsuite/gfortran.dg/enum_5.f90 | 2 +- gcc/testsuite/gfortran.dg/equiv_constraint_8.f90 | 2 +- .../gfortran.dg/execute_command_line_1.f90 | 60 + gcc/testsuite/gfortran.dg/exit_2.f08 | 6 +- gcc/testsuite/gfortran.dg/exit_3.f08 | 88 + gcc/testsuite/gfortran.dg/exit_4.f08 | 29 + gcc/testsuite/gfortran.dg/exit_5.f03 | 15 + gcc/testsuite/gfortran.dg/gomp/pr45595.f90 | 10 + gcc/testsuite/gfortran.dg/gomp/pr45597.f90 | 22 + gcc/testsuite/gfortran.dg/hollerith8.f90 | 26 + gcc/testsuite/gfortran.dg/iall_iany_iparity_1.f90 | 26 + gcc/testsuite/gfortran.dg/iall_iany_iparity_2.f90 | 18 + gcc/testsuite/gfortran.dg/impure_assignment_2.f90 | 6 +- gcc/testsuite/gfortran.dg/impure_assignment_3.f90 | 4 +- gcc/testsuite/gfortran.dg/initialization_27.f90 | 39 + gcc/testsuite/gfortran.dg/inline_transpose_1.f90 | 238 ++ gcc/testsuite/gfortran.dg/intent_optimize_1.f90 | 24 + gcc/testsuite/gfortran.dg/intent_out_1.f90 | 8 +- gcc/testsuite/gfortran.dg/intent_out_3.f90 | 2 +- gcc/testsuite/gfortran.dg/internal_dummy_1.f90 | 3 +- gcc/testsuite/gfortran.dg/internal_dummy_2.f08 | 64 + gcc/testsuite/gfortran.dg/internal_dummy_3.f08 | 66 + gcc/testsuite/gfortran.dg/internal_dummy_4.f08 | 57 + gcc/testsuite/gfortran.dg/intrinsic_intent_1.f03 | 11 + gcc/testsuite/gfortran.dg/ishft_4.f90 | 40 + gcc/testsuite/gfortran.dg/leadz_trailz_3.f90 | 30 + gcc/testsuite/gfortran.dg/masklr_1.F90 | 82 + gcc/testsuite/gfortran.dg/masklr_2.F90 | 32 + gcc/testsuite/gfortran.dg/merge_bits_1.F90 | 55 + gcc/testsuite/gfortran.dg/merge_bits_2.F90 | 22 + gcc/testsuite/gfortran.dg/namelist_63.f90 | 28 + gcc/testsuite/gfortran.dg/namelist_64.f90 | 27 + gcc/testsuite/gfortran.dg/namelist_65.f90 | 22 + gcc/testsuite/gfortran.dg/norm2_1.f90 | 91 + gcc/testsuite/gfortran.dg/norm2_2.f90 | 14 + gcc/testsuite/gfortran.dg/norm2_3.f90 | 95 + gcc/testsuite/gfortran.dg/norm_4.f90 | 11 + gcc/testsuite/gfortran.dg/parity_1.f90 | 40 + gcc/testsuite/gfortran.dg/parity_2.f90 | 13 + gcc/testsuite/gfortran.dg/parity_3.f90 | 10 + gcc/testsuite/gfortran.dg/pointer_assign_7.f90 | 2 +- gcc/testsuite/gfortran.dg/pointer_check_7.f90 | 36 + gcc/testsuite/gfortran.dg/pointer_intent_3.f90 | 20 +- gcc/testsuite/gfortran.dg/popcnt_poppar_1.F90 | 121 + gcc/testsuite/gfortran.dg/popcnt_poppar_2.F90 | 39 + gcc/testsuite/gfortran.dg/pr19936_1.f90 | 2 +- gcc/testsuite/gfortran.dg/pr25923.f90 | 4 +- gcc/testsuite/gfortran.dg/pr45578.f90 | 53 + gcc/testsuite/gfortran.dg/proc_ptr_comp_3.f90 | 2 +- gcc/testsuite/gfortran.dg/promotion.f90 | 2 +- gcc/testsuite/gfortran.dg/protected_4.f90 | 18 +- gcc/testsuite/gfortran.dg/protected_5.f90 | 6 +- gcc/testsuite/gfortran.dg/protected_6.f90 | 18 +- gcc/testsuite/gfortran.dg/protected_7.f90 | 4 +- gcc/testsuite/gfortran.dg/random_seed_1.f90 | 13 +- gcc/testsuite/gfortran.dg/select_type_13.f03 | 26 + gcc/testsuite/gfortran.dg/select_type_14.f03 | 24 + gcc/testsuite/gfortran.dg/select_type_15.f03 | 77 + gcc/testsuite/gfortran.dg/select_type_16.f03 | 41 + gcc/testsuite/gfortran.dg/select_type_17.f03 | 44 + gcc/testsuite/gfortran.dg/shiftalr_1.F90 | 162 + gcc/testsuite/gfortran.dg/shiftalr_2.F90 | 52 + gcc/testsuite/gfortran.dg/simpleif_2.f90 | 2 +- gcc/testsuite/gfortran.dg/transpose_2.f90 | 3 +- .../gfortran.dg/transpose_optimization_1.f90 | 106 + gcc/testsuite/gfortran.dg/trim_optimize_2.f90 | 37 + gcc/testsuite/gfortran.dg/typebound_proc_18.f03 | 29 + .../gfortran.dg/vect/fast-math-pr38968.f90 | 8 +- .../gfortran.dg/vect/fast-math-vect-8.f90 | 93 + gcc/testsuite/gfortran.dg/vect/pr45714-a.f | 27 + gcc/testsuite/gfortran.dg/vect/pr45714-b.f | 27 + .../gfortran.dg/vector_subscript_bound_1.f90 | 19 + .../gfortran.fortran-torture/compile/pr45598.f90 | 13 + .../gfortran.fortran-torture/compile/pr45634.f90 | 5 + gcc/testsuite/gnat.dg/const1.adb | 8 - gcc/testsuite/gnat.dg/constant1.adb | 8 + gcc/testsuite/gnat.dg/constant2.adb | 11 + gcc/testsuite/gnat.dg/constant2_pkg1.ads | 7 + gcc/testsuite/gnat.dg/constant2_pkg2.adb | 13 + gcc/testsuite/gnat.dg/constant2_pkg2.ads | 6 + gcc/testsuite/gnat.dg/discr24.adb | 46 + gcc/testsuite/gnat.dg/dse_step.adb | 18 + gcc/testsuite/gnat.dg/dse_step.ads | 19 + gcc/testsuite/gnat.dg/memtrap.adb | 15 + gcc/testsuite/gnat.dg/specs/constant1.ads | 22 + gcc/testsuite/gnat.dg/specs/constant1_pkg.ads | 11 + gcc/testsuite/gnat.dg/test_dse_step.adb | 14 + gcc/testsuite/lib/gcc-dg.exp | 22 +- gcc/testsuite/lib/profopt.exp | 4 + gcc/testsuite/lib/prune.exp | 3 + gcc/testsuite/lib/scanasm.exp | 27 +- gcc/testsuite/lib/target-supports-dg.exp | 15 + gcc/testsuite/lib/target-supports.exp | 124 +- gcc/testsuite/obj-c++.dg/comp-types-13.mm | 19 + gcc/testsuite/obj-c++.dg/msg-in-protocol.mm | 18 + gcc/testsuite/obj-c++.dg/naming-1.mm | 26 + gcc/testsuite/obj-c++.dg/naming-2.mm | 40 + gcc/testsuite/obj-c++.dg/proto-lossage-7.mm | 28 + gcc/testsuite/obj-c++.dg/too-many-args.mm | 10 + gcc/testsuite/objc.dg/break-in-ifstmt.m | 14 + gcc/testsuite/objc.dg/comp-types-12.m | 19 + gcc/testsuite/objc.dg/fobjc-exceptions.m | 29 + .../struct-layout-encoding-1_generate.c | 2 +- gcc/testsuite/objc.dg/invalid-method-1.m | 11 + gcc/testsuite/objc.dg/msg-in-protocol.m | 18 + gcc/testsuite/objc.dg/naming-4.m | 27 + gcc/testsuite/objc.dg/naming-5.m | 42 + gcc/testsuite/objc.dg/proto-lossage-7.m | 28 + gcc/testsuite/objc.dg/too-many-args.m | 10 + gcc/testsuite/objc.dg/type-stream-1.m | 42 +- gcc/testsuite/objc/execute/exceptions/handler-1.m | 8 +- gcc/testsuite/objc/execute/exceptions/matcher-1.m | 68 + gcc/testsuite/objc/execute/exceptions/throw-nil.m | 50 + gcc/toplev.c | 107 +- gcc/tree-cfg.c | 21 +- gcc/tree-complex.c | 6 +- gcc/tree-data-ref.c | 86 +- gcc/tree-data-ref.h | 36 +- gcc/tree-dfa.c | 19 +- gcc/tree-dump.c | 1 - gcc/tree-eh.c | 10 +- gcc/tree-flow.h | 8 +- gcc/tree-if-conv.c | 625 +++- gcc/tree-inline.c | 36 +- gcc/tree-nested.c | 19 +- gcc/tree-optimize.c | 45 +- gcc/tree-pass.h | 2 - gcc/tree-predcom.c | 13 +- gcc/tree-pretty-print.c | 38 +- gcc/tree-sra.c | 445 +-- gcc/tree-ssa-address.c | 156 +- gcc/tree-ssa-alias.c | 50 +- gcc/tree-ssa-ccp.c | 253 +- gcc/tree-ssa-dce.c | 6 +- gcc/tree-ssa-dom.c | 42 + gcc/tree-ssa-live.c | 17 +- gcc/tree-ssa-loop-im.c | 6 +- gcc/tree-ssa-loop-ivcanon.c | 8 +- gcc/tree-ssa-loop-ivopts.c | 118 +- gcc/tree-ssa-loop-niter.c | 89 +- gcc/tree-ssa-loop-prefetch.c | 5 +- gcc/tree-ssa-loop.c | 2 +- gcc/tree-ssa-math-opts.c | 22 +- gcc/tree-ssa-operands.c | 11 +- gcc/tree-ssa-pre.c | 47 +- gcc/tree-ssa-propagate.c | 8 +- gcc/tree-ssa-reassoc.c | 5 + gcc/tree-ssa-sccvn.c | 25 +- gcc/tree-ssa-sink.c | 9 +- gcc/tree-ssa-structalias.c | 83 +- gcc/tree-ssa-ter.c | 35 +- gcc/tree-ssa.c | 53 +- gcc/tree-ssanames.c | 12 +- gcc/tree-switch-conversion.c | 1 + gcc/tree-tailcall.c | 63 +- gcc/tree-vect-data-refs.c | 268 +- gcc/tree-vect-loop.c | 99 +- gcc/tree-vect-slp.c | 131 +- gcc/tree-vect-stmts.c | 431 ++- gcc/tree-vectorizer.c | 2 +- gcc/tree-vectorizer.h | 52 +- gcc/tree-vrp.c | 192 +- gcc/tree.c | 281 +- gcc/tree.def | 27 +- gcc/tree.h | 67 +- gcc/treestruct.def | 1 + gcc/unwind-dw2-fde-glibc.c | 4 +- gcc/varasm.c | 16 +- gcc/varpool.c | 61 +- include/ChangeLog | 4 + include/dwarf2.h | 1 + libcpp/ChangeLog | 27 + libcpp/config.in | 3 + libcpp/configure | 21 + libcpp/configure.ac | 7 + libcpp/directives.c | 8 +- libcpp/expr.c | 3 + libcpp/init.c | 2 +- libcpp/lex.c | 18 +- libcpp/system.h | 5 +- libdecnumber/ChangeLog | 32 + libdecnumber/Makefile.in | 32 +- libdecnumber/aclocal.m4 | 1 + libdecnumber/configure | 46 +- libdecnumber/configure.ac | 41 +- libffi/ChangeLog | 5 + libffi/src/closures.c | 2 +- libgcc/ChangeLog | 91 +- libgcc/Makefile.in | 19 +- libgcc/config.host | 7 +- libgcc/config/i386/libgcc-bsd.ver | 108 + libgcc/config/i386/libgcc-sol2.ver | 12 + libgcc/config/i386/t-freebsd | 2 + libgcc/configure | 39 +- libgcc/configure.ac | 37 +- libgfortran/ChangeLog | 280 ++ libgfortran/Makefile.am | 56 +- libgfortran/Makefile.in | 345 +- libgfortran/acinclude.m4 | 113 - libgfortran/config.h.in | 9 - libgfortran/config/fpu-387.h | 5 +- libgfortran/configure | 182 - libgfortran/configure.ac | 9 - libgfortran/generated/all_l1.c | 4 +- libgfortran/generated/all_l16.c | 4 +- libgfortran/generated/all_l2.c | 4 +- libgfortran/generated/all_l4.c | 4 +- libgfortran/generated/all_l8.c | 4 +- libgfortran/generated/any_l1.c | 4 +- libgfortran/generated/any_l16.c | 4 +- libgfortran/generated/any_l2.c | 4 +- libgfortran/generated/any_l4.c | 4 +- libgfortran/generated/any_l8.c | 4 +- libgfortran/generated/bessel_r10.c | 27 +- libgfortran/generated/bessel_r16.c | 35 +- libgfortran/generated/bessel_r4.c | 27 +- libgfortran/generated/bessel_r8.c | 27 +- libgfortran/generated/count_16_l.c | 4 +- libgfortran/generated/count_1_l.c | 4 +- libgfortran/generated/count_2_l.c | 4 +- libgfortran/generated/count_4_l.c | 4 +- libgfortran/generated/count_8_l.c | 4 +- libgfortran/generated/exponent_r10.c | 5 +- libgfortran/generated/exponent_r16.c | 11 +- libgfortran/generated/exponent_r4.c | 5 +- libgfortran/generated/exponent_r8.c | 5 +- libgfortran/generated/fraction_r10.c | 5 +- libgfortran/generated/fraction_r16.c | 11 +- libgfortran/generated/fraction_r4.c | 5 +- libgfortran/generated/fraction_r8.c | 5 +- libgfortran/generated/iall_i1.c | 509 +++ libgfortran/generated/iall_i16.c | 509 +++ libgfortran/generated/iall_i2.c | 509 +++ libgfortran/generated/iall_i4.c | 509 +++ libgfortran/generated/iall_i8.c | 509 +++ libgfortran/generated/iany_i1.c | 509 +++ libgfortran/generated/iany_i16.c | 509 +++ libgfortran/generated/iany_i2.c | 509 +++ libgfortran/generated/iany_i4.c | 509 +++ libgfortran/generated/iany_i8.c | 509 +++ libgfortran/generated/iparity_i1.c | 509 +++ libgfortran/generated/iparity_i16.c | 509 +++ libgfortran/generated/iparity_i2.c | 509 +++ libgfortran/generated/iparity_i4.c | 509 +++ libgfortran/generated/iparity_i8.c | 509 +++ libgfortran/generated/maxloc1_16_i1.c | 5 +- libgfortran/generated/maxloc1_16_i16.c | 5 +- libgfortran/generated/maxloc1_16_i2.c | 5 +- libgfortran/generated/maxloc1_16_i4.c | 5 +- libgfortran/generated/maxloc1_16_i8.c | 5 +- libgfortran/generated/maxloc1_16_r10.c | 5 +- libgfortran/generated/maxloc1_16_r16.c | 5 +- libgfortran/generated/maxloc1_16_r4.c | 5 +- libgfortran/generated/maxloc1_16_r8.c | 5 +- libgfortran/generated/maxloc1_4_i1.c | 5 +- libgfortran/generated/maxloc1_4_i16.c | 5 +- libgfortran/generated/maxloc1_4_i2.c | 5 +- libgfortran/generated/maxloc1_4_i4.c | 5 +- libgfortran/generated/maxloc1_4_i8.c | 5 +- libgfortran/generated/maxloc1_4_r10.c | 5 +- libgfortran/generated/maxloc1_4_r16.c | 5 +- libgfortran/generated/maxloc1_4_r4.c | 5 +- libgfortran/generated/maxloc1_4_r8.c | 5 +- libgfortran/generated/maxloc1_8_i1.c | 5 +- libgfortran/generated/maxloc1_8_i16.c | 5 +- libgfortran/generated/maxloc1_8_i2.c | 5 +- libgfortran/generated/maxloc1_8_i4.c | 5 +- libgfortran/generated/maxloc1_8_i8.c | 5 +- libgfortran/generated/maxloc1_8_r10.c | 5 +- libgfortran/generated/maxloc1_8_r16.c | 5 +- libgfortran/generated/maxloc1_8_r4.c | 5 +- libgfortran/generated/maxloc1_8_r8.c | 5 +- libgfortran/generated/maxval_i1.c | 5 +- libgfortran/generated/maxval_i16.c | 5 +- libgfortran/generated/maxval_i2.c | 5 +- libgfortran/generated/maxval_i4.c | 5 +- libgfortran/generated/maxval_i8.c | 5 +- libgfortran/generated/maxval_r10.c | 5 +- libgfortran/generated/maxval_r16.c | 5 +- libgfortran/generated/maxval_r4.c | 5 +- libgfortran/generated/maxval_r8.c | 5 +- libgfortran/generated/minloc1_16_i1.c | 5 +- libgfortran/generated/minloc1_16_i16.c | 5 +- libgfortran/generated/minloc1_16_i2.c | 5 +- libgfortran/generated/minloc1_16_i4.c | 5 +- libgfortran/generated/minloc1_16_i8.c | 5 +- libgfortran/generated/minloc1_16_r10.c | 5 +- libgfortran/generated/minloc1_16_r16.c | 5 +- libgfortran/generated/minloc1_16_r4.c | 5 +- libgfortran/generated/minloc1_16_r8.c | 5 +- libgfortran/generated/minloc1_4_i1.c | 5 +- libgfortran/generated/minloc1_4_i16.c | 5 +- libgfortran/generated/minloc1_4_i2.c | 5 +- libgfortran/generated/minloc1_4_i4.c | 5 +- libgfortran/generated/minloc1_4_i8.c | 5 +- libgfortran/generated/minloc1_4_r10.c | 5 +- libgfortran/generated/minloc1_4_r16.c | 5 +- libgfortran/generated/minloc1_4_r4.c | 5 +- libgfortran/generated/minloc1_4_r8.c | 5 +- libgfortran/generated/minloc1_8_i1.c | 5 +- libgfortran/generated/minloc1_8_i16.c | 5 +- libgfortran/generated/minloc1_8_i2.c | 5 +- libgfortran/generated/minloc1_8_i4.c | 5 +- libgfortran/generated/minloc1_8_i8.c | 5 +- libgfortran/generated/minloc1_8_r10.c | 5 +- libgfortran/generated/minloc1_8_r16.c | 5 +- libgfortran/generated/minloc1_8_r4.c | 5 +- libgfortran/generated/minloc1_8_r8.c | 5 +- libgfortran/generated/minval_i1.c | 5 +- libgfortran/generated/minval_i16.c | 5 +- libgfortran/generated/minval_i2.c | 5 +- libgfortran/generated/minval_i4.c | 5 +- libgfortran/generated/minval_i8.c | 5 +- libgfortran/generated/minval_r10.c | 5 +- libgfortran/generated/minval_r16.c | 5 +- libgfortran/generated/minval_r4.c | 5 +- libgfortran/generated/minval_r8.c | 5 +- libgfortran/generated/nearest_r10.c | 9 +- libgfortran/generated/nearest_r16.c | 15 +- libgfortran/generated/nearest_r4.c | 9 +- libgfortran/generated/nearest_r8.c | 9 +- libgfortran/generated/norm2_r10.c | 211 ++ libgfortran/generated/norm2_r16.c | 215 ++ libgfortran/generated/norm2_r4.c | 211 ++ libgfortran/generated/norm2_r8.c | 211 ++ libgfortran/generated/parity_l1.c | 191 + libgfortran/generated/parity_l16.c | 191 + libgfortran/generated/parity_l2.c | 191 + libgfortran/generated/parity_l4.c | 191 + libgfortran/generated/parity_l8.c | 191 + libgfortran/generated/product_c10.c | 5 +- libgfortran/generated/product_c16.c | 5 +- libgfortran/generated/product_c4.c | 5 +- libgfortran/generated/product_c8.c | 5 +- libgfortran/generated/product_i1.c | 5 +- libgfortran/generated/product_i16.c | 5 +- libgfortran/generated/product_i2.c | 5 +- libgfortran/generated/product_i4.c | 5 +- libgfortran/generated/product_i8.c | 5 +- libgfortran/generated/product_r10.c | 5 +- libgfortran/generated/product_r16.c | 5 +- libgfortran/generated/product_r4.c | 5 +- libgfortran/generated/product_r8.c | 5 +- libgfortran/generated/rrspacing_r10.c | 11 +- libgfortran/generated/rrspacing_r16.c | 19 +- libgfortran/generated/rrspacing_r4.c | 11 +- libgfortran/generated/rrspacing_r8.c | 11 +- libgfortran/generated/set_exponent_r10.c | 5 +- libgfortran/generated/set_exponent_r16.c | 11 +- libgfortran/generated/set_exponent_r4.c | 5 +- libgfortran/generated/set_exponent_r8.c | 5 +- libgfortran/generated/spacing_r10.c | 9 +- libgfortran/generated/spacing_r16.c | 17 +- libgfortran/generated/spacing_r4.c | 9 +- libgfortran/generated/spacing_r8.c | 9 +- libgfortran/generated/sum_c10.c | 1 + libgfortran/generated/sum_c16.c | 1 + libgfortran/generated/sum_c4.c | 1 + libgfortran/generated/sum_c8.c | 1 + libgfortran/generated/sum_i1.c | 1 + libgfortran/generated/sum_i16.c | 1 + libgfortran/generated/sum_i2.c | 1 + libgfortran/generated/sum_i4.c | 1 + libgfortran/generated/sum_i8.c | 1 + libgfortran/generated/sum_r10.c | 1 + libgfortran/generated/sum_r16.c | 1 + libgfortran/generated/sum_r4.c | 1 + libgfortran/generated/sum_r8.c | 1 + libgfortran/gfortran.map | 30 +- libgfortran/intrinsics/c99_functions.c | 3 +- libgfortran/intrinsics/cshift0.c | 4 +- libgfortran/intrinsics/execute_command_line.c | 177 + libgfortran/intrinsics/pack_generic.c | 6 +- libgfortran/intrinsics/unpack_generic.c | 7 +- libgfortran/io/list_read.c | 3 +- libgfortran/io/open.c | 2 +- libgfortran/io/write.c | 14 + libgfortran/io/write_float.def | 2 +- libgfortran/libgfortran.h | 48 +- libgfortran/m4/all.m4 | 6 +- libgfortran/m4/any.m4 | 6 +- libgfortran/m4/bessel.m4 | 30 +- libgfortran/m4/count.m4 | 6 +- libgfortran/m4/exponent.m4 | 6 +- libgfortran/m4/fraction.m4 | 6 +- libgfortran/m4/iall.m4 | 46 + libgfortran/m4/iany.m4 | 46 + libgfortran/m4/ifunction.m4 | 5 +- libgfortran/m4/iparity.m4 | 46 + libgfortran/m4/maxloc1.m4 | 6 +- libgfortran/m4/maxval.m4 | 6 +- libgfortran/m4/minloc1.m4 | 6 +- libgfortran/m4/minval.m4 | 6 +- libgfortran/m4/mtype.m4 | 7 + libgfortran/m4/nearest.m4 | 10 +- libgfortran/m4/norm2.m4 | 61 + libgfortran/m4/parity.m4 | 40 + libgfortran/m4/product.m4 | 6 +- libgfortran/m4/rrspacing.m4 | 14 +- libgfortran/m4/set_exponent.m4 | 6 +- libgfortran/m4/spacing.m4 | 12 +- libgfortran/mk-kinds-h.sh | 12 +- libgfortran/runtime/string.c | 23 +- libgomp/ChangeLog | 7 + libgomp/libgomp.texi | 16 +- libiberty/ChangeLog | 25 + libiberty/Makefile.in | 330 +- libiberty/configure | 8 +- libiberty/configure.ac | 8 +- libiberty/cp-demangle.c | 1 + libiberty/cplus-dem.c | 200 +- libiberty/maint-tool | 4 +- libiberty/testsuite/demangle-expected | 35 + libjava/ChangeLog | 19 + libjava/Makefile.am | 2 + libjava/Makefile.in | 3 + libjava/configure | 24 +- libjava/configure.ac | 16 +- libjava/gcj/Makefile.in | 1 + libjava/include/Makefile.in | 1 + libjava/libgcj.spec.in | 2 +- libjava/testsuite/Makefile.in | 1 + libobjc/ChangeLog | 305 ++ libobjc/Makefile.in | 260 +- libobjc/NXConstStr.m | 1 + libobjc/Object.m | 10 +- libobjc/Protocol.m | 1 + libobjc/README.threads | 50 - libobjc/THREADS | 104 +- libobjc/THREADS.MACH | 23 - libobjc/acinclude.m4 | 4 +- libobjc/archive.c | 90 +- libobjc/class.c | 12 +- libobjc/config.h.in | 6 + libobjc/configure | 217 +- libobjc/configure.ac | 2 + libobjc/encoding.c | 44 +- libobjc/error.c | 99 + libobjc/exception.c | 113 +- libobjc/gc.c | 1 + libobjc/hash.c | 10 +- libobjc/init.c | 33 +- libobjc/libobjc.def | 2 + libobjc/libobjc_entry.c | 2 +- libobjc/linking.m | 2 +- libobjc/makefile.dos | 55 - libobjc/memory.c | 175 + libobjc/misc.c | 184 - libobjc/nil_method.c | 3 +- libobjc/objc-private/README | 4 + libobjc/objc-private/common.h | 38 + libobjc/objc-private/error.h | 37 + libobjc/objc-private/hash.h | 214 ++ libobjc/objc-private/objc-list.h | 99 + libobjc/objc-private/objc-sync.h | 41 + libobjc/objc-private/runtime.h | 101 + libobjc/objc-private/sarray.h | 239 ++ libobjc/objc-sync.c | 491 +++ libobjc/objc/Object.h | 28 +- libobjc/objc/README | 13 + libobjc/objc/deprecated/MetaClass.h | 1 + libobjc/objc/deprecated/Object.h | 13 + libobjc/objc/deprecated/README | 11 + libobjc/objc/deprecated/STR.h | 2 + libobjc/objc/deprecated/hash.h | 214 ++ libobjc/objc/{ => deprecated}/objc-list.h | 0 libobjc/objc/deprecated/objc_error.h | 56 + libobjc/objc/deprecated/objc_malloc.h | 17 + .../objc/deprecated/objc_unexpected_exception.h | 9 + libobjc/objc/deprecated/objc_valloc.h | 2 + libobjc/objc/deprecated/sarray.h | 240 ++ libobjc/objc/deprecated/struct_objc_class.h | 44 + libobjc/objc/deprecated/struct_objc_protocol.h | 6 + libobjc/objc/deprecated/struct_objc_selector.h | 20 + libobjc/objc/deprecated/typedstream.h | 141 + libobjc/objc/hash.h | 218 +- libobjc/objc/message.h | 52 + libobjc/objc/objc-api.h | 130 +- libobjc/objc/objc-exception.h | 117 + libobjc/objc/objc-list.h | 157 +- libobjc/objc/objc-sync.h | 70 + libobjc/objc/objc.h | 344 +- libobjc/objc/runtime.h | 96 - libobjc/objc/sarray.h | 245 +- libobjc/objc/thr.h | 25 - libobjc/objc/typedstream.h | 144 +- libobjc/objects.c | 6 +- libobjc/sarray.c | 12 +- libobjc/selector.c | 11 +- libobjc/sendmsg.c | 14 +- libobjc/thr-dce.c | 280 -- libobjc/thr-decosf1.c | 280 -- libobjc/thr-irix.c | 234 -- libobjc/thr-mach.c | 312 -- libobjc/thr-objc.c | 191 - libobjc/thr-os2.c | 266 -- libobjc/thr-posix.c | 317 -- libobjc/thr-pthreads.c | 217 -- libobjc/thr-rtems.c | 193 -- libobjc/thr-single.c | 191 - libobjc/thr-solaris.c | 258 -- libobjc/thr-vxworks.c | 191 - libobjc/thr-win32.c | 271 -- libobjc/thr.c | 88 +- libstdc++-v3/ChangeLog | 736 ++++ libstdc++-v3/config/abi/pre/gnu.ver | 17 +- libstdc++-v3/doc/xml/api.xml | 5 +- libstdc++-v3/doc/xml/manual/prerequisites.xml | 16 +- libstdc++-v3/doc/xml/manual/spine.xml | 10 +- libstdc++-v3/doc/xml/spine.xml | 4 +- libstdc++-v3/include/Makefile.am | 3 +- libstdc++-v3/include/Makefile.in | 3 +- libstdc++-v3/include/bits/basic_string.h | 22 +- libstdc++-v3/include/bits/cpp_type_traits.h | 8 +- libstdc++-v3/include/bits/forward_list.h | 2 +- libstdc++-v3/include/bits/forward_list.tcc | 2 +- libstdc++-v3/include/bits/fstream.tcc | 100 +- libstdc++-v3/include/bits/functional_hash.h | 133 +- libstdc++-v3/include/bits/hashtable.h | 114 +- libstdc++-v3/include/bits/random.h | 5 +- libstdc++-v3/include/bits/random.tcc | 5 + libstdc++-v3/include/bits/stl_algo.h | 47 +- libstdc++-v3/include/bits/stl_algobase.h | 27 +- libstdc++-v3/include/bits/stl_bvector.h | 2 +- .../include/bits/stl_iterator_base_funcs.h | 18 +- .../include/bits/stl_iterator_base_types.h | 50 +- libstdc++-v3/include/bits/stl_raw_storage_iter.h | 4 +- libstdc++-v3/include/bits/vector.tcc | 6 +- libstdc++-v3/include/debug/bitset | 2 +- libstdc++-v3/include/debug/debug.h | 1 - libstdc++-v3/include/debug/deque | 10 +- libstdc++-v3/include/debug/formatter.h | 4 +- libstdc++-v3/include/debug/functions.h | 11 +- libstdc++-v3/include/debug/list | 10 +- libstdc++-v3/include/debug/map.h | 7 +- libstdc++-v3/include/debug/multimap.h | 7 +- libstdc++-v3/include/debug/multiset.h | 17 +- libstdc++-v3/include/debug/safe_iterator.h | 39 +- libstdc++-v3/include/debug/set.h | 7 +- libstdc++-v3/include/debug/string | 15 +- libstdc++-v3/include/debug/unordered_map | 18 +- libstdc++-v3/include/debug/unordered_set | 18 +- libstdc++-v3/include/debug/vector | 13 +- libstdc++-v3/include/ext/concurrence.h | 4 +- libstdc++-v3/include/ext/throw_allocator.h | 8 +- libstdc++-v3/include/parallel/set_operations.h | 18 +- libstdc++-v3/include/precompiled/stdc++.h | 3 +- libstdc++-v3/include/profile/bitset | 2 +- libstdc++-v3/include/profile/impl/profiler_node.h | 2 +- libstdc++-v3/include/profile/vector | 2 +- libstdc++-v3/include/std/atomic | 20 +- libstdc++-v3/include/std/bitset | 10 +- libstdc++-v3/include/std/complex | 81 +- libstdc++-v3/include/std/fstream | 5 +- libstdc++-v3/include/std/system_error | 24 +- libstdc++-v3/include/std/thread | 7 +- libstdc++-v3/include/std/typeindex | 105 + libstdc++-v3/include/tr1/random.tcc | 5 + libstdc++-v3/libsupc++/Makefile.am | 1 + libstdc++-v3/libsupc++/Makefile.in | 9 +- libstdc++-v3/libsupc++/cxxabi.h | 38 +- libstdc++-v3/libsupc++/hash_bytes.cc | 185 + libstdc++-v3/libsupc++/typeinfo | 17 + libstdc++-v3/src/Makefile.am | 3 + libstdc++-v3/src/Makefile.in | 3 + libstdc++-v3/src/compatibility-c++0x.cc | 28 +- libstdc++-v3/src/hash-string-aux.cc | 48 - libstdc++-v3/src/hash_tr1.cc | 25 +- .../testsuite/18_support/type_info/hash_code.cc | 79 + .../19_diagnostics/system_error/cons-1.cc | 8 +- .../19_diagnostics/system_error/what-1.cc | 9 +- .../19_diagnostics/system_error/what-2.cc | 5 +- .../19_diagnostics/system_error/what-3.cc | 5 +- .../19_diagnostics/system_error/what-4.cc | 3 +- .../19_diagnostics/system_error/what-big.cc | 5 +- .../20_util/typeindex/comparison_operators.cc | 88 + libstdc++-v3/testsuite/20_util/typeindex/hash.cc | 60 + .../testsuite/20_util/typeindex/hash_code.cc | 67 + libstdc++-v3/testsuite/20_util/typeindex/name.cc | 67 + .../basic_string/element_access/char/21674.cc | 3 +- .../basic_string/element_access/wchar_t/21674.cc | 3 +- .../codecvt/always_noconv/char/wrapped_env.cc | 2 +- .../codecvt/always_noconv/char/wrapped_locale.cc | 2 +- .../22_locale/codecvt/always_noconv/wchar_t/2.cc | 2 +- .../22_locale/codecvt/always_noconv/wchar_t/3.cc | 2 +- .../22_locale/codecvt/always_noconv/wchar_t/4.cc | 2 +- .../codecvt/always_noconv/wchar_t/wrapped_env.cc | 2 +- .../always_noconv/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/codecvt/encoding/char/wrapped_env.cc | 2 +- .../codecvt/encoding/char/wrapped_locale.cc | 2 +- .../22_locale/codecvt/encoding/wchar_t/2.cc | 2 +- .../22_locale/codecvt/encoding/wchar_t/3.cc | 2 +- .../22_locale/codecvt/encoding/wchar_t/4.cc | 2 +- .../codecvt/encoding/wchar_t/wrapped_env.cc | 2 +- .../codecvt/encoding/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/codecvt/in/char/wrapped_env.cc | 2 +- .../22_locale/codecvt/in/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/2.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/3.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/4.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/7.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/8.cc | 2 +- .../testsuite/22_locale/codecvt/in/wchar_t/9.cc | 2 +- .../22_locale/codecvt/in/wchar_t/wrapped_env.cc | 2 +- .../22_locale/codecvt/in/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/codecvt/length/char/wrapped_env.cc | 2 +- .../codecvt/length/char/wrapped_locale.cc | 2 +- .../22_locale/codecvt/length/wchar_t/2.cc | 2 +- .../22_locale/codecvt/length/wchar_t/3.cc | 2 +- .../22_locale/codecvt/length/wchar_t/4.cc | 2 +- .../22_locale/codecvt/length/wchar_t/7.cc | 2 +- .../codecvt/length/wchar_t/wrapped_env.cc | 2 +- .../codecvt/length/wchar_t/wrapped_locale.cc | 2 +- .../codecvt/max_length/char/wrapped_env.cc | 2 +- .../codecvt/max_length/char/wrapped_locale.cc | 2 +- .../22_locale/codecvt/max_length/wchar_t/2.cc | 2 +- .../22_locale/codecvt/max_length/wchar_t/3.cc | 2 +- .../22_locale/codecvt/max_length/wchar_t/4.cc | 2 +- .../codecvt/max_length/wchar_t/wrapped_env.cc | 2 +- .../codecvt/max_length/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/codecvt/out/char/wrapped_env.cc | 2 +- .../22_locale/codecvt/out/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/codecvt/out/wchar_t/2.cc | 2 +- .../testsuite/22_locale/codecvt/out/wchar_t/3.cc | 2 +- .../testsuite/22_locale/codecvt/out/wchar_t/4.cc | 2 +- .../testsuite/22_locale/codecvt/out/wchar_t/7.cc | 2 +- .../22_locale/codecvt/out/wchar_t/wrapped_env.cc | 2 +- .../codecvt/out/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/codecvt/unshift/char/wrapped_env.cc | 2 +- .../codecvt/unshift/char/wrapped_locale.cc | 2 +- .../22_locale/codecvt/unshift/wchar_t/2.cc | 2 +- .../22_locale/codecvt/unshift/wchar_t/3.cc | 2 +- .../22_locale/codecvt/unshift/wchar_t/4.cc | 2 +- .../codecvt/unshift/wchar_t/wrapped_env.cc | 2 +- .../codecvt/unshift/wchar_t/wrapped_locale.cc | 2 +- .../testsuite/22_locale/collate/compare/char/1.cc | 4 +- .../testsuite/22_locale/collate/compare/char/2.cc | 4 +- .../testsuite/22_locale/collate/compare/char/3.cc | 2 +- .../22_locale/collate/compare/char/wrapped_env.cc | 4 +- .../collate/compare/char/wrapped_locale.cc | 5 +- .../22_locale/collate/compare/wchar_t/1.cc | 4 +- .../22_locale/collate/compare/wchar_t/2.cc | 4 +- .../22_locale/collate/compare/wchar_t/3.cc | 2 +- .../collate/compare/wchar_t/wrapped_env.cc | 4 +- .../collate/compare/wchar_t/wrapped_locale.cc | 5 +- .../testsuite/22_locale/collate/hash/char/2.cc | 4 +- .../22_locale/collate/hash/char/wrapped_env.cc | 2 +- .../22_locale/collate/hash/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/collate/hash/wchar_t/2.cc | 4 +- .../22_locale/collate/hash/wchar_t/wrapped_env.cc | 4 +- .../collate/hash/wchar_t/wrapped_locale.cc | 5 +- .../22_locale/collate/transform/char/2.cc | 4 +- .../22_locale/collate/transform/char/3.cc | 2 +- .../collate/transform/char/wrapped_env.cc | 4 +- .../collate/transform/char/wrapped_locale.cc | 5 +- .../22_locale/collate/transform/wchar_t/2.cc | 4 +- .../22_locale/collate/transform/wchar_t/3.cc | 2 +- .../collate/transform/wchar_t/wrapped_env.cc | 4 +- .../collate/transform/wchar_t/wrapped_locale.cc | 5 +- .../22_locale/collate_byname/named_equivalence.cc | 2 +- .../22_locale/ctype/cons/char/wrapped_env.cc | 2 +- .../22_locale/ctype/cons/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/ctype/is/char/2.cc | 2 +- .../22_locale/ctype/is/char/wrapped_env.cc | 2 +- .../22_locale/ctype/is/char/wrapped_locale.cc | 3 +- .../testsuite/22_locale/ctype/is/wchar_t/2.cc | 2 +- .../22_locale/ctype/is/wchar_t/wrapped_env.cc | 2 +- .../22_locale/ctype/is/wchar_t/wrapped_locale.cc | 3 +- .../22_locale/ctype/narrow/char/wrapped_env.cc | 2 +- .../22_locale/ctype/narrow/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/ctype/narrow/wchar_t/3.cc | 2 +- .../22_locale/ctype/narrow/wchar_t/wrapped_env.cc | 2 +- .../ctype/narrow/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/ctype/scan/char/wrapped_env.cc | 2 +- .../22_locale/ctype/scan/char/wrapped_locale.cc | 2 +- .../22_locale/ctype/scan/wchar_t/wrapped_env.cc | 2 +- .../22_locale/ctype/scan/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/ctype/to/char/wrapped_env.cc | 2 +- .../22_locale/ctype/to/char/wrapped_locale.cc | 2 +- .../22_locale/ctype/to/wchar_t/wrapped_env.cc | 2 +- .../22_locale/ctype/to/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/ctype/widen/char/wrapped_env.cc | 2 +- .../22_locale/ctype/widen/char/wrapped_locale.cc | 2 +- .../testsuite/22_locale/ctype/widen/wchar_t/2.cc | 2 +- .../testsuite/22_locale/ctype/widen/wchar_t/3.cc | 2 +- .../22_locale/ctype/widen/wchar_t/wrapped_env.cc | 2 +- .../ctype/widen/wchar_t/wrapped_locale.cc | 2 +- libstdc++-v3/testsuite/22_locale/facet/2.cc | 2 +- .../22_locale/locale/cons/12658_thread-1.cc | 3 +- .../22_locale/locale/cons/12658_thread-2.cc | 3 +- libstdc++-v3/testsuite/22_locale/locale/cons/2.cc | 2 +- .../testsuite/22_locale/locale/cons/29217.cc | 2 +- .../testsuite/22_locale/locale/cons/38365.cc | 2 +- .../testsuite/22_locale/locale/cons/38368.cc | 2 +- libstdc++-v3/testsuite/22_locale/locale/cons/4.cc | 2 +- .../testsuite/22_locale/locale/cons/40184.cc | 2 +- libstdc++-v3/testsuite/22_locale/locale/cons/5.cc | 4 +- libstdc++-v3/testsuite/22_locale/locale/cons/7.cc | 2 +- .../locale/global_locale_objects/14071.cc | 3 +- .../22_locale/locale/global_locale_objects/2.cc | 3 +- .../testsuite/22_locale/messages/members/char/1.cc | 2 +- .../testsuite/22_locale/messages/members/char/2.cc | 2 +- .../testsuite/22_locale/messages/members/char/3.cc | 3 +- .../22_locale/messages/members/char/wrapped_env.cc | 4 +- .../messages/members/char/wrapped_locale.cc | 5 +- .../22_locale/messages_byname/named_equivalence.cc | 2 +- .../testsuite/22_locale/money_get/get/char/1.cc | 2 +- .../testsuite/22_locale/money_get/get/char/10.cc | 2 +- .../testsuite/22_locale/money_get/get/char/11.cc | 2 +- .../22_locale/money_get/get/char/11528.cc | 2 +- .../testsuite/22_locale/money_get/get/char/12.cc | 2 +- .../testsuite/22_locale/money_get/get/char/13.cc | 2 +- .../testsuite/22_locale/money_get/get/char/15.cc | 2 +- .../testsuite/22_locale/money_get/get/char/16.cc | 3 +- .../testsuite/22_locale/money_get/get/char/17.cc | 2 +- .../testsuite/22_locale/money_get/get/char/18.cc | 2 +- .../testsuite/22_locale/money_get/get/char/2.cc | 2 +- .../testsuite/22_locale/money_get/get/char/3.cc | 2 +- .../testsuite/22_locale/money_get/get/char/4.cc | 2 +- .../22_locale/money_get/get/char/wrapped_env.cc | 4 +- .../22_locale/money_get/get/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/money_get/get/wchar_t/1.cc | 2 +- .../22_locale/money_get/get/wchar_t/10.cc | 2 +- .../22_locale/money_get/get/wchar_t/11.cc | 2 +- .../22_locale/money_get/get/wchar_t/11528.cc | 2 +- .../22_locale/money_get/get/wchar_t/12.cc | 2 +- .../22_locale/money_get/get/wchar_t/13.cc | 2 +- .../22_locale/money_get/get/wchar_t/15.cc | 2 +- .../22_locale/money_get/get/wchar_t/16.cc | 3 +- .../22_locale/money_get/get/wchar_t/17.cc | 2 +- .../22_locale/money_get/get/wchar_t/18.cc | 2 +- .../testsuite/22_locale/money_get/get/wchar_t/2.cc | 2 +- .../testsuite/22_locale/money_get/get/wchar_t/3.cc | 2 +- .../testsuite/22_locale/money_get/get/wchar_t/4.cc | 2 +- .../22_locale/money_get/get/wchar_t/wrapped_env.cc | 4 +- .../money_get/get/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/money_put/put/char/1.cc | 2 +- .../testsuite/22_locale/money_put/put/char/2.cc | 2 +- .../testsuite/22_locale/money_put/put/char/3.cc | 2 +- .../22_locale/money_put/put/char/9780-3.cc | 3 +- .../22_locale/money_put/put/char/wrapped_env.cc | 4 +- .../22_locale/money_put/put/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/money_put/put/wchar_t/1.cc | 2 +- .../testsuite/22_locale/money_put/put/wchar_t/2.cc | 2 +- .../testsuite/22_locale/money_put/put/wchar_t/3.cc | 2 +- .../22_locale/money_put/put/wchar_t/wrapped_env.cc | 4 +- .../money_put/put/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/moneypunct/40712.cc | 2 +- .../22_locale/moneypunct/members/char/2.cc | 2 +- .../moneypunct/members/char/wrapped_env.cc | 2 +- .../moneypunct/members/char/wrapped_locale.cc | 3 +- .../22_locale/moneypunct/members/wchar_t/2.cc | 2 +- .../moneypunct/members/wchar_t/wrapped_env.cc | 2 +- .../moneypunct/members/wchar_t/wrapped_locale.cc | 3 +- .../moneypunct_byname/named_equivalence.cc | 2 +- .../testsuite/22_locale/num_get/get/char/1.cc | 2 +- .../testsuite/22_locale/num_get/get/char/3.cc | 2 +- .../testsuite/22_locale/num_get/get/char/5.cc | 2 +- .../testsuite/22_locale/num_get/get/char/6.cc | 2 +- .../testsuite/22_locale/num_get/get/char/9.cc | 2 +- .../22_locale/num_get/get/char/wrapped_env.cc | 3 +- .../22_locale/num_get/get/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/num_get/get/wchar_t/1.cc | 2 +- .../testsuite/22_locale/num_get/get/wchar_t/3.cc | 2 +- .../testsuite/22_locale/num_get/get/wchar_t/5.cc | 2 +- .../testsuite/22_locale/num_get/get/wchar_t/6.cc | 2 +- .../testsuite/22_locale/num_get/get/wchar_t/9.cc | 2 +- .../22_locale/num_get/get/wchar_t/wrapped_env.cc | 3 +- .../num_get/get/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/num_put/put/char/1.cc | 2 +- .../testsuite/22_locale/num_put/put/char/20909.cc | 2 +- .../testsuite/22_locale/num_put/put/char/20914.cc | 2 +- .../testsuite/22_locale/num_put/put/char/3.cc | 2 +- .../testsuite/22_locale/num_put/put/char/5.cc | 2 +- .../testsuite/22_locale/num_put/put/char/9780-2.cc | 3 +- .../22_locale/num_put/put/char/wrapped_env.cc | 4 +- .../22_locale/num_put/put/char/wrapped_locale.cc | 5 +- .../testsuite/22_locale/num_put/put/wchar_t/1.cc | 2 +- .../22_locale/num_put/put/wchar_t/20909.cc | 2 +- .../22_locale/num_put/put/wchar_t/20914.cc | 2 +- .../testsuite/22_locale/num_put/put/wchar_t/3.cc | 2 +- .../testsuite/22_locale/num_put/put/wchar_t/5.cc | 2 +- .../22_locale/num_put/put/wchar_t/wrapped_env.cc | 3 +- .../num_put/put/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/numpunct/members/char/2.cc | 4 +- .../testsuite/22_locale/numpunct/members/char/3.cc | 2 +- .../22_locale/numpunct/members/char/wrapped_env.cc | 4 +- .../numpunct/members/char/wrapped_locale.cc | 5 +- .../22_locale/numpunct/members/wchar_t/2.cc | 4 +- .../numpunct/members/wchar_t/wrapped_env.cc | 4 +- .../numpunct/members/wchar_t/wrapped_locale.cc | 5 +- .../22_locale/numpunct_byname/named_equivalence.cc | 2 +- .../time_get/date_order/char/wrapped_env.cc | 2 +- .../time_get/date_order/char/wrapped_locale.cc | 2 +- .../time_get/date_order/wchar_t/wrapped_env.cc | 2 +- .../time_get/date_order/wchar_t/wrapped_locale.cc | 2 +- .../22_locale/time_get/get_date/char/12750.cc | 2 +- .../22_locale/time_get/get_date/char/2.cc | 3 +- .../22_locale/time_get/get_date/char/26701.cc | 2 +- .../time_get/get_date/char/wrapped_env.cc | 3 +- .../time_get/get_date/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_date/wchar_t/12750.cc | 2 +- .../22_locale/time_get/get_date/wchar_t/2.cc | 3 +- .../22_locale/time_get/get_date/wchar_t/26701.cc | 2 +- .../22_locale/time_get/get_date/wchar_t/4.cc | 2 +- .../time_get/get_date/wchar_t/wrapped_env.cc | 3 +- .../time_get/get_date/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_monthname/char/2.cc | 3 +- .../time_get/get_monthname/char/wrapped_env.cc | 3 +- .../time_get/get_monthname/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_monthname/wchar_t/2.cc | 3 +- .../time_get/get_monthname/wchar_t/wrapped_env.cc | 3 +- .../get_monthname/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_time/char/1.cc | 2 +- .../22_locale/time_get/get_time/char/2.cc | 2 +- .../time_get/get_time/char/wrapped_env.cc | 3 +- .../time_get/get_time/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_time/wchar_t/1.cc | 2 +- .../22_locale/time_get/get_time/wchar_t/2.cc | 2 +- .../time_get/get_time/wchar_t/wrapped_env.cc | 3 +- .../time_get/get_time/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_weekday/char/2.cc | 3 +- .../22_locale/time_get/get_weekday/char/38081-1.cc | 2 +- .../22_locale/time_get/get_weekday/char/38081-2.cc | 2 +- .../time_get/get_weekday/char/wrapped_env.cc | 3 +- .../time_get/get_weekday/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_weekday/wchar_t/2.cc | 3 +- .../time_get/get_weekday/wchar_t/wrapped_env.cc | 3 +- .../time_get/get_weekday/wchar_t/wrapped_locale.cc | 4 +- .../time_get/get_year/char/wrapped_env.cc | 2 +- .../time_get/get_year/char/wrapped_locale.cc | 2 +- .../time_get/get_year/wchar_t/wrapped_env.cc | 2 +- .../time_get/get_year/wchar_t/wrapped_locale.cc | 2 +- .../testsuite/22_locale/time_put/put/char/17038.cc | 2 +- .../testsuite/22_locale/time_put/put/char/2.cc | 2 +- .../testsuite/22_locale/time_put/put/char/3.cc | 2 +- .../testsuite/22_locale/time_put/put/char/4.cc | 2 +- .../testsuite/22_locale/time_put/put/char/6.cc | 2 +- .../testsuite/22_locale/time_put/put/char/7.cc | 2 +- .../testsuite/22_locale/time_put/put/char/8.cc | 2 +- .../22_locale/time_put/put/char/9780-1.cc | 3 +- .../22_locale/time_put/put/char/wrapped_env.cc | 5 +- .../22_locale/time_put/put/char/wrapped_locale.cc | 5 +- .../22_locale/time_put/put/wchar_t/17038.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/2.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/3.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/4.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/6.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/7.cc | 2 +- .../testsuite/22_locale/time_put/put/wchar_t/8.cc | 2 +- .../22_locale/time_put/put/wchar_t/wrapped_env.cc | 5 +- .../time_put/put/wchar_t/wrapped_locale.cc | 6 +- .../testsuite/23_containers/bitset/45713.cc | 25 + .../bitset/{ => debug}/invalidation/1.cc | 0 .../23_containers/deque/debug/assign1_neg.cc | 33 + .../23_containers/deque/debug/assign2_neg.cc | 33 + .../23_containers/deque/debug/assign3_neg.cc | 33 + .../23_containers/deque/debug/assign4_neg.cc | 32 + .../23_containers/deque/debug/construct1_neg.cc | 33 + .../23_containers/deque/debug/construct2_neg.cc | 33 + .../23_containers/deque/debug/construct3_neg.cc | 33 + .../23_containers/deque/debug/construct4_neg.cc | 32 + .../23_containers/deque/debug/insert1_neg.cc | 33 + .../23_containers/deque/debug/insert2_neg.cc | 33 + .../23_containers/deque/debug/insert3_neg.cc | 33 + .../23_containers/deque/debug/insert4_neg.cc | 32 + .../deque/{ => debug}/invalidation/1.cc | 0 .../deque/{ => debug}/invalidation/2.cc | 0 .../deque/{ => debug}/invalidation/3.cc | 0 .../deque/{ => debug}/invalidation/4.cc | 0 .../forward_list/operations/remove_freed.cc | 2 +- .../23_containers/list/debug/assign1_neg.cc | 33 + .../23_containers/list/debug/assign2_neg.cc | 33 + .../23_containers/list/debug/assign3_neg.cc | 33 + .../23_containers/list/debug/assign4_neg.cc | 32 + .../23_containers/list/debug/construct1_neg.cc | 33 + .../23_containers/list/debug/construct2_neg.cc | 33 + .../23_containers/list/debug/construct3_neg.cc | 33 + .../23_containers/list/debug/construct4_neg.cc | 32 + .../23_containers/list/debug/insert1_neg.cc | 33 + .../23_containers/list/debug/insert2_neg.cc | 33 + .../23_containers/list/debug/insert3_neg.cc | 33 + .../23_containers/list/debug/insert4_neg.cc | 32 + .../list/{ => debug}/invalidation/1.cc | 0 .../list/{ => debug}/invalidation/2.cc | 0 .../list/{ => debug}/invalidation/3.cc | 0 .../list/{ => debug}/invalidation/4.cc | 0 .../23_containers/map/debug/construct1_neg.cc | 33 + .../23_containers/map/debug/construct2_neg.cc | 33 + .../23_containers/map/debug/construct3_neg.cc | 33 + .../23_containers/map/debug/construct4_neg.cc | 32 + .../23_containers/map/debug/insert1_neg.cc | 33 + .../23_containers/map/debug/insert2_neg.cc | 33 + .../23_containers/map/debug/insert3_neg.cc | 33 + .../23_containers/map/debug/insert4_neg.cc | 32 + .../map/{ => debug}/invalidation/1.cc | 0 .../map/{ => debug}/invalidation/2.cc | 0 .../23_containers/multimap/debug/construct1_neg.cc | 33 + .../23_containers/multimap/debug/construct2_neg.cc | 33 + .../23_containers/multimap/debug/construct3_neg.cc | 33 + .../23_containers/multimap/debug/construct4_neg.cc | 32 + .../23_containers/multimap/debug/insert1_neg.cc | 33 + .../23_containers/multimap/debug/insert2_neg.cc | 33 + .../23_containers/multimap/debug/insert3_neg.cc | 33 + .../23_containers/multimap/debug/insert4_neg.cc | 32 + .../multimap/{ => debug}/invalidation/1.cc | 0 .../multimap/{ => debug}/invalidation/2.cc | 0 .../23_containers/multiset/debug/construct1_neg.cc | 33 + .../23_containers/multiset/debug/construct2_neg.cc | 33 + .../23_containers/multiset/debug/construct3_neg.cc | 33 + .../23_containers/multiset/debug/construct4_neg.cc | 32 + .../23_containers/multiset/debug/insert1_neg.cc | 33 + .../23_containers/multiset/debug/insert2_neg.cc | 33 + .../23_containers/multiset/debug/insert3_neg.cc | 33 + .../23_containers/multiset/debug/insert4_neg.cc | 32 + .../multiset/{ => debug}/invalidation/1.cc | 0 .../multiset/{ => debug}/invalidation/2.cc | 0 .../23_containers/set/debug/construct1_neg.cc | 33 + .../23_containers/set/debug/construct2_neg.cc | 33 + .../23_containers/set/debug/construct3_neg.cc | 33 + .../23_containers/set/debug/construct4_neg.cc | 32 + .../23_containers/set/debug/insert1_neg.cc | 33 + .../23_containers/set/debug/insert2_neg.cc | 33 + .../23_containers/set/debug/insert3_neg.cc | 33 + .../23_containers/set/debug/insert4_neg.cc | 32 + .../set/{ => debug}/invalidation/1.cc | 0 .../set/{ => debug}/invalidation/2.cc | 0 .../unordered_map/debug/construct1_neg.cc | 34 + .../unordered_map/debug/construct2_neg.cc | 34 + .../unordered_map/debug/construct3_neg.cc | 34 + .../unordered_map/debug/construct4_neg.cc | 33 + .../unordered_map/debug/insert1_neg.cc | 34 + .../unordered_map/debug/insert2_neg.cc | 34 + .../unordered_map/debug/insert3_neg.cc | 34 + .../unordered_map/debug/insert4_neg.cc | 33 + .../unordered_multimap/debug/construct1_neg.cc | 34 + .../unordered_multimap/debug/construct2_neg.cc | 34 + .../unordered_multimap/debug/construct3_neg.cc | 34 + .../unordered_multimap/debug/construct4_neg.cc | 33 + .../unordered_multimap/debug/insert1_neg.cc | 34 + .../unordered_multimap/debug/insert2_neg.cc | 34 + .../unordered_multimap/debug/insert3_neg.cc | 34 + .../unordered_multimap/debug/insert4_neg.cc | 33 + .../unordered_multiset/debug/construct1_neg.cc | 34 + .../unordered_multiset/debug/construct2_neg.cc | 34 + .../unordered_multiset/debug/construct3_neg.cc | 34 + .../unordered_multiset/debug/construct4_neg.cc | 33 + .../unordered_multiset/debug/insert1_neg.cc | 34 + .../unordered_multiset/debug/insert2_neg.cc | 34 + .../unordered_multiset/debug/insert3_neg.cc | 34 + .../unordered_multiset/debug/insert4_neg.cc | 33 + .../unordered_set/debug/construct1_neg.cc | 34 + .../unordered_set/debug/construct2_neg.cc | 34 + .../unordered_set/debug/construct3_neg.cc | 34 + .../unordered_set/debug/construct4_neg.cc | 33 + .../unordered_set/debug/insert1_neg.cc | 34 + .../unordered_set/debug/insert2_neg.cc | 34 + .../unordered_set/debug/insert3_neg.cc | 34 + .../unordered_set/debug/insert4_neg.cc | 33 + .../23_containers/vector/debug/assign1_neg.cc | 33 + .../23_containers/vector/debug/assign2_neg.cc | 33 + .../23_containers/vector/debug/assign3_neg.cc | 33 + .../23_containers/vector/debug/assign4_neg.cc | 32 + .../23_containers/vector/debug/construct1_neg.cc | 33 + .../23_containers/vector/debug/construct2_neg.cc | 33 + .../23_containers/vector/debug/construct3_neg.cc | 33 + .../23_containers/vector/debug/construct4_neg.cc | 32 + .../23_containers/vector/debug/insert1_neg.cc | 33 + .../23_containers/vector/debug/insert2_neg.cc | 33 + .../23_containers/vector/debug/insert3_neg.cc | 33 + .../23_containers/vector/debug/insert4_neg.cc | 32 + .../vector/{ => debug}/invalidation/1.cc | 0 .../vector/{ => debug}/invalidation/2.cc | 0 .../vector/{ => debug}/invalidation/3.cc | 0 .../vector/{ => debug}/invalidation/4.cc | 0 .../27_io/basic_filebuf/imbue/char/13007.cc | 2 +- .../27_io/basic_filebuf/imbue/char/13171-1.cc | 2 +- .../27_io/basic_filebuf/imbue/char/13171-2.cc | 3 +- .../27_io/basic_filebuf/imbue/char/13171-4.cc | 3 +- .../27_io/basic_filebuf/imbue/char/13582-2.cc | 3 +- .../27_io/basic_filebuf/imbue/char/14975-1.cc | 2 +- .../testsuite/27_io/basic_filebuf/imbue/char/2.cc | 2 +- .../27_io/basic_filebuf/imbue/char/9322.cc | 3 +- .../27_io/basic_filebuf/imbue/wchar_t/12868.cc | 2 +- .../27_io/basic_filebuf/imbue/wchar_t/13007.cc | 2 +- .../27_io/basic_filebuf/imbue/wchar_t/13171-3.cc | 4 +- .../27_io/basic_filebuf/imbue/wchar_t/13582-2.cc | 3 +- .../27_io/basic_filebuf/imbue/wchar_t/13582-3.cc | 3 +- .../27_io/basic_filebuf/imbue/wchar_t/14975-2.cc | 2 +- .../27_io/basic_filebuf/imbue/wchar_t/2.cc | 2 +- .../27_io/basic_filebuf/imbue/wchar_t/9322.cc | 3 +- .../basic_filebuf/overflow/wchar_t/11305-1.cc | 2 +- .../basic_filebuf/overflow/wchar_t/11305-2.cc | 2 +- .../basic_filebuf/overflow/wchar_t/11305-3.cc | 2 +- .../basic_filebuf/overflow/wchar_t/11305-4.cc | 2 +- .../27_io/basic_filebuf/seekoff/45628-2.cc | 103 + .../27_io/basic_filebuf/seekoff/char/4.cc | 93 + .../27_io/basic_filebuf/seekoff/char/45628-1.cc | 79 + .../27_io/basic_filebuf/seekoff/wchar_t/1.cc | 2 +- .../27_io/basic_filebuf/seekoff/wchar_t/2.cc | 2 +- .../27_io/basic_filebuf/seekoff/wchar_t/4.cc | 93 + .../27_io/basic_filebuf/seekpos/wchar_t/9874.cc | 2 +- .../testsuite/27_io/basic_filebuf/sync/char/1.cc | 51 - .../27_io/basic_filebuf/sync/wchar_t/1.cc | 51 - .../27_io/basic_filebuf/underflow/wchar_t/1.cc | 2 +- .../basic_filebuf/underflow/wchar_t/11389-1.cc | 2 +- .../basic_filebuf/underflow/wchar_t/11389-2.cc | 2 +- .../basic_filebuf/underflow/wchar_t/11389-3.cc | 2 +- .../basic_filebuf/underflow/wchar_t/11389-4.cc | 2 +- .../27_io/basic_filebuf/underflow/wchar_t/2.cc | 2 +- .../27_io/basic_filebuf/underflow/wchar_t/3.cc | 2 +- .../27_io/basic_filebuf/underflow/wchar_t/4.cc | 2 +- .../27_io/basic_filebuf/underflow/wchar_t/5.cc | 2 +- .../27_io/basic_filebuf/underflow/wchar_t/9520.cc | 2 +- .../testsuite/27_io/basic_ios/copyfmt/char/2.cc | 2 +- .../basic_ostream/inserters_arithmetic/char/2.cc | 2 +- .../inserters_arithmetic/wchar_t/2.cc | 2 +- .../27_io/basic_streambuf/imbue/char/13007-1.cc | 2 +- .../27_io/basic_streambuf/imbue/char/13007-2.cc | 2 +- .../27_io/basic_streambuf/imbue/char/9322.cc | 3 +- .../27_io/basic_streambuf/imbue/wchar_t/13007-1.cc | 2 +- .../27_io/basic_streambuf/imbue/wchar_t/13007-2.cc | 2 +- .../27_io/basic_streambuf/imbue/wchar_t/9322.cc | 3 +- .../27_io/basic_stringbuf/imbue/char/9322.cc | 3 +- .../27_io/basic_stringbuf/imbue/wchar_t/9322.cc | 3 +- .../manipulators/extended/get_money/char/1.cc | 2 +- .../manipulators/extended/get_money/wchar_t/1.cc | 2 +- .../manipulators/extended/put_money/char/1.cc | 2 +- .../manipulators/extended/put_money/wchar_t/1.cc | 2 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc | 2 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc | 2 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc | 2 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc | 2 +- .../testsuite/27_io/objects/wchar_t/9520.cc | 2 +- .../ext/stdio_sync_filebuf/wchar_t/12077.cc | 2 +- libstdc++-v3/testsuite/lib/dg-options.exp | 2 +- libstdc++-v3/testsuite/lib/libstdc++.exp | 138 +- libstdc++-v3/testsuite/libstdc++-abi/abi.exp | 2 +- .../21_strings/{string_append.cc => append-1.cc} | 0 .../21_strings/{string_append_2.cc => append-2.cc} | 0 ...ns_input_iterator.cc => cons_input_iterator.cc} | 0 ...copy_cons_and_dest.cc => copy_cons_and_dest.cc} | 0 .../21_strings/{string_find.cc => find.cc} | 0 .../testsuite/performance/21_strings/hash.cc | 58 + .../range_construct/deque_construct.cc | 43 + .../range_construct/list_construct1.cc | 44 + .../range_construct/list_construct2.cc | 43 + .../range_construct/vector_construct.cc | 43 + libstdc++-v3/testsuite/util/debug/checks.h | 379 ++ libstdc++-v3/testsuite/util/exception/safety.h | 6 +- .../testsuite/util/replacement_memory_operators.h | 2 +- libstdc++-v3/testsuite/util/testsuite_character.h | 4 +- 1988 files changed, 73668 insertions(+), 26671 deletions(-) create mode 100644 config/dfp.m4 delete mode 100644 gcc/ada/gnatlbr.adb create mode 100644 gcc/ada/s-stratt-xdr.adb delete mode 100644 gcc/ada/s-strxdr.adb create mode 100644 gcc/ada/vms_cmds.ads create mode 100644 gcc/config/alpha/osf5-unwind.h create mode 100644 gcc/config/arm/cortex-a5.md create mode 100644 gcc/config/arm/cortex-a9-neon.md create mode 100644 gcc/config/arm/cortex-m4-fpu.md create mode 100644 gcc/config/arm/cortex-m4.md create mode 100644 gcc/config/i386/darwin.opt create mode 100644 gcc/config/mips/sde.opt create mode 100644 gcc/testsuite/c-c++-common/cpp/pr45457.c create mode 100644 gcc/testsuite/g++.dg/cpp0x/auto19.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/implicit9.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/initlist42.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/initlist43.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/initlist44.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/inline-ns4.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/inline-ns5.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for1.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for2.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for3.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for4.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for5.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/range-for6.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C rewrite gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C (64%) create mode 100644 gcc/testsuite/g++.dg/debug/pr45660.C create mode 100644 gcc/testsuite/g++.dg/eh/pr45569.C create mode 100644 gcc/testsuite/g++.dg/ext/attr-ifunc-1.C create mode 100644 gcc/testsuite/g++.dg/ext/attr-ifunc-2.C create mode 100644 gcc/testsuite/g++.dg/ext/attr-ifunc-3.C create mode 100644 gcc/testsuite/g++.dg/ext/attr-ifunc-4.C create mode 100644 gcc/testsuite/g++.dg/gomp/atomic-11.C create mode 100644 gcc/testsuite/g++.dg/gomp/atomic-12.C create mode 100644 gcc/testsuite/g++.dg/gomp/atomic-13.C create mode 100644 gcc/testsuite/g++.dg/gomp/atomic-14.C create mode 100644 gcc/testsuite/g++.dg/ipa/pr45565.C create mode 100644 gcc/testsuite/g++.dg/lto/pr45679-1_0.C create mode 100644 gcc/testsuite/g++.dg/lto/pr45679-1_1.C create mode 100644 gcc/testsuite/g++.dg/lto/pr45679-2_0.C create mode 100644 gcc/testsuite/g++.dg/lto/pr45679-2_1.C create mode 100644 gcc/testsuite/g++.dg/opt/pr44919.C create mode 100644 gcc/testsuite/g++.dg/opt/pr45316.C create mode 100644 gcc/testsuite/g++.dg/opt/pr45412.C create mode 100644 gcc/testsuite/g++.dg/other/i386-8.C create mode 100644 gcc/testsuite/g++.dg/parse/defarg15.C create mode 100644 gcc/testsuite/g++.dg/parse/parameter-declaration-2.C create mode 100644 gcc/testsuite/g++.dg/parse/redef2.C create mode 100644 gcc/testsuite/g++.dg/template/crash102.C create mode 100644 gcc/testsuite/g++.dg/template/crash103.C create mode 100644 gcc/testsuite/g++.dg/template/sfinae25.C create mode 100644 gcc/testsuite/g++.dg/template/typedef34.C create mode 100644 gcc/testsuite/g++.dg/template/typedef35.C create mode 100644 gcc/testsuite/g++.dg/torture/pr44972.C create mode 100644 gcc/testsuite/g++.dg/torture/pr45393.C create mode 100644 gcc/testsuite/g++.dg/torture/pr45580.C create mode 100644 gcc/testsuite/g++.dg/torture/pr45709-2.C create mode 100644 gcc/testsuite/g++.dg/torture/pr45709.C create mode 100644 gcc/testsuite/g++.dg/tree-prof/partition2.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr45453.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr45605.C create mode 100644 gcc/testsuite/g++.dg/vect/pr45470-a.cc create mode 100644 gcc/testsuite/g++.dg/vect/pr45470-b.cc create mode 100644 gcc/testsuite/g++.dg/warn/Wdouble-promotion.C create mode 100644 gcc/testsuite/g++.dg/warn/Wunused-var-15.C create mode 100644 gcc/testsuite/gcc.c-torture/compile/20100907.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20100915-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr44246.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr44937.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr45059.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr45412.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr45535.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr45728.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20100827-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr40386.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr40386.x create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr44858.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr45695.c create mode 100644 gcc/testsuite/gcc.dg/20100906-1.c create mode 100644 gcc/testsuite/gcc.dg/Wdouble-promotion.c create mode 100644 gcc/testsuite/gcc.dg/attr-ifunc-1.c create mode 100644 gcc/testsuite/gcc.dg/attr-ifunc-2.c create mode 100644 gcc/testsuite/gcc.dg/attr-ifunc-3.c create mode 100644 gcc/testsuite/gcc.dg/attr-ifunc-4.c create mode 100644 gcc/testsuite/gcc.dg/attr-ifunc-5.c create mode 100644 gcc/testsuite/gcc.dg/cpp/warn-comments-3.c rewrite gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c (65%) create mode 100644 gcc/testsuite/gcc.dg/gomp/atomic-12.c create mode 100644 gcc/testsuite/gcc.dg/gomp/atomic-13.c create mode 100644 gcc/testsuite/gcc.dg/gomp/atomic-14.c create mode 100644 gcc/testsuite/gcc.dg/graphite/id-27.c create mode 100644 gcc/testsuite/gcc.dg/ipa/pr45644.c create mode 100644 gcc/testsuite/gcc.dg/lto/20100825-1_0.c create mode 100644 gcc/testsuite/gcc.dg/nested-func-8.c create mode 100644 gcc/testsuite/gcc.dg/opts-4.c create mode 100644 gcc/testsuite/gcc.dg/pr44485.c create mode 100644 gcc/testsuite/gcc.dg/pr45415.c create mode 100644 gcc/testsuite/gcc.dg/pr45449.c create mode 100644 gcc/testsuite/gcc.dg/pr45461.c create mode 100644 gcc/testsuite/gcc.dg/pr45506.c create mode 100644 gcc/testsuite/gcc.dg/pr45567.c create mode 100644 gcc/testsuite/gcc.dg/pr45750.c create mode 100644 gcc/testsuite/gcc.dg/stack-usage-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr45623.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr45678-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr45678-2.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr45704.c create mode 100644 gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c rewrite gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c (67%) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr45427.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/vrp54.c create mode 100644 gcc/testsuite/gcc.dg/vect/bb-slp-8a.c create mode 100644 gcc/testsuite/gcc.dg/vect/bb-slp-8b.c create mode 100644 gcc/testsuite/gcc.dg/vect/pr43430-2.c create mode 100644 gcc/testsuite/gcc.dg/vect/pr43432.c create mode 100644 gcc/testsuite/gcc.dg/vect/pr45633.c create mode 100644 gcc/testsuite/gcc.target/arm/headmerge-1.c create mode 100644 gcc/testsuite/gcc.target/arm/headmerge-2.c create mode 100644 gcc/testsuite/gcc.target/arm/pr43137.c create mode 100644 gcc/testsuite/gcc.target/arm/sync-1.c create mode 100644 gcc/testsuite/gcc.target/i386/combine-mul.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-1.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-2.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-3.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-4.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-4a.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-5.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-6.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-7.c create mode 100644 gcc/testsuite/gcc.target/i386/divmod-8.c create mode 100644 gcc/testsuite/gcc.target/i386/headmerge-1.c create mode 100644 gcc/testsuite/gcc.target/i386/headmerge-2.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-1.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-10.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-2.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-3.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-4.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-5a.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-5b.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-6a.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-6b.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-7.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-8.c create mode 100644 gcc/testsuite/gcc.target/i386/pad-9.c create mode 100644 gcc/testsuite/gcc.target/i386/pr36502.c create mode 100644 gcc/testsuite/gcc.target/i386/pr45206.c create mode 100644 gcc/testsuite/gcc.target/i386/pr45500.c create mode 100644 gcc/testsuite/gcc.target/i386/pr45617.c create mode 100644 gcc/testsuite/gcc.target/i386/pr45739.c create mode 100644 gcc/testsuite/gcc.target/i386/stack-usage-realign.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-1.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-2.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-3.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-4.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-4a.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-5.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-6.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-7.c create mode 100644 gcc/testsuite/gcc.target/i386/udivmod-8.c create mode 100644 gcc/testsuite/gcc.target/i386/vect-double-1.c create mode 100644 gcc/testsuite/gcc.target/i386/vect-double-1a.c create mode 100644 gcc/testsuite/gcc.target/i386/vect-double-2.c create mode 100644 gcc/testsuite/gcc.target/i386/vect-double-2a.c create mode 100644 gcc/testsuite/gcc.target/mips/loongson-shift-count-truncated-1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-10.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-11.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-2.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-3.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-4.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-5.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-6.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-7.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-8.c create mode 100644 gcc/testsuite/gcc.target/powerpc/ppc-fpconv-9.c create mode 100644 gcc/testsuite/gcc.target/sparc/mnofpu.c create mode 100644 gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90 create mode 100644 gcc/testsuite/gfortran.dg/allocate_derived_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/associate_8.f03 create mode 100644 gcc/testsuite/gfortran.dg/bit_comparison_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/bit_comparison_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/char_length_17.f90 create mode 100644 gcc/testsuite/gfortran.dg/char_length_18.f90 create mode 100644 gcc/testsuite/gfortran.dg/class_dummy_1.f03 create mode 100644 gcc/testsuite/gfortran.dg/class_dummy_2.f03 create mode 100644 gcc/testsuite/gfortran.dg/dependency_33.f90 create mode 100644 gcc/testsuite/gfortran.dg/dependency_34.f90 create mode 100644 gcc/testsuite/gfortran.dg/dependency_35.f90 create mode 100644 gcc/testsuite/gfortran.dg/dependency_36.f90 create mode 100644 gcc/testsuite/gfortran.dg/der_io_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/derived_array_intrinisics_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/dshift_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/dshift_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/dummy_optional_arg.f90 create mode 100644 gcc/testsuite/gfortran.dg/dynamic_dispatch_11.f03 create mode 100644 gcc/testsuite/gfortran.dg/execute_command_line_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/exit_3.f08 create mode 100644 gcc/testsuite/gfortran.dg/exit_4.f08 create mode 100644 gcc/testsuite/gfortran.dg/exit_5.f03 create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr45595.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr45597.f90 create mode 100644 gcc/testsuite/gfortran.dg/hollerith8.f90 create mode 100644 gcc/testsuite/gfortran.dg/iall_iany_iparity_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/iall_iany_iparity_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/initialization_27.f90 create mode 100644 gcc/testsuite/gfortran.dg/inline_transpose_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/internal_dummy_2.f08 create mode 100644 gcc/testsuite/gfortran.dg/internal_dummy_3.f08 create mode 100644 gcc/testsuite/gfortran.dg/internal_dummy_4.f08 create mode 100644 gcc/testsuite/gfortran.dg/intrinsic_intent_1.f03 create mode 100644 gcc/testsuite/gfortran.dg/ishft_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/leadz_trailz_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/masklr_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/masklr_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/merge_bits_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/merge_bits_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_63.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_64.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_65.f90 create mode 100644 gcc/testsuite/gfortran.dg/norm2_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/norm2_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/norm2_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/norm_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/parity_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/parity_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/parity_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/pointer_check_7.f90 create mode 100644 gcc/testsuite/gfortran.dg/popcnt_poppar_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/popcnt_poppar_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/pr45578.f90 create mode 100644 gcc/testsuite/gfortran.dg/select_type_13.f03 create mode 100644 gcc/testsuite/gfortran.dg/select_type_14.f03 create mode 100644 gcc/testsuite/gfortran.dg/select_type_15.f03 create mode 100644 gcc/testsuite/gfortran.dg/select_type_16.f03 create mode 100644 gcc/testsuite/gfortran.dg/select_type_17.f03 create mode 100644 gcc/testsuite/gfortran.dg/shiftalr_1.F90 create mode 100644 gcc/testsuite/gfortran.dg/shiftalr_2.F90 create mode 100644 gcc/testsuite/gfortran.dg/transpose_optimization_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/trim_optimize_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/typebound_proc_18.f03 create mode 100644 gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/pr45714-a.f create mode 100644 gcc/testsuite/gfortran.dg/vect/pr45714-b.f create mode 100644 gcc/testsuite/gfortran.dg/vector_subscript_bound_1.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/compile/pr45598.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/compile/pr45634.f90 delete mode 100644 gcc/testsuite/gnat.dg/const1.adb create mode 100644 gcc/testsuite/gnat.dg/constant1.adb create mode 100644 gcc/testsuite/gnat.dg/constant2.adb create mode 100644 gcc/testsuite/gnat.dg/constant2_pkg1.ads create mode 100644 gcc/testsuite/gnat.dg/constant2_pkg2.adb create mode 100644 gcc/testsuite/gnat.dg/constant2_pkg2.ads create mode 100644 gcc/testsuite/gnat.dg/discr24.adb create mode 100644 gcc/testsuite/gnat.dg/dse_step.adb create mode 100644 gcc/testsuite/gnat.dg/dse_step.ads create mode 100644 gcc/testsuite/gnat.dg/memtrap.adb create mode 100644 gcc/testsuite/gnat.dg/specs/constant1.ads create mode 100644 gcc/testsuite/gnat.dg/specs/constant1_pkg.ads create mode 100644 gcc/testsuite/gnat.dg/test_dse_step.adb create mode 100644 gcc/testsuite/obj-c++.dg/comp-types-13.mm create mode 100644 gcc/testsuite/obj-c++.dg/msg-in-protocol.mm create mode 100644 gcc/testsuite/obj-c++.dg/naming-1.mm create mode 100644 gcc/testsuite/obj-c++.dg/naming-2.mm create mode 100644 gcc/testsuite/obj-c++.dg/proto-lossage-7.mm create mode 100644 gcc/testsuite/obj-c++.dg/too-many-args.mm create mode 100644 gcc/testsuite/objc.dg/break-in-ifstmt.m create mode 100644 gcc/testsuite/objc.dg/comp-types-12.m create mode 100644 gcc/testsuite/objc.dg/fobjc-exceptions.m create mode 100644 gcc/testsuite/objc.dg/invalid-method-1.m create mode 100644 gcc/testsuite/objc.dg/msg-in-protocol.m create mode 100644 gcc/testsuite/objc.dg/naming-4.m create mode 100644 gcc/testsuite/objc.dg/naming-5.m create mode 100644 gcc/testsuite/objc.dg/proto-lossage-7.m create mode 100644 gcc/testsuite/objc.dg/too-many-args.m rewrite gcc/testsuite/objc.dg/type-stream-1.m (85%) create mode 100644 gcc/testsuite/objc/execute/exceptions/matcher-1.m create mode 100644 gcc/testsuite/objc/execute/exceptions/throw-nil.m create mode 100644 libgcc/config/i386/libgcc-bsd.ver create mode 100644 libgcc/config/i386/t-freebsd create mode 100644 libgfortran/generated/iall_i1.c create mode 100644 libgfortran/generated/iall_i16.c create mode 100644 libgfortran/generated/iall_i2.c create mode 100644 libgfortran/generated/iall_i4.c create mode 100644 libgfortran/generated/iall_i8.c create mode 100644 libgfortran/generated/iany_i1.c create mode 100644 libgfortran/generated/iany_i16.c create mode 100644 libgfortran/generated/iany_i2.c create mode 100644 libgfortran/generated/iany_i4.c create mode 100644 libgfortran/generated/iany_i8.c create mode 100644 libgfortran/generated/iparity_i1.c create mode 100644 libgfortran/generated/iparity_i16.c create mode 100644 libgfortran/generated/iparity_i2.c create mode 100644 libgfortran/generated/iparity_i4.c create mode 100644 libgfortran/generated/iparity_i8.c create mode 100644 libgfortran/generated/norm2_r10.c create mode 100644 libgfortran/generated/norm2_r16.c create mode 100644 libgfortran/generated/norm2_r4.c create mode 100644 libgfortran/generated/norm2_r8.c create mode 100644 libgfortran/generated/parity_l1.c create mode 100644 libgfortran/generated/parity_l16.c create mode 100644 libgfortran/generated/parity_l2.c create mode 100644 libgfortran/generated/parity_l4.c create mode 100644 libgfortran/generated/parity_l8.c create mode 100644 libgfortran/intrinsics/execute_command_line.c create mode 100644 libgfortran/m4/iall.m4 create mode 100644 libgfortran/m4/iany.m4 create mode 100644 libgfortran/m4/iparity.m4 create mode 100644 libgfortran/m4/norm2.m4 create mode 100644 libgfortran/m4/parity.m4 delete mode 100644 libobjc/README.threads delete mode 100644 libobjc/THREADS.MACH create mode 100644 libobjc/error.c delete mode 100644 libobjc/makefile.dos create mode 100644 libobjc/memory.c delete mode 100644 libobjc/misc.c create mode 100644 libobjc/objc-private/README create mode 100644 libobjc/objc-private/common.h create mode 100644 libobjc/objc-private/error.h create mode 100644 libobjc/objc-private/hash.h create mode 100644 libobjc/objc-private/objc-list.h create mode 100644 libobjc/objc-private/objc-sync.h create mode 100644 libobjc/objc-private/runtime.h create mode 100644 libobjc/objc-private/sarray.h create mode 100644 libobjc/objc-sync.c create mode 100644 libobjc/objc/README create mode 100644 libobjc/objc/deprecated/MetaClass.h create mode 100644 libobjc/objc/deprecated/Object.h create mode 100644 libobjc/objc/deprecated/README create mode 100644 libobjc/objc/deprecated/STR.h create mode 100644 libobjc/objc/deprecated/hash.h copy libobjc/objc/{ => deprecated}/objc-list.h (100%) create mode 100644 libobjc/objc/deprecated/objc_error.h create mode 100644 libobjc/objc/deprecated/objc_malloc.h create mode 100644 libobjc/objc/deprecated/objc_unexpected_exception.h create mode 100644 libobjc/objc/deprecated/objc_valloc.h create mode 100644 libobjc/objc/deprecated/sarray.h create mode 100644 libobjc/objc/deprecated/struct_objc_class.h create mode 100644 libobjc/objc/deprecated/struct_objc_protocol.h create mode 100644 libobjc/objc/deprecated/struct_objc_selector.h create mode 100644 libobjc/objc/deprecated/typedstream.h rewrite libobjc/objc/hash.h (99%) create mode 100644 libobjc/objc/message.h create mode 100644 libobjc/objc/objc-exception.h rewrite libobjc/objc/objc-list.h (99%) create mode 100644 libobjc/objc/objc-sync.h rewrite libobjc/objc/objc.h (75%) delete mode 100644 libobjc/objc/runtime.h rewrite libobjc/objc/sarray.h (99%) rewrite libobjc/objc/typedstream.h (99%) delete mode 100644 libobjc/thr-dce.c delete mode 100644 libobjc/thr-decosf1.c delete mode 100644 libobjc/thr-irix.c delete mode 100644 libobjc/thr-mach.c delete mode 100644 libobjc/thr-objc.c delete mode 100644 libobjc/thr-os2.c delete mode 100644 libobjc/thr-posix.c delete mode 100644 libobjc/thr-pthreads.c delete mode 100644 libobjc/thr-rtems.c delete mode 100644 libobjc/thr-single.c delete mode 100644 libobjc/thr-solaris.c delete mode 100644 libobjc/thr-vxworks.c delete mode 100644 libobjc/thr-win32.c create mode 100644 libstdc++-v3/include/std/typeindex create mode 100644 libstdc++-v3/libsupc++/hash_bytes.cc delete mode 100644 libstdc++-v3/src/hash-string-aux.cc create mode 100644 libstdc++-v3/testsuite/18_support/type_info/hash_code.cc create mode 100644 libstdc++-v3/testsuite/20_util/typeindex/comparison_operators.cc create mode 100644 libstdc++-v3/testsuite/20_util/typeindex/hash.cc create mode 100644 libstdc++-v3/testsuite/20_util/typeindex/hash_code.cc create mode 100644 libstdc++-v3/testsuite/20_util/typeindex/name.cc create mode 100644 libstdc++-v3/testsuite/23_containers/bitset/45713.cc rename libstdc++-v3/testsuite/23_containers/bitset/{ => debug}/invalidation/1.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/map/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/map/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/multimap/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/multimap/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/multiset/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/multiset/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/set/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/set/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/45628-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/45628-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/4.cc delete mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc delete mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc rename libstdc++-v3/testsuite/performance/21_strings/{string_append.cc => append-1.cc} (100%) rename libstdc++-v3/testsuite/performance/21_strings/{string_append_2.cc => append-2.cc} (100%) rename libstdc++-v3/testsuite/performance/21_strings/{string_cons_input_iterator.cc => cons_input_iterator.cc} (100%) rename libstdc++-v3/testsuite/performance/21_strings/{string_copy_cons_and_dest.cc => copy_cons_and_dest.cc} (100%) rename libstdc++-v3/testsuite/performance/21_strings/{string_find.cc => find.cc} (100%) create mode 100644 libstdc++-v3/testsuite/performance/21_strings/hash.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/deque_construct.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct1.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct2.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/vector_construct.cc create mode 100644 libstdc++-v3/testsuite/util/debug/checks.h diff --git a/ChangeLog b/ChangeLog index 581daf65728..7e624711294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2010-09-21 Iain Sandoe + + * configure.ac (enable-lto): Add Darwin to the list of supported lto + targets and amend comment. + * configure: Regenerate. + +2010-09-15 Tejas Belagod + + * MAINTAINERS (Write After Approval): Add myself. + +2010-09-03 Jack Howarth + + * configure.ac: Enable LTO by default on Darwin. + * configure: Regenerate. + +2010-09-02 Marcus Shawcroft + + * MAINTAINERS (Write After Approval): Add myself. + +2010-09-01 Ian Bolton + + * MAINTAINERS (Write After Approval): Add myself. + +2010-08-25 Danny Smith + + * MAINTAINERS (OS Port Maintainers): Remove myself from windows + ports + 2010-07-28 David Yuste * MAINTAINERS (Write After Approval): Add myself. diff --git a/ChangeLog.graphite b/ChangeLog.graphite index c5edc3a09aa..b9d072372a7 100644 --- a/ChangeLog.graphite +++ b/ChangeLog.graphite @@ -1,3 +1,7 @@ +2010-09-24 Sebastian Pop + + * Merge from mainline (163495:164578). + 2010-08-24 Sebastian Pop * Merge from mainline (160224:163495). diff --git a/MAINTAINERS b/MAINTAINERS index 263c9c19419..57952ada5e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -122,7 +122,6 @@ RTEMS Ports Joel Sherrill joel@oarcorp.com RTEMS Ports Ralf Corsepius ralf.corsepius@rtems.org VxWorks ports Nathan Sidwell nathan@codesourcery.com windows, cygwin, mingw Christopher Faylor cgf@gcc.gnu.org -windows, cygwin, mingw Danny Smith dannysmith@users.sourceforge.net windows, cygwin, mingw Kai Tietz kai.tietz@onevision.com windows, cygwin, mingw Dave Korn dave.korn.cygwin@gmail.com @@ -291,6 +290,7 @@ Giovanni Bajo giovannibajo@gcc.gnu.org Simon Baldwin simonb@google.com Scott Bambrough scottb@netwinder.org Wolfgang Bangerth bangerth@dealii.org +Tejas Belagod tejas.belagod@arm.com Andrey Belevantsev abel@ispras.ru Jon Beniston jon@beniston.com Peter Bergner bergner@vnet.ibm.com @@ -302,6 +302,7 @@ Eric Blake ericb@gcc.gnu.org Phil Blundell pb@futuretv.com Hans Boehm hboehm@gcc.gnu.org Segher Boessenkool segher@kernel.crashing.org +Ian Bolton ian.bolton@arm.com Andrea Bona andrea.bona@st.com Paolo Bonzini bonzini@gnu.org Neil Booth neil@daikokuya.co.uk @@ -455,6 +456,7 @@ Duncan Sands baldrick@gcc.gnu.org Dodji Seketeli dseketel@redhat.com Svein Seldal svein@dev.seldal.com Thiemo Seufer ths@networkno.de +Marcus Shawcroft marcus.shawcroft@arm.com Johannes Singler singler@kit.edu Franz Sirl franz.sirl-kernel@lauterbach.com Jan Sjodin jan.sjodin@amd.com diff --git a/config/ChangeLog b/config/ChangeLog index 22a36414fc3..8be04587356 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,27 @@ +2010-09-10 Jonathan Yong + + * dfp.m4: Enable decimal float for i?86 cygwin + and mingw, and for x86_64 mingw. + +2010-09-06 H.J. Lu + + PR target/45524 + * dfp.m4: Don't set enable_decimal_float to dpd if DFP is + disabled. Set default_decimal_float. + +2010-09-06 Andreas Schwab + + * dfp.m4: Quote argument of AC_MSG_WARN. + +2010-09-03 Andreas Krebbel + + * dfp.m4: New file. + +2010-09-01 Andi Kleen + + * bootstrap-lto.mk (STAGE2_CFLAGS, STAGE3_CFLAGS): Change + to -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1. + 2010-08-21 Ralf Wildenhues PR target/45084 diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk index 14099a08b8d..785d15f81c2 100644 --- a/config/bootstrap-lto.mk +++ b/config/bootstrap-lto.mk @@ -1,8 +1,8 @@ # This option enables LTO for stage2 and stage3. It requires lto to # be enabled for stage1 with --enable-stage1-languages. -STAGE2_CFLAGS += -flto -STAGE3_CFLAGS += -flto +STAGE2_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 +STAGE3_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 # Ada fails to build with LTO, turn it off for now. BOOT_ADAFLAGS += -fno-lto diff --git a/config/dfp.m4 b/config/dfp.m4 new file mode 100644 index 00000000000..cc778b19bbb --- /dev/null +++ b/config/dfp.m4 @@ -0,0 +1,56 @@ +dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet]) +dnl +dnl Enable C extension for decimal float if target supports it. +dnl +dnl @author Andreas Krebbel + +AC_DEFUN([GCC_AC_ENABLE_DECIMAL_FLOAT], +[ +AC_ARG_ENABLE(decimal-float, +[ --enable-decimal-float={no,yes,bid,dpd} + enable decimal float extension to C. Selecting 'bid' + or 'dpd' choses which decimal floating point format + to use], +[ + case $enable_decimal_float in + yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;; + *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float. +Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;; + esac +], +[ + case $1 in + powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \ + i?86*-*-mingw* | x86_64*-*-mingw* | \ + i?86*-*-cygwin*) + enable_decimal_float=yes + ;; + *) + AC_MSG_WARN([decimal float is not supported for this target, ignored]) + enable_decimal_float=no + ;; + esac +]) + +# x86's use BID format instead of DPD +case x$enable_decimal_float in + xyes) + case $1 in + i?86*-*-* | x86_64*-*-*) + enable_decimal_float=bid + ;; + *) + enable_decimal_float=dpd + ;; + esac + default_decimal_float=$enable_decimal_float + ;; + xno) + # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper + # dependency on libdecnumber. + default_decimal_float=dpd + ;; +esac +AC_SUBST(enable_decimal_float) + +]) diff --git a/configure b/configure index fc759d774c1..9e398677fdc 100755 --- a/configure +++ b/configure @@ -6670,17 +6670,19 @@ to specify its location." "$LINENO" 5 fi else if test x"$default_enable_lto" = x"yes" ; then - # On non-ELF platforms, LTO must be explicitly enabled. - enable_lto=no + case $target in + *-apple-darwin*) ;; + # On other non-ELF platforms, LTO must be explicitly enabled. + *) enable_lto=no ;; + esac else - # Apart from ELF platforms, only Windows supports LTO so far. It - # would also be nice to check the binutils support, but we don't + # Apart from ELF platforms, only Windows and Darwin support LTO so far. + # It would also be nice to check the binutils support, but we don't # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just # warn during gcc/ subconfigure; unless you're bootstrapping with # -flto it won't be needed until after installation anyway. case $target in - *-cygwin*|*-mingw*) ;; - *-apple-darwin*) ;; + *-cygwin*|*-mingw* | *-apple-darwin*) ;; *) if test x"$enable_lto" = x"yes"; then as_fn_error "LTO support is not enabled for this target." "$LINENO" 5 fi diff --git a/configure.ac b/configure.ac index 3d969aa0ebc..67e79fe144e 100644 --- a/configure.ac +++ b/configure.ac @@ -1787,17 +1787,19 @@ to specify its location.]) AC_SUBST(libelflibs) AC_SUBST(libelfinc) fi],[if test x"$default_enable_lto" = x"yes" ; then - # On non-ELF platforms, LTO must be explicitly enabled. - enable_lto=no + case $target in + *-apple-darwin*) ;; + # On other non-ELF platforms, LTO must be explicitly enabled. + *) enable_lto=no ;; + esac else - # Apart from ELF platforms, only Windows supports LTO so far. It - # would also be nice to check the binutils support, but we don't + # Apart from ELF platforms, only Windows and Darwin support LTO so far. + # It would also be nice to check the binutils support, but we don't # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just # warn during gcc/ subconfigure; unless you're bootstrapping with # -flto it won't be needed until after installation anyway. case $target in - *-cygwin*|*-mingw*) ;; - *-apple-darwin*) ;; + *-cygwin*|*-mingw* | *-apple-darwin*) ;; *) if test x"$enable_lto" = x"yes"; then AC_MSG_ERROR([LTO support is not enabled for this target.]) fi diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 5175d512d52..b98ef7bc989 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,19 @@ +2010-08-22 Ralf Wildenhues + + * texi2pod.pl: Replace @@ before @{ and @}, for @samp{@@}. + Also escape characters with grave accents, to be fixed ... + (unmunge): ... here. + (postprocess): Also handle @/ and @acronym{...}. + +2010-07-02 Sebastian Pop + + * check_GNU_style.sh: Do not print warning messages when there are + no occurences. + +2010-09-13 Rainer Orth + + * gcc_update: Handle hg, too. + 2010-07-08 Eric Botcazou * make_sunver.pl: Remove extra whitespace in regexp. diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index 6396417fab7..8fb579fd160 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -84,8 +84,11 @@ col (){ | grep -v ':+++' \ | cut -f 2 -d '+' \ | awk '{ if (length ($0) > 80) print $0 }' \ - > $tmp && printf "\n$msg\n" - cat $tmp + > $tmp + if [ -s $tmp ]; then + printf "\n$msg\n" + cat $tmp + fi } col 'Lines should not exceed 80 characters.' $* diff --git a/contrib/gcc_update b/contrib/gcc_update index cfae86a50c6..8192d811102 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -1,10 +1,11 @@ #! /bin/sh # -# Update a local Subversion tree from the GCC repository, with an emphasis -# on treating generated files correctly, so that autoconf, gperf et -# al are not required for the ``end'' user. +# Update a local Subversion, Git or Mercurial tree from the GCC +# repository, with an emphasis on treating generated files correctly, so +# that autoconf, gperf et al are not required for the ``end'' user. # -# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation +# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 +# Free Software Foundation # Originally by Gerald Pfeifer , August 1998. # # This script is Free Software, and it can be copied, distributed and @@ -12,8 +13,8 @@ # its license can be downloaded from http://www.gnu.org/copyleft/gpl.html # # -# By default all command-line options are passed to `svn update` in -# addition to $UPDATE_OPTIONS (defined below). If the first parameter +# By default all command-line options are passed to `svn update` or `hg/git +# pull` in addition to $UPDATE_OPTIONS (defined below). If the first parameter # reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself # are omitted. # @@ -38,9 +39,7 @@ # contrib/gcc_update --list -# SVN command -GCC_SVN=${GCC_SVN-${SVN-svn}} -# Default options used when updating via SVN (none). +# Default options used when updating (none). UPDATE_OPTIONS="" # Set the locale to C to make this script work for users with foreign @@ -245,14 +244,18 @@ p esac -is_git=0 -# Check whether this indeed looks like a local SVN tree. +# Check for known version control systems. if [ -d .git ]; then GCC_GIT=${GCC_GIT-${GIT-git}} - GCC_SVN="true -" - is_git=1 -elif [ ! -d .svn ]; then - echo "This does not seem to be a GCC SVN tree!" + vcs_type="git" +elif [ -d .hg ]; then + GCC_HG=${GCC_HG-${HG-hg}} + vcs_type="hg" +elif [ -d .svn ]; then + GCC_SVN=${GCC_SVN-${SVN-svn}} + vcs_type="svn" +else + echo "This does not seem to be a GCC GIT/HG/SVN tree!" exit fi @@ -263,53 +266,96 @@ else set -- $UPDATE_OPTIONS ${1+"$@"} fi -if [ $is_git -eq 0 ]; then -chat "Updating SVN tree" +case $vcs_type in + git) + chat "Updating GIT tree" -$GCC_SVN ${silent+-q} --non-interactive update ${1+"$@"} -if [ $? -ne 0 ]; then - (touch_files_reexec) - echo "SVN update of full tree failed." >&2 - exit 1 -fi + $GCC_GIT diff --quiet --exit-code HEAD + if [ $? -ne 0 ]; then + echo "Attempting to update a dirty git tree!" >&2 + echo "Commit or stash your changes first and retry." >&2 + exit 1 + fi -rm -f LAST_UPDATED gcc/REVISION + $GCC_GIT pull ${silent+-q} --rebase ${1+"$@"} + if [ $? -ne 0 ]; then + (touch_files_reexec) + echo "git pull of full tree failed." >&2 + exit 1 + fi -revision=`svn info | awk '/Revision:/ { print $2 }'` -branch=`svn info | sed -ne "/URL:/ { -s,.*/trunk,trunk, -s,.*/branches/,, -s,.*/tags/,, -p -}"` + revision=`$GCC_GIT log -n1 --pretty=%p:%t:%H` + branch=`$GCC_GIT name-rev --name-only HEAD || :` + ;; + + hg) + chat "Updating HG tree" + + # Add -q so untracked files aren't listed. + if [ `$GCC_HG status -q | wc -l` -gt 0 ]; then + echo "Attempting to update a dirty hg tree!" >&2 + echo "Commit or revert your changes first and retry." >&2 + exit 1 + fi + + # Check for mq extension. mq patches must be popped so tip has + # been converted from the SVN tree. + if [ -d .hg/patches ] && [ `$GCC_HG qapplied | wc -l` -gt 0 ]; then + # FIXME: Perhaps pop queue instead? We could do that since we + # know the tree is clean. + echo "Attempting to update hg tree with mq patches applied!" >&2 + echo "Pop your patches first and retry." >&2 + exit 1 + fi + + # Update tree, but make sure to only pull the default branch. + # Otherwise all branches in the upstream repo are added, even if + # only a single one has been cloned. + $GCC_HG pull -u ${silent+-q} -r`$GCC_HG branch` ${1+"$@"} + if [ $? -ne 0 ]; then + (touch_files_reexec) + echo "hg pull of full tree failed." >&2 + exit 1 + fi + + # Extract SVN revision corresponding to tip, as stored by hg convert. + # Before hg 1.4.3, there's no template keyword corresponding to the + # extra: tag, so need to use hg log --debug to extract the info. + revision=`$GCC_HG log --debug -l1 | \ + sed -ne "/^extra:.*convert_revision=svn:/ { + s%^.*@%% + p + }"` + branch=`$GCC_HG branch` + # trunk in SVN parlance shows up as default branch in hg. + [ x$branch = x"default" ] && branch="trunk" + ;; + + svn) + chat "Updating SVN tree" + + $GCC_SVN ${silent+-q} --non-interactive update ${1+"$@"} + if [ $? -ne 0 ]; then + (touch_files_reexec) + echo "SVN update of full tree failed." >&2 + exit 1 + fi + + revision=`svn info | awk '/Revision:/ { print $2 }'` + branch=`svn info | sed -ne "/URL:/ { + s,.*/trunk,trunk, + s,.*/branches/,, + s,.*/tags/,, + p + }"` + ;; +esac + +rm -f LAST_UPDATED gcc/REVISION { - date - echo "`TZ=UTC date` (revision $revision)" + date + echo "`TZ=UTC date` (revision $revision)" } > LAST_UPDATED - echo "[$branch revision $revision]" > gcc/REVISION -else - chat "Updating GIT tree" - $GCC_GIT diff --quiet --exit-code HEAD - if [ $? -ne 0 ]; then - echo "Attempting to update a dirty git tree!" >&2 - echo "Commit or stash your changes first and retry." >&2 - exit 1 - fi - $GCC_GIT pull ${silent+-q} --rebase ${1+"$@"} - if [ $? -ne 0 ]; then - (touch_files_reexec) - echo "git pull of full tree failed." >&2 - exit 1 - fi - rm -f LAST_UPDATED gcc/REVISION - revision=`$GCC_GIT log -n1 --pretty=%p:%t:%H` - branch=`$GCC_GIT name-rev --name-only HEAD || :` - { - date - echo "`TZ=UTC date` (revision $revision)" - } > LAST_UPDATED - echo "[$branch revision $revision]" > gcc/REVISION -fi touch_files_reexec diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl index fcdc14550ba..5a4bbacdf5e 100755 --- a/contrib/texi2pod.pl +++ b/contrib/texi2pod.pl @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2003, 2010 Free Software Foundation, Inc. # This file is part of GCC. @@ -213,10 +213,12 @@ while(<$inf>) { # Now the ones that have to be replaced by special escapes # (which will be turned back into text by unmunge()) + # Replace @@ before @{ and @} in order to parse @samp{@@} correctly. s/&/&/g; + s/\@\@/&at;/g; s/\@\{/{/g; s/\@\}/}/g; - s/\@\@/&at;/g; + s/\@`\{(.)\}/&$1grave;/g; # Inside a verbatim block, handle @var, @samp and @url specially. if ($shift ne "") { @@ -391,9 +393,11 @@ sub postprocess s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g; s/\@(?:samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g; s/\@sc\{([^\}]*)\}/\U$1/g; + s/\@acronym\{([^\}]*)\}/\U$1/g; s/\@file\{([^\}]*)\}/F<$1>/g; s/\@w\{([^\}]*)\}/S<$1>/g; s/\@(?:dmn|math)\{([^\}]*)\}/$1/g; + s/\@\///g; # keep references of the form @ref{...}, print them bold s/\@(?:ref)\{([^\}]*)\}/B<$1>/g; @@ -462,6 +466,7 @@ sub unmunge # Replace escaped symbols with their equivalents. local $_ = $_[0]; + s/&(.)grave;/E<$1grave>/g; s/</E/g; s/>/E/g; s/{/\{/g; diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 942df122fc4..60c76dd678d 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,8 @@ +2010-09-07 John David Anglin + + * inclhack.def (hpux_htonl): Allow trailing whitespace in select. + * fixincl.x: Regenerate. + 2010-07-12 Rainer Orth * inclhack.def (solaris_cond_init): New fix. diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index f1552cc1741..dd493bb6254 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Sunday June 27, 2010 at 12:52:26 PM MEST + * It has been AutoGen-ed Tuesday September 7, 2010 at 10:44:48 AM EDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jun 27 12:52:26 MEST 2010 +/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Sep 7 10:44:48 EDT 2010 * * You must regenerate it. Use the ./genfixes script. * @@ -3618,7 +3618,7 @@ tSCC zHpux_HtonlList[] = * content selection pattern - do fix if pattern found */ tSCC zHpux_HtonlSelect0[] = - "#ifndef _XOPEN_SOURCE_EXTENDED\n\ + "#ifndef _XOPEN_SOURCE_EXTENDED[ \t]*\n\ (/\\*\n\ \\* Macros for number representation conversion\\.\n\ \\*/\n\ diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 362dc7054c9..ef4f167b66a 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1985,7 +1985,7 @@ fix = { fix = { hackname = hpux_htonl; files = netinet/in.h; - select = "#ifndef _XOPEN_SOURCE_EXTENDED\n" + select = "#ifndef _XOPEN_SOURCE_EXTENDED[ \t]*\n" "(/\\*\n" " \\* Macros for number representation conversion\\.\n" " \\*/\n" diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8b62c47b0b4..d23732f7ea6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,3577 @@ +2010-09-24 Nicola Pero + + * c-typeck.c (convert_arguments): Use warning 'too many arguments + to method [methodname]' for an Objective-C method instead of the + less satisfactory 'too many arguments to function' (with no method + name). + +2010-09-23 Eric Botcazou + + * tree-flow.h (execute_update_addresses_taken): Remove parameter. + * tree-ssa.c (maybe_optimize_var): Tweak comment and dump messages. + (execute_update_addresses_taken): Remove parameter. Execute the + optimization unconditionally. + * passes.c (execute_function_todo): Call execute_update_addresses_taken + unconditionally if TODO_rebuild_alias is set, else only when optimizing + if TODO_update_address_taken is set. + +2010-09-23 Anatoly Sokolov + + * config/arm/arm.h (OUTPUT_ADDR_CONST_EXTRA): Remove. + * config/arm/arm-protos.h (arm_output_addr_const_extra): Remove. + * config/arm/arm.c (TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define. + (arm_output_addr_const_extra): Make static. + +2010-09-23 Uros Bizjak + + * config/i386/i386.md (UNSPECV_NOPS): Rename from UNSPEC_NOPS and + define as unspec_volatile. + ("nops"): Define as unspec_volatile. Use fputs to write to + asm_out_file directly. Output NOPs on separate lines using while loop. + * config/i386/i386.c (ix86_code_end): Use fputs to write to + asm_out_file directly. Output NOPs on separate lines using while loop. + +2010-09-23 Richard Guenther + + PR tree-optimization/45565 + * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): + Make sure to adjust the fndecl before replacing the stmt. + +2010-09-23 Richard Guenther + + PR middle-end/45750 + * gimplify.c (gimplify_expr): Properly pass on GS_ERROR when + gimplifying MEM_REF. + +2010-09-23 Alan Modra + + * config/rs6000/rs6000.c (toc_relative_ok): Delete. + (rs6000_emit_move): Use SYMBOL_REF_LOCAL_P instead. + +2010-09-23 Bernd Schmidt + + PR rtl-optimization/44374 + * basic-block.h (enum bb_flags): Add BB_MODIFIED. + * df-core.c (df_set_bb_dirty): Set it. + * ifcvt.c (find_memory): Remove function. + (dead_or_predicable): Use can_move_insns_across. + * df.h (can_move_insns_across): Declare function. + * cfgcleanup.c (block_was_dirty): New static variable. + (try_crossjump_bb, try_forward_edges): Test BB_MODIFIED flag rather + than df_get_bb_dirty. + (try_head_merge_bb): New static function. + (try_optimize_cfg): Call it. Call df_analyze if block_was_dirty + is set. + * df-problems.c: Include "target.h" + (df_simulate_find_uses): New static function. + (MEMREF_NORMAL, MEMREF_VOLATILE): New macros. + (find_memory, find_memory_store): New static functions. + (can_move_insns_across): New function. + * Makefile.in (df-problems.o): Update dependencies. + +2010-09-22 Eric Botcazou + + PR java/44095 + * config/sparc/linux.h (ASM_SPEC): Pass -K PIC if -findirect-dispatch + is specified and the suffix of the file isn't ".c". + * config/sparc/linux64.h (ASM_SPEC): Likewise. + +2010-09-22 Ralf Wildenhues + + * doc/contrib.texi (Contributors): Allow URL to wrap in PDF output. + * doc/cppopts.texi: Fix markup of index entry. + * doc/extend.texi (Constructing Calls): Fix markup of + __builtin_va_arg_pack and __builtin_va_arg_pack_len definition. + (Conditionals, C++ Comments, Pragmas, Unnamed Fields, Thread-Local) + (Vague Linkage, C++ Attributes): Fix markup of index entries and + keywords. + * doc/invoke.texi (Option Summary): Fix spacing. Rewrap to + avoid long lines. + (C Dialect Options, C++ Dialect Options, Warning Options) + (Debugging Options, Spec Files, Darwin Options) + (i386 and x86-64 Options, MIPS Options) + (RS/6000 and PowerPC Options, Code Gen Options): Fix markup of + index entries, avoid abbreviations, allow URLs to wrap, avoid + long lines, avoid overlong pages from long @itemx lists. + * doc/objc.texi (Garbage Collection): Allow URLs to wrap. + * doc/standards.texi (Standards): Likewise. + * doc/trouble.texi (Incompatibilities): Fix markup of index entry. + +2010-09-22 Joseph Myers + + * opts-common.c (prune_options): Make static. Work with decoded + options. + (decode_cmdline_options_to_array): Call prune_options. Don't + resize option array here. + * opts.h (prune_options): Remove prototype. + * gcc.c (process_command): Take decoded options; don't call + decode_cmdline_options_to_array here. Use decoded options for argv[0]. + (main): Call decode_cmdline_options_to_array here instead of + prune_options. Update call to process_command. + * config/darwin-driver.c: Include opts.h. + (darwin_default_min_version): Work with decoded options. Don't + handle -b or -V here. + * config/darwin.h (darwin_default_min_version): Update prototype. + (GCC_DRIVER_HOST_INITIALIZATION): Update call to + darwin_default_min_version. + * config/i386/cygwin.h (mingw_scan): Update prototype. + (GCC_DRIVER_HOST_INITIALIZATION): Update call to mingw_scan. + * config/i386/cygwin1.c: Include opts.h. + (mingw_scan): Work with decoded options. + * config/i386/t-cygwin (cygwin1.o): Update dependencies. + * config/t-darwin (darwin-driver.o): Update dependencies. + +2010-09-22 Joseph Myers + + * common.opt (-assemble, -compile, -coverage, -debug, -dump, + -dump=, -dumpbase, -dumpdir, -entry, -entry=, -extra-warnings, + -for-assembler, -for-assembler=, -for-linker, -for-linker=, + -force-link, -force-link=, -language, -language=, + -library-directory, -library-directory=, -no-canonical-prefixes, + -no-standard-libraries, -no-warnings, -optimize, -output, + -output=, -pass-exit-codes, -pedantic, -pedantic-errors, -pie, + -pipe, -prefix, -prefix=, -preprocess, -print-file-name, + -print-file-name=, -print-libgcc-file-name, + -print-multi-directory, -print-multi-lib, + -print-multi-os-directory, -print-prog-name, -print-prog-name=, + -print-search-dirs, -print-sysroot, -print-sysroot-headers-suffix, + -profile, -save-temps, -shared, -specs, -specs=, -static, + -symbolic, -time, -verbose, -param=, -sysroot, coverage, e, u, + symbolic): New. + (fhelp, fhelp=, ftarget-help, fversion): Make into aliases. + * gcc.c (A Short Introduction to Adding a Command-Line Option): + Remove comment. + (cc1_options): Correct specs for passing down --help, + --target-help and --help=*. Add spec for passing down --version. + (struct option_map, option_map, target_option_translations, + translate_options): Remove. + (driver_handle_option): Handle OPT__version, OPT__help, OPT__help_ + and OPT__target_help instead of OPT_fversion, OPT_fhelp, + OPT_fhelp_ and OPT_ftarget_help. + (process_command): Don't call translate_options. Call + decode_cmdline_options_to_array before checking for + -no-canonical-prefixes using decoded options. + * opts-common.c (tm.h): Update comment on #include. + (find_opt): Allow abbreviations of long options. + (struct option_map, option_map): New. + (decode_cmdline_option): Use them instead of hardcoding -Wno, -fno + and -mno handling. + (target_option_translations): New. + (decode_cmdline_options_to_array): Handle + TARGET_OPTION_TRANSLATE_TABLE in driver. + * opts.c (common_handle_option): Don't handle OPT_fhelp, + OPT_ftarget_help, OPT_fhelp_ or OPT_fversion. + +2010-09-22 Richard Guenther + + * tree-inline.c (optimize_inline_calls): Schedule cleanups + only if we inlined something. Block compaction and conditional + folding are done by cfg cleanup. Schedule update-address-taken. + (tree_function_versioning): Remove redundant call to number_blocks. + * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Conditional + folding is done by cfg cleanup. + * passes.c (init_optimization_passes): Remove update-address-taken + pass after IPA inlining. + +2010-09-22 Chung-Lin Tang + + * postreload.c (move2add_note_store): Add reg_symbol_ref[] checks + to update conditions. Fix reg_mode[] check. + +2010-09-22 Hariharan Sandanagobalane + + * config/picochip/picochip.md (movhicc): Use expand to check whether + movhicc is available and split it after reload. + +2010-09-22 Richard Guenther + + * tree-ssanames.c (release_dead_ssa_names): Do not remove + callee edges here. + * passes.c (init_optimization_passes): Remove early CFG cleanup. + * tree-optimize.c (execute_cleanup_cfg_pre_ipa): Remove. + (pass_cleanup_cfg): Likewise. + (execute_fixup_cfg): Cleanup. + * tree-pass.h (pass_cleanup_cfg): Remove. + +2010-09-22 Martin Jambor + + * gimple-fold.c (fold_gimple_call): New parameter inplace, do not fold + builtins if it is true. + (fold_stmt_1): Call, fold_gimple_call always, pass inplace as a + parameter. + +2010-09-22 Martin Jambor + + * tree-sra.c (struct access): New field grp_no_warning. + (create_access_replacement): Set TREE_NO_WARNING according to + grp_no_warning. + (create_artificial_child_access): Use build_ref_for_model and set + grp_no_warning if build_user_friendly_ref_for_offset fails. + (propagate_subaccesses_across_link): Likewise. + +2010-09-22 Eric Botcazou + + PR target/35664 + * config/sparc/constraints.md ('e'): Return NO_REGS if !TARGET_FPU. + ('f'): Likewise. + +2010-09-22 Tristan Gingold + + * config/alpha/alpha.c (alpha_use_linkage): Initialize target field. + +2010-09-22 Uros Bizjak + + * config/i386/i386.h (MAX_STRINGOP_ALGS): Fix typo in the name. + * config/i386/i386.c (decide_alg): Update for rename. + +2010-09-22 Jakub Jelinek + + PR rtl-optimization/45739 + * simplify-rtx.c (simplify_binary_operation_1): Optimize even + vector mode | CONST0_RTX (mode) and ^ CONST0_RTX (mode). + +2010-09-21 Anatoly Sokolov + + * config/rs6000/rs6000.h (OUTPUT_ADDR_CONST_EXTRA): Remove macros. + * config/rs6000/rs6000-protos.h (rs6000_output_addr_const_extra): + Remove. + * config/rs6000/rs6000.c (rs6000_output_addr_const_extra): Make static. + (TTARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define. + +2010-09-21 Nicola Pero + + PR objc/23710 + * c-parser.c (c_parser_objc_method_definition): Check the return + value of objc_start_method_definition and if false is returned, + parse the method definition but emit no code. + +2010-09-21 Nicola Pero + + PR objc/25965 + * c-decl.c (detect_field_duplicates): If compiling Objective-C, + call objc_get_interface_ivars (). + +2010-09-21 Kai Tietz + + PR target/45694 + * config/i386/i386.c (ix86_expand_prologue): Save r10 in case that + static chain-register is used for 64-bit. + +2010-09-21 Richard Guenther + + * dwarf2out.c (is_cu_die): New function. + (add_pubtype): Use it. + (gen_subprogram_die): Likewise. + (gen_struct_or_union_type_die): Likewise. + (dwarf2out_finish): Likewise. + (comp_unit_die): Rename to ... + (single_comp_unit_die): ... this. + (comp_unit_die): New function lazily constructing and + returning single_comp_unit_die. + (is_cxx, is_fortran, is_ada, debug_dwarf, break_out_comdat_types, + base_type_die, subrange_type_die, modified_type_die, + lower_bound_default, add_bound_info, add_prototyped_attribute, + dwarf2out_vms_debug_main_pointer, scope_die_for, retry_incomplete_types, + dwarf2out_abstract_function, gen_type_die_with_usage, get_context_die, + force_decl_die, gen_namespace_die, dwarf2out_decl, + dwarf2out_start_source_file, dwarf2out_end_source_file, + prune_unused_types, dwarf2out_finish): Use it. + (gen_compile_unit_die): For GNU GIMPLE derive DW_AT_language from + the global list of translation-unit decls. + (dwarf2out_init): Do not create single_comp_unit_die here. + (force_decl_die): Handle TRANSLATION_UNIT_DECL. + +2010-09-21 Richard Guenther + + * dwarf2out.c (dwarf2out_decl): Do not always generate a DIE + for bool for C++. + +2010-09-21 Bernd Schmidt + + * config/arm/iterators.md (qhs_extenddi_op): New mode_attr. + (qhs_extenddi_cstr): Likewise. + * config/arm/arm.md (zero_extenddi2, extenddi2): Use + them for the source operand. + +2010-09-21 Uros Bizjak + + * config/i386/i386.c (ix86_split_ashl): Rename single_width variable + to half_width. Use GET_MODE_BITSIZE to calculate mode size. + (ix86_split_ashr): Ditto. + (ix86_split_lshr): Ditto. + +2010-09-21 Richard Guenther + + PR tree-optimization/45580 + * tree-ssa-propagate.c (substitute_and_fold): Always replace + regular uses. + * gimple-fold.c (gimple_fold_obj_type_ref): For a BINFO without + virtuals fold the call into a regular indirect one. + +2010-09-20 Eric Botcazou + + PR rtl-optimization/42775 + * cfgrtl.c (rest_of_pass_free_cfg): Recompute notes if delay slot + scheduling is enabled. + +2010-09-20 Jakub Jelinek + + PR rtl-optimization/45728 + * expr.c (expand_expr_real_1): If op0 isn't REG or MEM, try + gen_lowpart_common first and if that fails, force_reg first + before calling gen_lowpart. + + PR middle-end/45678 + * cfgexpand.c (expand_one_stack_var_at): Use + crtl->max_used_stack_slot_alignment as max_align, instead + of maximum of that and PREFERRED_STACK_BOUNDARY. + Don't call update_stack_alignment. + +2010-09-20 Eric Botcazou + + * langhooks.h (struct lang_hooks_for_types): Remove hash_types field. + * langhooks-def.h (LANG_HOOKS_HASH_TYPES): Delete. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Remove LANG_HOOKS_HASH_TYPES. + * system.h (LANG_HOOKS_HASH_TYPES): Poison. + * tree.c (type_hash_canon): Do not test lang_hooks.types.hash_types. + (build_nonstandard_integer_type): Likewise. + (build_range_type_1): New function, built from... + (build_range_type): ...this. Call build_range_type_1. + (build_nonshared_range_type): New function. + (build_array_type_1): New function, built from... + (build_array_type: ...this. Call build_array_type_1. + (build_nonshared_array_type): New function. + * tree.h (build_nonshared_range_type): Declare. + (build_nonshared_array_type): Likewise. + +2010-09-20 Anatoly Sokolov + + * config/arm/arm.h (CLASS_LIKELY_SPILLED_P): Remove. + * config/arm/arm.c (TARGET_CLASS_LIKELY_SPILLED_P): Define. + (arm_class_likely_spilled_p): New function. + +2010-09-20 Uros Bizjak + + * config/i386/i386.c (ix86_expand_ashl_const): Rewrite using + indirect functions. + (ix86_split_ashl): Ditto. + (ix86_split_ashr): Ditto. + (ix86_split_lshr): Ditto. + (ix86_adjust_counter): Ditto. + +2010-09-20 Nicola Pero + + * c-family/c-common.h (constant_string_class): Documented with + comment identical to the one already in c-common.c. + +2010-09-20 Jakub Jelinek + + * dwarf2out.c (any_cfis_emitted): New static variable. + (add_fde_cfi): Set it. + (dwarf2out_frame_debug): Clear it before processing, + if it is set afterwards, flush any queued reg saves. + + PR debug/45124 + * dwarf2out.c (add_accessibility_attribute): Assume + DW_ACCESS_private as the default for dwarf_version > 2 + and DW_TAG_class_type parent. + (gen_inheritance_die): Assume DW_ACCESS_public as the default + for dwarf_version > 2 and parent other than DW_TAG_class_type. + +2010-09-20 Rafael Carre + + PR target/45726 + * arm.md (arm_movt): Only enable on machines with MOVT. + +2010-09-20 Jie Zhang + + * config/arm/arm.c (arm_address_offset_is_imm): New. + (arm_early_store_addr_dep): New. + (arm_early_load_addr_dep): New. + * config/arm/arm-protos.h (arm_early_store_addr_dep): Declare. + (arm_early_load_addr_dep): Declare. + (arm_address_offset_is_imm): Declare. + * config/arm/cortex-m4.md: New file. + * config/arm/cortex-m4-fpu.md: New file. + * config/arm/arm.md: Include cortex-m4.md and cortex-m4-fpu.md. + (attr generic_sched): Exclude cortexm4. + (attr generic_vfp): Exclude cortexm4. + +2010-09-20 Richard Guenther + + PR middle-end/45704 + * gimplify.c (gimplify_modify_expr_rhs): Preserve volatileness. + +2010-09-20 Jan Hubicka + + PR tree-optimize/45605 + * cgraph.h (const_value_known_p): Declare. + (varpool_decide_const_value_known): Remove. + * tree-ssa-ccp.c (get_base_constructor): Use it. + * lto-cgraph.c (compute_ltrans_boundary): Likewise. + * expr.c (string_constant): Likewise. + * tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise. + * ipa.c (ipa_discover_readonly_nonaddressable_var, + function_and_variable_visibility): Likewise. + * gimplify.c (gimplify_call_expr): Likewise. + * gimple-fold.c (get_symbol_constant_value): Likewise. + * varpool.c (varpool_decide_const_value_known): Replace by... + (const_value_known_p): ... this one; handle other kinds of DECLs + too and work for automatic vars. + (varpool_finalize_decl): Use const_value_known_p. + +2010-09-20 Rafael Carre + + PR target/45726 + * arm.md (arm_movtas_ze): Only enable on machine with MOVT. + +2010-09-20 Richard Guenther + + PR tree-optimization/45705 + * tree-ssa-dom.c (optimize_stmt): Perform redundant store elimination. + +2010-09-20 Jakub Jelinek + + PR rtl-optimization/45695 + * combine.c (try_combine): When splitting a two set pattern, + make sure the pattern which will be put into i2 doesn't use REGs + or MEMs set by insns in between i2 and i3. + +2010-09-19 Jan Hubicka + + PR lto/44246 + * lto-cgraph.c (input_cgraph_1, input_varpool_1): Avoid + processing same node twice. + +2010-09-19 Anatoly Sokolov + + * config/bfin/bfin.h (CLASS_LIKELY_SPILLED_P): Remove. + * config/bfin/bfin.c (TARGET_CLASS_LIKELY_SPILLED_P): Define. + (bfin_class_likely_spilled_p): New function + +2010-09-19 Ira Rosen + + PR tree-optimization/45714 + * tree-vect-stmts.c (vect_transform_stmt): Use a dummy statement + created in vectorizable_call instead of the original statement in + def stmt updates. + +2010-09-19 Uros Bizjak + + * config/i386/i386-protos.h (split_double_mode): New prototype. + (split_di, split_ti): Remove prototypes. + * config/i386/i386.c (split_double_mode): New function. + (split_di, split_ti): Remove. + (ix86_expand_branch): Use split_double_mode. + (ix86_split_to_parts): Ditto. + (ix86_split_ashl): Ditto. + (ix86_split_ashr): Ditto. + (ix86_split_lshr): Ditto. + (ix86_force_to_memory): Ditto. + * config/i386/i386.md: Use split_double_mode in double-mode splitters. + +2010-09-18 Jan Hubicka + + PR tree-optimization/45453 + * cgraphunit.c (cgraph_finalize_function): Consider comdat & external + virtual functions are reachable. + * ipa-inline.c (cgraph_clone_inlined_nodes): Likewise. + * ipa.c (cgraph_remove_unreachable_nodes): Likewise. + * ipa-prop.c (ipa_modify_formal_parameters): Clear DECL_VIRTUAL_P + when modifying function. + +2010-09-18 Jan Hubicka + + PR tree-optimization/45605 + * cgraphunit.c (cgraph_analyze_functions): Allocate bitmap obstack. + * gimple-fold.c (static_object_in_other_unit_p): New function. + (canonicalize_constructor_val): Use it. + (get_symbol_constant_value): Be reaqdy for canonicalize_constructor_val + returning NULL. + (gimple_fold_obj_type_ref_known_binfo): Use + static_object_in_other_unit_p. + +2010-09-18 Richard Guenther + + PR tree-optimization/45709 + * tree-inline.c (copy_phis_for_bb): Delay commit of edge + insertions until after all PHI nodes of the block are processed. + +2010-09-18 Tijl Coosemans + + * config/i386/freebsd.h (SUBTARGET32_DEFAULT_CPU): Add. + +2010-09-18 Kai Tietz + + * config.gcc (*-w64-mingw*): Correct typo about t-dfprules. + +2010-09-18 Richard Guenther + + PR tree-optimization/45709 + * tree-inline.c (copy_phis_for_bb): Fixup new_edge when we splitted it. + +2010-09-17 Sebastian Pop + + * graphite-dependences.c (dot_deps): Add DEBUG_FUNCTION. + (dot_deps_stmt): Same. + * graphite-poly.c (dot_lst): Same. + * graphite-scop-detection.c (dot_all_scops): Same. + (dot_scop): Same. + +2010-09-17 Sebastian Pop + + Revert: + 2009-12-16 Ben Elliston + + * tree-data-ref.c (dot_rdg_1): Added back. + (dot_rdg): Same. Added "#if 0" around system call. + +2010-09-17 H.J. Lu + Richard Henderson + + * config/i386/i386.c (initial_ix86_tune_features): Add + X86_TUNE_PAD_SHORT_FUNCTION. + (ix86_code_end): Pad with 8 NOPs for TARGET_PAD_SHORT_FUNCTION. + (ix86_count_insn): New. + (ix86_pad_short_function): Likewise. + (ix86_reorg): Support TARGET_PAD_SHORT_FUNCTION. + + * config/i386/i386.h (ix86_tune_indices): Add + X86_TUNE_PAD_SHORT_FUNCTION. + (TARGET_PAD_SHORT_FUNCTION): New. + + * config/i386/i386.md (UNSPEC_NOPS): New. + (nops): Likewise. + +2010-09-17 H.J. Lu + + PR middle-end/45234 + * calls.c (expand_call): Make sure that all variable sized + adjustments are multiple of preferred stack boundary after + stack alignment. + +2010-09-17 DJ Delorie + + * config/rx/rx.c (rx_print_operand): If __builtin_rx_setpsw() is + passed an invalid value, print an error instead of ICEing. + (valid_psw_flag): New. + (rx_expand_builtin): Call it for setpsw/clrpsw. + (rx_expand_builtin_mvtipl): Pass an integer to IN_RANGE, not an RTX. + + * config/rx/rx.md (bitclr): Don't mark the output as early-clobber. + (bitclr_in_memory): Likewise. + (clrspw, setpsw, mvfc, mvtc, mvtipl): Make volatile. + +2010-09-17 H.J. Lu + + PR middle-end/45678 + * cfgexpand.c (update_stack_alignment): New. + (get_decl_align_unit): Use it. + (expand_one_stack_var_at): Call update_stack_alignment. + +2010-09-17 Richard Guenther + + * lto-streamer-in.c (lto_input_ts_translation_unit_decl_tree_pointers): + Properly copy the read string. + +2010-09-17 Joseph Myers + + * doc/options.texi (Variable): Document. + * optc-gen.awk, opth-gen.awk: Handle Variable records. Don't + generate target_flags declarations explicitly. Don't define + VarExists variables for the driver. + * common.opt (target_flags): New Variable record. + (flag_dump_unnumbered, flag_dump_unnumbered_links, + flag_var_tracking, flag_var_tracking_assignments, + flag_var_tracking_assignments_toggle): Don't mark variables with + VarExists. + * config/i386/i386.c (ix86_isa_flags): Don't define here. + * config/i386/i386.opt (ix86_isa_flags): Define here. + * config/mcore/mcore.c (mcore_stack_increment): Don't define here. + * config/mcore/mcore.opt (mcore_stack_increment): Don't mark with + VarExists. + * flags.h (flag_dump_unnumbered, flag_var_tracking): Remove. + * print-rtl.c (flag_dump_unnumbered, flag_dump_unnumbered_links): + Only define for generator programs. + * rtlanal.c (target_flags): Remove. + * toplev.c (flag_var_tracking, flag_var_tracking_assignments, + flag_var_tracking_assignments_toggle): Remove. + +2010-09-17 Michael Matz + + PR tree-optimization/43432 + * tree-vect-data-refs.c (vect_analyze_data_ref_access): + Accept backwards consecutive accesses. + (vect_create_data_ref_ptr): If step is negative generate + decreasing IVs. + * tree-vect-stmts.c (vectorizable_store): Reject negative steps. + (perm_mask_for_reverse, reverse_vec_elements): New functions. + (vectorizable_load): Handle loads with negative steps when easily + possible. + +2010-09-03 Jan Hubicka + + * lto-cgraph.c (compute_ltrans_boundary): Use const_value_known. + +2010-09-03 Naveen H.S + + * config/v850/v850.c (v850_function_value_regno_p): Make static. + Adjust comments. Declare. + (TARGET_FUNCTION_VALUE_REGNO_P): Define. + * config/v850/v850.h (FUNCTION_VALUE_REGNO_P): Delete. + +2010-09-17 Richard Guenther + + * common.opt (combine): Remove. + * gcc.c (default_compilers): Remove specs testing combine. + The C compilers no longer can combine. + (option_map): Remove -combine. + (display_help): Remove -combine. + (driver_handle_option): Remove OPT_combine handling. + (compile_input_file_p): Remove. + (do_spec): Remove code concerning combine. + (main): Likewise. + * doc/invoke.texi: Remove traces of -combine. + * lto-wrapper.c (run_gcc): Do not pass -combine to the compiler driver. + +2010-09-17 Richard Guenther + + PR middle-end/45678 + * builtins.c (fold_builtin_memory_op): Always properly adjust + alignment of memory accesses. + +2010-09-16 Jan Hubicka + + * lto-cgraph.c (input_overwrite_node): Do not set DECL_EXTERNAL when + processing clone. + +2010-09-16 H.J. Lu + + * config/i386/i386-protos.h (ix86_split_idivmod): New prototype. + + * config/i386/i386.c (predict_jump): Add prototype. + (flag_opts): Add -m8bit-idiv. + (ix86_split_idivmod): New. + + * config/i386/i386.md (UNSPEC_DIV_ALREADY_SPLIT): New. + Add 2 splitters for SI/DI mode divide. + (divmod4_1): New pattern. + (udivmod4_1): Likewise. + (testdi_ccno_1): Likewise. + + * config/i386/i386.opt (m8bit-idiv): New. + + * doc/invoke.texi: Document -m8bit-idiv. + +2010-09-16 Reza Yazdani + + PR bootstrap/45680 + * config/i386/i386.c (min_insn_size): Moved out of the + ASM_OUTPUT_MAX_SKIP_PAD ifdef. + +2010-09-16 Jan Hubicka + + * lto-cgraph.c (lto_output_node): Fix handling of clones. + * ipa.c (cgraph_remove_unreachabloe_nodes): Fix handling of + unreachable clones with reachable clones. + * tree-inline.c (copy_bb): Fix sanity checking when producing + unreachable clone. + +2010-09-16 Anatoly Sokolov + + * config/m32r/m32r.c (TARGET_MEMORY_MOVE_COSTS): Remove. + (TARGET_MEMORY_MOVE_COST): Define. + (m32r_function_arg): Annotate argument 'type' with ATTRIBUTE_UNUSED. + +2010-09-16 Alexander Monakov + + * sel-sched.c (move_cond_jump): Use tidy_control_flow instead of + maybe_tidy_empty_bb. + + Revert: + 2010-09-06 Alexander Monakov + * sel-sched-ir.c (maybe_tidy_empty_bb): Export. + +2010-09-16 Joseph Myers + + * target.def (target_option.optimization): New hook. + * doc/tm.texi.in (OPTIMIZATION_OPTIONS): Change to + TARGET_OPTION_OPTIMIZATION hook. + * doc/tm.texi: Regenerate. + * hooks.c (hook_void_int_int): New. + * hooks.h (hook_void_int_int): Declare. + * opts.c: Don't include tm_p.h. + (decode_options): Use targetm.target_option.optimization instead + of OPTIMIZATION_OPTIONS. + * system.h (OPTIMIZATION_OPTIONS): Poison. + * config/arm/arm-protos.h (arm_optimization_options): Remove. + * config/arm/arm.c (TARGET_OPTION_OPTIMIZATION): Define. + (arm_optimization_options): Rename to arm_option_optimization. + Make static. + * config/arm/arm.h (OPTIMIZATION_OPTIONS): Remove. + * config/cris/cris.c (TARGET_OPTION_OPTIMIZATION): Define. + (cris_option_optimization): New. + * config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove. + * config/crx/crx.c (TARGET_OPTION_OPTIMIZATION): Define. + (crx_option_optimization): New. + * config/crx/crx.h (OPTIMIZATION_OPTIONS): Remove. + * config/frv/frv-protos.h (frv_optimization_options): Remove. + * config/frv/frv.c (TARGET_OPTION_OPTIMIZATION): Define. + (frv_optimization_options): Rename to frv_option_optimization. + Make static. + * config/frv/frv.h (OPTIMIZATION_OPTIONS): Remove. + * config/h8300/h8300.c (h8300_option_optimization): New. + (TARGET_OPTION_OPTIMIZATION): Define. + * config/h8300/h8300.h (OPTIMIZATION_OPTIONS): Remove. + * config/i386/i386-protos.h (optimization_options): Remove. + * config/i386/i386.c (optimization_options): Rename to + ix86_option_optimization. Make static. + (TARGET_OPTION_OPTIMIZATION): Define. + * config/i386/i386.h (OPTIMIZATION_OPTIONS): Remove. + * config/ia64/ia64-protos.h (ia64_optimization_options): Remove. + * config/ia64/ia64.c (TARGET_OPTION_OPTIMIZATION): Define. + (ia64_optimization_options): Rename to ia64_option_optimization. + Make static. Call SUBTARGET_OPTIMIZATION_OPTIONS. + * config/ia64/ia64.h (OPTIMIZATION_OPTIONS): Remove. Remove + commented-out definition. + * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define + instead of OPTIMIZATION_OPTIONS. + * config/m32r/m32r.c (TARGET_OPTION_OPTIMIZATION): Define. + (m32r_option_optimization): New. + * config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove. + * config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options): + Remove. + * config/mcore/mcore.c (TARGET_OPTION_OPTIMIZATION): Define. + (mcore_option_optimization): New. + * config/mcore/mcore.h (OPTIMIZATION_OPTIONS): Remove. + * config/mep/mep-protos.h (mep_optimization_options): Remove. + * config/mep/mep.c (TARGET_OPTION_OPTIMIZATION): Define. + (mep_optimization_options): Rename to mep_option_optimization. + Make static. Take unused level and size parameters. + * config/mep/mep.h (OPTIMIZATION_OPTIONS): Remove. + * config/mmix/mmix.c (TARGET_OPTION_OPTIMIZATION): Define. + (mmix_option_optimization): New. + * config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove. + * config/pdp11/pdp11.c (TARGET_OPTION_OPTIMIZATION): Define. + (pdp11_option_optimization): New. + * config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Remove. + * config/rs6000/rs6000-protos.h (optimization_options): Remove. + * config/rs6000/rs6000.c (TARGET_OPTION_OPTIMIZATION): Define. + (optimization_options): Rename to rs6000_option_optimization. + Make static. + * config/rs6000/rs6000.h (OPTIMIZATION_OPTIONS): Remove. + * config/rx/rx-protos.h (rx_set_optimization_options): Remove. + * config/rx/rx.c (rx_set_optimization_options): Rename to + rx_option_optimization. Make static. Take unused level and size + parameters. + (TARGET_OPTION_OPTIMIZATION): Define. + * config/rx/rx.h (OPTIMIZATION_OPTIONS): Remove. + * config/s390/s390-protos.h (optimization_options): Remove. + * config/s390/s390.c (optimization_options): Rename to + s390_option_optimization. Make static. Don't mark size parameter + unused. + (TARGET_OPTION_OPTIMIZATION): Define. + * config/s390/s390.h (OPTIMIZATION_OPTIONS): Remove. + * config/sh/sh-protos.h (sh_optimization_options): Remove. + * config/sh/sh.c (TARGET_OPTION_OPTIMIZATION): Define. + (sh_optimization_options): Rename to sh_option_optimization. Make + static. Don't mark parameters unused. + * config/sh/sh.h (OPTIMIZATION_OPTIONS): Remove. + * config/spu/spu-protos.h (spu_optimization_options): Remove. + * config/spu/spu.c (TARGET_OPTION_OPTIMIZATION): Define. + (spu_optimization_options): Rename to spu_option_optimization. + Make static. + * config/spu/spu.h (OPTIMIZATION_OPTIONS): Remove. + * config/v850/v850.c (TARGET_OPTION_OPTIMIZATION): Define. + (v850_option_optimization): New. + * config/v850/v850.h (OPTIMIZATION_OPTIONS): Remove. + * config/xtensa/xtensa.c (TARGET_OPTION_OPTIMIZATION): Define. + (xtensa_option_optimization): New. + * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Remove. + +2010-09-16 Joseph Myers + + * doc/tm.texi.in (OVERRIDE_OPTIONS): Remove documentation. + (C_COMMON_OVERRIDE_OPTIONS): Don't refer to OVERRIDE_OPTIONS. + * doc/tm.texi: Regenerate. + * system.h (OVERRIDE_OPTIONS): Poison. + * target.def (override): Default to hook_void_void. + * targhooks.c (default_target_option_override): Remove. + * genmodes.c, machmode.def: Update comments mentioning + OVERRIDE_OPTIONS. + * config/alpha/alpha-modes.def: Update comment mentioning + alpha_override_options. + * config/alpha/alpha-protos.h (override_options): Remove. + * config/alpha/alpha.c (override_options): Rename to + alpha_option_override. Call SUBTARGET_OVERRIDE_OPTIONS. Make static. + (TARGET_OPTION_OVERRIDE): Define. + * config/alpha/alpha.h (OVERRIDE_OPTIONS): Remove. + * config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead + of OVERRIDE_OPTIONS. + * config/arc/arc-protos.h (arc_init): Remove. + * config/arc/arc.c (TARGET_OPTION_OVERRIDE): Define. + (arc_init): Rename to arc_option_override. Make static. + * config/arc/arc.h (ARC_EXTENSION_CPU): Correct comment. + (OVERRIDE_OPTIONS): Remove. + * config/arm/arm-protos.h (arm_override_options): Remove. + * config/arm/arm.c (TARGET_OPTION_OVERRIDE): Define. + (arm_override_options): Rename to arm_option_override. Make + static. Call SUBTARGET_OVERRIDE_OPTIONS. + * config/arm/arm.h (OVERRIDE_OPTIONS): Remove. + * config/arm/arm.md: Update comment referring to arm_override_options. + * config/arm/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define + instead of OVERRIDE_OPTIONS. + * config/avr/avr-protos.h (avr_override_options): Remove. + * config/avr/avr.c (TARGET_OPTION_OVERRIDE): Define. + (avr_override_options): Rename to avr_option_override. Make static. + * config/avr/avr.h (OVERRIDE_OPTIONS): Remove. + * config/bfin/bfin-protos.h (override_options): Remove (twice). + * config/bfin/bfin.c (override_options): Rename to + bfin_option_override. Make static. + (TARGET_OPTION_OVERRIDE): Define. + * config/bfin/bfin.h (OVERRIDE_OPTIONS): Remove. + * config/cris/cris-protos.h (cris_override_options): Remove. + * config/cris/cris.c (TARGET_OPTION_OVERRIDE): Define. + (cris_override_options): Rename to cris_option_override. Make static. + * config/cris/cris.h (OVERRIDE_OPTIONS): Remove. + * config/frv/frv-protos.h (frv_override_options): Remove. + * config/frv/frv.c (TARGET_OPTION_OVERRIDE): Define. + (frv_override_options): Rename to frv_option_override. Make static. + * config/frv/frv.h (OVERRIDE_OPTIONS): Remove. + * config/h8300/h8300-protos.h (h8300_init_once): Remove. + * config/h8300/h8300.c (h8300_init_once): Rename to + h8300_option_override. Make static. + (TARGET_OPTION_OVERRIDE): Define. + * config/h8300/h8300.h (OVERRIDE_OPTIONS): Remove. + * config/i386/i386-protos.h (override_options): Remove. + * config/i386/i386.c (override_options): Rename to + ix86_option_override_internal. Make static. Comments referring + to this function and callers changed. + (ix86_option_override): New. + (TARGET_OPTION_OVERRIDE): Define. + * config/i386/i386.h (OVERRIDE_OPTION): Remove. + * config/i386/linux64.h (DEFAULT_PCC_STRUCT_RETURN): Update comment. + * config/ia64/ia64.c (ia64_file_start): Update comment referring + to ia64_override_options. + * config/iq2000/iq2000-protos.h (override_options): Remove. + * config/iq2000/iq2000.c (TARGET_OPTION_OVERRIDE): Define. + (override_options): Rename to iq2000_option_override. Make static. + * config/iq2000/iq2000.h (OVERRIDE_OPTIONS): Remove. + * config/lm32/lm32-protos.h (lm32_override_options): Remove. + * config/lm32/lm32.c (TARGET_OPTION_OVERRIDE): Define. + (lm32_override_options): Rename to lm32_option_override. Make static. + * config/lm32/lm32.h (OVERRIDE_OPTIONS): Remove. + * config/m32r/m32r.c (TARGET_OPTION_OVERRIDE): Define. + (m32r_option_override): New. + (m32r_init): Update comment. + * config/m32r/m32r.h (OVERRIDE_OPTIONS): Remove. + * config/m68hc11/m68hc11-protos.h (m68hc11_override_options): Remove. + * config/m68hc11/m68hc11.c (TARGET_OPTION_OVERRIDE): Define. + (m68hc11_override_options): Rename to m68hc11_option_override. + Make static. Return void. + * config/m68hc11/m68hc11.h (OVERRIDE_OPTIONS): Remove. + * config/m68k/m68k-protos.h (override_options): Remove. + * config/m68k/m68k.c (TARGET_OPTION_OVERRIDE): Define. + (override_options): Rename to m68k_option_override. Make static. + * config/m68k/m68k.h (OVERRIDE_OPTIONS): Remove. + * config/mcore/mcore-protos.h (mcore_override_options): Remove. + * config/mcore/mcore.c (TARGET_OPTION_OVERRIDE): Define. + (mcore_override_options): Rename to mcore_option_override. Make + static. + * config/mcore/mcore.h (OVERRIDE_OPTIONS): Remove. + * config/mep/mep-protos.h (mep_override_options): Remove. + * config/mep/mep.c (TARGET_OPTION_OVERRIDE): Define. + (mep_override_options): Rename to mep_option_override. Make static. + * config/mep/mep.h (OVERRIDE_OPTIONS): Remove. + * config/mmix/mmix-protos.h (mmix_override_options): Remove. + * config/mmix/mmix.c (TARGET_OPTION_OVERRIDE): Define. + (mmix_override_options): Rename to mmix_option_override. Make static. + * config/mmix/mmix.h (OVERRIDE_OPTIONS): Remove. + * config/mn10300/mn10300-protos.h (mn10300_override_options): Remove. + * config/mn10300/mn10300.c (TARGET_OPTION_OVERRIDE): Define. + (mn10300_override_options): Rename to mn10300_option_override. + Make static. + * config/mn10300/mn10300.h (OVERRIDE_OPTIONS): Remove. + * config/moxie/moxie-protos.h (moxie_override_options): Remove. + * config/moxie/moxie.c (moxie_override_options): Rename to + moxie_option_override. Make static. + (TARGET_OPTION_OVERRIDE): Define. + * config/moxie/moxie.h (OVERRIDE_OPTIONS): Remove. + * config/picochip/picochip-protos.h (picochip_override_options): + Remove. Update comment referring to picochip_override_options. + * config/picochip/picochip.c (TARGET_OPTION_OVERRIDE): Define. + (picochip_override_options): Rename to picochip_option_override. + Make static. Update comment and definition of + TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE. + * config/picochip/picochip.h (OVERRIDE_OPTIONS): Remove. + * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Define + instead of OVERRIDE_OPTIONS. + * config/rs6000/rs6000-modes.def: Update comment referring to + rs6000_override_options. + * config/rs6000/rs6000-protos.h (rs6000_override_options): Remove. + * config/rs6000/rs6000.c (TARGET_OPTION_OVERRIDE): Define. + (rs6000_override_options): Rename to + rs6000_option_override_internal. Make static. Commented + referring to rs6000_override_options and OVERRIDE_OPTIONS updated. + (rs6000_option_override): New. + * config/rs6000/rs6000.h (OPTION_TARGET_CPU_DEFAULT): Define + instead of OVERRIDE_OPTIONS. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. + * config/s390/s390-protos.h (override_options): Remove. + * config/s390/s390.c (override_options): Rename to + s390_option_override. Make static. + (TARGET_OPTION_OVERRIDE): Define. + * config/s390/s390.h (OVERRIDE_OPTIONS): Remove. + * config/score/score-protos.h (score_override_options): Remove. + * config/score/score.c (TARGET_OPTION_OVERRIDE): Define. + (score_override_options): Rename to score_option_override. Make + static. + * config/score/score.h (OVERRIDE_OPTIONS): Remove. + Update comment referring to override_options. + * config/score/score3.c (score3_override_options): Rename to + score3_option_override. + * config/score/score3.h (score3_override_options): Rename to + score3_option_override. + * config/score/score7.c (score7_override_options): Rename to + score7_option_override. + * config/score/score7.h (score7_override_options): Rename to + score7_option_override. + * config/sh/sh.c: Update comments referring to OVERRIDE_OPTIONS. + * config/sparc/sparc.c (TARGET_OPTION_OVERRIDE): Define. + (sparc_override_options): Rename to sparc_option_override. Make + static. Call SUBTARGET_OVERRIDE_OPTIONS. + * config/sparc/sparc.h (OVERRIDE_OPTIONS): Remove. + * config/sparc/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define + instead of OVERRIDE_OPTIONS. + * config/spu/spu-protos.h (spu_override_options): Remove. + * config/spu/spu.c (TARGET_OPTION_OVERRIDE): Define. + (spu_override_options): Rename to spu_option_override. Make + static. + * config/spu/spu.h (OVERRIDE_OPTIONS): Remove. + * config/vax/elf.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of + OVERRIDE_OPTIONS. + * config/vax/vax-protos.h (override_options): Remove. + * config/vax/vax.c (TARGET_OPTION_OVERRIDE): Define. + (override_options): Rename to vax_option_override. Make static. + Call SUBTARGET_OVERRIDE_OPTIONS. + * config/vax/vax.h (OVERRIDE_OPTIONS): Remove. + * config/vxworks.c: Update comment referring to OVERRIDE_OPTIONS. + * config/vxworks.h: Update comment referring to OVERRIDE_OPTIONS. + * config/xtensa/xtensa-protos.h (override_options): Remove. + * config/xtensa/xtensa.c (TARGET_OPTION_OVERRIDE): Define. + (override_options): Rename to xtensa_option_override. Make static. + * config/xtensa/xtensa.h (OVERRIDE_OPTIONS): Remove. + +2010-09-16 Richard Guenther + + PR tree-optimization/45623 + * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Adjust. + (get_constraint_for_component_ref): If computing a constraint + for the rhs handle type punning through unions. + (get_constraint_for_address_of): Adjust. + (get_constraint_for_1): Likewise. + (get_constraint_for): Likewise. + (get_constraint_for_rhs): New function. + (do_structure_copy): Adjust. + (make_constraint_to): Likewise. + (handle_const_call): Likewise. + (find_func_aliases): Likewise. + (process_ipa_clobber): Likewise. + (create_variable_info_for): Likewise. + +2010-09-16 Ira Rosen + + * tree-vectorizer.c: Fix documentation. + * tree-vectorizer.h (vinfo_for_stmt): Add documentation. + (set_vinfo_for_stmt, get_earlier_stmt, get_later_stmt, + is_pattern_stmt_p, is_loop_header_bb_p, + stmt_vinfo_set_inside_of_loop_cost, + stmt_vinfo_set_outside_of_loop_cost, vect_pow2, aligned_access_p, + known_alignment_for_access_p): Likewise. + * tree-vect-loop.c: Fix documentation. + (vect_get_cost): Start function name from new line. + * tree-vect-data-refs.c: Fix documentation. + * tree-vect_stmts.c: Likewise. + (vect_create_vectorized_promotion_stmts): Always free vec_tmp. + (vectorizable_store): Free vec_oprnds if allocated. + (vectorizable_condition): Initialize several variables to avoid + warnings. + * tree-vect-slp.c: Fix documentation. + +2010-09-16 Richard Guenther + + * tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL + is TS_TRANSLATION_UNIT_DECL. + (initialize_tree_contains_struct): Adjust. + (all_translation_units): New global vector. + (build_translation_unit_decl): New function. + * tree.h (TRANSLATION_UNIT_LANGUAGE): New macro. + (struct tree_translation_unit_decl): New. + (all_translation_units): Declare. + (union tree_node): Add translation_unit_decl member. + (build_translation_unit_decl): Declare. + * treestruct.def (TS_TRANSLATION_UNIT_DECL): New. + * lto-streamer-out.c (pack_ts_translation_unit_decl_value_fields): + New function. + (pack_value_fields): Call it. + (lto_output_tree_ref): Handle references to TRANSLATION_UNIT_DECL. + (lto_output_ts_translation_unit_decl_tree_pointers): New function. + (lto_output_tree_pointers): Call it. + * lto-streamer-in.c (lto_input_tree_ref): Handle references + to TRANSLATION_UNIT_DECL. + (unpack_ts_translation_unit_decl_value_fields): New function. + (unpack_value_fields): Call it. + (lto_input_ts_translation_unit_decl_tree_pointers): New function. + (lto_input_tree_pointers): Call it. + * lto-streamer.c (check_handled_ts_structures): Adjust. + * lto-streamer.h (enum LTO_tags): Add LTO_translation_unit_decl_ref. + * c-decl.c (all_translation_units): Remove. + (pop_scope): Use build_translation_unit_decl. + (collect_all_refs): Adjust. + (for_each_global_decl): Likewise. + (c_write_global_declarations): Likewise. + +2010-09-16 Jakub Jelinek + + PR bootstrap/45686 + * fold-const.c (fold_checksum_tree): Change slot from const void ** + to void **, use CONST_CAST_TREE to store into *slot. + +2010-09-16 Uros Bizjak + + * config/i386/i386.md: Remove unneeded empty conditions and + preparation statements from expanders. + * config/i386/mmx.md: Ditto. + * config/i386/sse.md: Ditto. + +2010-09-16 Uros Bizjak + + * config/i386/i386.h (PUSH_ROUNDING): Redefine using UNITS_PER_WORD. + +2010-09-15 Eric Botcazou + + PR rtl-optimization/45593 + * reorg.c (relax_delay_slots): Use emit_copy_of_insn_after to re-emit + insns that were in delay slots as stand-alone insns. + +2010-09-15 Ian Lance Taylor + + * incpath.c (remove_duplicates): If name is not a directory, issue + a warning rather than an error. + +2010-09-15 Martin Jambor + + PR middle-end/45644 + * tree-sra.c (create_access): Check for bit-fields directly. + +2010-09-15 Jakub Jelinek + + PR tree-optimization/45633 + * tree-cfg.c (verify_gimple_assign_binary): Allow + MINUS_EXPR with lhs and rhs1 pointer vector and + rhs2 sizetype vector. + * expr.c (expand_expr_real_2) : For pointer + or vector pointer use TER to optimize pointer subtraction. + +2010-09-15 Jie Zhang + + * config/arm/vfp.md (cmpsf_trap_vfp): Change type from + fcmpd to fcmps. + +2010-09-15 Ian Lance Taylor + + * config/i386/i386.md (truncxf2): Fix indentation. + +2010-09-15 Ian Lance Taylor + + * function.c (get_arg_pointer_save_area): Set + arg_pointer_save_area_init to true. + +2010-09-15 Martin Jambor + + * tree-sra.c (generate_subtree_copies): Updated comment. + (handle_unscalarized_data_in_subtree): Removed parameter lhs which is + obtained from the statement iterator instead. + (load_assign_lhs_subreplacements): Removed parameters lhs and + right_offset, which is obtained from top_racc instead. Parameter lacc + is now expected to be the root of the processed tree rather than root's + first child. Updated all callers. + +2010-09-15 Joseph Myers + + * config/pdp11/pdp11.c (register_move_cost): Rename to + pdp11_register_move_cost. + * config/pdp11/pdp11-protos.h (register_move_cost): Rename to + pdp11_register_move_cost. + * config/pdp11/pdp11.h (REGISTER_MOVE_COST): Call + pdp11_register_move_cost instead of register_move_cost. + +2010-09-15 Tejas Belagod + + * config/arm/neon.md (vec_pack_trunc_): Instruction + pattern for vmovn. Expansion in case of non + -mvectorize-with-neon-quad. + (neon_vec_pack_trunc_): Instruction pattern for vmovn for + non- -mvectorize-with-neon-quad case. + (move_lo_quad_): New expansion to vmov into low part. + (move_hi_quad_): New expansion to vmov into high part. + (move_lo_quad_v4si): Refactor to move_lo_quad_ expansion. + (move_lo_quad_v4sf): Likewise. + (move_lo_quad_v8hi): Likewise. + (neon_move_lo_quad_): Instruction pattern for vmov into + low part. + (neon_move_hi_quad_): Instruction pattern for vmov into + high part. + * config/arm/iterators.md (ANY128): New mode iterator. + (V_narrow_pack): New mode attribute. + (V_HALF): Add attribute. + (V_DOUBLE): Add attribute. + (V_mode_nunits): Add attribute. + +2010-09-15 Eric Botcazou + + * config/alpha/alpha.c (alpha_expand_prologue): If stack checking + is enabled, probe up to frame_size + STACK_CHECK_PROTECT bytes. + +2010-09-15 Olivier Hainque + Jose Ruiz + + * config/alpha/osf5.h (MD_UNWIND_SUPPORT): Define. + * config/alpha/osf5-unwind.h: New file. + +2010-09-14 H.J. Lu + + PR bootstrap/45672 + * config/mips/mips.c (mips_units_per_simd_word): Correct return type. + * config/rs6000/rs6000.c (rs6000_units_per_simd_word): Likewise. + * config/sparc/sparc.c (sparc_units_per_simd_word): Likewise. + +2010-09-15 Laurynas Biveinis + + * c-lang.h (struct lang_type): Add variable_size GTY option. + +2010-09-14 H.J. Lu + + PR bootstrap/45672 + * config/rs6000/rs6000.c (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): New. + +2010-09-14 H.J. Lu + + * config/i386/i386.c (ix86_lea_for_add_ok): Return false if + result isn't used in memory address. + +2010-09-14 H.J. Lu + + * defaults.h (UNITS_PER_SIMD_WORD): Removed. + * config/arm/arm.h (UNITS_PER_SIMD_WORD): Likewise. + * config/i386/i386.h (UNITS_PER_SIMD_WORD): Likewise. + * config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise. + * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise. + * config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise. + + * target.def: Add units_per_simd_word to vectorize. + + * targhooks.c (default_units_per_simd_word): New. + * targhooks.h (default_units_per_simd_word): Likewise. + * config/arm/arm.c (arm_units_per_simd_word): Likewise. + (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. + * config/mips/mips.c (mips_units_per_simd_word): Likewise. + (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. + * config/rs6000/rs6000.c (rs6000_units_per_simd_word): Likewise. + (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. + * config/sparc/sparc.c (sparc_units_per_simd_word): Likewise. + (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. + + * tree-vect-loop.c: Replace UNITS_PER_SIMD_WORD with + TARGET_VECTORIZE_UNITS_PER_SIMD_WORD in comments. + + * tree-vect-stmts.c: Don't include "tm_p.h". + (get_vectype_for_scalar_type): Replace UNITS_PER_SIMD_WORD + with targetm.vectorize.units_per_simd_word. + + * system.h (UNITS_PER_SIMD_WORD): Poisoned. + + * config/i386/i386-protos.h (ix86_units_per_simd_word): Removed. + + * config/i386/i386.c (ix86_units_per_simd_word): Make it static. + (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): New. + + * doc/tm.texi.in: Remove UNITS_PER_SIMD_WORD. Add + TARGET_VECTORIZE_UNITS_PER_SIMD_WORD. + + * doc/tm.texi: Regenerated. + +2010-09-14 H.J. Lu + + * tree-vect-stmts.c: Include "tm_p.h". + + * config/i386/i386-protos.h (ix86_units_per_simd_word): Moved + out of RTX_CODE. + +2010-09-14 Martin Jambor + + * tree-sra.c (build_ref_for_offset): Loc made a parameter. Set the + location of generated statement. Changed all callers. + (build_ref_for_model): New parameter loc which used to set location of + all generated expressions. Changed all callers. + (generate_subtree_copies): Likewise. + (init_subtree_with_zero): Likewise. + (sra_modify_expr): Set locations of all generated statements and + expressions to the location the original statement. + (handle_unscalarized_data_in_subtree): Likewise. + (load_assign_lhs_subreplacements): Likewise. + (sra_modify_constructor_assign): Likewise. + (sra_modify_assign): Likewise. + +2010-09-14 Eric Botcazou + + PR target/45277 + PR target/45363 + PR target/45407 + * doc/install.texi (sparc*-*-*): New section. + (sparc-sun-solaris2*): Mention MPC alongside GMP and MPFR. + +2010-09-14 Jakub Jelinek + + PR middle-end/45567 + * builtins.c (expand_builtin_interclass_mathfn, expand_builtin_cexpi, + expand_builtin_powi): Remove subtarget argument, pass NULL_RTX instead. + (expand_builtin): Adjust caller. + (expand_builtin_unop): Only use subtarget if it has the right mode. + +2010-09-14 Tristan Gingold + + * configure.ac (plugins): Fix typos. + * configure: Regenerate. + +2010-09-14 Jakub Jelinek + + PR debug/45660 + * dwarf2out.c (gen_decl_die): Call gen_type_die for origin before + gen_type_die for function/method return type. + +2010-09-14 Ira Rosen + + PR tree-optimization/45470 + * tree-vect-data-refs.c (vect_analyze_data_refs): Fail if a statement + can throw an exception. + * tree-vect-stmts.c (vectorizable_call): Likewise. + +2010-09-14 DJ Delorie + + PR target/44749 + * config/mep/mep-protos.h (mep_save_register_info, + mep_reinit_regs, mep_init_regs): Declare. + + * config/mep/mep.c: Move all target definitions to the end of the + file to avoid the need for duplicate declarations. + (mep_save_register_info, mep_reinit_regs, mep_init_regs): New. + (mep_reorg_erepeat): Remove unused variables. + (mep_expand_builtin): Likewise. + + * config/mep/mep-pragma.c: Don't include rtl.h. + (INVALID_REGNUM): New. + (mep_pragma_coprocessor_which): Call mep-specific rtl-layer bridge + functions. + (mep_pragma_coprocessor_subclass): Rename "class" to "rclass". + Avoid enum/integer math. + +2010-09-13 Joseph Myers + + PR target/44749 + * config/mep/t-mep (GTM_H): Add insn-constants.h. + * config/mep/mep.c (mep_conditional_register_usage): Take no + parameters. + * config/mep/mep-protos.h (mep_conditional_register_usage): Update + prototype. + * config/mep/mep-pragma.c (CONDITIONAL_REGISTER_USAGE): Update + call to mep_conditional_register_usage. + +2010-09-13 Eric Botcazou + + PR debug/43937 + * varasm.c (output_constant_def_contents): Set TREE_ASM_WRITTEN on + the DECL as well. + +2010-09-13 Jakub Jelinek + + PR rtl-optimization/45617 + * combine.c (simplify_comparison): Optimize (X >> N) {>,>=,<,<=} C + even if low N bits of X aren't known to be zero. + +2010-09-13 H.J. Lu + + * config/i386/i386-protos.h (ix86_units_per_simd_word): New. + + * config/i386/i386.c (initial_ix86_tune_features): Add + X86_TUNE_VECTORIZE_DOUBLE. + (ix86_units_per_simd_word): New. + + * config/i386/i386.h (ix86_tune_indices): Add + X86_TUNE_VECTORIZE_DOUBLE. + (TARGET_VECTORIZE_DOUBLE): New. + (UNITS_PER_SIMD_WORD): Defined with ix86_units_per_simd_word. + +2010-09-13 Pat Haugen + + * tree-ssa-ter.c (temp_expr_table_d): Add call_cnt field. + (new_temp_expr_table): Allocate call_cnt vector. + (free_temp_expr_table): Free it. + (process_replaceable): Add call_cnt parm and set in vector. + (find_replaceable_in_bb): Skip replacement if def/use span a call. + (debug_ter): Dump call_cnt value, remove stderr uses. + +2010-09-13 Jan Hubicka + + * tree.c (build_zero_cst): New. + * tree.h (build_zero_cst): Declare. + * tree-ssa-ccp.c (get_constant_value): Accept general operands. + (get_base_constructor): Break out from ... + (fold_const_aggregate_ref): Here; handle empty constructors. + +2010-09-13 Marcus Shawcroft + + * config/arm/arm.md: (define_attr "conds"): Update comment. + * config/arm/sync.md (arm_sync_compare_and_swapsi): Change + conds attribute to clob. + (arm_sync_compare_and_swapsi): Likewise. + (arm_sync_compare_and_swap): Likewise. + (arm_sync_lock_test_and_setsi): Likewise. + (arm_sync_lock_test_and_set): Likewise. + (arm_sync_new_si): Likewise. + (arm_sync_new_nandsi): Likewise. + (arm_sync_new_): Likewise. + (arm_sync_new_nand): Likewise. + (arm_sync_old_si): Likewise. + (arm_sync_old_nandsi): Likewise. + (arm_sync_old_): Likewise. + (arm_sync_old_nand): Likewise. + +2010-09-13 Olivier Hainque + + * fwprop.c (forward_propagate_and_simplify): Only attach a + REG_EQUAL note to an insn if the destination is a register. + * gcse.c (try_replace_reg): Likewise. + +2010-09-13 Richard Guenther + + PR tree-optimization/45611 + * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Fix typo. + (copy_ref_info): Likewise. + +2010-09-13 Alexandre Oliva + + PR debug/45604 + PR debug/45419 + PR debug/45408 + * tree-pretty-print.c (dump_generic_node): Disregard top-level + types of MEM_REF pointer types to the same type. + +2010-09-13 Hans-Peter Nilsson + + PR rtl-optimization/41087 + * ifcvt.c (noce_get_condition): Don't allow conditions with + side-effects. + +2010-09-12 Anatoly Sokolov + + * config/frv/frv.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. + * config/frv/frv-protos.h (frv_register_move_cost): Remove. + * config/frv/frv.c (frv_register_move_cost): Make static. Change + arguments type to reg_class_t. Add mode argument. + (frv_memory_move_cost): New. + (TARGET_REGISTER_MOVE_COSTS, TARGET_MEMORY_MOVE_COSTS): Define. + +2010-09-12 Bernd Schmidt + + * config/arm/arm.md (arm_ashldi3_1bit, arm_ashrdi3_1bit, + arm_lshrdi3_1bit): Put earlyclobber on the right alternative. + +2010-09-10 Jan Hubicka + + * tree-ssa-ccp.c (fold_const_aggregate_ref): Do not check STATIC flag. + +2010-09-10 Richard Guenther + + * tree.c (make_vector_type): Do not set TYPE_DEBUG_REPRESENTATION_TYPE. + * tree.h (TYPE_DEBUG_REPRESENTATION_TYPE): Remove. + * lto-streamer-out.c (lto_output_ts_type_tree_pointers): Do + not stream TYPE_DEBUG_REPRESENTATION_TYPE. + * lto-streamer-in.c (lto_input_ts_type_tree_pointers): Likewise. + +2010-09-10 Richard Guenther + + * dwarf2out.c (gen_array_type_die): Output DW_TAG_subrange_type + for VECTOR_TYPEs using TYPE_VECTOR_SUBPARTS. + * dbxout.c (dbxout_type): Manually deal with VECTOR_TYPE + using TYPE_VECTOR_SUBPARTS, not TYPE_DEBUG_REPRESENTATION_TYPE. + +2010-09-10 H.J. Lu + + PR middle-end/45634 + * tree-ssa-ccp.c (fold_const_aggregate_ref): Check that result + of string folding is of integral type. + +2010-09-10 Ryan Mansfield + + * doc/invoke.texi (-x): Fix typo. + +2010-09-10 Richard Guenther + + PR debug/44115 + * tree.c (free_lang_data_in_decl): Do not clear DECL_DEBUG_EXPR. + * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers): + Output DECL_DEBUG_EXPR. + * lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers): + Input DECL_DEBUG_EXPR. + +2010-09-10 Richard Guenther + + * tree.c (type_hash_eq): For ARRAY_TYPEs also compare TYPE_SIZE. + (build_index_type): Implement in terms of build_range_type. + (build_range_type): Do not allow NULL_TREE type, improve + hashing to cover more cases. Set TYPE_STRUCTURAL_EQUALITY_P + if we didn't hash. + * c-decl.c (grokdeclarator): When modifying TYPE_SIZE manually + create a distinct copy of the type. + +2010-09-10 Kai Tietz + + * configure: Regenerated. + * config.gcc: Add for x86_64 and i?86 mingw t-dfprule. + +2010-09-10 Ramana Radhakrishnan + + * config/arm/neon-schedgen.ml (allCores): Add support for Cortex-A9. + * config/arm/cortex-a9-neon.md: New and partially generated. + * config/arm/cortex-a9.md (cortex_a9_dp): Adjust for Neon. + +2010-09-10 Richard Guenther + + * tree.h (build_index_2_type): Remove. + * tree.c (build_index_2_type): Remove. + +2010-09-10 Jakub Jelinek + + PR bootstrap/45630 + * dwarf2out.c (get_ref_die_offset_label): Use %ld instead of + HOST_WIDE_INT_PRINT_DEC to print ref->die_offset. + (implicit_ptr_descriptor): Return NULL if dwarf_strict. + +2010-09-10 Martin Jambor + + PR tree-optimization/44972 + * tree-sra.c: Include toplev.h. + (build_ref_for_offset): Entirely reimplemented. + (build_ref_for_model): New function. + (build_user_friendly_ref_for_offset): New function. + (analyze_access_subtree): Removed build_ref_for_offset check. + (propagate_subaccesses_across_link): Likewise. + (create_artificial_child_access): Use + build_user_friendly_ref_for_offset. + (propagate_subaccesses_across_link): Likewise. + (ref_expr_for_all_replacements_p): Removed. + (generate_subtree_copies): Updated comment. Use build_ref_for_model. + (sra_modify_expr): Use build_ref_for_model. + (load_assign_lhs_subreplacements): Likewise. + (sra_modify_assign): Removed ref_expr_for_all_replacements_p checks, + checks for return values of build_ref_for_offset. + * ipa-cp.c (ipcp_lattice_from_jfunc): No need to check return value of + build_ref_for_offset. + * ipa-prop.h: Include gimple.h + * ipa-prop.c (ipa_compute_jump_functions): Update to look for MEM_REFs. + (ipa_analyze_indirect_call_uses): Update comment. + * Makefile.in (tree-sra.o): Add $(GIMPLE_H) to dependencies. + (IPA_PROP_H): Likewise. + +2010-09-10 Martin Jambor + + PR tree-optimization/44972 + * ipa-prop.c (ipa_modify_call_arguments): Build MEM_REF instead of + calling build_ref_for_offset. + +2010-09-09 Ramana Radhakrishnan + + * config/arm/bpabi.h (BE8_LINK_SPEC): Handle Cortex-a15. + * config/arm/arm-cores.def (cortex-a15): New core. Treat it as a v7-a. + * config/arm/arm-tune.md: Regenerate. + * doc/invoke.texi (ARM Options): Document it. + +2010-09-09 Reza Yazdani + + * config/i386/i386.c: Include sched-int.h. + (TARGET_SCHED_DISPATCH): Defined. + (TARGET_SCHED_DISPATCH_DO): Defined. + (DISPATCH_WINDOW_SIZE): Defined. + (MAX_DISPATCH_WINDOWS): Defined. + (MAX_INSN): Defined. + (MAX_IMM): Defined. + (MAX_IMM_SIZE): Defined. + (MAX_IMM_32): Defined. + (MAX_IMM_64): Defined. + (MAX_LOAD): Defined. + (MAX_STORE): Defined. + (BIG): Defined. + (dispatch_group): New. + (num_allowable_groups): New. + (group_name): New. + (sched_insn_info_s): New. + (dispatch_windows_s): New. + (imm_info_s): New. + (dispatch_window_list): New. + (dispatch_window_list1): New. + (get_mem_group): New. + (is_cmp): New. + (dispatch_violation): New. + (is_branch): New. + (is_prefetch): New. + (init_window): New. + (allocate_window): New. + (init_dispatch_sched): New. + (is_end_basic_block): New. + (process_end_window): New. + (allocate_next_window): New. + (find_constant_1): New. + (find_constant): New. + (get_num_immediates): New. + (has_immediate): New. + (get_insn_path): New. + (get_insn_group): New. + (count_num_restricted): New. + (fits_dispatch_window): New. + (add_insn_window): New. + (add_to_dispatch_window): New. + (debug_dispatch_window_file): New. + (debug_dispatch_window): New. + (debug_insn_dispatch_info_file): New. + (debug_ready_dispatch): New. + (do_dispatch): New. + (has_dispatch): New. + * config/i386/i386.h (debug_ready_dispatch): Declared. + (debug_dispatch_window): Declared. + * config/i386/i386.opt (mdispatch-scheduler): New flag. + * doc/tm.texi.in (TARGET_SCHED_DISPATCH): New. + (TARGET_SCHED_DISPATCH_DO): New. + * doc/tm.texi: Regererated. + * haifa-sched.c (choose_ready): Call targetm.sched.dispatch and + ready_remove_first_dispatch + (schedule_block): Call targetm.sched.dispatch and + targetm.sched.dispatch_do. + (sched_init): Call targetm.sched.dispatch and + targetm.sched.dispatch_do. + (ready_remove_first_dispatch): New. + (number_in_ready): New. + (get_ready_element): New. + * hooks.c (hook_bool_rtx_int_false): New. + (hook_void_rtx_int): New. + * hooks.h (hook_bool_rtx_int_false): Declared. + (hook_void_rtx_int): Declared. + * sched-int.h (IS_DISPATCH_ON): Defined. + (IS_CMP): Defined. + (DISPATCH_VIOLATION): Defined. + (FITS_DISPATCH_WINDOW): Defined. + (DISPATCH_INIT): Defined. + (ADD_TO_DISPATCH_WINDOW): Defined. + (get_ready_element): Declared. + (number_in_ready): Declared. + * target.def (dispatch): Defined. + (dispatch_do): Defined. + +2010-09-09 Vladimir Makarov + + PR middle-end/45312 + * reload1.c (merge_assigned_reloads): Remove. + (reload_as_needed): Don't call it. + +2010-09-09 Anatoly Sokolov + + * config/m32r/m32r.c (m32r_mode_dependent_address_p): New functions. + (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. + * config/m32r/m32r.h: (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. + +2010-09-09 Matthias Klose + + PR bootstrap/43847 + * configure.ac (--enable-plugin): Enhance for cross builds. + * configure: Regenerate. + +2010-09-09 Jan Hubicka + + PR tree-optimization/45598 + * tree-ssa-ccp.c (fold_const_aggregate_ref): Check that result of + string folding is of integral type. + +2010-09-09 Nathan Sidwell + + * configure.ac (gnu_indirect_function): New test. + * configure: Rebuilt. + * config.in (HAVE_GAS_INDIRECT_FUNCTION): New. + * defaults.h (IFUNC_ASM_TYPE): Provide default. + + * doc/extend.texi (Function Attributes): Document ifunc. + * varasm.c (do_assemble_alias): Deal with ifuncs too. + +2010-09-09 Hariharan Sandanagobalane + + * config/picochip/picochip.c (picochip_reorg): Check for note_p for + epilogue instruction move. + +2010-09-09 Jan Hubicka + + * collect2.c (maybe_run_lto_and_relink): Rewrite code producing ld + command line to allow more partitions than input files. + +2010-09-09 Vladimir Makarov + + PR middle-end/44554 + * ira.c (ira): Switch off sharing spill slots if setjmp is called. + +2010-09-09 Vladimir Makarov + + PR middle-end/40386 + * ira.c (pseudo_for_reload_consideration_p): Don't use + flag_ira_share_spill_slots. + +2010-09-09 Ulrich Weigand + + * config/s390/s390.c (legitimate_reload_constant_p): Accept floating- + point zero operands that fit into a single GPR. + (s390_preferred_reload_class): Ensure we only return general-purpose + register classes. + * config/s390/s390.md ("*mov_64dfp"): Use lghi to load + floating-point zero operands into GPRs. + ("*mov_64"): Likewise. + ("mov"): Likewise using lhi. + +2010-09-09 Ulrich Weigand + + * config/s390/s390.c (s390_symref_operand_p): Return false for + literal pool references. + (s390_check_qrst_address): Update caller. + +2010-09-09 Uros Bizjak + + * config/i386/predicates.md (ext_register_operand): Check that + SUBREG_REG is really a register before looking for REGNO. + (reg_not_xmm0_operand): Handle SUBREGs correctly. + (nonimm_not_xmm0_operand): Call reg_not_xmm0_operand. + +2010-09-09 Jakub Jelinek + + * rtl.def (DEBUG_IMPLICIT_PTR): New rtl code. + * rtl.h (DEBUG_IMPLICIT_PTR_DECL): Define. + * rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_IMPLICIT_PTR. + * print-rtl.c (print_rtx): Likewise. + * cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise. + * cfgexpand.c (expand_debug_expr): Generate DEBUG_IMPLICIT_PTR + for ADDR_EXPR with non-addressable object. + * dwarf2out.c (enum dw_val_class): Add dw_val_class_decl_ref. + (struct dw_val_struct): Add v.val_decl_ref. + (dwarf_stack_op_name, output_loc_operands, output_loc_operands_raw): + Handle DW_OP_GNU_implicit_pointer. + (size_of_loc_descr): Likewise. Fix up DW_OP_call_ref size. + (get_ref_die_offset_label): New function. + (implicit_ptr_descriptor): New function. + (mem_loc_descriptor): Handle DEBUG_IMPLICIT_PTR. + (loc_descriptor): Likewise. + (gen_variable_die): Put even definitions into decl_die_table. + (resolve_addr_in_expr): Resolve still unresolved + DW_OP_GNU_implicit_pointer operands, if it can't be resolved + return false. + (dwarf2out_finish): Call output_location_lists after outputting + .debug_info and .debug_abbrev instead of before. + +2010-09-09 Roland McGrath + + * dwarf2out.c (DWARF_REF_SIZE): Define. + (size_of_loc_descr): Use it for DW_OP_call_ref. + +2010-09-09 Alan Modra + + * doc/invoke.text: Reinstate mcmodel=medium. + * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Set + CMODEL_MEDIUM as default. + * config/rs6000/rs6000.h (enum rs6000_cmodel): Add CMODEL_MEDIUM. + * config/rs6000/rs6000.c (rs6000_handle_option): Add mcmodel=medium. + (toc_relative_ok, offsettable_ok_by_alignment): New functions. + (rs6000_emit_move): Reinstate mcmodel=medium optimization. + +2010-09-08 John David Anglin + + PR target/45250 + * config/pa/pa.md (nonlocal_goto): Restore hard frame pointer using + hard_frame_pointer_rtx instead of virtual_stack_vars_rtx. + (builtin_longjmp): Likewise. + (allocate_stack): Use hard_frame_pointer_rtx instead of + frame_pointer_rtx. + * config/pa/pa-protos.h (pa_initial_elimination_offset): Declare. + * config/pa/pa.c (pa_internal_arg_pointer): Declare. + (pa_can_eliminate): Likewise. + (TARGET_INTERNAL_ARG_POINTER): Define. + (TARGET_CAN_ELIMINATE): Define. + (hppa_expand_prologue): Use hard frame pointer instead of soft frame + pointer. + (hppa_expand_epilogue, pa_eh_return_handler_rtx): Likewise. + (pa_internal_arg_pointer, pa_can_eliminate, + pa_initial_elimination_offset): New. + * config/pa/pa.h (FRAME_POINTER_REGNUM): Set to new general register. + (HARD_FRAME_POINTER_REGNUM): Set to register three. + (INITIAL_FRAME_POINTER_OFFSET): Delete. + (ELIMINABLE_REGS, INITIAL_ELIMINATION_OFFSET, DWARF_FRAME_REGISTERS): + Define. + (DWARF_ALT_FRAME_RETURN_COLUMN, REGNO_OK_FOR_INDEX_P, + REGNO_OK_FOR_BASE_P): Update to include soft frame pointer. + * config/pa/pa32-regs.h (FIRST_PSEUDO_REGISTER): Increase by one. + (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER, + REG_CLASS_CONTENTS, REGNO_REG_CLASS, REGISTER_NAMES): Update to include + new soft frame pointer. + * config/pa/pa64-regs.h: Likewise. + +2010-09-08 Uros Bizjak + + * config/i386/i386.h (EH_RETURN_DATA_REGNO) Use DX_REG instead of + numerical constant. + (EH_RETURN_STACKADJ_RTX): Use CX_REG insted of numerical constant. + +2010-09-08 Alexandre Oliva + + PR debug/45531 + * cfglayout.c (fixup_reorder_chain): Skip debug insns. + +2010-09-08 Alexandre Oliva + + PR debug/45419 + PR debug/45408 + * tree-pretty-print.c (dump_generic_node): Disregard top-level + qualifiers in otherwise equal MEM_REF pointer types. + * fold-const.c (operand_equal_p): Compare pointer type of MEM_REFs. + * tree.c (iterative_hash_expr): Hash the pointer type of MEM_REFs. + +2010-09-08 Ramana Radhakrishnan + + PR target/44392 + * config/arm/arm.md (bswapsi2): Handle condition correctly + for armv6 and optimize_size. + +2010-09-08 Francois-Xavier Coudert + + PR other/18555 + * doc/cppopts.texi (-isysroot): Document Darwin behaviour. + +2010-09-08 Uros Bizjak + + * config/i386/i386-protos.h (ix86_can_use_return_insn_p, + symbolic_reference_mentioned_p, ix86_expand_movmem, ix86_expand_setmem, + ix86_expand_strlen, legitimate_pic_address_disp_p, + ix86_binary_operator_ok, ix86_unary_operator_ok, ix86_match_ccmode, + ix86_expand_int_movcc, ix86_expand_fp_movcc, ix86_expand_int_addcc, + ix86_check_movabs, ix86_secondary_memory_needed): Change function + prototype to bool. + * config/i386/i386.c (return_in_memory_32, return_in_memory_64, + return_in_memory_ms_64, ix86_check_movabs, + symbolic_reference_mentioned_p, ix86_can_use_return_insn_p, + legitimate_pic_address_disp_p, ix86_binary_operator_ok, + ix86_unary_operator_ok, ix86_match_ccmode, ix86_expand_int_movcc, + ix86_expand_fp_movcc, ix86_expand_int_addcc, ix86_expand_movmem, + ix86_expand_setmem, ix86_expand_strlen, inline_secondary_memory_needed, + ix86_secondary_memory_needed): Change to bool. Return + "true" and "false" values. + * config/i386/i386.md: Return "true" and "false" values. + +2010-09-08 Rainer Orth + + * doc/sourcebuild.texi (Effective-Target Keywords): Document + run_expensive_tests. + +2010-09-08 Rainer Orth + + * toplev.c (output_stack_usage): Use lbasename instead of basename. + +2010-09-08 Martin Jambor + + PR other/45443 + * doc/invoke.texi: Add -fipa-cp-clone to list of switches turned on + at -O3. + +2010-09-08 Richard Guenther + + * gimple.c (gimple_types, type_hash_cache): Move to GC memory. + (visit): Adjust. + (iterative_hash_gimple_type): Likewise. + (gimple_type_hash): Likewise. + (gimple_register_type): Likewise. + (print_gimple_types_stats): Likewise. + (free_gimple_type_tables): Likewise. + +2010-09-08 Michael Matz + + PR tree-optimization/43430 + * tree-vect-stmts.c (vectorizable_condition): Support multiple + copies for conditional statements if it's not part of a reduction. + +2010-09-08 Michael Matz + + PR tree-optimization/33244 + * tree-ssa-sink.c (statement_sink_location): Don't sink into + empty loop latches. + +2010-09-08 Richard Guenther + + PR tree-optimization/45578 + * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): + Be more careful when transfering alignment information to + the new induction variable. + (copy_ref_info): Likewise. + +2010-09-08 Richard Guenther + + * tree.h (TYPE_ORIG_SIZE_TYPE): Remove. + * c-typeck.c (comptypes_internal): Remove TYPE_ORIG_SIZE_TYPE checks. + +2010-09-08 Arnaud Charlet + + * c-tree.h, c-decl.c (build_enumerator): Add location parameter. + * c-parser.c (c_parser_enum_specifier): Adjust call to build_enumerator. + +2010-09-08 Kenneth Zadeck + + PR doc/45587 + * doc/md.texi: Fixed modes on several standard pattern names. + +2010-09-08 Mingjie Xing + + * config/mips/loongson.md (loongson_psll): Rename to... + (ashl3): ...this. + (loongson_psra): Rename to... + (ashr3): ...this. + (loongson_psrl): Rename to... + (lshr3): ...this. + * config/mips/mips.c (CODE_FOR_loongson_psllh): Define. + (CODE_FOR_loongson_psllw): Define. + (CODE_FOR_loongson_psrlh): Define. + (CODE_FOR_loongson_psrlw): Define. + (CODE_FOR_loongson_psrah): Define. + (CODE_FOR_loongson_psraw): Define. + +2010-09-07 Richard Henderson + + * tree-vect-data-refs.c: Include tm_p.h. + * Makefile.in (tree-vect-data-refs.o): Update deps. + * config/i386/i386-protos.h (ix86_cfun_abi, ix86_function_type_abi): + Move delarations outside #ifdef RTX_CODE. + +2010-09-07 Richard Henderson + + * final.c (rest_of_handle_final): Unconditionally do + output_function_exception_table before assemble_end_function. + +2010-09-07 Jan Hubicka + + * tree-inline.c (tree_inlinable_function_p): Do not test + DECL_REPLACEABLE_P. + * ipa-inline.c (cgraph_default_inline_p, update_caller_keys, + update_callee_keys, cgraph_decide_inlining): Test function availability. + * cif-code.def (OVERWRITABLE): New code. + +2010-09-07 H.J. Lu + Jack Howarth + + PR target/36502 + PR target/42313 + PR target/44651 + * config/i386/darwin.h (STACK_BOUNDARY): Redefine as 128 for + profiling or 64-bit MS_ABI and as BITS_PER_WORD otherwise. + (PREFERRED_STACK_BOUNDARY): Replace STACK_BOUNDARY with 128 in + MAX macro. + +2010-09-07 H.J. Lu + + * unwind-dw2-fde-glibc.c: Include for DT_CONFIG. + Include only if USE_PT_GNU_EH_FRAME is defined. + +2010-09-07 H.J. Lu + + * config.gcc: Don't append t-android for Android targets. + + * config/t-android: Removed. + +2010-09-07 Richard Henderson + + * target.def (TARGET_ASM_EMIT_EXCEPT_PERSONALITY): New hook. + * doc/tm.texi.in: Add doc marker. + * doc/tm.texi: Rebuild. + * except.c (switch_to_exception_section): Always build. + (output_one_function_exception_table): Move section switch, + personality output, and label output ... + (output_function_exception_table): ... here. Use the new + personality hook. + + * config/ia64/ia64.c (ia64_asm_emit_except_personality, + ia64_asm_init_sections, TARGET_ASM_EMIT_EXCEPT_PERSONALITY, + TARGET_ASM_INIT_SECTIONS): New. + (ia64_asm_unwind_emit): Rename from process_for_unwind_directive, + make static. + (TARGET_ASM_UNWIND_EMIT): Update to match. + * config/ia64/ia64-protos.h (process_for_unwind_directive): Remove. + + * config/arm/arm.c (arm_asm_emit_except_personality): New. + (arm_asm_init_sections): New. + (TARGET_ASM_EMIT_EXCEPT_PERSONALITY, TARGET_ASM_INIT_SECTIONS): New. + +2010-09-07 Ramana Radhakrishnan + + * config/arm/arm.md: Remove unused variable. + +2010-09-07 Anatoly Sokolov + + * config/m32r/m32r.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. + * config/m32r/m32r.c (TARGET_MEMORY_MOVE_COSTS): Define. + (m32r_memory_move_cost): New function. + +2010-09-07 H.J. Lu + + * config.gcc: Append t-android for Android targets. + + * config/t-android: New. + +2010-09-07 Richard Henderson + + * target.def (unwind_emit_before_insn): New hook. + * doc/tm.texi.in: Add @hook marker for it. + * doc/tm.texi: Rebuild. + * final.c (final_scan_insn): Respect unwind_emit_before_insn. + +2010-09-07 Martin Jambor + + PR fortran/43665 + * ipa-cp.c (ipcp_versionable_function_p): Return false if there + are any type attributes. + +2010-09-07 Jan Hubicka + + * tree-ssa-ccp.c (fold_const_aggregate_ref): Fix handling of + array_ref_low_bound in string access folding. + +2010-09-07 Uros Bizjak + + PR target/45206 + * config/i386/i386.c (ix86_expand_epilogue): Mark SP as valid after + eh_return fixup sequence. + +2010-09-07 Jan Hubicka + + * gimple-fold.c (maybe_fold_reference): Verify that operand is + gimple_min_invariant. + +2010-09-07 Richard Guenther + + PR middle-end/45569 + * tree-eh.c (operation_could_trap_helper_p): Neither COMPLEX_EXPR + nor CONSTRUCTOR can trap. + * tree-complex.c (update_complex_assignment): Update EH info. + +2010-09-07 Richard Guenther + + PR middle-end/45569 + * tree-cfg.c (build_gimple_cfg): Remove redundant stmt verification. + * passes.c (execute_function_todo): Do not verify anything if + we saw errors. + +2010-09-07 Richard Guenther + + * tree-pretty-print.c (dump_generic_node): Dump void types as void. + +2010-09-07 Bernd Schmidt + + PR target/43137 + * config/arm/iterators.md (qhs_zextenddi_cond, qhs_sextenddi_cond): + New define_mode_attrs. + * config/arm/arm.md (zero_extendsidi2, arm_zero_extendsidi2, + arm_exxtendsidi2, arm_extendsidi2): Delete patterns. + (zero_extenddi2, extenddi2 and related splits): New. + (thumb1_zero_extendhisi2): Remove code to handle LABEL_REFs. + Remove pool_range attribute. + (arm_zero_extendhisi2, arm_zero_extendhisi2_v6, arm_zero_extendqisi2, + arm_zero_extendqisi2_v6, thumb1_zero_extendqisi2_v6): Remove + pool_range and neg_pool_range attributes. + * config/arm/thumb2.md (thumb2_zero_extendsidi2, + thumb2_zero_extendhidi2, thumb2_zero_extendqidi2, thumb2_extendsidi2, + thumb2_extendhidi2, thumb2_extendqidi2): Delete. + +2010-09-06 H.J. Lu + + * config/i386/linux-unwind.h (x86_fallback_frame_state): Properly + check glibc. + +2010-09-06 Uros Bizjak + + PR target/22152 + * config/i386/mmx.md (*mov_internal_rex64, + *mov_internal_avx, *mov_internal, + *movv2sf_internal_rex64_avx, *movv2sf_internal_rex64, + *movv2sf_internal_avx, *movv2sf_internal): Split out !y-!y alternative. + +2010-09-06 Mark Mitchell + + * c-typeck.c (do_warn_double_promotion): Remove. + * doc/invoke.texi (-Wdouble-promotion): Note available for C++ and + Objective-C++ too. + +2010-09-06 Anatoly Sokolov + + * config/frv/frv.h (CLASS_LIKELY_SPILLED_P): Remove. + * config/frv/frv-protos.h (frv_class_likely_spilled_p): Remove. + * config/frv/frv.c (frv_class_likely_spilled_p): Make static. Change + argument type to reg_class_t. Change result type to bool. + (TARGET_CLASS_LIKELY_SPILLED_P): Define. + +2010-09-06 Nicola Pero + + PR libobjc/19850 + * gthr-posix.h (__gthread_objc_thread_detach): Use + _objc_thread_attribs when detaching a thread. + * gthr-posix95.h (__gthread_objc_thread_detach): Same change. + +2010-09-06 H.J. Lu + + PR target/45524 + * configure.ac (enable_decimal_float): Set to $default_decimal_float. + * configure: Regenerated. + +2010-09-06 Andreas Krebbel + + * combine.c (try_combine): Set subst_low_luid to i0. + +2010-09-06 Richard Guenther + + * tree.def (MISALIGNED_INDIRECT_REF): Remove. + * tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF. + (build_aligned_type): Declare. + * tree.c (check_qualified_type): Also compare TYPE_ALIGN. + (check_aligned_type): New function. + (build_aligned_type): Likewise. + * expr.c (expand_assignment): Handle misaligned stores via + TARGET_MEM_REF and MEM_REF using movmisalign_optab. + (expand_expr_real_1): Likewise. + (safe_from_p): Remove MISALIGNED_INDIRECT_REF handling. + * tree-vect-stmts.c (vectorizable_store): Do not build + MISALIGNED_INDIRECT_REF but initialize alignment information. + (vectorizable_load): Likewise. + * builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF + handling. + * cfgexpand.c (expand_debug_expr): Likewise. + * dwarf2out.c (loc_list_from_tree): Likewise. + * fold-const.c (maybe_lvalue_p): Likewise. + (operand_equal_p): Likewise. + (build_fold_addr_expr_with_type_loc): Likewise. + * gimplify.c (gimplify_addr_expr): Likewise. + (gimplify_expr): Likewise. + * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise. + (verify_gimple_assign_single): Likewise. + * tree-dump.c (dequeue_and_dump): Likewise. + (tree_could_trap_p): Likewise. + * tree-predcom.c (ref_at_iteration): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + (op_code_prio): Likewise. + (op_symbol_code): Likewise. + * tree-ssa-ccp.c (get_value_from_alignment): Likewise. + * tree-ssa-loop-im.c (for_each_index): Likewise. + (gen_lsm_tmp_name): Likewise. + * tree-ssa-loop-ivopts.c (idx_find_step): Likewise. + (find_interesting_uses_address): Likewise. + * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. + * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. + (ao_ref_init_from_vn_reference): Likewise. + * tree.c (staticp): Likewise. + (build1_stat): Likewise. + (reference_alias_ptr_type): Likewise. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. + * config/rs6000/rs6000.c (rs6000_check_sdmode): Remove + MISALIGNED_INDIRECT_REF handling. + +2010-09-06 Richard Guenther + + PR tree-optimization/45534 + * tree-ssa-address.c (create_mem_ref_raw): Add verify parameter. + (create_mem_ref): Do verify the created TARGET_MEM_REF is valid + on the target. + (maybe_fold_tmr): Do not verify the created TARGET_MEM_REF is + valid on the target. + +2010-09-06 Andreas Schwab + + * configure.ac: Quote argument of AC_MSG_WARN. + * configure: Regenerate. + +2010-09-06 Alexander Monakov + + * sel-sched.c (move_cond_jump): Correct arguments to + maybe_tidy_empty_bb. + * sel-sched-ir.c (maybe_tidy_empty_bb): Export. + +2010-09-06 Andrey Belevantsev + + PR rtl-optimization/44919 + * sel-sched.c (move_cond_jump): Remove assert, check that + the several blocks case can only happen with mutually exclusive + insns instead. Rewrite the movement code to support moving through + several basic blocks. + +2010-09-06 Uros Bizjak + + * config/i386/i386.md (iptrsize): New mode attribute. + (tp_seg): Ditto. + (*load_tp_): Macroize insn from *load_tp_{si,di} using P + mode iterator. + (*add_tp_): Ditto from *add_tp_{si,di}. + (stack_protect_set_): Ditto from stack_protect_set_{si,di}. + (stack_protect_test_): Ditto from stack_protect_test_{si,di}. + (stack_tls_protect_set_): Ditto from + stack_tls_protect_set_{si,di}. Use %@ to output segment register + of thread base pointer load. + (stack_tls_protect_test_): Ditto from + stack_tls_protect_test_{si,di}. Use %@ to output segment register + of thread base pointer load. + (stack_protect_set): Rewrite using indirect functions. + (stack_protect_test): Ditto. + * config/i386/i386.c (ix86_print_operand_punct_valid): Add '@'. + (ix86_print_operand): Handle '@'. + +2010-09-05 Giuseppe Scrivano + + * tree-tailcall.c (process_assignment): Handle NEGATE_EXPR and + MINUS_EXPR. + +2010-09-05 Mark Mitchell + + * doc/invoke.texi: Document -Wdouble-promotion. + * c-typeck.c (convert_arguments): Check for implicit conversions + from float to double. + (do_warn_double_promotion): New function. + (build_conditional_expr): Use it. + (build_binary_op): Likewise. + +2010-09-05 Richard Guenther + + PR tree-optimization/45535 + * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Properly + handle TMR_INDEX2. Make sure TMR_INDEX is not NULL before + dereferencing it. + (indirect_refs_may_alias_p): Likewise. + +2010-09-05 Naveen H.S + + * config/sh/sh.c (sh_option_override): Make static. + Adjust comments. Declare. + (sh_function_value_regno_p): Likewise. + (sh_register_move_cost): Modify the arguments, make static. + Adjust comments. Declare. + (TARGET_OPTION_OVERRIDE, TARGET_REGISTER_MOVE_COST + TARGET_FUNCTION_VALUE_REGNO_P): Define. + * config/sh/sh.h (OVERRIDE_OPTIONS, FUNCTION_VALUE_REGNO_P + REGISTER_MOVE_COST): Delete. + * config/sh/sh-protos.h (sh_override_options): Delete. + (sh_register_move_cost): Delete. + (sh_function_value_regno_p): Delete. + +2010-09-04 Anatoly Sokolov + + * config/m32r/m32r.c (m32r_function_value, m32r_libcall_value, + m32r_function_value_regno_p): New functions. + (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE, + TARGET_FUNCTION_VALUE_REGNO_P): Declare. + * config/m32r/m32r.h: (FUNCTION_VALUE, LIBCALL_VALUE, + FUNCTION_VALUE_REGNO_P): Remove. + +2010-09-04 Jan Hubicka + + * gimple-fold.c (maybe_fold_reference): Use fold_const_aggregate_ref. + * tree-ssa-ccp.c (fold_const_aggregate_ref): Use + fold_read_from_constant_string. + + * gimple.h (canonicalize_constructor_val): Declare. + * gimple-fold.c (canonicalize_constructor_val): New function. + (get_symbol_constant_value):Use it. + * tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise. + +2010-09-04 Jan Hubicka + + * tree-switch-conversion.c (build_one_array): Set constructor to be + static. + * varpool.c (varpool_finalize_decl): Compute const_value_known. + +2010-09-04 Richard Guenther + + PR bootstrap/45519 + * tree-flow.h (force_gimple_operand_1): Declare. + (force_gimple_operand_gsi_1): Likewise. + * gimplify.c (force_gimple_operand_1): New worker taking a + gimple predicate for ... + (force_gimple_operand): ... which now wraps it. + (force_gimple_operand_gsi_1, force_gimple_operand_gsi): Likewise. + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Revert + last change. + * tree-ssa-address.c (gimplify_mem_ref_parts): Use + force_gimple_operand_gsi_1 with is_gimple_mem_ref_addr. + (create_mem_ref): Likewise. + +2010-09-04 Uros Bizjak + + * config/i386/predicates.md (sse_reg_operand): New predicate. + * config/i386/i386.md (TFmode push splitter): Use sse_reg_operand + predicate for operand 1. + (XFmode push splitter): Use fp_register_operand predicate + for operand 1. + (*dummy_extendsfdf2, *dummy_extendsfxf2): Remove disabled patterns. + (SF-DF float_extend push splitter): Add reload_completed insn + predicate. + ({SF,DF}-XF float_extend_push splitter): Macroize splitter using + MODEF mode macro. Add reload_completed insn predicate. + +2010-09-04 Paolo Bonzini + + * df.h (enum df_ref_class): Remove DF_REF_EXTRACT. + (struct df_extract_ref): Remove. + (union df_ref_d): Remove extract_ref member. + (df_ref_create): Remove last three arguments. + (DF_REF_LOC): Remove DF_REF_EXTRACT case. + * df-scan.c (df_ref_record): Remove last three arguments, do not + pass them to df_ref_create_structure. + (df_uses_record): Remove first and last three arguments. Replace + first argument with DF_REF_REGULAR, adjust calls to remove the + width, offset and mode. Always call recursively on the second + and third argument of ZERO_EXTRACT and SIGN_EXTRACT. + (df_ref_create_structure): Remove first argument. + (struct df_scan_problem_data): Remove ref_extract_pool. + (df_scan_free_internal): Do not free it. + (df_scan_alloc): Do not allocate it. + (df_ref_create): Remove last three arguments, do not pass them to + df_ref_create_structure. + (df_free_ref): Remove DF_REF_EXTRACT case. + (df_notes_rescan): Adjust call to df_uses_record. + (df_ref_equal_p, df_ref_compare, df_ref_create_structure): + Remove DF_REF_EXTRACT case. + (df_def_record_1): Do not special case class for a ZERO_EXTRACT lhs. + Adjust calls to df_ref_record, using DF_REF_REGULAR for all REG + and SUBREG definitions. + (df_get_conditional_uses): Remove references to width/offset/mode, + adjust call to df_ref_create_structure. + (df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect, + df_entry_block_defs_collect, df_exit_block_uses_collect): Adjust + calls to df_uses_record and df_ref_record. + * fwprop.c (update_df): Remove references to width/offset/mode, + adjust call to df_ref_create. + +2010-09-03 Jan Hubicka + + * ipa.c (build_cdtor): Take VECtor as argument; fix array walk. + (build_cdtor_fns): Update use of build_cdtor. + +2010-09-03 Joseph Myers + + * doc/options.texi (SeparateAlias): Document. + * opt-functions.awk (switch_flags): Handle SeparateAlias. + * opth-gen.awk: Generate enumeration names for options marked + SeparateAlias, but not for those marked Ignore. + * opts-common.c (generate_canonical_option): Don't output separate + argument for options marked CL_SEPARATE_ALIAS. + (decode_cmdline_option): Handle CL_SEPARATE_ALIAS. + * opts.h (CL_SEPARATE_ALIAS): New. + (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_DRIVER, CL_TARGET, + CL_COMMON): Adjust definitions. + * config/i386/darwin.opt, config/mips/sde.opt: New. + * common.opt (fdump-final-insns): New. + * config.gcc (i[34567]86-*-darwin*, x86_64-*-darwin*): Add + i386/darwin.opt. + (mips*-sde-elf*): Add mips/sde.opt. + * config/mips/sde.h (DRIVER_SELF_SPECS): Don't handle + -mno-data-in-code and -mcode-xonly here. + * defaults.h (DEFAULT_SWITCH_TAKES_ARG): Add 'd'. + * gcc.c (option_map): Add "j" to --dump entry. + (translate_options): Don't translate -d to -foutput-class-dir= here. + +2010-09-03 Sebastian Pop + + * tree-data-ref.c (dr_may_alias_p): Replace !DR_IS_READ with + DR_IS_WRITE. + (compute_all_dependences): Same. + (create_rdg_edge_for_ddr): Same. + * tree-data-ref.h (DR_IS_WRITE): New. + (ddr_is_anti_dependent): Replace !DR_IS_READ with DR_IS_WRITE. + * tree-if-conv.c (write_memrefs_written_at_least_once): Same. + (write_memrefs_written_at_least_once): Same. + * tree-predcom.c (suitable_component_p): Same. + (determine_roots_comp): Same. + (execute_load_motion): Same. + * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Same. + (vect_enhance_data_refs_alignment): Same. + (vect_analyze_group_access): Same. + +2010-09-03 Joern Rennecke + + PR testsuite/42843 + * Makefile.in (PLUGINCC): Define in terms of @CC@ / @CXX@ + (PLUGINCFLAGS): Define in terms of @CFLAGS@ / @CXXFLAGS@ + +2010-09-03 Marcin Baczynski + + * dwarf2out.c (file scope): Remove #if0'd code. + (gen_subprogram_die): Same. + +2010-09-03 Jakub Jelinek + + PR middle-end/45484 + * dwarf2out.c (flush_queued_reg_saves): Rename to... + (dwarf2out_flush_queued_reg_saves): ... this. No longer static. + (dwarf2out_frame_debug_expr, dwarf2out_frame_debug): Adjust callers. + * dwarf2out.h (dwarf2out_flush_queued_reg_saves): New prototype. + * config/i386/i386.c (output_set_got): Call it. + +2010-09-03 Michael Matz + + PR middle-end/45415 + * tree-sra.c (sra_modify_assign): If we modify the statement, + say so. + + * tree-ssa.c (verify_ssa): Check number of operands and links + per statement to agree. + +2010-09-03 Uros Bizjak + Iain Sandoe + + PR target/45476 + * config/i386/t-darwin (LIB2FUNCS_EXCLUDE): New. + * config/i386/darwin.h (LIBGCC2_HAS_TF_MODE, + LIBGCC2_TF_CEXT, TF_SIZE): New defines. + +2010-09-03 Richard Guenther + + * lto-streamer-out.c (output_function): Output function + start and end loci. + * lto-streamer-in.c (input_function): Input function start + and end loci. + +2010-09-03 Andreas Krebbel + + * configure.ac: Use the GCC_AC_ENABLE_DECIMAL_FLOAT macro. + * Makefile.in: Add aclocal.m4 dependency to dfp.m4. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2010-09-03 Jan Hubicka + + PR lto/44812 + * lto-cgraph.c (intput_node, input_varpool_node): Set DECL_EXTERNAL + on functions/variables in other partition. + +2010-09-03 Jan Hubicka + + * cgraph.h (struct varpool_node): Add const_value_known. + (varpool_decide_const_value_known): Declare. + * tree-ssa-ccp.c (fold_const_aggregate_ref): Update initializer folding. + * lto-cgraph.c (lto_output_varpool_node): Store const_value_known. + (input_varpool_node): Restore const_value_known. + * tree-ssa-loop-ivcanon (constant_after_peeling): Check varpool for + initializer folding. + * ipa.c (ipa_discover_readonly_nonaddressable_var, + function_and_variable_visibility): Compute const_value_known. + * gimple-fold.c (get_symbol_constant_value): Use varpool for + initializer folding. + * varpool.c (varpool_decide_const_value_known): New function. + +2010-09-03 Uros Bizjak + + * config/i386/i386.md: Remove empty preparation statements + from splitters. + +2010-09-03 Jan Hubicka + + * passes.c (rest_of_decl_compilation): Do not add local vars into + varpool. + * varpool.c (varpool_get_node, varpool_node): Sanity check that only + static or extern vars are in varpool. + (varpool_finalize_decl): Sanity check that only static vars are + finalized. + +2010-09-03 Jakub Jelinek + + PR debug/45500 + * dwarf2out.c (rtl_for_decl_init): Give up for all generic vectors, + not just generic vectors with BLKmode. + +2010-09-03 Richard Guenther + + * tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE. + Move TMR_OFFSET to second operand. Add TMR_INDEX2. + * tree.h (TMR_SYMBOL): Remove. + (TMR_BASE, TMR_OFFSET): Adjust. + (TMR_INDEX2): New. + * alias.c (ao_ref_from_mem): Use TMR_BASE. + * builtins.c (get_object_alignment): Merge TMR_BASE and + TMR_SYMBOL handling. + * cfgexpand.c (expand_debug_expr): Use TMR_BASE. + * gimple.c (get_base_address): Merge MEM_REF and TARGET_MEM_REF + handling. Also allow TARGET_MEM_REF as base address. + (walk_stmt_load_store_addr_ops): TMR_BASE is always non-NULL. + * gimplify.c (gimplify_expr): Gimplify TMR_BASE like MEM_REF + base. Gimplify TMR_INDEX2. + * tree-cfg.c (verify_types_in_gimple_reference): Adjust. + * tree-dfa.c (get_ref_base_and_extent): Likewise. + (get_addr_base_and_unit_offset): Likewise. + * tree-eh.c (tree_could_trap_p): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-ssa-address.c (tree_mem_ref_addr): Simplify. Handle TMR_INDEX2. + (create_mem_ref_raw): Merge symbol and base. Move 2ndary + base to index2. + (get_address_description): Reconstruct addres description + from merged TMR_BASE and TMR_INDEX2. + (maybe_fold_tmr): Fold propagated addresses. + * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Merge + MEM_REF and TARGET_MEM_REF paths. + (indirect_refs_may_alias_p): Likewise. + * tree-ssa-live.c (mark_all_vars_used_1): Handle TMR_INDEX2 + instead of TMR_SYMBOL. + * tree-ssa-operands.c (get_tmr_operands): Simplify. + * tree-ssa-pre.c (create_component_ref_by_pieces_1): Adjust + according to changes ... + * tree-ssa-sccvn.c (copy_reference_ops_from_ref): ... here. + Split TARGET_MEM_REF into two fields plus the base. + * tree.c (mem_ref_offset): Simplify. + * tree-ssa-loop-im.c (for_each_index): Handle TMR_INDEX2. + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. + Strip NOPs when folding MEM_REF addresses. + * tree-ssa-sink.c (is_hidden_global_store): Handle TARGET_MEM_REF. + * gimple-fold.c (maybe_fold_reference): Fold TARGET_MEM_REF here ... + (fold_gimple_assign): ... not here. + +2010-09-03 Mingjie Xing + + * config/mips/mips.h (SHIFT_COUNT_TRUNCATED): Change the definition. + * config/mips/mips.c (mips_shift_truncation_mask): New function. + (TARGET_SHIFT_TRUNCATION_MASK): Define. + +2010-09-02 Richard Henderson + + * configure.ac (gcc_cv_as_cfi_advance_working): Use objdump + instead of readelf in the test. + (gcc_cv_as_cfi_sections_directive): Check for correct relocation + in the .debug_frame section for coff targets. + * configure: Rebuild. + +2010-09-02 Anatoly Sokolov + + * config/m32c/m32c.h (CLASS_LIKELY_SPILLED_P): Remove. + * config/m32c/m32c-protos.h (m32c_class_likely_spilled_p): Remove. + * config/m32c/m32c.c (TARGET_CLASS_LIKELY_SPILLED_P): Define. + (m32c_class_likely_spilled_p): Make static. Change argument type to + reg_class_t. Change result type to bool. + +2010-09-02 Michael Meissner + + * config/rs6000/rs6000.opt (-mfriz): New switch to control whether + to convert (double)(long) into a single FRIZ instruction or not + when -ffast-math is used. + + * config/rs6000/vsx.md (VSX_DF): New iterator for DF/V2DF modes. + (vsx_float_fix_2): Optimize (double)(long) into X{S,V}RDPIZ + or FRIZ instruction if -ffast-math. + * config/rs6000/rs6000.md (friz): Ditto. + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mfriz. + +2010-09-02 Joseph Myers + + * opth-gen.awk (quote, comma): Remove unused variables. + +2010-09-02 Ryan Mansfield + + * arm.c (arm_override_options): Correct fall-back code to use + SUBTARGET_CPU_DEFAULT. + +2010-09-02 Julian Brown + + * config/arm/neon.md (UNSPEC_VCLE, UNSPEC_VCLT): New constants for + unspecs. + (vcond, vcondu): New expanders. + (neon_vceq, neon_vcge, neon_vcgt): Support + comparisons with zero. + (neon_vcle, neon_vclt): New patterns. + * config/arm/constraints.md (Dz): New constraint. + +2010-09-02 Anatoly Sokolov + + * target.def (class_likely_spilled_p): New hook. + * doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Document. + * doc/tm.texi: Regenerate. + * targhooks.c (default_class_likely_spilled_p): New function. + * targhooks.h (default_class_likely_spilled_p): Declare. + * regs.h (CLASS_LIKELY_SPILLED_P): Remove. + * combine.c (cant_combine_insn_p, likely_spilled_retval_p): Use + TARGET_CLASS_LIKELY_SPILLED_P target hook. Use HARD_REGISTER_P macro. + Use fixed_reg_set instead of fixed_regs. + * cse.c (hash_rtx_cb): Use TARGET_CLASS_LIKELY_SPILLED_P target hook. + * calls.c (avoid_likely_spilled_reg): Ditto. + * ira-conflicts.c (ira_build_conflicts): Ditto. + * ira.c (update_equiv_regs): Ditto. + * mode-switching.c (create_pre_exit): Ditto. + * regmove.c (find_matches): Ditto. + (regclass_compatible_p): Use TARGET_CLASS_LIKELY_SPILLED_P target hook. + * reload.c (SMALL_REGISTER_CLASS_P): Remove macro. + (small_register_class_p): New inline function. + (push_secondary_reload, find_reusable_reload, find_reloads): Use + small_register_class_p instead of SMALL_REGISTER_CLASS_P. + + * config/i386/i386.h (CLASS_LIKELY_SPILLED_P): Remove. + * config/i386/i386.c (ix86_class_likely_spilled_p): New. + (TARGET_CLASS_LIKELY_SPILLED_P): Define. + +2010-09-02 Richard Guenther + + PR tree-optimization/44937 + PR tree-optimization/45412 + * ipa-split.c (split_function): Properly remove PHI nodes. + +2010-09-02 Joseph Myers + + * opts.h (struct cl_option): Add warn_message field. + (struct cl_decoded_option): Add warn_message field. + * doc/options.texi (Ignore, Warn): Document. + * opt-functions.awk (needs_state_p): Don't consider aliases or + ignored options to need state saved. + * optc-gen.awk: Handle Warn and Ignore. + * opth-gen.awk: Output OPT_SPECIAL_ignore. + * opts-common.c (decode_cmdline_option): Set warn_message field. + Handle ignored options. + (decode_cmdline_options_to_array, generate_option, + generate_option_input_file): Set warn_message field. + (read_cmdline_option): Generate warnings from warn_message field. + Handle ignored options. + * common.opt (Wunreachable-code, fargument-alias, + fargument-noalias, fargument-noalias-global, + fargument-noalias-anything, fcse-skip-blocks, fforce-addr, + floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee, + fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop, + ftree-salias): Mark Ignore. + * config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu, + -mintel-syntax and -mno-intel-syntax here. + * config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases + using Warn. + * opts.c (common_handle_option): Don't handle options marked as + ignored. + (enable_warning_as_error): Handle ignored options. + +2010-09-02 Joseph Myers + + PR driver/44076 + * opts.h (struct cl_option): Add alias_arg, neg_alias_arg and + alias_target fields. + * opt-functions.awk (opt_sanitized_name): Don't handle + finline-limit=, Wlarger-than= and ftemplate-depth= specially. + * optc-gen.awk: Generate alias fields. + * opth-gen.awk: Explicitly give values for OPT_* enum constants. + Don't generate such constants for aliases. + * opts-common.c (generate_canonical_option): New. + (decode_cmdline_option): Handle aliases. Use + generate_canonical_option for known options instead of copying the + input option text. + * doc/options.texi (Alias): Document. + * common.opt (W, Wlarger-than-, aux-info=, finline-limit-, + fstack-check, specs): Mark as aliases. + * gcc.c (driver_handle_option): Canonicalize -L options to joined + arguments. + (driver_handle_option): Don't handle OPT_specs. + * opts.c (common_handle_option): Don't handle options marked as + aliases. + (enable_warning_as_error): Handle aliases. + * stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of + OPT_Wlarger_than_eq. + * tree-optimize.c (tree_rest_of_compilation): Use + OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq. + +2010-09-02 Uros Bizjak + + * config/i386/i386.md (nonmemory_operand): New mode attribute. + (push memory peephole2): Macroize peepholes using SWI mode iterator. + (move immediate to memory peephole2): Macroize peepholes using + SWI124 mode iterator. + (non-pairable NOT peephole2): Macroize peepholes using SWI124 + mode iterator. + (simple lea add peephole2): Macroize peepholes using SWI48 + mode iterator. + (simple lea mult peephole2): Ditto. + (imul by 3,5,9 to lea peephole2): Ditto. + (mov $-1, reg peephole2): Macroize peepholes using SWI248 + mode iterator. + (imul $32bit_imm,mem,reg peephole2): Ditto. + (imul $8/16bit_imm,regmem,reg peephole2): Ditto. + +2010-09-02 Ian Bolton + + * tree-ssa-loop-prefetch.c: Fix comment at head of file. + +2010-09-02 Olivier Hainque + + PR middle-end/44763 + * ira-color.c (SORTGT): New macro, helper for qsort callbacks. + (allocno_priority_compare_func): Use it instead of a straight + difference computation over priorities. + +2010-09-02 Andi Kleen + + * opts.c (common_handle_option): Fix OPT_fwhopr/fwhopr_ handling. + +2010-09-02 Ira Rosen + + * tree-vectorizer.h (get_later_stmt): New function. + (vect_analyze_data_ref_dependences): Add argument. + * tree-vect-loop.c (vect_analyze_loop): Update call to + vect_analyze_data_ref_dependences. + * tree-vect-data-refs.c (vect_drs_dependent_in_basic_block): + New function. + (vect_analyze_data_ref_dependence): Add argument for basic block + dependencies. Check dependencies in basic block vectorization. + (vect_analyze_data_ref_dependences): Add argument and update call to + vect_analyze_data_ref_dependences. + * tree-vect-slp.c (vect_find_last_store_in_slp_instance): New. + (vect_bb_vectorizable_with_dependencies): New. + (vect_slp_analyze_bb): Check dependencies in basic block. + (vect_schedule_slp_instance): Insert stores before the last store in + SLP instance. + +2010-09-02 Uros Bizjak + + PR target/45476 + * config/i386/freebsd.h (LIBGCC2_HAS_TF_MODE, + LIBGCC2_TF_CEXT, TF_SIZE): New defines. + +2010-09-01 Jakub Jelinek + + PR middle-end/45458 + * bb-reorder.c (add_labels_and_missing_jumps): Treat + bbs ending with throwing insns like blocks ending with a call. + (fix_up_fall_thru_edges): Likewise. + +2010-09-01 Nathan Froyd + + * config/m32c/m32c-protos.h (m32c_function_arg): Delete. + (m32c_function_arg_advance): Delete. + * config/m32c/m32c.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/m32c/m32c.c (m32c_function_arg): Make static. Adjust + comments. Take a const_tree and a bool. Declare. + (m32c_function_arg_advance): Likewise. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-09-01 Uros Bizjak + + PR target/45476 + * config/i386/cygming.h (LIBGCC2_HAS_TF_MODE, + LIBGCC2_TF_CEXT, TF_SIZE): Move from ... + * config/i386/mingw32.h: ... here. + +2010-09-01 Andi Kleen + + PR lto/45475 + * lto-streamer-in.c (lto_input_ts_target_option): Add. + (lto_input_tree_pointers): Call lto_input_ts_target_option. + * lto-streamer-out (lto_output_ts_target_option): Add. + (lto_output_tree_pointers): Call lto_output_ts_target_option. + +2010-09-01 Kai Tietz + + PR/target 45452 + * config/i386/cygwin.h: Change order of specified import libraries. + * config/i386/mingw32.h: Likewise. + * config/i386/t-cygwin: Likewise. + * config/i386/t-mingw32: Likewise. + * config/i386/t-mingw-w32: Likewise. + * config/i386/t-mingw-w64: Likewise. + +2010-09-01 Ramana Radhakrishnan + + * config/arm/neon-schedgen.ml (core): New type. + (allCores): List of supported cores. + (availability_table): Add supported cores. + (collate_bypasses): Accept core as a parameter. + (worst_case_latencies_and_bypasses): Accept core as a parameter. + (emit_insn_reservations): Accept core as a parameter. Use tuneStr + and coreStr to get tune attribute and prefix for functional units. + (emit_bypasses): Accept core name and use it. + (calculate_per_core_availability_table): New. + (filter_core): New. + (calculate_core_availability_table): New. + (main): Use calculate_core_availablity_table. + * config/arm/cortex-a8-neon.md: Update copyright year. + Regenerated from ml file and merged in. + (neon_mrrc, neon_mrc): Rename to cortex_a8_neon_mrrc and + cortex_a8_neon_mrc. + +2010-09-01 Ian Bolton + + * Makefile.in (tree-switch-conversion.o): Update dependencies. + +2010-09-01 Richard Guenther + + * alias.c (ao_ref_from_mem): Adjust. + * builtins.c (get_object_alignment): Likewise. + * cfgexpand.c (expand_debug_expr): Likewise. + * gimple.c (get_base_address): Likewise. + * tree-dfa.c (get_ref_base_and_extent): Likewise. + (get_addr_base_and_unit_offset): Likewise. Fix for + both TMR_SYMBOL and TMR_BASE being set. + * tree-eh.c (tree_could_trap_p): Likewise. + * gimplify.c (gimplify_expr): Do not attempt to gimplify + TMR_SYMBOL. Always gimplify TMR_BASE. + * tree-cfg.c (verify_types_in_gimple_reference): Verify + TMR_BASE if there is a TMR_SYMBOL. + * tree-pretty-print.c (dump_generic_node): Adjust. + * tree-ssa-address.c (addr_for_mem_ref): Likewise. + (tree_mem_ref_addr): Likewise. + (create_mem_ref_raw): Likewise. + (move_fixed_address_to_symbol): Likewise. + (create_mem_ref): Likewise. + (dump_mem_address): Likewise. + * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust. + Fix for both TMR_SYMBOL and TMR_BASE being set. + (indirect_refs_may_alias_p): Likewise. + * tree-ssa-operands.c (get_tmr_operands): Adjust. + * tree.def (TARGET_MEM_REF): Adjust documentation. + +2010-09-01 Uros Bizjak + + * config/i386/i386.h (enum ix86_tune_indices) : + Rename from X86_TUNE_ADD_ESP_4. + : Rename from X86_TUNE_ADD_ESP_8. + : Rename from X86_TUNE_SUB_ESP_4. + : Rename from X86_TUNE_SUB_ESP_8. + (TARGET_SINGLE_POP): Rename from TARGET_ADD_ESP_4. + (TARGET_DOUBLE_POP): Rename from TARGET_ADD_ESP_8. + (TARGET_SINGLE_PUSH): Rename from TARGET_SUB_ESP_4. + (TARGET_DOUBLE_POP): Rename from TARGET_SUB_ESP_8. + * config/i386/i386.c (initial_ix86_tune_features) + : Invert members. + : Ditto. + : Ditto. + : Ditto. + * config/i386/i386.md (*pop1): Rename from pop1. + No longer exported. + (push peephole2 patterns): Macroize peepholes using P mode iterator. + Adjust for renamed TARGET_{SINGLE,DOUBLE}_PUSH defines. + (pop peephole2 patterns): Macroize peepholes using P mode iterator. + Adjust for renamed TARGET_{SINGLE,DOUBLE}_POP defines. + +2010-09-01 Eric Botcazou + + * gimplify.c (gimplify_init_constructor): Do not create a temporary for + a volatile LHS if the constructor has only one element. + +2010-09-01 Mikael Pettersson + + PR bootstrap/45321 + * tree.c (stdarg_p): Make fntype parameter const. + * tree.h (stdarg_p): Likewise. + (function_args_iterator): Remove unused fntype field. + (function_args_iter_init): Do not initialize fntype + field. Make fntype parameter const. + +2010-09-01 Richard Guenther + + * tree-vrp.c (adjust_range_with_scev): Use number of iteration + estimate. + (vrp_visit_phi_node): Delay using SCEV till we balloon the range. + (execute_vrp): Compute number of iteration estimates. + * cfgloop.h (estimate_numbers_of_iterations_loop): Adjust prototype. + * tree-flow.h (estimate_numbers_of_iterations): Likewise. + * tree-data-ref.c (estimated_loop_iterations): Adjust. + * tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): + Infer loop bounds from undefined behavior based on a new parameter. + (estimate_numbers_of_iterations): Likewise. + (scev_probably_wraps_p): Adjust. + * tree-ssa-loop.c (tree_ssa_loop_bounds): Likewise. + +2010-09-01 Nick Clifton + + * config/stormy16/stormy16.c: Use REG_P, MEM_P and CONST_INT_P + where appropriate. + (xstormy16_legitimate_address_p): Use true and false instead of 1 + and 0. + (xstormy16_expand_prologue): Delete unused local variable 'insn'. + (xstormy16_function_arg): Use FIRST_ARGUMENT_REGNUM in place of + magic constant 2. + (xstormy16_expand_call): Fix comment at start of function. + +2010-09-01 Nick Clifton + + * config/rx/rx.c (rx_expand_prologue): Do not adjust frame size + when pushing accumulator register. + (rx_get_stack_layout): Always save call clobbered registers inside + interrupt handlers. + * config/rx/rx-modes.def: Fix descriptive comment at start of file. + +2010-09-01 Uros Bizjak + + * config.gcc (i[34567]86-*-freebsd*, x86_64-*-freebsd*): Add + i386/t-fprules-softfp and soft-fp/t-softfp to tmake_file. + + * libgcc-std.ver (GCC_4.6.0): Define version. + +2010-08-31 Eric Botcazou + + * tree-nested.c (convert_all_function_calls): Iterate until after the + sum of static chains in the nest doesn't change. + +2010-08-31 Anatoly Sokolov + + * config/m32c/m32c.c (classes_intersect): Remove. + (m32c_preferred_reload_class, m32c_secondary_reload_class): Use + reg_classes_intersect_p instead of classes_intersect. + (class_can_hold_mode): Change arguments type from enum reg_class to + reg_class_t. Use reg_class_contents instead of class_contents. + (m32c_register_move_cost): Make static. Change arguments type from + enum reg_class to reg_class_t. Use reg_classes_intersect_p instead of + classes_intersect. Use reg_class_contents instead of class_contents. + (m32c_memory_move_cost): Make static. Change arguments type from + enum reg_class to reg_class_t. + (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define. + * config/m32c/m32c.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. + * config/m32c/m32c-protos.h (m32c_register_move_cost, + m32c_memory_move_cost): Remove. + +2010-08-31 Nathan Froyd + + * config/arm/arm-protos.h (arm_function_arg_advance): Delete. + (arm_function_arg): Delete. + (arm_needs_doubleword_align): Take a const_tree. + * config/arm/arm.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/arm/arm.c (aapcs_select_call_coproc): Take a const_tree. + (aapcs_layout_arg, arm_needs_doubleword_align): Likewise. + (arm_function_arg): Make static. Take a const_tree and a bool. + (arm_function_arg_advance): Likewise. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-31 Andi Kleen + + * common.opt (fwhopr=): Update for -fwhopr=jobserver + * doc/invoke.texi (fwhopr): Document -fwhopr=jobserver. + * lto-wrapper.c (run_gcc): Add jobserver mode. + * opts.c (common_handle_option): Fix OPT_fwhopr for non numeric + argument. + +2010-08-31 Uros Bizjak + + * config/i386/i386.md (popdi1): Rewrite using POST_INC memory operand. + (popsi1): Ditto. + (*popdi1_epilogue): Ditto. + (*popsi1_epilogue): Ditto. + (popsi, popdi peephole2 patterns): Update peepholes for changed + pop{si,di}1 and *pop{si,di}1_epilogue patterns. + + (pop1): Macroize insn from pop{si,di}1 using P code iterator. + (*pop1_epilogue): Ditto from *pop{si,di}1_epilogue. + + * config/i386/i386.c (*ix86_gen_pop1): Remove indirect function. + (override_options): Do not initialize removed ix86_gen_pop1. + (gen_pop): New static function. + (ix86_expand_prologue): Use gen_pop instead of ix86_gen_pop1. + (release_scratch_register_on_entry): Ditto. + (ix86_restore_reg_using_pop): Ditto. + (ix86_expand_epilogue): Ditto. + +2010-08-31 Jakub Jelinek + + PR middle-end/45461 + * builtins.c (dummy_object): Return a MEM_REF instead of INDIRECT_REF. + +2010-08-31 Nathan Froyd + + * config/fr30/fr30.c (fr30_move_double): Delete `dregno' and extra + semicolons. + +2010-08-31 Francois-Xavier Coudert + + * doc/extend.texi: Fix documentation of the return value of + __builtin_choose_expr. + +2010-08-31 Nathan Froyd + + * config/v850/v850-protos.h (function_arg): Delete. + * config/v850/v850.h (FUNCTION_ARG): Delete. + (FUNCTION_ARG_ADVANCE): Move code to... + * config/v850/v850.c (v850_function_arg_advance): ...here. + (v850_function_arg): Make static. Take a const_tree and a bool. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-31 Nathan Froyd + + * config/m32r/m32r.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Move + these... + (ROUND_ADVANCE, ROUND_ADVANCE_ARG, ROUND_ADVANCE_CUM, PASS_IN_REG_P): + ...and these... + * config/m32r/m32r.c (m32r_function_arg, m32r_function_arg_advance): + ..to here.. + (ROUND_ADVANCE, ROUND_ADVANCE_ARG, ROUND_ADVANCE_CUM, PASS_IN_REG_P): + ...and here. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-31 Nathan Froyd + + * config/rx/rx-protos.h (rx_function_arg, rx_function_arg_size): + Delete. + * config/rx/rx.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/rx/rx.c (rx_function_arg_size): Make static. + (rx_function_arg): Likewise. + (rx_function_arg_advance): New function. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-31 John Tytgat + + * config/arm/arm.c (arm_override_options): Remove superfluous test. + Fix indentation. + +2010-08-31 Eric Botcazou + + * dwarf2out.c (gen_decl_die) : Do not skip in Ada. + (dwarf2out_decl) : Likewise. + +2010-08-30 Eric Botcazou + + Stack usage support + * common.opt (-fstack-usage): New option. + * doc/invoke.texi (Debugging options): Document it. + * builtins.c (expand_builtin_apply): Pass TRUE as 4th argument to + allocate_dynamic_stack_space. + (expand_builtin_alloca): Add 4th bool parameter CANNOT_ACCUMULATE + and propagate it to allocate_dynamic_stack_space. + (expand_builtin) : Adjust for above change. + * calls.c (initialize_argument_information): Pass TRUE as 4th + argument to allocate_dynamic_stack_space. + (expand_call): Set current_function_has_unbounded_dynamic_stack_size + to 1 when pushing a variable-sized argument onto the stack. Pass + TRUE as 4th argument to allocate_dynamic_stack_space. + Update current_function_pushed_stack_size. + (emit_library_call_value_1): Likewise. + * explow.c (allocate_dynamic_stack_space): Add 4th bool parameter + CANNOT_ACCUMULATE. If flag_stack_usage, look into the size and + attempt to find an upper bound. Remove redundant code for the + SETJMP_VIA_SAVE_AREA case. + * expr.h (allocate_dynamic_stack_space): Add 4th bool parameter. + * function.h (struct stack_usage): New structure. + (current_function_static_stack_size): New macro. + (current_function_dynamic_stack_size): Likewise. + (current_function_pushed_stack_size): Likewise. + (current_function_dynamic_alloc_count): Likewise. + (current_function_has_unbounded_dynamic_stack_size): Likewise. + (current_function_allocates_dynamic_stack_space): Likewise. + (struct function): Add new field 'su'. + * function.c (instantiate_virtual_regs): If SETJMP_VIA_SAVE_AREA, + add the value of the dynamic offset to the dynamic stack usage. + (gimplify_parameters): Set ALLOCA_FOR_VAR_P on call to BUILT_IN_ALLOCA + for variable-sized objects. + (prepare_function_start): Allocate cfun->su if flag_stack_usage. + (rest_of_handle_thread_prologue_and_epilogue): Call output_stack_usage. + * gimplify.c (gimplify_decl_expr): Set ALLOCA_FOR_VAR_P on call to + BUILT_IN_ALLOCA for variable-sized objects. + * output.h (output_stack_usage): Declare. + * toplev.c (stack_usage_file): New file pointer. + (output_stack_usage): New function. + (open_auxiliary_file): Likewise. + (lang_dependent_init): Open file if flag_stack_usage is set. + (finalize): Close file if stack_usage_file is not null. + * tree.h (ALLOCA_FOR_VAR_P): New macro. + * config/alpha/alpha.c (compute_frame_size): New function. + (alpha_expand_prologue): Use it. + (alpha_start_function): Likewise. + (alpha_expand_epilogue): Likewise. Set stack usage info. + * config/i386/i386.c (ix86_expand_prologue): Likewise. + * config/ia64/ia64.c (ia64_expand_prologue): Likewise. + * config/mips/mips.c (mips_expand_prologue): Likewise. + * config/pa/pa.c (hppa_expand_prologue): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. + * config/sparc/sparc.c (sparc_expand_prologue): Likewise. + +2010-08-30 Zdenek Dvorak + + PR tree-optimization/45427 + * tree-ssa-loop-niter.c (number_of_iterations_ne_max): Rewritten. + Handle the case that the exit is never taken correctly. + (number_of_iterations_ne): Pass exit_must_be_taken to + number_of_iterations_ne_max. + +2010-08-30 Catherine Moore + + * config/mips/mips.h (BASE_DRIVER_SELF_SPECS): + Infer -mdspr2 for the the 74K. + +2010-08-30 Jakub Jelinek + + PR debug/45419 + * tree-ssa-live.c (dump_enumerated_decls): Clear the whole wi variable. + + PR middle-end/45423 + * gimplify.c (goa_stabilize_expr): Handle TRUTH_NOT_EXPR + and TRUTH_{AND,OR,XOR}_EXPR. + * c-parser.c (c_parser_omp_atomic): Handle boolean + {PRE,POST}_{INC,DEC}REMENT. + +2010-08-30 Nathan Froyd + + * config/xtensa/xtensa-protos.h (function_arg_advance): Delete. + (function_arg): Delete. + * config/xtensa/xtensa.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + (FUNCTION_INCOMING_ARG): Delete. + * config/xtensa/xtensa.c (function_arg_advance): Rename to... + (xtensa_function_arg_advance): ...this. Make static. Take a const_tree + and a bool. + (function_arg): Rename to... + (xtensa_function_arg_1): ...this. Make static. Take a const_tree and + a bool. + (xtensa_function_arg, xtensa_function_incoming_arg): Nex functions. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + (TARGET_FUNCTION_INCOMING_ARG): Define. + +2010-08-30 Richard Guenther + + PR tree-optimization/21602 + * builtins.c (fold_builtin_memory_op): Fold memmove to memcpy + using points-to information. + +2010-08-30 H.J. Lu + + * config/linux.h (TARGET_HAS_SINCOS): Replace | with ||. + +2010-08-30 Richard Guenther + + PR tree-optimization/45449 + * tree-ssa-live.c (remove_unused_locals): Also remove address-taken + variables. + +2010-08-30 Joseph Myers + + * opts.h (CL_ERR_NEGATIVE): Define. + * opts.c (unknown_option_callback): Don't postpone warnings for + options marked with CL_ERR_NEGATIVE. + * opts-common.c (decode_cmdline_option): Set CL_ERR_NEGATIVE error + for negative versions of CL_REJECT_NEGATIVE options. + +2010-08-30 Uros Bizjak + + * config/i386/i386.md (zero_extendsidi2_1): Rename from + zero_extendsidi2_32. + (zero_extenddi2): Macroize insn from zero_extend{qi,hi}di2 + using SWI12 mode iterator. + (zero_extendhisi2_and): Merge insn pattern and corresponding spliter + to define_insn_and_split pattern. + (zero_extendqi2): Macroize expander from zero_extendqi{hi,si}2 + using SWI24 mode iterator. + (*zero_extendqi2_and): Macroize insn from + *zero_extendqi{hi,si}2_and using SWI24 mode iterator. + (*zero_extendqi2_movzbl_and): Macroize insn from + *zero_extendqihi2_movzbw_and and *zero_extendqisi2_movzbl_and using + SWI24 mode iterator. + (*zero_extendqi2_movzbl): Ditto from + *zero_extendqi{hi,si}2_movzbl. + (extendsidi2_1): Rename from extendsidi2_32. + (extenddi2): Macroize insn from extend{qi,hi}di2 using + SWI12 mode iterator. + +2010-08-29 Eric Botcazou + + * config/ia64/ia64.h (HARD_REGNO_NREGS): Return 1 for CCImode in + general purpose registers. + (HARD_REGNO_MODE_OK): Accept CCImode in general purpose registers. + * config/ia64/ia64.md (*movcci): Change to named pattern. Deal + with general purpose registers and memory operands. Add associated + CCImode post-reload splitter. + * config/ia64/div.md: Change BImode to CCImode throughout. + +2010-08-28 Eric Botcazou + + * config/ia64/ia64.md (cstorebi4): Fix thinko. + +2010-08-28 Hariharan Sandanagobalane + + * config/picochip/picochip.c (reorder_var_tracking_notes): This + function was dropping debug insns which caused PR45299. + +2010-08-28 Uros Bizjak + + * config/i386/sse.md (extsuffix): New code attribute. + (sse4_1_v8qiv8hi2): Macroize insn from sse4_1_extendv8qiv8hi2 + and sse4_1_zero_extendv8qiv8hi2 using any_extend code iterator. + (sse4_1_v4qiv4si2): Ditto from sse4_1_extendv4qiv4si2 + and sse4_1_zero_extendv4qiv4si2. + (sse4_1_v2qiv2di2): Ditto from sse4_1_extendv2qiv2di2 + and sse4_1_zero_extendv2qiv2di2. + (sse4_1_v4hiv4si2): Ditto from sse4_1_extendv4hiv4si2 + and sse4_1_zero_extendv4hiv4si2. + (sse4_1_v2hiv2di2): Ditto from sse4_1_extendv2hiv2di2 + and sse4_1_zero_extendv2hiv2di2. + (sse4_1_extendv2siv2di2): Ditto from sse4_1_extendv2siv2di2 + and sse4_1_zero_extendv2siv2di2 + + (mulv8hi3_highpart): Macroize expander from {u,s}mulv8hi3_highpart + using any_extend code iterator. + (*avx_mulv8hi3_highpart): Macroize insn from + *avx_{u,s}mulv8hi3_highpart using any_extend code iterator. + (*mulv8hi3_highpart): Ditto from *{u,s}mulv8hi3_highpart. + + * config/i386/i386.c (ix86_expand_sse4_unpack): Update for renamed + gen_sse4_1_sign_extend* functions. + (struct builtin_description bdesc_args): Ditto. + +2010-08-27 Xinliang David Li + + PR/45422 + * tree-ssa-loop-ivopts.c (iv_ca_get_num_inv_exprs): Remove. + (iv_ca_set_no_cp): Update used inv expr count. + (iv_ca_set_cp): Ditto. + (iv_ca_new): Initialize new member. + (iv_ca_free): Free memory. + +2010-08-27 Nathan Froyd + + * config/sh/sh-protos.h (sh_function_arg): Delete. + (sh_function_arg_advance): Delete. + * config/sh/sh.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + (PASS_IN_REG_P): Eliminate cast. + * config/sh/sh.c (sh_function_arg_advance): Make static. Take a + const_tree and a bool. + (sh_function_arg): Likewise. + (sh_output_mi_thunk): Call sh_function_arg_advance) and + sh_function_arg. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-27 Naveen H.S + Kaz Kojima + + * config/sh/sh.c (push_regs): Emit movml for interrupt handler + when possible. + (sh_expand_epilogue): Likewise. + * config/sh/sh.md (movml_push_banked): New insn. + (movml_pop_banked): Likewise. + +2010-08-28 Bernd Schmidt + + * genautomata.c (gen_regexp_repeat, gen_regexp_allof, + gen_regexp_oneof, gen_regexp_sequence): Use the string found + in vector element 0 rather than the original string when there's + only one element. + (gen_regexp): Remove extra semicolon. + + * config/arm/vfp.md (arm_movsi_vfp, thumb2_movsi_vfp, movsf_vfp, + thumb2_movsf_vfp): Set attribute "insn". + * config/arm/arm.md (arm_ashrdi3_1bit, arm_lshrdi3_1bit, not_shiftsi, + not_shiftsi_compare0, not_shiftsi_compare0_scratch, arm_one_cmplsi2, + thumb1_one_cmplsi2, notsi_compare0, notsi_compare0_scratch, + arm_zero_extendsidi2, arm_extendsidi2, thumb1_movdi_insn, + arm_movsi_insn, movhi_insn_arch4, movhi_bytes, arm_movqi_insn, + thumb1_movqi_insn arm32_movhf, thumb1_movhf, arm_movsf_soft_insn, + thumb1_movsf_insn, thumb_movdf_insn, mov_scc, mov_negscc, mov_notscc, + movsicc_insn, movsfcc_soft_insn, and_scc, cond_move, if_move_not, + if_not_move, if_shift_move, if_move_shift, if_shift_shift, + if_not_arith, if_arith_not, cond_move_not): Likewise. + +2010-08-23 Michael Meissner + + * config/rs6000/rs6000-protos.h (rs6000_address_for_fpconvert): + New declaration. + (rs6000_allocate_stack_temp): Ditto. + (rs6000_expand_convert_si_to_sfdf): Ditto. + + * config/rs6000/rs6000.c (rs6000_override_options): Adjust long + line. Update the options set if power6 or power7 server/embedded + type options are used. If we give a warning for no vsx under + -mcpu=power7 -mno-altivec, mark -mvsx as an explicit option. + (rs6000_allocate_stack_temp): New function to allocate a stack + tempoary and adjust the address so it meets either REG+OFFSET or + REG+REG addressing requirements. + (rs6000_address_for_fpconvert): Adjust REG+OFFSET addresses so + that they can be used with the LFIWAX/LFIWZX instrucitons. + (rs6000_expand_convert_si_to_sfdf): New helper funciton for + converting signed/unsigned SImode to either SFmode/DFmode. + + * config/rs6000/rs6000.h (TARGET_FCFID): New macros to determine + whether certain instructions can be generated. + (TARGET_FCTIDZ): Ditto. + (TARGET_STFIWX): Ditto. + (TARGET_LFIWAX): Ditto. + (TARGET_LFIWZX): Ditto. + (TARGET_FCFIDS): Ditto. + (TARGET_FCFIDU): Ditto. + (TARGET_FCFIDUS): Ditto. + (TARGET_FCTIDUZ): Ditto. + (TARGET_FCTIWUZ): Ditto. + + * config/rs6000/rs6000.md (UNSPEC_FCTIW): New unspec constants. + (UNSPEC_FCTID): Ditto. + (UNSPEC_LFIWAX): Ditto. + (UNSPEC_LFIWZX): Ditto. + (UNSPEC_FCTIWUZ): Ditto. + (rreg): Use correct constraints. + (SI_CONVERT_FP): New mode attribute for floating point conversion + tests. + (E500_CONVERT): Ditto. + (lfiwax): New insns for converting from integer to floating point + utilizing newer instructions. Attempt to optimize conversions + that come from memory so that we don't load the value into a GPR, + spill it to the stack and reload it into a FPR. + (floatsi2_lfiwax): Ditto. + (floatsi2_lfiwax_mem): Ditto. + (floatsi2_lfiwax_mem2): Ditto. + (lfiwzx): Ditto. + (floatunssi2_lfiwzx): Ditto. + (floatunssi2_lfiwzx_mem): Ditto. + (floatunssi2_lfiwzx_mem2): Ditto. + (floatdidf2_mem): Ditto. + (floatunsdidf2_fcfidu): Ditto. + (floatunsdidf2_mem): Ditto. + (floatunsdisf2): Ditto. + (floatunsdisf2_fcfidus): Ditto. + (floatunsdisf2_mem): Ditto. + (floatsidf2): Add support for LFIWAX/LFIWZX/FCFIDS/FCFIDU/FCFIDUS. + Use FCFID on 32-bit hosts that support it. + (floatsidf2_internal): Ditto. + (floatunssisf2): Ditto. + (floatunssidf2): Ditto. + (floatunssidf2_internal): Ditto. + (floatsisf2): Ditto. + (floatdidf2): Ditto. + (floatdidf2_fpr): Ditto. + (floatunsdidf2): Ditto. + (floatdisf2): Ditto. + (floatdisf2_fcfids): Ditto. + (floatdisf2_internal1): Ditto. + (fixuns_truncsfsi2): Delete, merge into common pattern for both + SF/DF. Add power7 support. + (fix_truncsfsi2): Ditto. + (fixuns_truncdfsi2): Ditto. + (fixuns_truncdfdi2): Ditto. + (fix_truncdfsi2): Ditto. + (fix_truncdfsi2_internal): Ditto. + (fix_truncdfsi2_internal_gfxopt): Ditto. + (fix_truncdfsi2_mfpgpr): Ditto. + (fctiwz): Ditto. + (btruncdf2): Ditto. + (btruncdf2_fpr): Ditto. + (btructsf2): Ditto. + (ceildf2): Ditto. + (ceildf2_fpr): Ditto. + (ceilsf2): Ditto. + (floordf2): Ditto. + (floordf2_fpr): Ditto. + (floorsf2): Ditto. + (rounddf2): Ditto. + (rounddf2_fpr): Ditto. + (roundsf2): Ditto. + (fix_truncsi2): Combine SF/DF conversion into one insn. + (fix_truncdi2): Ditto. + (fixuns_truncsi2): Ditto. + (fixuns_truncdi2): Ditto. + (fctiwz_): Ditto. + (btrunc2): Ditto. + (btrunc2_fpr): Ditto. + (ceil2): Ditto. + (ceil2_fpr): Ditto. + (floor2): Ditto. + (float2_fpr): Ditto. + (round2): Ditto. + (round2_fpr): Ditto. + (fix_truncsi2_stfiwx): New insn for machines with STFIWX. + (fixuns_truncsi2_stfiwx): Ditto. + (fix_truncdfsi2_internal): Ditto. + (fix_truncsi2_mem): Combiner pattern to eliminate storing + converted value on stack, loaded into GPR, and then stored into + the final destination. + (fix_truncdi2_fctidz): New pattern for targets supporting + FCTIDZ. + (lrintdi2): New insn, provide the lrint builtin functions. + (ftruncdf2): Delete, unused. + (fix_trunctfsi2_internal): Use gen_fctiwz_df, not gen_fctiwz. + + * config/rs6000/vsx.md (toplevel): Update copyright year. + (VSr2): Use "ws" contraint for DFmode, not "!r#r". + (VSr3): Ditto. + +2010-08-27 Basile Starynkevitch + Jeremie Salvucci + + * gengtype.c (output_type_enum): Test the right union member. + +2010-08-27 Uros Bizjak + + PR target/41484 + * config/i386/sse.md (sse4_1_extendv8qiv8hi2): Also accept memory + operands for operand 1. + (sse4_1_extendv4qiv4si2): Ditto. + (sse4_1_extendv2qiv2di2): Ditto. + (sse4_1_extendv4hiv4si2): Ditto. + (sse4_1_extendv2hiv2di2): Ditto. + (sse4_1_extendv2siv2di2): Ditto. + (sse4_1_zero_extendv8qiv8hi2): Ditto. + (sse4_1_zero_extendv4qiv4si2): Ditto. + (sse4_1_zero_extendv2qiv2di2): Ditto. + (sse4_1_zero_extendv4hiv4si2): Ditto. + (sse4_1_zero_extendv2hiv2di2): Ditto. + (sse4_1_zero_extendv2siv2di2): Ditto. + (*sse4_1_extendv8qiv8hi2): Remove insn pattern. + (*sse4_1_extendv4qiv4si2): Ditto. + (*sse4_1_extendv2qiv2di2): Ditto. + (*sse4_1_extendv4hiv4si2): Ditto. + (*sse4_1_extendv2hiv2di2): Ditto. + (*sse4_1_extendv2siv2di2): Ditto. + (*sse4_1_zero_extendv8qiv8hi2): Ditto. + (*sse4_1_zero_extendv4qiv4si2): Ditto. + (*sse4_1_zero_extendv2qiv2di2): Ditto. + (*sse4_1_zero_extendv4hiv4si2): Ditto. + (*sse4_1_zero_extendv2hiv2di2): Ditto. + (*sse4_1_zero_extendv2siv2di2): Ditto. + +2010-08-27 Nathan Froyd + + * config/mips/mips-protos.h (mips_function_arg_advance): Delete + (mips_function_arg): Delete. + (mips_function_arg_boundary): Take a const_tree. + * config/mips/mips.c (mips_function_arg_boundary): Likewise. + (mips_arg_info): Likewise. + (mips_setup_incoming_varargs): Call mips_function_arg_advance + instead of FUNCTION_ARG_ADVANCE. + (mips_function_arg_advance): Adjust prototype. Make static. + (mips_function_arg): Likewise. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + * config/mips/mips.h (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Delete. + +2010-08-27 Nathan Froyd + + * config/rs6000/rs6000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/rs6000/rs6000-protos.h (function_arg_advance): Delete. + (function_arg): Delete. + (function_arg_boundary): Take a const_tree. + * config/rs6000/rs6000.c (function_arg_boundary): Likewise. + (rs6000_spe_function_arg): Likewise. + (rs6000_parm_start): Likewise. + (rs6000_arg_size): Likewise. + (rs6000_darwin64_record_arg_advance_recurse): Likewise. + (rs6000_darwin64_record_arg): Likewise. Take a bool instead of an int. + (rs6000_mixed_function_arg): Likewise. + (function_arg): Rename to... + (rs6000_function_arg): ...this. + (function_arg_advance): Rename to... + (rs6000_function_arg_advance_1): ...this + (rs6000_function_arg_advance): New function. Call it. + (setup_incoming_varargs): Call rs6000_function_arg_advance_1. + (rs6000_return_in_memory): Adjust call to rs6000_darwin64_record_arg. + (rs6000_function_value): Likewise. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-08-27 Ramana Radhakrishnan + + * config/arm/arm.md (enabled): Test the value of arch_enabled + rather than just using it. + +2010-08-27 Olivier Hainque + Eric Botcazou + + * dse.c (group_info.base_mem, get_group_info): Use BLKmode to + cover all the possible offsets from this base. + (scan_reads_nospill): Pass base_mem's mode to canon_true_dependence. + +2010-08-26 Jakub Jelinek + + PR tree-optimization/44485 + * calls.c (flags_from_decl_or_type): For const or pure + noreturn functions return ECF_LOOPING_CONST_OR_PURE|ECF_NORETURN + together with ECF_CONST resp. ECF_PURE. + * builtins.c (expand_builtin): Use flags_from_decl_or_type + instead of querying flags directly. + * tree-ssa-loop-niter.c (finite_loop_p): Likewise. + * tree-ssa-dce.c (find_obviously_necessary_stmts): Likewise. + +2010-08-26 Richard Guenther + + PR tree-optimization/45255 + * tree.c (decl_address_invariant_p): DECL_DLLIMPORT_P statics + and externals are also invariant. + +2010-08-25 Jakub Jelinek + + PR rtl-optimization/44858 + * combine.c (try_combine): If recog_for_combine added CLOBBERs to + newi2pat, make sure they don't affect newpat. + + PR rtl-optimization/45400 + * combine.c (simplify_shift_const_1) : Only use + SUBREG_REG if both modes are of MODE_INT class. + +2010-08-25 Julian Brown + + * config/arm/arm.c (arm_issue_rate): Return 2 for Cortex-A5. + * config/arm/arm.md (generic_sched): No for Cortex-A5. + (generic_vfp): Likewise. + (cortex-a5.md): Include. + * config/arm/cortex-a5.md: New. + +2010-08-25 Richard Guenther + + * alias.c (get_alias_set): Assign a single alias-set to all pointers. + * gimple.c (gimple_get_alias_set): Remove special handling + for pointers. + +2010-08-25 Bernd Schmidt + + PR middle-end/45355 + * combine.c (try_combine): Use reg_overlap_mentioned_p rather than + dead_or_set_p when computing i0_feeds_i2_n. + + * combine.c (find_split_point): Undo canonicalization of multiply-add + to (minus x (mult)) when it seems likely that this will increase the + chances of a split. + +2010-08-25 Richard Guenther + + PR lto/44562 + * lto-streamer.c (lto_record_common_node): Do not mess with + TYPE_CANONICAL when not in lto. + * gimple.c (gimple_register_type): Likewise. + +2010-08-25 Richard Guenther + + PR tree-optimization/45316 + * tree-ssa-pre.c (eliminate): Properly clean EH info. + +2010-08-25 Richard Guenther + + PR tree-optimization/45393 + * tree-ssa-math-opts.c (execute_cse_sincos_1): Properly transfer + and clean EH info. Avoid SSA update. + (execute_cse_sincos): Cleanup the CFG if it has changed. + +2010-08-25 Richard Guenther + + PR middle-end/45379 + * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle + TARGET_MEM_REF in alignment computation. + +2010-08-25 Jakub Jelinek + + PR tree-optimization/45059 + * tree-ssa-reassoc.c (eliminate_redundant_comparison): Strip useless + type conversions from newop{1,2}. Assert t is a comparison and + newop{1,2} after the stripping are gimple vals. + +2010-08-25 Tejas Belagod + + * config/arm/iterators.md (VU, SE, V_widen_l): New. + (V_unpack, US): New. + * config/arm/neon.md (vec_unpack_hi_): Expansion for vmovl. + (vec_unpack_lo_): Likewise. + (neon_vec_unpack_hi_): Instruction pattern for vmovl. + (neon_vec_unpack_lo_): Likewise. + (vec_widen_mult_lo_): Expansion for vmull. + (vec_widen_mult_hi_): Likewise. + (neon_vec_mult_lo_"): Instruction pattern for vmull. + (neon_vec_mult_hi_"): Likewise. + (neon_unpack_): Widening move intermediate step for + vectorizing without -mvectorize-with-neon-quad. + (neon_vec_mult_): Widening multiply intermediate step + for vectorizing without -mvectorize-with-neon-quad. + * config/arm/predicates.md (vect_par_constant_high): Check for + high-half lanes of a vector. + (vect_par_constant_low): Check for low-half lanes of a vector. + +2010-08-24 Sebastian Pop + + * tree-if-conv.c (struct ifc_dr): New. + (IFC_DR): New. + (DR_WRITTEN_AT_LEAST_ONCE): New. + (DR_RW_UNCONDITIONALLY): New. + (memref_read_or_written_unconditionally): Use the cached values + when possible. + (write_memref_written_at_least_once): Same. + (if_convertible_loop_p): Initialize and free DR->aux fields. + +2010-08-24 Sebastian Pop + + * gimple.c (gimple_could_trap_p_1): Not static anymore. + Pass an extra bool parameter include_mem. + (gimple_could_trap_p): Adjust call to gimple_could_trap_p_1. + (gimple_assign_rhs_could_trap_p): Same. + * gimple.h (gimple_could_trap_p_1): Declared. + * tree-data-ref.h (same_data_refs_base_objects): New. + (same_data_refs): New. + * tree-if-conv.c (memrefs_read_or_written_unconditionally): New. + (write_memrefs_written_at_least_once): New. + (ifcvt_memrefs_wont_trap): New. + (operations_could_trap): New. + (ifcvt_could_trap_p): New. + (if_convertible_gimple_assign_stmt_p): Call ifcvt_could_trap_p. + Gets a vector of data refs. + (if_convertible_stmt_p): Same. + (if_convertible_loop_p_1): New. + (if_convertible_loop_p): Call if_convertible_loop_p_1. + +2010-08-24 Sebastian Pop + + * common.opt (ftree-loop-if-convert-stores): New flag. + * doc/invoke.texi (ftree-loop-if-convert-stores): Documented. + * tree-if-conv.c (ifc_temp_var): Pass an extra parameter GSI. Insert + the created statement before GSI. + (if_convertible_phi_p): Allow virtual phi nodes when + flag_loop_if_convert_stores is set. + (if_convertible_gimple_assign_stmt_p): Allow memory reads and writes + Do not handle types that do not match is_gimple_reg_type. + Remove loop and bb parameters. Call gimple_could_trap_p instead of + when flag_loop_if_convert_stores is set, as LHS can contain + memory refs. + (if_convertible_stmt_p): Remove loop and bb parameters. Update calls + to if_convertible_gimple_assign_stmt_p. + (if_convertible_loop_p): Update call to if_convertible_stmt_p. + (replace_phi_with_cond_gimple_assign_stmt): Renamed + predicate_scalar_phi. Do not handle virtual phi nodes. + (ifconvert_phi_nodes): Renamed predicate_all_scalar_phis. + Call predicate_scalar_phi. + (insert_gimplified_predicates): Insert the gimplified predicate of a BB + just after the labels for flag_loop_if_convert_stores, otherwise + insert the predicate in the end of the BB. + (predicate_mem_writes): New. + (combine_blocks): Call predicate_all_scalar_phis. When + flag_loop_if_convert_stores is set, call predicate_mem_writes. + (tree_if_conversion): Call mark_sym_for_renaming when + flag_loop_if_convert_stores is set. + (main_tree_if_conversion): Return TODO_update_ssa_only_virtuals when + flag_loop_if_convert_stores is set. + +2010-08-24 Anatoly Sokolov + + * config/pa/pa.c (hppa_register_move_cost, pa_libcall_value, + pa_function_value_regno_p, pa_print_operand_punct_valid_p): New. + (pa_function_value): Make static. + (override_options): Rename to... + (pa_option_override): ...this. Make static. + (TARGET_PRINT_OPERAND_PUNCT_VALID_P, TARGET_REGISTER_MOVE_COST, + TARGET_LIBCALL_VALUE, TARGET_FUNCTION_VALUE_REGNO_P, + TARGET_OPTION_OVERRIDE): Define. + * config/pa/pa.h (OVERRIDE_OPTIONS, FUNCTION_VALUE_REGNO_P, + LIBCALL_VALUE, REGISTER_MOVE_COST, PRINT_OPERAND_PUNCT_VALID_P): + Remove. + * config/pa/pa-protos.h (override_options): Remove. + +2010-08-24 Richard Guenther + + PR middle-end/45379 + * tree-ssa-address.c (create_mem_ref_raw): Drop to MEM_REF + if addr->index is NULL or zero. + * tree-ssa-alias.c (indirect_refs_may_alias_p): Handle + TARGET_MEM_REF more properly. + (indirect_ref_may_alias_decl_p): Likewise. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Keep TARGET_MEM_REFs. + * alias.c (ao_ref_from_mem): Handle TARGET_MEM_REF more properly. + 2010-08-23 Anatoly Sokolov * config/m32c/m32c.c (m32c_function_value_regno_p): Make static. @@ -24,10 +3598,10 @@ * tree-flow.h (may_be_nonaddressable_p): New definition. Make the existing static function global. - *tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): This function + * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): This function is changed to global. - *tree-ssa-loop-prefetch.c (gather_memory_references_ref): Call + * tree-ssa-loop-prefetch.c (gather_memory_references_ref): Call may_be_nonaddressable_p on base, and don't collect this reference if the address of the base could not be taken. @@ -131,9 +3705,9 @@ (build_cdtor): Move to ipa.c; add code avoiding construction when target have ctors/dtors and there is only one ctor/dtor at given priority. - (compare_ctor, compare_dtor): Move to ipa.c; use DECL_UID to stabilize sort; - reverse order of constructors. - (cgraph_build_cdtor_fns):Move to ipa.c; rename to build_cdtor_fns. + (compare_ctor, compare_dtor): Move to ipa.c; use DECL_UID to stabilize + sort; reverse order of constructors. + (cgraph_build_cdtor_fns): Move to ipa.c; rename to build_cdtor_fns. (cgraph_finalize_function): Do not call record_cdtor_fn. (cgraph_finalize_compilation_unit): Do not call cgraph_build_cdtor_fns. (cgraph_build_static_cdtor): Move to ipa.c. @@ -143,7 +3717,8 @@ build_cdtor_fns, ipa_cdtor_merge, gate_ipa_cdtor_merge, pass_ipa_cdtor_merge): New. * passes.c (init_optimization_passes): Enqueue pass_ipa_cdtor_merge. - * ipa-prop.c (update_indirect_edges_after_inlining): Avoid out of bounds access. + * ipa-prop.c (update_indirect_edges_after_inlining): Avoid out of + bounds access. 2010-08-20 Jan Hubicka @@ -159,9 +3734,11 @@ 2010-08-20 Jan Hubicka - * lto-cgraph.c (lto_output_edge): Use gimple_has_body_p instead of flag_wpa. + * lto-cgraph.c (lto_output_edge): Use gimple_has_body_p instead of + flag_wpa. * lto-streamer-out.c (lto_output): Likewise. - * passes.c (ipa_write_optimization_summaries): Initialize statement uids. + * passes.c (ipa_write_optimization_summaries): Initialize statement + uids. 2010-08-20 Olivier Hainque @@ -205,9 +3782,9 @@ revert r163410, partially revert r163267. * config/rs6000/darwin.h (LIB_SPEC): Remove. - * config/darwin.h (REAL_LIBGCC_SPEC): Link lgcc for all + * config/darwin.h (REAL_LIBGCC_SPEC): Link lgcc for all Darwin versions. - + 2010-08-20 Jakub Jelinek PR middle-end/44974 @@ -216,7 +3793,7 @@ 2010-08-20 Uros Bizjak - * config/i386/i386.md (ashift RSP splitter): Remove splitter. + * config/i386/i386.md (ashift %rsp splitter): Remove splitter. (pro_epilogue_adjust_stack_di_2): Use "l" constraint for alternative 1 of operand 2. @@ -835,7 +4412,7 @@ 2010-08-13 Jack Howarth - * gcc/configure.ac: Enable -fomit-frame-pointer on darwin + * configure.ac: Enable -fomit-frame-pointer on darwin which support dwarf2. * config/i386/i386.c (override_options): Same. @@ -1494,7 +5071,7 @@ * doc/tm.texi: Regenerate. * targhooks.c (default_asm_output_addr_const_extra): New function. * targhooks.h (default_asm_output_addr_const_extra): Declare. - * final.c: (output_addr_const): Use TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA + * final.c (output_addr_const): Use TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA target hook. * config/i386/i386.h (OUTPUT_ADDR_CONST_EXTRA): Remove. @@ -2362,7 +5939,7 @@ PR target/45142 * config/i386/sse.md (vec_set_0): Do not set mode attribute for alternative 2. - (vec_set_0 splitter): Use SSEMODE4S mode iterator to also + (vec_set_0 splitter): Use SSEMODE4S mode iterator to also split V4SI operands. 2010-08-01 Anatoly Sokolov @@ -7491,7 +11068,7 @@ targetm.asm_file_start_file_directive * dwarf2out.c, opts.c, tree-vect-data-refs.c, except.c: Likewise. * varasm.c, config/alpha/alpha.c, config/cris/cris.c: Likewise. - * gcc/config/spu/spu.c, config/ia64/ia64.c: Rename target macros: + * config/spu/spu.c, config/ia64/ia64.c: Rename target macros: TARGET_VECTOR_ALIGNMENT_REACHABLE -> TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE TARGET_SUPPORT_VECTOR_MISALIGNMENT -> @@ -10901,10 +14478,10 @@ PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. - (typdef_variant_p): Move definition here from gcc/cp/tree.c. + (typdef_variant_p): Move definition here from cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. - (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h + (typedef_variant_p): Move declaration here from cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous @@ -12523,12 +16100,12 @@ definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Revert the moving of this definition - here from gcc/cp/tree.c. + here from cp/tree.c. * c-common.h (is_typedef_decl): Revert the moving of this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Revert the moving of this declaration here - from gcc/cp/cp-tree.h + from cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): Revert this new function. (gen_tagged_type_die): Revert the splitting out of ... (gen_type_die_with_usage): ... this function. Revert the anonymous @@ -12661,10 +16238,10 @@ PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. - (typdef_variant_p): Move definition here from gcc/cp/tree.c. + (typdef_variant_p): Move definition here from cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. - (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h + (typedef_variant_p): Move declaration here from cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous @@ -16820,9 +20397,9 @@ warn if older binutils found. (LTO_BINARY_READER): New AC_SUBST'd variable. (LTO_USE_LIBELF): Likewise. - * gcc/config.gcc (lto_binary_reader): New target-specific configure + * config.gcc (lto_binary_reader): New target-specific configure variable. - * gcc/Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var. + * Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var. (LTO_USE_LIBELF): Likewise. * configure: Regenerate. @@ -16854,10 +20431,10 @@ 2010-04-26 Jack Howarth PR 43715 - * gcc/configure.ac: Use "$gcc_cv_nm -g" on darwin + * configure.ac: Use "$gcc_cv_nm -g" on darwin instead of "$gcc_cv_objdump -T". Use "-undefined dynamic_lookup" on darwin. - * gcc/configure: Regenerate. + * configure: Regenerate. 2010-04-26 Jakub Jelinek @@ -17854,11 +21431,11 @@ (MASK_ACCUMULATE_OUTGOING_ARGS) Define and Set. (rounded_frame_size): Adjust size with outgoing_args_size. (sh_set_return_address): Must return from stack pointer. - * gcc/config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Define. + * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Define. (SUBTARGET_FRAME_POINTER_REQUIRED): Define. (ACCUMULATE_OUTGOING_ARGS): Define. * doc/invoke.texi (maccumulate-outgoing-args): Document for SH. - * gcc/config/sh/sh.opt (maccumulate-outgoing-args): New option. + * config/sh/sh.opt (maccumulate-outgoing-args): New option. 2010-04-15 Kaz Kojima @@ -18259,8 +21836,8 @@ 2010-04-13 Andreas Krebbel Ulrich Weigand - * gcc/config/s390/s390.md: Replace TARGET_64BIT with TARGET_ZARCH. - * gcc/config/s390/s390.c: Replace UNTIS_PER_WORD with + * config/s390/s390.md: Replace TARGET_64BIT with TARGET_ZARCH. + * config/s390/s390.c: Replace UNTIS_PER_WORD with UNITS_PER_LONG where it is ABI relevant. (s390_return_addr_rtx): Likewise. (s390_back_chain_rtx): Likewise. @@ -18291,9 +21868,9 @@ (HARD_REGNO_CALL_PART_CLOBBERED): New macro. (DWARF_CIE_DATA_ALIGNMENT): New macro. (s390_expand_setmem): Remove unused variable src_addr. - * gcc/longlong.h: Make smul_ppmm and sdiv_qrnnd inline asms to + * longlong.h: Make smul_ppmm and sdiv_qrnnd inline asms to deal with 64 bit registers. - * gcc/config/s390/s390.h: Define __zarch__ predefined macro. + * config/s390/s390.h: Define __zarch__ predefined macro. Replace UNITS_PER_WORD with UNITS_PER_LONG where it is ABI relevant. (UNITS_PER_LONG): New macro. * libjava/include/s390-signal.h: Define extended ucontext @@ -20075,7 +23652,7 @@ fixinc/Makefile*, intl/Makefile.*. * doc/makefile.texi: Fixed markup. Abstract from version control system used. - (Makefile): Removed obsolete gcc/java/parse.y example. + (Makefile): Removed obsolete java/parse.y example. * doc/sourcebuild.texi: Likewise. (Top Level): Added config, gnattools, libdecnumber, libgcc, libgomp, libssp. Removed fastjar. @@ -20604,7 +24181,7 @@ 2010-03-12 Michael Meissner PR middle-end/42431 - * gcc/config/rs6000/rs6000.c (rs6000_emit_move): Delete band-aid + * config/rs6000/rs6000.c (rs6000_emit_move): Delete band-aid code added to work around reload clobbering CONST insns. 2010-03-12 Jakub Jelinek diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 4377019555d..7adab4e9241 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20100824 +20100924 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 957b31e0f7d..32baa9dfd5c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -330,11 +330,14 @@ enable_lto = @enable_lto@ LTO_BINARY_READER = @LTO_BINARY_READER@ LTO_USE_LIBELF = @LTO_USE_LIBELF@ -# Compiler needed for plugin support -PLUGINCC = $(COMPILER) - -# Flags needed for plugin support -PLUGINCFLAGS = $(COMPILER_FLAGS) +# Compiler and flags needed for plugin support +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) +PLUGINCC = @CC@ +PLUGINCFLAGS = @CFLAGS@ +else +PLUGINCC = @CXX@ +PLUGINCFLAGS = @CXXFLAGS@ +endif # Libs and linker options needed for plugin support PLUGINLIBS = @pluginlibs@ @@ -965,7 +968,7 @@ EBITMAP_H = ebitmap.h sbitmap.h LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \ $(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) TREE_VECTORIZER_H = tree-vectorizer.h $(TREE_DATA_REF_H) -IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) +IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) GSTAB_H = gstab.h stab.def BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \ @@ -1714,6 +1717,7 @@ aclocal_deps = \ $(srcdir)/../config/stdint.m4 \ $(srcdir)/../config/unwind_ipinfo.m4 \ $(srcdir)/../config/warnings.m4 \ + $(srcdir)/../config/dfp.m4 \ $(srcdir)/acinclude.m4 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 @@ -2760,7 +2764,8 @@ tree-vect-stmts.o: tree-vect-stmts.c $(CONFIG_H) $(SYSTEM_H) \ tree-vect-data-refs.o: tree-vect-data-refs.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \ $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \ - $(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \ + $(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) $(TOPLEV_H) \ + $(DIAGNOSTIC_CORE_H) $(TM_P_H) \ tree-pretty-print.h gimple-pretty-print.h tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(GGC_H) $(TREE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ @@ -3149,16 +3154,16 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \ tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \ $(DBGCNT_H) tree-pretty-print.h gimple-pretty-print.h tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \ - $(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) $(IPA_PROP_H) \ - $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) \ - $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h $(DBGCNT_H) \ - $(TREE_INLINE_H) gimple-pretty-print.h + $(TM_H) $(TOPLEV_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) \ + $(IPA_PROP_H) $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) \ + $(PARAMS_H) $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h \ + $(DBGCNT_H) $(TREE_INLINE_H) gimple-pretty-print.h tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \ $(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \ $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \ $(TREE_PASS_H) $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) output.h \ $(GGC_H) $(OBSTACK_H) $(PARAMS_H) $(CPPLIB_H) $(PARAMS_H) \ - gimple-pretty-print.h + gimple-pretty-print.h langhooks.h tree-complex.o : tree-complex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ $(TM_H) $(FLAGS_H) $(TREE_FLOW_H) $(GIMPLE_H) \ tree-iterator.h $(TREE_PASS_H) tree-ssa-propagate.h $(DIAGNOSTIC_H) @@ -3177,7 +3182,7 @@ df-core.o : df-core.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ df-problems.o : df-problems.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \ - $(TM_P_H) $(FLAGS_H) output.h $(EXCEPT_H) dce.h vecprim.h + $(TM_P_H) $(TARGET_H) $(FLAGS_H) output.h $(EXCEPT_H) dce.h vecprim.h df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \ diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 0aeaf6e52d7..73afd7fedee 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -106,6 +106,7 @@ m4_include([../ltversion.m4]) m4_include([../lt~obsolete.m4]) m4_include([../config/acx.m4]) m4_include([../config/codeset.m4]) +m4_include([../config/dfp.m4]) m4_include([../config/gettext-sister.m4]) m4_include([../config/iconv.m4]) m4_include([../config/lcmessage.m4]) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9fb2bf19006..42c3d3cd19b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,1239 @@ +2010-09-22 Joseph Myers + + * gcc-interface/lang.opt (-all-warnings, -include-barrier, + -include-directory, -include-directory=, -no-standard-includes, + -no-standard-libraries): New. + +2010-09-20 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity): Replace calls to + build_array_type with calls to build_nonshared_array_type. + (substitute_in_type): Likewise. + * gcc-interface/misc.c (LANG_HOOKS_HASH_TYPES): Delete. + (LANG_HOOKS_TYPE_HASH_EQ): Define. + (gnat_post_options): Add 'static' keyword. + (gnat_type_hash_eq): New static function. + * gcc-interface/utils.c (fntype_same_flags_p): New function. + (create_subprog_type): Call it. + (create_index_type): Call build_nonshared_range_type and tidy up. + (create_range_type): Likewise. + * gcc-interface/gigi.h (fntype_same_flags_p): Declare. + +2010-09-19 Eric Botcazou + + * gcc-interface/trans.c (gnat_pushdecl): Do not do anything special + for PARM_DECLs. + (end_subprog_body): If the body is a BIND_EXPR, make its associated + block the top-level one. + (build_function_stub): Build a statement group for the whole function. + * gcc-interface/utils.c (Subprogram_Body_to_gnu): If copy-in/copy-out + is used, create the enclosing block early and process first the OUT + parameters. + +2010-09-19 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Do + not generate debug info for individual enumerators. + +2010-09-19 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Use record + type instead of enumeral type as the dummy type built for the template + type of fat pointers. + +2010-09-19 Eric Botcazou + + * gcc-interface/gigi.h (get_elaboration_procedure): Declare. + (gnat_zaplevel): Likewise. + * gcc-interface/decl.c (gnat_to_gnu_entity): Do not force global + binding level for an external constant. + : Force the local context and create a fake scope before + translating the defining expression of an external constant. + : Treat external constants at the global level explicitly for + renaming declarations. + (elaborate_expression_1): Force the variable to be static if the + expression is global. + * gcc-interface/trans.c (get_elaboration_procedure): New function. + (call_to_gnu): Use it. + (gnat_to_gnu): Likewise. + : Do not test Is_Public to force the creation of + an initialization variable. + (add_decl_expr): Discard the statement if the declaration is external. + * gcc-interface/utils.c (gnat_pushdecl): Do not put the declaration in + the current block if it is external. + (create_var_decl_1): Do not test Is_Public to set TREE_STATIC. + (gnat_zaplevel): New global function. + +2010-09-19 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity): Explicitly test _LEVEL + variables against zero in all cases. + (rest_of_type_decl_compilation): Likewise. + * gcc-interface/trans.c (gigi): Pass properly typed constants to + create_var_decl. + (call_to_gnu): Fix formatting. + (Handled_Sequence_Of_Statements_to_gnu): Likewise. + (Exception_Handler_to_gnu_zcx): Likewise. + (gnat_to_gnu) : Short-circuit handling of + constant + expressions in presence of a freeze node. + +2010-09-19 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Look into + expressions for external constants that are aggregates. + * gcc-interface/utils2.c (build_simple_component_ref): If the field + is an inherited component in an extension, look through the extension. + +2010-09-10 Vincent Celier + + * projects.texi: Add documentation for package extensions + Add some documentation for attributes Leading_Library_Options and + Linker'Leading_Switches. + +2010-09-10 Ed Schonberg + + * exp_util.adb (Expand_Subtype_From_Expression): When expansion is + disabled, compute subtype for all string types. + +2010-09-10 Robert Dewar + + * gnat_ugn.texi: Add documentation for -gnatw.s/S + * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case + Component_Size): Implement warning on overriden size clause. + (Analyze_Record_Representation_Clause): Implement warning on overriden + size clause. + * sem_warn.ads, sem_warn.adb (Warn_On_Overridden_Size): New flag + (-gnatw.s/S). + * ug_words: Add entries for -gnatw.s/S. + * vms_data.ads, usage.adb: Add line for -gnatw.s/-gnatw.S. + * gcc-interface/Make-lang.in: Update dependencies. + +2010-09-10 Vincent Celier + + * prj-dect.adb (Parse_Package_Declaration): Allow a package to extend + a package with the same name from an imported or extended project. + * prj-proc.adb (Process_Declarative_Items): Process package extensions + +2010-09-10 Bob Duff + + * exp_ch6.adb (Expand_Call): Do not perform a null_exclusion check on + 'out' parameters. + +2010-09-10 Robert Dewar + + * sem.adb: Minor reformatting. + +2010-09-10 Bob Duff + + * s-os_lib.ads, g-expect.ads: Add comments. + +2010-09-10 Robert Dewar + + * exp_ch5.adb: Minor reformatting. + +2010-09-10 Thomas Quinot + + * scos.ads: Add comments. + +2010-09-10 Vincent Celier + + * gnatcmd.adb (Get_Closure): Remove useless invocation of Close. + +2010-09-10 Hristian Kirtchev + + * exp_ch7.adb, exp_ch6.adb (Expand_Call): Establish a transient scope + for a controlled build-in-place function call which appears in an + anonymous context. The transient scope ensures that the intermediate + function result is cleaned up after the master is left. + (Make_Build_In_Place_Call_In_Anonymous_Context): Remove the creation + of the transient scope. This is now done in Exand_Call which covers + additional cases other than secondary stack release. + +2010-09-10 Arnaud Charlet + + * sem.adb (Do_Unit_And_Dependents): Add guard. + +2010-09-10 Robert Dewar + + * exp_ch5.adb: Update comments. + * exp_dist.adb: Minor reformatting. + +2010-09-10 Robert Dewar + + * sem_ch13.adb (Check_Record_Representation_Clause): Implement record + gap warnings. + * sem_warn.ads, sem_warn.adb (Warn_On_Record_Holes): New warning flag. + * usage.adb: Add lines for -gnatw.h/H + * gnat_ugn.texi: Add documentation for J519-010 + Warn on record holes/gaps + * ug_words: Add entries for -gnatw.h/-gnatw.H + * vms_data.ads: Add entries for [NO]AVOIDGAPS + +2010-09-10 Gary Dismukes + + * sem_ch6.adb: Update comment. + +2010-09-10 Ed Schonberg + + * sem_ch3.adb (Build_Derived_Private_Type): Mark generated declaration + of full view analyzed after analyzing the corresponding record + declaration, to prevent spurious name conflicts with original + declaration. + +2010-09-10 Jerome Lambourg + + * sem_ch13.adb (Analyze_Attribute_Definition_Clause): In the VM case, + just issue a warning, but continue with the normal processing. + +2010-09-10 Robert Dewar + + * exp_attr.adb, prj-nmsc.adb, sem_ch4.adb, sem_res.adb: Minor + reformatting. + +2010-09-10 Thomas Quinot + + * exp_dist.adb (Build_From_Any_Call, Build_To_Any_Call, + Build_TypeCode_Call): For a subtype inserted for the expansion of a + generic actual type, go to the underlying type of the original actual + type. + +2010-09-10 Ed Schonberg + + * exp_ch5.adb (Expand_Assign_Array_Loop): In CodePeer mode, place a + guard around the increment statement, to prevent an off-by-one-value + on the last iteration. + +2010-09-10 Vincent Celier + + * sem_aggr.adb, exp_prag.adb, sem_ch3.adb, exp_attr.adb, + sem_res.adb, sem_attr.adb, sem_elab.adb, sem_ch4.adb, exp_disp.adb, + exp_aggr.adb, exp_dist.adb: Change all mentions of "at run-time" to + "at run time" in comments and error/warning messages. + +2010-09-10 Ed Schonberg + + * exp_cg.adb: Handle properly bodies without specs. + +2010-09-10 Emmanuel Briot + + * prj-nmsc.adb (Find_Source_Dirs): When a source directory is not + present, and the user requested to either ignore this or display a + warning (as opposed to an error), we still need to register the + directory. + +2010-09-10 Robert Dewar + + * errout.adb: Remove tests of Parsing_Main_Subunit, since this test is + now done in In_Extended_Main_Source_Unit. + * errout.ads (Compiler_State[_Type]): Moved from Errout to Lib + (Parsing_Main_Subunit): Moved from Errout to Lib and renamed + as Parsing_Main_Extended_Source. + * frontend.adb: Set Parsing_Main_Extended_Source True for parsing main + unit. + * lib-load.adb (Load_Unit): Add PMES parameter + Set PMES appropriately in all calls to Load_Unit + * lib-load.ads (Load_Unit): Add PMES parameter + * lib.adb (In_Extended_Main_Source_Unit): When called with + Compiler_State set to Parsing, test new flag + Compiling_Main_Extended_Source. + * lib.ads (Compiler_State[_Type]): Moved from Errout to Lib + (Parsing_Main_Subunit): Moved from Errout to Lib and renamed + as Parsing_Main_Extended_Source + * par-load.adb (Load): Set PMES properly in call to Load_Unit + +2010-09-10 Ed Schonberg + + * exp_cg.adb: Use proper entity to handle overloads. + * sem_res.adb (Check_Parameterless_Call): An operator node without + actuals cannot be a call, and must be treated as a string. + +2010-09-10 Robert Dewar + + * frontend.adb: Minor reformatting. + +2010-09-10 Robert Dewar + + * par-ch4.adb (P_Conditional_Expression): Use P_Condition for condition + * par-ch5.adb (P_Condition): Move from body to spec + * par.adb (Ch5.P_Condition): Move from body to spec + +2010-09-10 Ed Schonberg + + * exp_cg.adb (Write_Call_Info): If a type that has been registered in + the call table is private, use its full view to generate information + on its operations. + +2010-09-10 Jose Ruiz + + * exp_cg.adb (Is_Predefined_Dispatching_Operation): When trying the + pattern matching to detect predefined primitive operations take into + account that there can be an extra suffix related to body-nested + package entities. + +2010-09-10 Ed Schonberg + + * s-pooglo.ads: Add overriding indicators. + +2010-09-10 Vincent Celier + + * vms_data.ads: Add new GNAT BIND qualifiers /32_MALLOC (for -H32) and + /64_MALLOC (for -H64). + +2010-09-10 Robert Dewar + + * errout.adb (Error_Msg_Internal): Test Parsing_Main_Subunit flag + (Error_Msg_NW): Test Parsing_Main_Subunit flag + * errout.ads (Parsing_Main_Subunit): New flag + * lib-load.adb (Load_Unit): Set Parsing_Main_Subunit flag + * par-ch6.adb: Minor style fix (remove redandant parentheses) + * par-ch9.adb: Minor style fix (remove redundant parens) + * par-load.adb: (Load): Deal with setting Parsing_Main_Subunit + +2010-09-10 Vincent Celier + + * make.adb (Create_Binder_Mapping_File): Remove procedure. Replaced by + function of the same name in Makeutl. + (Gnatmake): Call function Create_Binder_Mapping_File in Makeutl, instead + of removed procedure when creating a binder mapping file. + * makeutl.adb (Create_Binder_Mapping_File): New function. Was a + procedure in Make. + * makeutl.ads (Create_Binder_Mapping_File): New function + +2010-09-10 Jose Ruiz + + * exp_cg.adb (Is_Predefined_Dispatching_Operation): Add the "__" scope + separator when trying the pattern matching to detect predefined + primitive operations. + +2010-09-10 Robert Dewar + + * bindgen.adb, atree.adb: Minor reformatting. + +2010-09-10 Ben Brosgol + + * ug_words, gnat_ugn.texi: Revised "Transitioning to 64-Bit GNAT for + OpenVMS" section. + +2010-09-10 Doug Rupp + + * bindgen.adb: Minor comment fix for -H switch. + +2010-09-10 Ed Schonberg + + * exp_cg.adb (Register_CG_Node): Determine enclosing subprogram or + library unit now, by traversing tree before context is expanded. + (Write_Call_Info): Use enclosing unit name directly. + * exp_ch9.adb (Expand_N_Accept_Statement): Attach generated block to + tree earlier, to ensure that subsequent declarations are analyzed in a + connected structure. + * exp_intr.adb (Expand_Unc_Deallocation): Ditto for generated statement + list. + +2010-09-10 Robert Dewar + + * symbols-processing-vms-alpha.adb: Minor reformatting. + +2010-09-10 Jerome Lambourg + + * bindgen.adb (Gen_Adainit_Ada): In .NET, don't call + __gnat_install_handler in case the binder is called with -n. + +2010-09-10 Ed Schonberg + + * exp_ch6.adb (Make_Build_In_Place_In_Object_Declaration): Use proper + sloc for renaming declaration and set Comes_From_Source properly to + ensure that references are properly generated for an object declaration + that is built in place. + +2010-09-10 Tristan Gingold + + * symbols-processing-vms-alpha.adb: Allow gnatsym to work as a cross + tool. + * gcc-interface/Make-lang.in: Install gnatsym when cross compiling. + * gcc-interface/Makefile.in: gnat.hlp is now generated by + Make-generated.in + +2010-09-10 Bob Duff + + * exp_pakd.adb (Expand_Bit_Packed_Element_Set): For things like ""X(J) + := ...;", remove side effects from the right-hand side, because they + might affect the value of the left-hand side, but the left-hand side is + first READ (so we can do shifting and masking) and then written back, + which would cause the side effects to be incorrectly overwritten. + +2010-09-10 Robert Dewar + + * sem_ch4.adb: Minor reformatting. + * exp_ch6.adb: Add comment on testing limited on full type + * gnat_rm.texi: Add documentation on Pure_Function. + +2010-09-10 Vincent Celier + + * prj-nmsc.adb (Add_Source): Allow an Ada source to have the same name + as a source of another project and of another language. + +2010-09-10 Robert Dewar + + * exp_ch3.adb (Expand_N_Object_Declaration): Defend against previous + errors. + * freeze.adb (Check_Unsigned_Type): Ditto. + * sem_aggr.adb (Resolve_Aggr_Expr): Ditto. + * sem_ch3.adb (Convert_Scalar_Bounds): Ditto. + (Set_Scalar_Range_For_Subtype): Ditto. + * sem_eval.adb (Subtypes_Statically_Match): Ditto. + +2010-09-10 Robert Dewar + + * repinfo.adb (List_Type_Info): List Small and Range for fixed-point + types. + * sprint.adb (Write_Ureal_With_Col_Check_Sloc): Use square brackets + rather than parens for fixed constants. + * sprint.ads: Use square brackets rather than parens for fixed constants + * urealp.adb (UR_Write): Use square brackets rather than parens + (UR_Write): Add Brackets argument + (UR_Write): Add many more special cases to output literals + * urealp.ads (UR_Write): Use square brackets rather than parens + (UR_Write): Add Brackets argument + +2010-09-10 Robert Dewar + + * sem_ch4.adb: Minor reformatting. + +2010-09-10 Richard Guenther + + * gcc-interface/utils.c (create_index_type): Use build_range_type. + +2010-09-10 Arnaud Charlet + + * vms_cmds.ads: New. + +2010-09-10 Eric Botcazou + + * exp_dbug.ads: Mention enhanced encoding for array types. + +2010-09-10 Jerome Lambourg + + * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Size clause are + unsupported in VM targets. Display a warning in this case. + +2010-09-10 Ed Schonberg + + * sprint.adb (Sprint_Node_Actual, case N_Derived_Type_Definition): Do + not reset Sloc when printing keyword "new". + +2010-09-10 Vincent Celier + + * gnatcmd.adb (GNATCmd): Put the command line in environment variable + GNAT_DRIVER_COMMAND_LINE. + +2010-09-10 Ed Schonberg + + * sem.adb (Do_Unit_And_Dependents): if Withed_Body is set on a context + clause, process the body at once. + +2010-09-10 Ed Schonberg + + * sem_res.adb (Resolve_Type_Conversion): Do not warn on a redundant + conversion is the expression is a qualified expression used to + disambiguate a function call. + +2010-09-10 Vincent Celier + + * prj-nmsc.adb (Add_Source): Allow an Ada source to have the same name + as a source of another project and of another language. + +2010-09-10 Robert Dewar + + * prj-util.adb: Minor reformatting. + +2010-09-10 Eric Botcazou + + * exp_disp.adb: Minor reformatting. + +2010-09-10 Arnaud Charlet + + * sem_prag.adb (Analyze_Pragma): Ignore Inline_Always pragma in + CodePeer mode. + +2010-09-10 Thomas Quinot + + * sem_res.adb: Minor reformatting. + * exp_ch9.adb, rtsfind.ads, exp_ch4.adb, exp_ch3.adb: Do not hardcode + magic constants for task master levels (instead, reference + named numbers from System.Tasking). + +2010-09-10 Eric Botcazou + + * gnatvsn.ads (Ver_Prefix): New constant string. + * bindgen.adb (Gen_Output_File_Ada): Use it in lieu of hardcoded value. + (Gen_Output_File_C): Likewise. + * g-comver.adb (Ver_Prefix): Add cross-reference to Gnatvsn.Ver_Prefix + in comment. + +2010-09-10 Ed Schonberg + + * sem.adb (Walk_Library_Items): Do not traverse children of the main + unit, to prevent spurious circularities in the walk order. + (Depends_On_Main): Use elsewhere to prevent circularities when the body + of an ancestor of the main unit depends on a child of the main unit. + +2010-09-10 Robert Dewar + + * gnatlink.adb, prj-ext.adb, prj-util.adb, s-tporft.adb, + sem_ch3.adb: Minor reformatting. + +2010-09-10 Ed Schonberg + + * sem_ch3.adb (Derive_Subprograms): An interface primitive operation + that is a renaming must be derived like any other primitive operation, + the renamed operation is not relevant to the derivation. + +2010-09-10 Robert Dewar + + * sem_aux.ads: Add comment for Is_Inherently_Limited_Type. + * checks.adb: Minor reformatting. + +2010-09-10 Robert Dewar + + * gnat_ugn.texi: Add section on intent of style checking options. + +2010-09-10 Arnaud Charlet + + * xref_lib.adb (Get_Full_Type): Fix handling of 'a' char. + +2010-09-10 Ed Schonberg + + * sem_ch3.adb: Improve error message on derivation from class-wide type + +2010-09-10 Steve Baird + + * gnat1drv.adb (Adjust_Global_Switches): Enable Expression_With_Actions + generation when Generate_SCIL is True. + +2010-09-10 Geert Bosch + + * gnatlink.adb (Check_ Existing_Executable): New procedure for checking + validity of executable name and removing any existing executable + (Gnatlink): Call Check_Existing_Executable. + +2010-09-10 Arnaud Charlet + + * s-tporft.adb, s-taskin.ads (Register_Foreign_Thread): Move + initialization of Task_Alternate_Stack here, cleaner since in case of + ranvescar, Restricted_Ada_Task_Control_Block is not initialized + implicitly. + +2010-09-10 Thomas Quinot + + * s-fileio.adb, a-dirval.adb: Minor reformatting. + +2010-09-10 Emmanuel Briot + + * prj-util.adb (Executable_Of): Fix CE when the project does not + contain a Builder package. + +2010-09-10 Vincent Celier + + * prj-ext.adb (Initialize_Project_Path): Add /lib/gpr/ + to the project path, if Prefix and Target_Name are defined. + * prj-tree.ads (Project_Node_Tree_Data): New component Target_Name + +2010-09-10 Ed Schonberg + + * checks.adb (Ensure_Valid): If the expression is a boolean expression + or short-circuit operation, do no emit a validity check: only the + elementary operands of the expression need checking. + +2010-09-10 Ben Brosgol + + * gnat_rm.texi: Document Short_Descriptors. + +2010-09-10 Arnaud Charlet + + * s-taprop-linux.adb, s-taskin.ads (Task_Alternate_Stack): Default + initialize to Null_Address. + (Enter_Task): Do not set up an alternate stack for foreign threads. + +2010-09-10 Robert Dewar + + * opt.adb (Short_Descriptors): New flag + (Short_Descriptors_Config): New flag + * opt.ads (Short_Descriptors): New flag + (Short_Descriptors_Config): New flag + * par-prag.adb: Add dummy entry for Short_Descriptors pragma + * sem_prag.adb (Set_Mechanism_Value): Deal with Short_Descriptors pragma + (Analyze_Pragma): Implement Short_Descriptors pragma + * snames.ads-tmpl: Add entry for Short_Descriptors pragma + +2010-09-10 Emmanuel Briot + + * prj-util.adb, prj-util.ads (Executable_Of): Take into account the + project's Executable_Suffix. + +2010-09-10 Robert Dewar + + * g-pehage.ads: Minor reformatting + + * gnat_ugn.texi: Clarifying comment on -gnatyc + * exp_ch6.adb (Expand_N_Subprogram_Body): Reset Is_Pure if limited + arguments. + +2010-09-10 Tristan Gingold + + * Make-generated.in (gnat.hlp): New rule. + +2010-09-10 Emmanuel Briot + + * prj-util.adb, prj-util.ads (Executable_Of): New parameter + Include_Suffix. + +2010-09-10 Robert Dewar + + * einfo.adb: Minor code cleanup: Add assertion to + Set_Corresponding_Protected_Entry. + +2010-09-10 Bob Duff + + * g-pehage.ads, g-pehage.adb (Produce): Add a new flag to allow sending + the output to standard output. + +2010-09-09 Vincent Celier + + * gnat_ugn.texi: Add documentation for new gnatmake switch + --create-map-file. + * make.adb (Map_File): New global variable to store the value of switch + --create-map-file. + (Gnatmake): Add switch -M to gnatlink if buider switch --create-map-file + has been specified. + (Scan_Make_Arg): Recognize switch --create-map-file + * makeutl.ads (Create_Map_File_Switch): New constant string for new + gnatmake and gprbuild switch --create-map-file. + +2010-09-09 Robert Dewar + + * sinput-p.ads: Minor comment update. + +2010-09-09 Arnaud Charlet + + * s-tpobop.adb, s-taenca.adb (Wait_For_Completion_With_Timeout): Reset + Entry_Call.State if needed so that the call is marked as cancelled by + Check_Pending_Actions_For_Entry_Call. + (Timed_Protected_Entry_Call): Adjust calls to Defer/Under_Abort, since + this procedure may be called from a controlled operation + (Initialize/Finalize). + +2010-09-09 Vadim Godunko + + * impunit.adb: Correct spelling of package's name in the comment. + +2010-09-09 Robert Dewar + + * gnatcmd.adb, gnatlink.adb, sem_ch12.adb, sem_eval.adb, sinput-p.adb: + Minor reformatting + +2010-09-09 Robert Dewar + + * impunit.adb: Add entry for a-izteio. + * checks.adb: Add comment. + * debug.adb, exp_disp.adb: Minor reformatting. + * exp_dbug.ads: Minor reformatting throughout (pack block comments). + +2010-09-09 Ed Schonberg + + * sem_eval.adb (Is_Same_Value): Two occurrences of the same + discriminant cannot be assumed to be the same value because they may + refer to bounds of a component of two different instances of a + discriminated type. + +2010-09-09 Gary Dismukes + + * checks.adb (Apply_Arithmetic_Overflow_Check): When converting the + operands of an operator to the type of an enclosing conversion, rewrite + the operator so the conversion can't be flagged as redundant. + Remove useless assignments to Typ and Rtyp. + +2010-09-09 Eric Botcazou + + * gnat_ugn.texi: Fix another long line. + +2010-09-09 Bob Duff + + * sem_warn.adb (Output_Reference_Error): Don't warn for renames read + but never assigned. + +2010-09-09 Matthew Heaney + + * a-convec.adb, a-coinve.adb (Clear, Delete, Delete_Last, Finalize, + Merge, Insert, Insert_Space, Move, Reserve_Capacity, Generic_Sorting, + Replace_Element, Reverse_Elements, Swap): Change exception message to + correctly indicate kind of tampering (cursor or element). + * a-cdlili.adb, a-cidlli.adb (Clear, Delete, Delete_First, Delete_Last, + Merge, Generic_Sorting, Insert, Move, Reverse_Elements, Splice, + Swap_Links, Replace_Element, Swap): Ditto. + * a-coorse.adb, a-ciorse.adb (Include, Replace, Replace_Element): Ditto + * a-coorma.adb, a-ciorma.adb (Include, Replace, Replace_Element): Ditto + * a-coormu.adb, a-ciormu.adb (Replace_Element): Ditto + * a-chtgke.adb (Delete_Key_Sans_Free, Generic_Conditional_Insert, + Generic_Replace_Element): Ditto + * a-chtgop.adb (Clear, Move, Reserve_Capacity): Ditto + * a-cohama.adb, a-cihama.adb (Delete, Include, Replace, + Replace_Element): Ditto. + * a-cohase.adb, a-cihase.adb (Delete, Difference, Intersection, + Symmetric_Difference, Union, Include, Replace): Ditto + +2010-09-09 Ed Schonberg + + * sprint.adb (Write_Id): If the parent node is an expanded name, check + that its entity_or_associated_node is an entity before writing it out. + * exp_disp.adb (Make_Tags); if a type is declared in C++ and has no + constructors, there is no need for a dispatch table pointer because the + table is fully inherited from the C++ code. + +2010-09-09 Thomas Quinot + + * projects.texi: Fix wrong identifiers on package end lines in project + files examples. + * exp_ch6.adb: Minor reformatting. + +2010-09-09 Tristan Gingold + + * gnatcmd.adb, vms_conv.ads: Extract Command_Type. + +2010-09-09 Eric Botcazou + + * gnat_ugn.texi: Fix description of -O3 optimization level. + +2010-09-09 Yannick Moy + + * a-cihama.adb, a-cohama.adb: Fix comments. + +2010-09-09 Arnaud Charlet + + * i-cexten.ads: Add comments. + (Signed_128): New type, used by some C bindings. + * debug.adb: Update comment. + +2010-09-09 Sergey Rybin + + * gnat_ugn.texi: For ASIS tools (gnatpp, gnatcheck, gnatelim, + gnatmetric and gnatstub) add a note that '-gnat05' should be used if + the tool should process Ada 2005 sources. + +2010-09-09 Ed Schonberg + + * sem_ch12.adb (Remove_Parent): If the scope containing the child + instance is a block, examine the enclosing scope to determine if it is + a parent instance. + +2010-09-09 Doug Rupp + + * sem_prag.adb (pragma Ident): Pass --identification= vice + IDENTIFICATION= + * gnatlink.adb (Linker_Options): Look for --identification= vice + IDENTIFICATION= + +2010-09-09 Gary Dismukes + + * exp_attr.adb (Expand_N_Attribute_Reference, case Attribute_Old): When + inserting and analyzing the object declaration for the temporary object + created to hold a 'Old value, push the scope for the subprogram where + the object is inserted, so that its Scope (and that of related objects) + will be set properly. + +2010-09-09 Vincent Celier + + * prj.adb (Get_Object_Directory): Return object directory display name + * adaint.c (__gnat_get_file_names_case_sensitive): When environment + variable GNAT_FILE_NAME_CASE_SENSITIVE has a value of "0" or "1", + return this value, otherwise return the default for the platform. + +2010-09-09 Arnaud Charlet + + * gcc-interface/Makefile.in, gcc-interface/Make-lang.in: Update + dependencies. Remove handling of gnatlbr. + Do not remove s-stratt-xdr for the run-time when installing. + +2010-09-09 Robert Dewar + + * sem_attr.adb: Minor reformatting. + +2010-09-09 Thomas Quinot + + * socket.c (__gnat_socket_ioctl): On Darwin, the req parameter is an + unsigned long, not an int. + +2010-09-09 Vincent Celier + + * make.adb, mlib-prj.adb, prj.adb, prj-nmsc.adb, mlib-tgt.adb, + prj-conf.adb, prj-env.adb: Use Display_Name instead of Name whenever + we are not checking for equality of path or file names. + +2010-09-09 Ed Schonberg + + * exp_util.adb (Remove_Side_Effects): If the expression is a packed + array reference, reset the Analyzed flag so that it is properly + expanded when the resulting object declaration is analyzed. + +2010-09-09 Vincent Celier + + * sinput-p.adb (Source_File_Is_Subunit): Return False if X is + No_Source_File. + +2010-09-09 Ramon Fernandez + + * sysdep.c: The wrSbc8548 BSP in MILS doesn't know anything about the + VX_SPE_TASK option, so disable it. + +2010-09-09 Ed Schonberg + + * sem.adb (Walk_Library_Items): Traverse context of subunits of the + main unit. + (Is_Subunit_Of_Main): Handle null nodes properly. + +2010-09-09 Robert Dewar + + * par-ch2.adb: Update comments. + +2010-09-09 Ben Brosgol + + * gnat_rm.texi: Minor wordsmithing of section on pragma Ordered. + +2010-09-09 Arnaud Charlet + + * par-ch2.adb (Scan_Pragma_Argument_Association): In CodePeer mode, + do not generate an error for compatibility with legacy code. + ignored when generating SCIL. + * sem_attr.adb (Resolve_Attribute): Ignore AI-229 in CodePeer mode. + +2010-09-09 Thomas Quinot + + * s-strxdr.adb, gnat_rm.texi, s-stratt-xdr.adb, s-stratt.ads: Rename + s-strxdr.adb to s-stratt-xdr.adb + +2010-09-09 Robert Dewar + + * ali-util.adb (Obsolescent_Check): Removed. + * gprep.adb (Obsolescent_Check): Removed. + Remove Obsolescent_Check parameter in Scng instantiation + * prj-err.adb (Obsolescent_Check): Removed. + * prj-err.ads (Obsolescent_Check): Removed. + Remove Obsolescent_Check parameter in Scng instantiation + * scans.ads (Based_Literal_Uses_Colon): New flag + * scn.adb (Obsolscent_Check_Flag): Removed + (Obsolscent_Check): Removed + (Set_Obsolescent_Check): Removed + (Post_Scan): Add handling for obsolescent features + * scn.ads (Obsolscent_Check): Removed + (Set_Obsolescent_Check): Removed + (Post_Scan): Can no longer be inlined + Remove Obsolescent_Check from instantiation of Scng + * scng.adb (Nlit): Set Based_Literal_Uses_Colon + (Nlit): Remove handling of obsolescent check + (Scan, case '%'): Remove handling of obsolescent check + (Scan, case '|'): Call Post_Scan + (Scan, case '!'): Remove handling of obsolescent check, call Post_Scan + * scng.ads Remove Obsolescent_Check argument from Scng generic + (Post_Scan): Now called for Tok_Vertical_Bar + * sinput-l.adb: Remove calls to Set_Obsolescent_Check + +2010-09-09 Doug Rupp + + * gnatlbr.adb: Removed. + * gnat_rm.texi, ug_words, gnat_ugn.texi: Remove mention of gnatlbr. + +2010-09-09 Robert Dewar + + * sem_res.adb (Resolve_Type_Conversion): Catch more cases of redundant + conversions. + +2010-09-09 Vincent Celier + + * gnatlbr.adb: Remove redundant conversions. + +2010-09-09 Vincent Celier + + * prj-proc.adb: Minor comment spelling error fix. + * osint.ads (Env_Vars_Case_Sensitive): Use function + Get_Env_Vars_Case_Sensitive, not Get_File_Names_Case_Sensitive to + compute value. + +2010-09-09 Ed Schonberg + + * sem_res.adb (Resolve_Equality_Op): Implement Ada2012 rule for + resolution of conditional expressions whose dependent expressions are + anonymous access types. + +2010-09-09 Robert Dewar + + * a-ststio.adb: Minor code reorganization. + * s-direio.adb, prj.adb, prj-nmsc.adb, sem_type.adb: Remove redundant + conversion. + * types.ads: Minor reformatting. + * binde.adb, vms_conv.adb, gnatls.adb, s-strxdr.adb, uintp.adb: Remove + redundant conversions. + * output.adb: Minor reformatting. + * sem_ch8.adb (Find_Type): Test for redundant base applies to user + types. + * opt.ads: Add pragma Ordered for Verbosity_Level. + * prj.ads: Add pragma Ordered for type Verbosity. + +2010-09-09 Vincent Celier + + * osint.adb (Canonical_Case_File_Name): Use procedure To_Lower in + System.Case_Util + (Canonical_Case_Env_Var_Name): Ditto + +2010-09-09 Bob Duff + + * g-pehage.adb (Allocate): Initialize the allocated elements of IT. + +2010-09-09 Robert Dewar + + * cstand.adb: Mark Boolean and Character types as Ordered + * einfo.adb (Has_Pragma_Ordered): New flag + * einfo.ads (Has_Pragma_Ordered): New flag + * g-calend.ads: Mark Day_Name as Ordered + * opt.ads: Mark Ada_Version_Type as Ordered + (Warn_On_Unordered_Enumeration_Type): New flag + * par-prag.adb: Add procdessing for pragma Ordered + * s-ficobl.ads (Read_File_Mode): New subtype + * s-fileio.adb: Use Read_File_Mode instead of explicit ranges + * s-taskin.ads: Mark Entry_Call_State as ordered + * sem_ch3.adb (Build_Derived_Enumeration_Type): Inherit + Has_Pragma_Ordered. + * sem_ch6.ads: Mark Conformance_Type as Ordered + * sem_prag.adb: Implement pragma Ordered + * sem_res.adb (Bad_Unordered_Enumeration_Reference): New function + (Resolve_Comparison_Op): Diagnose unordered comparison + (Resolve_Range): Diagnose unordered range + * sem_warn.adb (Warn_On_Unordered_Enumeration_Type): New flag (from + -gnatw.u/U) + * snames.ads-tmpl: Add entry for pragma Ordered + * style.ads (Check_Enumeration_Subrange): Removed + * styleg.adb (Check_Enumeration_Subrange): Removed + * styleg.ads (Check_Enumeration_Subrange): Removed + * stylesw.adb: Remove handling of -gnatyE switch + * stylesw.ads: (Style_Check_Enumeration_Subranges): Removed + * vms_data.ads: Remove -gnatyE entries + Add -gnatw.u entries + * ug_words: Entries for -gnatw.u and -gnatw.U + * gnat_ugn.texi: Document -gnatw.u/-gnatw.U switches + * gnat_rm.texi: Document pragma Ordered. + * s-tasren.adb: Avoid unnecessary comparison on unordered enumeration. + * s-tpobop.adb: Remove comparison on unordered enumeration type. + +2010-09-09 Vincent Celier + + * adaint.c: New function __gnat_get_env_vars_case_sensitive, returns 0 + for VMS and Windows, and 1 for all other platforms. + * adaint.h: New function __gnat_get_env_vars_case_sensitive + * osint.ads, osint.adb (Canonical_Case_Env_Var_Name): New procedure. + * prj-ext.adb (Add): Call Canonical_Case_Env_Var_Name instead of + Canonical_Case_File_Name, as we are dealing with environment variables, + not files. + +2010-09-09 Robert Dewar + + * sem_util.adb: Minor reformatting + +2010-09-09 Vincent Celier + + * vms_data.ads: Add documentation for S_Make_Single. + +2010-09-09 Ed Schonberg + + * sem_util.adb (Same_Object): include formal parameters. + +2010-09-09 Vincent Celier + + * make.adb (Queue): New package implementing a new impementation of the + queue, taking into account the new switch --single-compile-per-obj-dir. + * makeutl.ads (Single_Compile_Per_Obj_Dir_Switch): New constant String + for gnatmake and gprbuild new switch --single-compile-per-obj-dir. + * opt.ads (One_Compilation_Per_Obj_Dir): New Boolean flag, defauted to + False. + * switch-m.adb (Scan_Make_Switches): Take into account new gnatmake + switch --single-compile-per-obj-dir. + * vms_data.ads: Add qualifier SINGLE_COMPILE_PER_OBJ_DIR for gnatmake + switch --single-compile-per-obj-dir. + * gnat_ugn.texi: Add documentation for new gnatmake switch + --single-compile-per-obj-dir. + +2010-09-09 Ed Schonberg + + * einfo.adb, einfo.ads: Clarify use of Corresponding_Protected_Entry. + +2010-09-09 Javier Miranda + + * sem_ch3.adb (Is_Progenitor): Relocated to sem_type. + (Replace_Type): Code cleanup. + * sem_type.ads, sem_type.adb (Is_Progenitor): Relocated from sem_ch3 + +2010-09-09 Thomas Quinot + + * exp_ch8.adb: Minor reformatting. + +2010-09-09 Ed Schonberg + + * exp_ch9.adb, einfo.adb, einfo.ads: New attribute + Corresponding_Protected_Entry. + +2010-09-09 Ed Schonberg + + * exp_ch3.adb (Build_Untagged_Equality): Do not set alias of implicit + inequality, it is always rewritten as the negation of the corresponding + equality operation. + * exp_ch8.adb (Expand_N_Subprogram_Renaming): If the subprogram renames + the predefined equality of an untagged record, create a body at the + point of the renaming, to capture the current meaning of equality for + the type. + +2010-09-09 Robert Dewar + + * sem.adb, sem_warn.adb: Minor reformatting. + +2010-09-09 Ed Schonberg + + * sem_ch6.adb: Improve error message on untagged equality. + * sem.adb (Semantics): Include subprogram bodies that act as spec. + +2010-09-09 Javier Miranda + + * sem_ch13.adb, exp_ch13.adb: Undo previous change, unneeded. + +2010-09-09 Robert Dewar + + * sem_ch13.adb, sem_ch6.adb, exp_ch3.adb: Minor reformatting. + +2010-09-09 Robert Dewar + + * einfo.adb (Is_Aggregate_Type): New function. + * einfo.ads (Aggregate_Kind): New enumeration subtype + (Is_Aggregate_Type): New function. + * sem_type.adb (Is_Array_Class_Record_Type): Removed, replaced by + Is_Aggregate_Typea. + +2010-09-09 Robert Dewar + + * exp_ch11.adb, frontend.adb, sem_attr.adb, sem_ch10.adb, sem_ch3.adb, + sem_ch4.adb, sem_ch9.adb, sem_res.adb: Use Restriction_Check_Needed + where appropriate. + * restrict.ads, restrict.adb: Ditto. + (Restriction_Check_Needed): New function + +2010-09-09 Ed Schonberg + + * exp_ch9.ads (Find_Master_Scope): New function, extracted from + Build_Master_Entity, to find the proper scope for the master entity of + a type that may contain tasks, in the presence of transient scopes. + * exp_ch9.adb (Build_Master_Entity) Use new function. + * exp_ch3.adb (Build_Class_Wide_Master): ditto. + +2010-09-09 Vincent Celier + + * prj-attr.adb: Add new attributes Leading_Library_Options and + Linker'Leading_Switches. + * snames.ads-tmpl: Add new standard names Leading_Library_Options and + Leading_Switches. + +2010-09-09 Javier Miranda + + * sem_ch3.adb (Derive_Subprogram): The code that checks if a + dispatching primitive covers some interface primitive is incomplete. + Replace such code by the invocation of a new subprogram that provides + this functionality. + * sem_ch6.ads (Is_Interface_Conformant): Add missing documentation. + * sem_ch6.adb (Check_Missing_Return): Minor reformating + (Check_Convention): Complete if-statement conditition when reporting + errors (to avoid assertion failure). + * sem_ch13.adb (Make_Null_Procedure_Specs): This routine was previously + located in exp_ch3. Relocated inside Analyze_Freeze_Entity. + (Analyze_Freeze_Entity): Invoke routine that adds the spec of non + overridden null interface primitives. + * sem_type.adb (Is_Ancestor): If the parent of the partial view of a + private type is an interface then use the parent of its full view to + climb to its ancestor type. + * sem_disp.ads, sem_disp.adb (Covers_Some_Interface): New subprogram. + (Check_Dispatching_Operation): Extend assertion to handle wrappers of + null interface primitives. + (Is_Null_Interface_Primitive): New subprogram. + * exp_ch3.adb (Make_Null_Procedure_Specs): Removed. + (Expand_Freeze_Record_Type): Do not generate specs of null interface + subprograms because they are now generated by Analyze_Freeze_Entity. + +2010-09-09 Robert Dewar + + * a-calfor.adb, sem_ch3.adb: Minor reformatting. + +2010-09-09 Robert Dewar + + * bindgen.adb (Gen_Restrictions_Ada): Avoid explicit enumeration ranges + (Gen_Restrictions_C): Avoid explicit enumeration ranges + (Set_String_Replace): New procedure + * casing.ads (Known_Casing): New subtype declaration + * prj-attr.ads (All_Case_Insensitive_Associative_Array): New subtype + declaration + * prj-dect.adb (Parse_Attribute_Declaration): Avoid enumeration range + * prj-nmsc.adb (Check_Naming): Avoid unnecessary enumeration range + * prj-strt.adb (Attribute_Reference): Avoid enumeration range test + * prj.adb (Known_Casing): Moved to Casing spec (avoid enum range) + * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Avoid enumeration + ranges + * sem_res.adb (Resolve_Range): Check for enumeration subrange style rule + * sem_type.adb (Is_Array_Class_Record_Type): New. + * style.ads (Check_Enumeration_Subrange): New procedure + * styleg.adb (Check_Enumeration_Subrange): New procedure + * styleg.ads (Check_Enumeration_Subrange): New procedure + * stylesw.adb Add handling for Style_Check_Enumeration_Subranges + * stylesw.ads (Style_Check_Enumeration_Subranges): New flag + * usage.adb: Add line for -gnatyE + * vms_data.ads: Add entries for [NO]ENUMERATION_RANGES + Add missing entry for NOBOOLEAN_OPERATORS + * gnat_ugn.texi: Add documentation for -gnatyE + +2010-09-09 Robert Dewar + + * namet.adb (Initialize): Is now a dummy procedure + (Reinitialize): New procedure + Call Reinitialize from package initialization + * namet.ads (Initialize): Is now a dummy procedure + (Reinitialize): New procedure + * clean.adb, gnat1drv.adb, gnatbind.adb, gnatcmd.adb, gnatlink.adb, + gnatls.adb, gprep.adb, make.adb, prj-makr.adb: Remove obsolete call to + Namet.Initialize. + +2010-09-09 Bob Duff + + * sem_elab.adb, s-os_lib.ads: Minor comment fixes. + +2010-09-09 Robert Dewar + + * s-bitops.adb (Raise_Error): Add exception message + +2010-09-09 Robert Dewar + + * par-ch5.adb (Test_Statement_Required): Deal with Ada 2012 allowing no + null statement after label. + * sinfo.ads: Minor comment updates. + +2010-09-09 Robert Dewar + + * nlists.ads, nlists.adb (In_Same_List): New function. + Use Node_Or_Entity_Id where appropriate. + * par-labl.adb, sem_ch6.adb, sem_type.adb: Use In_Same_List. + +2010-09-09 Robert Dewar + + * restrict.ads, restrict.adb (Check_Wide_Character_Restriction): New + procedure. + * sem_ch3.adb: Use Check_Wide_Character_Restriction + (Enumeration_Type_Declaration): Check violation of No_Wide_Characters + * sem_ch8.adb (Find_Direct_Name): Check violation of No_Wide_Characters + (Find_Expanded_Name): Check violation of No_Wide_Characters + +2010-09-09 Robert Dewar + + * par-ch5.adb: Minor reformatting. + +2010-09-09 Robert Dewar + + * prj-env.adb: Minor code reorganization. + * par-ch3.adb: Minor reformatting. + * gcc-interface/Make-lang.in: Update dependencies. + +2010-09-09 Ed Schonberg + + * exp_ch9.adb (Build_Activation_Chain_Entity): The construct enclosing + a task declaration can be an entry body. + +2010-09-09 Javier Miranda + + * exp_disp.adb (Make_DT): Decorate as "static" variables containing + tags of library level tagged types. + (Make_Tags): Disable backend optimizations about aliasing for + declarations of access to dispatch tables. + +2010-09-09 Ed Schonberg + + * sem_ch12.adb (Reset_Entity): If the entity is an itype created as a + subtype for a null-excluding access type, recover the original + subtype_mark to get the proper visibility on the original name. + +2010-09-09 Ed Schonberg + + * exp_ch3.adb (Build_Untagged_Equality): For Ada2012, new procedure to + create the primitive equality operation for an untagged record. The + operation is the predefined equality if no record component has a + user-defined equality, or if there is a user-defined equality for the + type as a whole, or when the type is derived and it has an inherited + equality. Otherwise the body of the operations is built as for tagged + types. + (Expand_Freeze_Record_Type): Call Build_Untagged_Equality when needed. + (Make_Eq_Body): New function to create the expanded body of the equality + operation for tagged and untagged records. In both cases the operation + composes, and the primitive operation of each record component is used + to generate the equality function for the type. + * exp_ch4.adb (Expand_Composite_Equality): In Ada2012, if a component + has an abstract equality defined, replace its call with a + Raise_Program_Error. + * sem_ch6.adb (New_Overloaded_Entity): if Ada2012, verify that a + user-defined equality operator for an untagged record type does not + happen after type is frozen, and appears in the visible part if partial + view of type is not limited. + +2010-09-09 Tristan Gingold + + * gnatlbr.adb: Make Create_Directory more portable: use __gnat_mkdir. + +2010-09-09 Bob Duff + + * gnat_ugn.texi: Remove incorrect statement about -E being the default. + +2010-09-09 Pascal Obry + + * gnat_ugn.texi: Update doc on windows related topics. + +2010-09-09 Geert Bosch + + * s-fatgen.adb: Update comments. + +2010-09-09 Robert Dewar + + * par-ch4.adb (Box_Error): New procedure. + +2010-09-09 Thomas Quinot + + * sem.adb: Minor reformatting. + +2010-09-09 Pascal Obry + + * prj-env.adb: Style fix, use /and then/ and /or else/. + * gnat_ugn.texi: Fix typos. + +2010-09-03 Joseph Myers + + PR ada/45499 + * gcc-interface/misc.c (gnat_init_options): Allow options with + empty canonical form. Generate a single save_argv element from -I + options. + +2010-08-30 Eric Botcazou + + * gcc-interface/utils.c (gnat_pushdecl): Remove test for PARM_DECLs. + Attach fake PARM_DECLs to the topmost block of the function. + +2010-08-30 Eric Botcazou + + * gcc-interface/trans.c (call_to_gnu): Also force the return slot opt + for the call to a function whose return type was unconstrained. + +2010-08-30 Olivier Hainque + + * gcc-interface/decl.c (FOREIGN_FORCE_REALIGN_STACK): New macro, + replacement for FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN. + (gnat_to_gnu_entity) : Use it. + 2010-08-21 Eric Botcazou * tracebak.c: Fix typo in comment. diff --git a/gcc/ada/Make-generated.in b/gcc/ada/Make-generated.in index 06cb4a21468..6942d7a5fcc 100644 --- a/gcc/ada/Make-generated.in +++ b/gcc/ada/Make-generated.in @@ -124,3 +124,11 @@ $(ADA_GEN_SUBDIR)/stamp-sdefault : $(srcdir)/version.c Makefile $(ECHO) "end Sdefault;" >> tmp-sdefault.adb $(MOVE_IF_CHANGE) tmp-sdefault.adb $(ADA_GEN_SUBDIR)/sdefault.adb touch $(ADA_GEN_SUBDIR)/stamp-sdefault + +$(ADA_GEN_SUBDIR)/gnat.hlp : $(ADA_GEN_SUBDIR)/vms_help.adb $(ADA_GEN_SUBDIR)/vms_cmds.ads $(ADA_GEN_SUBDIR)/gnat.help_in $(ADA_GEN_SUBDIR)/vms_data.ads + -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp + $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp/,$(notdir $^)) + $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp + (cd $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp; \ + gnatmake -q vms_help; \ + ./vms_help$(build_exeext) gnat.help_in vms_data.ads ../../gnat.hlp) diff --git a/gcc/ada/a-calfor.adb b/gcc/ada/a-calfor.adb index b8e6222475d..39c3c0a2f79 100644 --- a/gcc/ada/a-calfor.adb +++ b/gcc/ada/a-calfor.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2006-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2006-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -42,15 +42,15 @@ package body Ada.Calendar.Formatting is -- independent, thus only one source file is needed for multiple targets. procedure Check_Char (S : String; C : Character; Index : Integer); - -- Subsidiary to the two versions of Value. Determine whether the - -- input string S has character C at position Index. Raise - -- Constraint_Error if there is a mismatch. + -- Subsidiary to the two versions of Value. Determine whether the input + -- string S has character C at position Index. Raise Constraint_Error if + -- there is a mismatch. procedure Check_Digit (S : String; Index : Integer); - -- Subsidiary to the two versions of Value. Determine whether the - -- character of string S at position Index is a digit. This catches - -- invalid input such as 1983-*1-j3 u5:n7:k9 which should be - -- 1983-01-03 05:07:09. Raise Constraint_Error if there is a mismatch. + -- Subsidiary to the two versions of Value. Determine whether the character + -- of string S at position Index is a digit. This catches invalid input + -- such as 1983-*1-j3 u5:n7:k9 which should be 1983-01-03 05:07:09. Raise + -- Constraint_Error if there is a mismatch. ---------------- -- Check_Char -- @@ -781,8 +781,8 @@ package body Ada.Calendar.Formatting is raise Constraint_Error; end if; - -- After the correct length has been determined, it is safe to - -- copy the Date in order to avoid Date'First + N indexing. + -- After the correct length has been determined, it is safe to copy the + -- Date in order to avoid Date'First + N indexing. D (1 .. Date'Length) := Date; @@ -865,8 +865,8 @@ package body Ada.Calendar.Formatting is raise Constraint_Error; end if; - -- After the correct length has been determined, it is safe to - -- copy the Elapsed_Time in order to avoid Date'First + N indexing. + -- After the correct length has been determined, it is safe to copy the + -- Elapsed_Time in order to avoid Date'First + N indexing. D (1 .. Elapsed_Time'Length) := Elapsed_Time; diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb index 78ed93a411e..5ca043554b7 100644 --- a/gcc/ada/a-cdlili.adb +++ b/gcc/ada/a-cdlili.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -151,7 +151,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; while Container.Length > 1 loop @@ -227,7 +227,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for Index in 1 .. Count loop @@ -277,7 +277,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for I in 1 .. Count loop @@ -315,7 +315,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for I in 1 .. Count loop @@ -464,12 +464,12 @@ package body Ada.Containers.Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; LI := First (Target); @@ -583,7 +583,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; Sort (Front => null, Back => null); @@ -638,7 +638,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; New_Node := new Node_Type'(New_Item, null, null); @@ -693,7 +693,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; New_Node := new Node_Type; @@ -844,7 +844,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; Clear (Target); @@ -1048,7 +1048,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (list is locked)"; + "attempt to tamper with elements (list is locked)"; end if; pragma Assert (Vet (Position), "bad cursor in Replace_Element"); @@ -1116,7 +1116,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; Container.First := J; @@ -1243,12 +1243,12 @@ package body Ada.Containers.Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; if Target.Length = 0 then @@ -1328,7 +1328,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; if Before.Node = null then @@ -1432,12 +1432,12 @@ package body Ada.Containers.Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; if Position.Node = Source.First then @@ -1536,7 +1536,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (list is locked)"; + "attempt to tamper with elements (list is locked)"; end if; pragma Assert (Vet (I), "bad I cursor in Swap"); @@ -1585,7 +1585,7 @@ package body Ada.Containers.Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; pragma Assert (Vet (I), "bad I cursor in Swap_Links"); diff --git a/gcc/ada/a-chtgke.adb b/gcc/ada/a-chtgke.adb index ecf2d6f1789..89649f33a5d 100644 --- a/gcc/ada/a-chtgke.adb +++ b/gcc/ada/a-chtgke.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -57,7 +57,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if Equivalent_Keys (Key, X) then if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; HT.Buckets (Indx) := Next (X); HT.Length := HT.Length - 1; @@ -75,7 +75,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if Equivalent_Keys (Key, X) then if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; Set_Next (Node => Prev, Next => Next (X)); HT.Length := HT.Length - 1; @@ -130,7 +130,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if B = null then if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; if HT.Length = Count_Type'Last then @@ -160,7 +160,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; if HT.Length = Count_Type'Last then @@ -212,7 +212,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (container is locked)"; + "attempt to tamper with elements (container is locked)"; end if; -- We can change a node's key to Key (that's what Assign is for), but @@ -256,7 +256,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (container is locked)"; + "attempt to tamper with elements (container is locked)"; end if; Assign (Node, Key); @@ -269,7 +269,7 @@ package body Ada.Containers.Hash_Tables.Generic_Keys is if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; -- Do the assignment first, before moving the node, so that if Assign diff --git a/gcc/ada/a-chtgop.adb b/gcc/ada/a-chtgop.adb index e5cfc6f2050..d014dc17c09 100644 --- a/gcc/ada/a-chtgop.adb +++ b/gcc/ada/a-chtgop.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -132,7 +132,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is begin if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; while HT.Length > 0 loop @@ -478,7 +478,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; Clear (Target); @@ -619,7 +619,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is if HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (container is busy)"; + "attempt to tamper with cursors (container is busy)"; end if; Rehash : declare diff --git a/gcc/ada/a-cidlli.adb b/gcc/ada/a-cidlli.adb index 0d01502e05d..8d1f8e36439 100644 --- a/gcc/ada/a-cidlli.adb +++ b/gcc/ada/a-cidlli.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -175,7 +175,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; while Container.Length > 1 loop @@ -254,7 +254,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for Index in 1 .. Count loop @@ -304,7 +304,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for I in 1 .. Count loop @@ -342,7 +342,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; for I in 1 .. Count loop @@ -510,12 +510,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; LI := First (Target); @@ -627,7 +627,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; Sort (Front => null, Back => null); @@ -665,7 +665,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Before.Container /= null then if Before.Container /= Container'Unrestricted_Access then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; if Before.Node = null @@ -689,7 +689,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; declare @@ -867,7 +867,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; Clear (Target); @@ -1077,7 +1077,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (list is locked)"; + "attempt to tamper with elements (list is locked)"; end if; if Position.Node.Element = null then @@ -1156,7 +1156,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; Container.First := J; @@ -1293,12 +1293,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; if Target.Length = 0 then @@ -1388,7 +1388,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; if Before.Node = null then @@ -1504,12 +1504,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Target (list is busy)"; + "attempt to tamper with cursors of Target (list is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements of Source (list is busy)"; + "attempt to tamper with cursors of Source (list is busy)"; end if; if Position.Node = Source.First then @@ -1608,7 +1608,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (list is locked)"; + "attempt to tamper with elements (list is locked)"; end if; pragma Assert (Vet (I), "bad I cursor in Swap"); @@ -1654,7 +1654,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (list is busy)"; + "attempt to tamper with cursors (list is busy)"; end if; pragma Assert (Vet (I), "bad I cursor in Swap_Links"); diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb index 0ec53dfe54b..b487394b366 100644 --- a/gcc/ada/a-cihama.adb +++ b/gcc/ada/a-cihama.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -197,7 +197,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is if Container.HT.Busy > 0 then raise Program_Error with - "Delete attempted to tamper with elements (map is busy)"; + "Delete attempted to tamper with cursors (map is busy)"; end if; pragma Assert (Vet (Position), "bad cursor in Delete"); @@ -482,7 +482,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is if not Inserted then if Container.HT.Lock > 0 then raise Program_Error with - "Include attempted to tamper with cursors (map is locked)"; + "Include attempted to tamper with elements (map is locked)"; end if; K := Position.Node.Key; @@ -836,7 +836,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is if Container.HT.Lock > 0 then raise Program_Error with - "Replace attempted to tamper with cursors (map is locked)"; + "Replace attempted to tamper with elements (map is locked)"; end if; K := Node.Key; @@ -885,7 +885,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is if Position.Container.HT.Lock > 0 then raise Program_Error with - "Replace_Element attempted to tamper with cursors (map is locked)"; + "Replace_Element attempted to tamper with elements (map is locked)"; end if; pragma Assert (Vet (Position), "bad cursor in Replace_Element"); @@ -1031,7 +1031,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is return False; end if; - if X = X.Next then -- to prevent endless loop + if X = X.Next then -- to prevent unnecessary looping return False; end if; diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb index c901e646e66..0a42fb239b3 100644 --- a/gcc/ada/a-cihase.adb +++ b/gcc/ada/a-cihase.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -242,7 +242,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Container.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; pragma Assert (Vet (Position), "Position cursor is bad"); @@ -275,7 +275,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; if Source.HT.Length < Target.HT.Length then @@ -667,7 +667,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if not Inserted then if Container.HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; X := Position.Node.Element; @@ -776,7 +776,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; Tgt_Node := HT_Ops.First (Target.HT); @@ -1145,7 +1145,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Container.HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; X := Node.Element; @@ -1220,7 +1220,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; declare @@ -1540,7 +1540,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; declare diff --git a/gcc/ada/a-ciorma.adb b/gcc/ada/a-ciorma.adb index 4093d610b9a..9cfcd3f5a80 100644 --- a/gcc/ada/a-ciorma.adb +++ b/gcc/ada/a-ciorma.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -625,7 +625,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is if not Inserted then if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; K := Position.Node.Key; @@ -1106,7 +1106,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; K := Node.Key; @@ -1155,7 +1155,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; pragma Assert (Vet (Container.Tree, Position.Node), diff --git a/gcc/ada/a-ciormu.adb b/gcc/ada/a-ciormu.adb index 6afe081685f..8c7055b2fef 100644 --- a/gcc/ada/a-ciormu.adb +++ b/gcc/ada/a-ciormu.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -1564,7 +1564,7 @@ package body Ada.Containers.Indefinite_Ordered_Multisets is else if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; declare diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb index 6090089f25a..7153c6dd235 100644 --- a/gcc/ada/a-ciorse.adb +++ b/gcc/ada/a-ciorse.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -930,7 +930,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is if not Inserted then if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; X := Position.Node.Element; @@ -1444,7 +1444,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; X := Node.Element; @@ -1499,7 +1499,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is X : Element_Access := Node.Element; - -- Start of processing for Insert + -- Start of processing for Replace_Element begin if Item < Node.Element.all @@ -1510,7 +1510,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is else if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := new Element_Type'(Item); @@ -1528,7 +1528,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is if Hint = Node then if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := new Element_Type'(Item); diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb index 9c8877f2d40..65247241939 100644 --- a/gcc/ada/a-cohama.adb +++ b/gcc/ada/a-cohama.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -192,7 +192,7 @@ package body Ada.Containers.Hashed_Maps is if Container.HT.Busy > 0 then raise Program_Error with - "Delete attempted to tamper with elements (map is busy)"; + "Delete attempted to tamper with cursors (map is busy)"; end if; pragma Assert (Vet (Position), "bad cursor in Delete"); @@ -413,7 +413,7 @@ package body Ada.Containers.Hashed_Maps is if not Inserted then if Container.HT.Lock > 0 then raise Program_Error with - "Include attempted to tamper with cursors (map is locked)"; + "Include attempted to tamper with elements (map is locked)"; end if; Position.Node.Key := Key; @@ -755,7 +755,7 @@ package body Ada.Containers.Hashed_Maps is if Container.HT.Lock > 0 then raise Program_Error with - "Replace attempted to tamper with cursors (map is locked)"; + "Replace attempted to tamper with elements (map is locked)"; end if; Node.Key := Key; @@ -784,7 +784,7 @@ package body Ada.Containers.Hashed_Maps is if Position.Container.HT.Lock > 0 then raise Program_Error with - "Replace_Element attempted to tamper with cursors (map is locked)"; + "Replace_Element attempted to tamper with elements (map is locked)"; end if; pragma Assert (Vet (Position), "bad cursor in Replace_Element"); @@ -908,7 +908,7 @@ package body Ada.Containers.Hashed_Maps is return False; end if; - if X = X.Next then -- to prevent endless loop + if X = X.Next then -- to prevent unnecessary looping return False; end if; diff --git a/gcc/ada/a-cohase.adb b/gcc/ada/a-cohase.adb index 760605feb30..643dde5d964 100644 --- a/gcc/ada/a-cohase.adb +++ b/gcc/ada/a-cohase.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -230,7 +230,7 @@ package body Ada.Containers.Hashed_Sets is if Container.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; pragma Assert (Vet (Position), "bad cursor in Delete"); @@ -263,7 +263,7 @@ package body Ada.Containers.Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; if Source.HT.Length < Target.HT.Length then @@ -614,7 +614,7 @@ package body Ada.Containers.Hashed_Sets is if not Inserted then if Container.HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Position.Node.Element := New_Item; @@ -713,7 +713,7 @@ package body Ada.Containers.Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; Tgt_Node := HT_Ops.First (Target.HT); @@ -1059,7 +1059,7 @@ package body Ada.Containers.Hashed_Sets is if Container.HT.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := New_Item; @@ -1123,7 +1123,7 @@ package body Ada.Containers.Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; declare @@ -1392,7 +1392,7 @@ package body Ada.Containers.Hashed_Sets is if Target.HT.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (set is busy)"; + "attempt to tamper with cursors (set is busy)"; end if; declare diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb index 6443644b4f6..97d3f8a294a 100644 --- a/gcc/ada/a-coinve.adb +++ b/gcc/ada/a-coinve.adb @@ -619,7 +619,7 @@ package body Ada.Containers.Indefinite_Vectors is begin if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; while Container.Last >= Index_Type'First loop @@ -720,7 +720,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- We first calculate what's available for deletion starting at @@ -911,7 +911,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- Elements in an indefinite vector are allocated, so we must iterate @@ -1182,7 +1182,7 @@ package body Ada.Containers.Indefinite_Vectors is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; I := Target.Last; -- original value (before Set_Length) @@ -1258,7 +1258,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; Sort (Container.Elements.EA (Index_Type'First .. Container.Last)); @@ -1491,7 +1491,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; if New_Length <= Container.Elements.EA'Length then @@ -2210,7 +2210,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; if New_Length <= Container.Elements.EA'Length then @@ -2500,7 +2500,7 @@ package body Ada.Containers.Indefinite_Vectors is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (Source is busy)"; + "attempt to tamper with cursors (Source is busy)"; end if; Clear (Target); -- Checks busy-bit @@ -2711,7 +2711,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare @@ -2742,7 +2742,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare @@ -2812,7 +2812,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; declare @@ -2943,7 +2943,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; declare @@ -2998,7 +2998,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- We now allocate a new internal array, having a length different from @@ -3042,7 +3042,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare @@ -3207,7 +3207,7 @@ package body Ada.Containers.Indefinite_Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index 501128b9d89..16b6591f6a4 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -440,7 +440,7 @@ package body Ada.Containers.Vectors is begin if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; Container.Last := No_Index; @@ -524,7 +524,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- We first calculate what's available for deletion starting at @@ -653,7 +653,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- There is no restriction on how large Count can be when deleting @@ -717,7 +717,7 @@ package body Ada.Containers.Vectors is begin if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; Container.Elements := null; @@ -862,7 +862,7 @@ package body Ada.Containers.Vectors is if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; Target.Set_Length (Length (Target) + Length (Source)); @@ -923,7 +923,7 @@ package body Ada.Containers.Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; Sort (Container.Elements.EA (Index_Type'First .. Container.Last)); @@ -1147,7 +1147,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- An internal array has already been allocated, so we must determine @@ -1802,7 +1802,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- An internal array has already been allocated, so we must determine @@ -2102,12 +2102,12 @@ package body Ada.Containers.Vectors is if Target.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (Target is busy)"; + "attempt to tamper with cursors (Target is busy)"; end if; if Source.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (Source is busy)"; + "attempt to tamper with cursors (Source is busy)"; end if; declare @@ -2303,7 +2303,7 @@ package body Ada.Containers.Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; Container.Elements.EA (Index) := New_Item; @@ -2329,7 +2329,7 @@ package body Ada.Containers.Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; Container.Elements.EA (Position.Index) := New_Item; @@ -2392,7 +2392,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; declare @@ -2527,7 +2527,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; declare @@ -2586,7 +2586,7 @@ package body Ada.Containers.Vectors is if Container.Busy > 0 then raise Program_Error with - "attempt to tamper with elements (vector is busy)"; + "attempt to tamper with cursors (vector is busy)"; end if; -- We now allocate a new internal array, having a length different from @@ -2649,7 +2649,7 @@ package body Ada.Containers.Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare @@ -2801,7 +2801,7 @@ package body Ada.Containers.Vectors is if Container.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (vector is locked)"; + "attempt to tamper with elements (vector is locked)"; end if; declare diff --git a/gcc/ada/a-coorma.adb b/gcc/ada/a-coorma.adb index 934d9de658c..ba865202d24 100644 --- a/gcc/ada/a-coorma.adb +++ b/gcc/ada/a-coorma.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -537,7 +537,7 @@ package body Ada.Containers.Ordered_Maps is if not Inserted then if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; Position.Node.Key := Key; @@ -1018,7 +1018,7 @@ package body Ada.Containers.Ordered_Maps is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; Node.Key := Key; @@ -1047,7 +1047,7 @@ package body Ada.Containers.Ordered_Maps is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (map is locked)"; + "attempt to tamper with elements (map is locked)"; end if; pragma Assert (Vet (Container.Tree, Position.Node), diff --git a/gcc/ada/a-coormu.adb b/gcc/ada/a-coormu.adb index 011ffbfae52..b59f6f554ef 100644 --- a/gcc/ada/a-coormu.adb +++ b/gcc/ada/a-coormu.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -1481,7 +1481,7 @@ package body Ada.Containers.Ordered_Multisets is else if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := Item; diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb index 2c02f2fd6a4..d4e73029b2a 100644 --- a/gcc/ada/a-coorse.adb +++ b/gcc/ada/a-coorse.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -855,7 +855,7 @@ package body Ada.Containers.Ordered_Sets is if not Inserted then if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Position.Node.Element := New_Item; @@ -1355,7 +1355,7 @@ package body Ada.Containers.Ordered_Sets is if Container.Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := New_Item; @@ -1405,7 +1405,7 @@ package body Ada.Containers.Ordered_Sets is Result : Node_Access; Inserted : Boolean; - -- Start of processing for Insert + -- Start of processing for Replace_Element begin if Item < Node.Element @@ -1416,7 +1416,7 @@ package body Ada.Containers.Ordered_Sets is else if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := Item; @@ -1432,7 +1432,7 @@ package body Ada.Containers.Ordered_Sets is if Hint = Node then if Tree.Lock > 0 then raise Program_Error with - "attempt to tamper with cursors (set is locked)"; + "attempt to tamper with elements (set is locked)"; end if; Node.Element := Item; diff --git a/gcc/ada/a-dirval.adb b/gcc/ada/a-dirval.adb index 48f3cc6f48e..c3da2efd437 100644 --- a/gcc/ada/a-dirval.adb +++ b/gcc/ada/a-dirval.adb @@ -7,7 +7,7 @@ -- B o d y -- -- (POSIX Version) -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -47,7 +47,7 @@ package body Ada.Directories.Validity is -- Is_Valid_Path_Name -- ------------------------ - function Is_Valid_Path_Name (Name : String) return Boolean is + function Is_Valid_Path_Name (Name : String) return Boolean is begin -- A path name cannot be empty and cannot contain any NUL character diff --git a/gcc/ada/a-strunb-shared.ads b/gcc/ada/a-strunb-shared.ads index b4b7c622759..cbeae34fd98 100644 --- a/gcc/ada/a-strunb-shared.ads +++ b/gcc/ada/a-strunb-shared.ads @@ -55,19 +55,19 @@ -- - Object mutation. Shared data object can be reused without memory -- reallocation when all of the following requirements are met: - -- - shared data object is no longer used by anyone else. - -- - the size is sufficient to store new value. - -- - the gap after reuse is less then a defined threashold. + -- - the shared data object is no longer used by anyone else; + -- - the size is sufficient to store the new value; + -- - the gap after reuse is less then a defined threshold. -- - Memory preallocation. Most of used memory allocation algorithms - -- allign allocated segments on the some boundary, thus some amount of + -- align allocated segments on the some boundary, thus some amount of -- additional memory can be preallocated without any impact. Such -- preallocated memory can used later by Append/Insert operations -- without reallocation. -- Reference counting uses GCC builtin atomic operations, which allows to - -- safely share internal data between Ada tasks. Nevertheless, this not - -- make objects of Unbounded_String thread-safe, so each instance can't be + -- safely share internal data between Ada tasks. Nevertheless, this doesn't + -- make objects of Unbounded_String thread-safe: each instance can't be -- accessed by several tasks simulatenously. with Ada.Strings.Maps; diff --git a/gcc/ada/a-ststio.adb b/gcc/ada/a-ststio.adb index f3949898e5a..c5da571495f 100644 --- a/gcc/ada/a-ststio.adb +++ b/gcc/ada/a-ststio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -147,7 +147,7 @@ package body Ada.Streams.Stream_IO is function End_Of_File (File : File_Type) return Boolean is begin FIO.Check_Read_Status (AP (File)); - return Count (File.Index) > Size (File); + return File.Index > Size (File); end End_Of_File; ----------- @@ -175,7 +175,7 @@ package body Ada.Streams.Stream_IO is function Index (File : File_Type) return Positive_Count is begin FIO.Check_File_Open (AP (File)); - return Count (File.Index); + return File.Index; end Index; ------------- diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index cc1dd99ead6..bfb58e07aa9 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -579,10 +579,29 @@ __gnat_get_maximum_file_name_length (void) int __gnat_get_file_names_case_sensitive (void) { + const char *sensitive = getenv ("GNAT_FILE_NAME_CASE_SENSITIVE"); + + if (sensitive != NULL + && (sensitive[0] == '0' || sensitive[0] == '1') + && sensitive[1] == '\0') + return sensitive[0] - '0'; + else #if defined (VMS) || defined (WINNT) || defined (__APPLE__) - return 0; + return 0; #else - return 1; + return 1; +#endif +} + +/* Return nonzero if environment variables are case sensitive. */ + +int +__gnat_get_env_vars_case_sensitive (void) +{ +#if defined (VMS) || defined (WINNT) + return 0; +#else + return 1; #endif } diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index 7af079e35a9..a43f9b23f4e 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2009, Free Software Foundation, Inc. * + * Copyright (C) 1992-2010, 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- * @@ -101,6 +101,7 @@ extern void __gnat_to_gm_time (OS_Time *, int *, int *, extern int __gnat_get_maximum_file_name_length (void); extern int __gnat_get_switches_case_sensitive (void); extern int __gnat_get_file_names_case_sensitive (void); +extern int __gnat_get_env_vars_case_sensitive (void); extern char __gnat_get_default_identifier_character_set (void); extern void __gnat_get_current_dir (char *, int *); extern void __gnat_get_object_suffix_ptr (int *, diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb index 001d654ff1d..8c837b4177d 100644 --- a/gcc/ada/ali-util.adb +++ b/gcc/ada/ali-util.adb @@ -50,8 +50,6 @@ package body ALI.Util is procedure Error_Msg_SP (Msg : String); - procedure Obsolescent_Check (S : Source_Ptr); - -- Instantiation of Styleg, needed to instantiate Scng package Style is new Styleg @@ -61,8 +59,7 @@ package body ALI.Util is -- Get_File_Checksum). package Scanner is new Scng - (Post_Scan, Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP, - Obsolescent_Check, Style); + (Post_Scan, Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP, Style); type Header_Num is range 0 .. 1_000; @@ -201,16 +198,6 @@ package body ALI.Util is Interfaces.Reset; end Initialize_ALI_Source; - ----------------------- - -- Obsolescent_Check -- - ----------------------- - - procedure Obsolescent_Check (S : Source_Ptr) is - pragma Warnings (Off, S); - begin - null; - end Obsolescent_Check; - --------------- -- Post_Scan -- --------------- diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 807527230af..6e01d7ed42e 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -1261,7 +1261,7 @@ package body Atree is -- New_Node_Breakpoint -- ------------------------- - procedure nn is -- New_Node_Breakpoint + procedure nn is begin Write_Str ("Watched node "); Write_Int (Int (Watch_Node)); @@ -1273,7 +1273,7 @@ package body Atree is -- New_Node_Debugging_Output -- ------------------------------- - procedure nnd (N : Node_Id) is -- New_Node_Debugging_Output + procedure nnd (N : Node_Id) is Node_Is_Watched : constant Boolean := N = Watch_Node; begin @@ -1666,7 +1666,7 @@ package body Atree is -- Rewrite_Breakpoint -- ------------------------- - procedure rr is -- Rewrite_Breakpoint + procedure rr is begin Write_Str ("Watched node "); Write_Int (Int (Watch_Node)); @@ -1678,7 +1678,7 @@ package body Atree is -- Rewrite_Debugging_Output -- ------------------------------ - procedure rrd (Old_Node, New_Node : Node_Id) is -- Rewrite_Debugging_Output + procedure rrd (Old_Node, New_Node : Node_Id) is Node_Is_Watched : constant Boolean := Old_Node = Watch_Node; begin diff --git a/gcc/ada/binde.adb b/gcc/ada/binde.adb index f4681906df1..0dc65218644 100644 --- a/gcc/ada/binde.adb +++ b/gcc/ada/binde.adb @@ -614,7 +614,7 @@ package body Binde is Write_Str (" decrementing Num_Pred for unit "); Write_Unit_Name (Units.Table (U).Uname); Write_Str (" new value = "); - Write_Int (Int (UNR.Table (U).Num_Pred)); + Write_Int (UNR.Table (U).Num_Pred); Write_Eol; end if; @@ -1152,7 +1152,7 @@ package body Binde is Write_Str (" Elaborate_Body = True, Num_Pred for body = "); Write_Int - (Int (UNR.Table (Corresponding_Body (U)).Num_Pred)); + (UNR.Table (Corresponding_Body (U)).Num_Pred); else Write_Str (" Elaborate_Body = False"); @@ -1243,8 +1243,7 @@ package body Binde is goto Next_With; end if; - Withed_Unit := - Unit_Id (Unit_Id_Of (Withs.Table (W).Uname)); + Withed_Unit := Unit_Id_Of (Withs.Table (W).Uname); -- Pragma Elaborate_All case, for this we use the recursive -- Elab_All_Links procedure to establish the links. diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 3d120161789..cbcc96bbd65 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -139,7 +139,7 @@ package body Bindgen is -- Heap_Size is the heap to use for memory allocations set by use of a -- -Hnn parameter for the binder or by the GNAT$NO_MALLOC_64 logical. - -- Valid values are 32 and 64. This switch is only available on VMS. + -- Valid values are 32 and 64. This switch is only effective on VMS. -- WC_Encoding shows the wide character encoding method used for the main -- program. This is one of the encoding letters defined in @@ -349,6 +349,11 @@ package body Bindgen is -- Sets characters of given string in Statement_Buffer, starting at the -- Last + 1 position, and updating last past the string value. + procedure Set_String_Replace (S : String); + -- Replaces the last S'Length characters in the Statement_Buffer with + -- the characters of S. The caller must ensure that these characters do + -- in fact exist in the Statement_Buffer. + procedure Set_Unit_Name; -- Given a unit name in the Name_Buffer, copies it to Statement_Buffer, -- starting at the Last + 1 position, and updating last past the value. @@ -788,10 +793,17 @@ package body Bindgen is -- Generate call to Install_Handler - WBI (""); - WBI (" if Handler_Installed = 0 then"); - WBI (" Install_Handler;"); - WBI (" end if;"); + -- In .NET, when binding with -z, we don't install the signal handler + -- to let the caller handle the last exception handler. + + if VM_Target /= CLI_Target + or else Bind_Main_Program + then + WBI (""); + WBI (" if Handler_Installed = 0 then"); + WBI (" Install_Handler;"); + WBI (" end if;"); + end if; -- Generate call to Set_Features @@ -2336,7 +2348,7 @@ package body Bindgen is WBI (""); WBI (" GNAT_Version : constant String :="); - WBI (" ""GNAT Version: " & + WBI (" """ & Ver_Prefix & Gnat_Version_String & """ & ASCII.NUL;"); WBI (" pragma Export (C, GNAT_Version, ""__gnat_version"");"); @@ -2745,7 +2757,7 @@ package body Bindgen is if Bind_Main_Program then WBI (""); - WBI ("char __gnat_version[] = ""GNAT Version: " & + WBI ("char __gnat_version[] = """ & Ver_Prefix & Gnat_Version_String & """;"); Set_String ("char __gnat_ada_main_program_name[] = """); @@ -2801,9 +2813,7 @@ package body Bindgen is Count := 0; - for J in Cumulative_Restrictions.Set'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Set'Last) - loop + for J in Cumulative_Restrictions.Set'Range loop Set_Boolean (Cumulative_Restrictions.Set (J)); Set_String (", "); Count := Count + 1; @@ -2815,30 +2825,22 @@ package body Bindgen is end if; end loop; - Set_Boolean - (Cumulative_Restrictions.Set (Cumulative_Restrictions.Set'Last)); - Set_String ("),"); + Set_String_Replace ("),"); Write_Statement_Buffer; Set_String (" Value => ("); - for J in Cumulative_Restrictions.Value'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Value'Last) - loop + for J in Cumulative_Restrictions.Value'Range loop Set_Int (Int (Cumulative_Restrictions.Value (J))); Set_String (", "); end loop; - Set_Int (Int (Cumulative_Restrictions.Value - (Cumulative_Restrictions.Value'Last))); - Set_String ("),"); + Set_String_Replace ("),"); Write_Statement_Buffer; WBI (" Violated =>"); Set_String (" ("); Count := 0; - for J in Cumulative_Restrictions.Violated'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Violated'Last) - loop + for J in Cumulative_Restrictions.Violated'Range loop Set_Boolean (Cumulative_Restrictions.Violated (J)); Set_String (", "); Count := Count + 1; @@ -2850,36 +2852,26 @@ package body Bindgen is end if; end loop; - Set_Boolean (Cumulative_Restrictions.Violated - (Cumulative_Restrictions.Violated'Last)); - Set_String ("),"); + Set_String_Replace ("),"); Write_Statement_Buffer; Set_String (" Count => ("); - for J in Cumulative_Restrictions.Count'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Count'Last) - loop + for J in Cumulative_Restrictions.Count'Range loop Set_Int (Int (Cumulative_Restrictions.Count (J))); Set_String (", "); end loop; - Set_Int (Int (Cumulative_Restrictions.Count - (Cumulative_Restrictions.Count'Last))); - Set_String ("),"); + Set_String_Replace ("),"); Write_Statement_Buffer; Set_String (" Unknown => ("); - for J in Cumulative_Restrictions.Unknown'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Unknown'Last) - loop + for J in Cumulative_Restrictions.Unknown'Range loop Set_Boolean (Cumulative_Restrictions.Unknown (J)); Set_String (", "); end loop; - Set_Boolean - (Cumulative_Restrictions.Unknown - (Cumulative_Restrictions.Unknown'Last)); - Set_String ("));"); + Set_String_Replace ("))"); + Set_String (";"); Write_Statement_Buffer; end Gen_Restrictions_Ada; @@ -2926,68 +2918,49 @@ package body Bindgen is WBI (" restrictions r = {"); Set_String (" {"); - for J in Cumulative_Restrictions.Set'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Set'Last) - loop + for J in Cumulative_Restrictions.Set'Range loop Set_Int (Boolean'Pos (Cumulative_Restrictions.Set (J))); Set_String (", "); end loop; - Set_Int (Boolean'Pos - (Cumulative_Restrictions.Set (Cumulative_Restrictions.Set'Last))); - Set_String ("},"); + Set_String_Replace ("},"); Write_Statement_Buffer; Set_String (" {"); - for J in Cumulative_Restrictions.Value'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Value'Last) - loop + for J in Cumulative_Restrictions.Value'Range loop Set_Int (Int (Cumulative_Restrictions.Value (J))); Set_String (", "); end loop; - Set_Int (Int (Cumulative_Restrictions.Value - (Cumulative_Restrictions.Value'Last))); - Set_String ("},"); + Set_String_Replace ("},"); Write_Statement_Buffer; Set_String (" {"); - for J in Cumulative_Restrictions.Violated'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Violated'Last) - loop + for J in Cumulative_Restrictions.Violated'Range loop Set_Int (Boolean'Pos (Cumulative_Restrictions.Violated (J))); Set_String (", "); end loop; - Set_Int (Boolean'Pos (Cumulative_Restrictions.Violated - (Cumulative_Restrictions.Violated'Last))); - Set_String ("},"); + Set_String_Replace ("},"); Write_Statement_Buffer; Set_String (" {"); - for J in Cumulative_Restrictions.Count'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Count'Last) - loop + for J in Cumulative_Restrictions.Count'Range loop Set_Int (Int (Cumulative_Restrictions.Count (J))); Set_String (", "); end loop; - Set_Int (Int (Cumulative_Restrictions.Count - (Cumulative_Restrictions.Count'Last))); - Set_String ("},"); + Set_String_Replace ("},"); Write_Statement_Buffer; Set_String (" {"); - for J in Cumulative_Restrictions.Unknown'First .. - Restriction_Id'Pred (Cumulative_Restrictions.Unknown'Last) - loop + for J in Cumulative_Restrictions.Unknown'Range loop Set_Int (Boolean'Pos (Cumulative_Restrictions.Unknown (J))); Set_String (", "); end loop; - Set_Int (Boolean'Pos (Cumulative_Restrictions.Unknown - (Cumulative_Restrictions.Unknown'Last))); - Set_String ("}};"); + Set_String_Replace ("}}"); + Set_String (";"); Write_Statement_Buffer; WBI (" system__restrictions__run_time_restrictions = r;"); end Gen_Restrictions_C; @@ -3475,6 +3448,15 @@ package body Bindgen is Last := Last + S'Length; end Set_String; + ------------------------ + -- Set_String_Replace -- + ------------------------ + + procedure Set_String_Replace (S : String) is + begin + Statement_Buffer (Last - S'Length + 1 .. Last) := S; + end Set_String_Replace; + ------------------- -- Set_Unit_Name -- ------------------- diff --git a/gcc/ada/casing.ads b/gcc/ada/casing.ads index 6585a0299e9..8d169fbd3f1 100644 --- a/gcc/ada/casing.ads +++ b/gcc/ada/casing.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -61,6 +61,9 @@ package Casing is -- (e.g. X, Y_3, M4, A_B, or if it is inconsistent ABC_def). ); + subtype Known_Casing is Casing_Type range All_Upper_Case .. Mixed_Case; + -- Exclude Unknown casing + ------------------------------ -- Case Control Subprograms -- ------------------------------ diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 59270e875a9..7448168566c 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -722,8 +722,8 @@ package body Checks is procedure Apply_Arithmetic_Overflow_Check (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); - Typ : Entity_Id := Etype (N); - Rtyp : Entity_Id := Root_Type (Typ); + Typ : constant Entity_Id := Etype (N); + Rtyp : constant Entity_Id := Root_Type (Typ); begin -- An interesting special case. If the arithmetic operation appears as @@ -815,9 +815,23 @@ package body Checks is Subtype_Mark => New_Occurrence_Of (Target_Type, Loc), Expression => Relocate_Node (Right_Opnd (N)))); + -- Rewrite the conversion operand so that the original + -- node is retained, in order to avoid the warning for + -- redundant conversions in Resolve_Type_Conversion. + + -- The above comment is uncomfortable. This seems like + -- an awkward covert channel, since there isno general + -- requirement in sinfo.ads or einfo.ads that requires + -- this rewrite. Instead, the issue seems to be that in + -- the old code, some node was incorrectly marked as + -- coming from source when it should not have been and/or + -- the warning code did not properly test the appropriate + -- Comes_From_Soure flag. ??? + + Rewrite (N, Relocate_Node (N)); + Set_Etype (N, Target_Type); - Typ := Target_Type; - Rtyp := Root_Type (Typ); + Analyze_And_Resolve (Left_Opnd (N), Target_Type); Analyze_And_Resolve (Right_Opnd (N), Target_Type); @@ -4094,6 +4108,17 @@ package body Checks is end if; end if; + -- If this is a boolean expression, only its elementary consituents need + -- checking: if they are valid, a boolean or short-circuit operation + -- with them will be valid as well. + + if Base_Type (Typ) = Standard_Boolean + and then + (Nkind (Expr) in N_Op or else Nkind (Expr) in N_Short_Circuit) + then + return; + end if; + -- If we fall through, a validity check is required Insert_Valid_Check (Expr); diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb index 54497274f2d..f3a1e2fb7a7 100644 --- a/gcc/ada/clean.adb +++ b/gcc/ada/clean.adb @@ -1556,7 +1556,6 @@ package body Clean is -- Initialize some packages Csets.Initialize; - Namet.Initialize; Snames.Initialize; Project_Node_Tree := new Project_Node_Tree_Data; diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 9f9332b7241..bc85f0c5044 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -446,6 +446,7 @@ package body CStand is Set_Is_Unsigned_Type (Standard_Boolean); Set_Size_Known_At_Compile_Time (Standard_Boolean); + Set_Has_Pragma_Ordered (Standard_Boolean); Set_Ekind (Standard_True, E_Enumeration_Literal); Set_Etype (Standard_True, Standard_Boolean); @@ -566,6 +567,7 @@ package body CStand is Init_RM_Size (Standard_Character, 8); Set_Elem_Alignment (Standard_Character); + Set_Has_Pragma_Ordered (Standard_Character); Set_Is_Unsigned_Type (Standard_Character); Set_Is_Character_Type (Standard_Character); Set_Is_Known_Valid (Standard_Character); @@ -611,6 +613,7 @@ package body CStand is Init_Size (Standard_Wide_Character, Standard_Wide_Character_Size); Set_Elem_Alignment (Standard_Wide_Character); + Set_Has_Pragma_Ordered (Standard_Wide_Character); Set_Is_Unsigned_Type (Standard_Wide_Character); Set_Is_Character_Type (Standard_Wide_Character); Set_Is_Known_Valid (Standard_Wide_Character); @@ -658,6 +661,7 @@ package body CStand is Standard_Wide_Wide_Character_Size); Set_Elem_Alignment (Standard_Wide_Wide_Character); + Set_Has_Pragma_Ordered (Standard_Wide_Wide_Character); Set_Is_Unsigned_Type (Standard_Wide_Wide_Character); Set_Is_Character_Type (Standard_Wide_Wide_Character); Set_Is_Known_Valid (Standard_Wide_Wide_Character); diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index b7f750d506f..bbf86466eae 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -581,8 +581,8 @@ package body Debug is -- d.T Force Optimize_Alignment (Time) mode as the default -- d.W Print out debugging information for Walk_Library_Items, including - -- the order in which units are walked. This is primarily for SofCheck - -- Inspector. + -- the order in which units are walked. This is primarily for use in + -- debugging CodePeer mode. -- d.X By default, the compiler uses an elaborate rewriting framework for -- short-circuited forms where the right hand condition generates diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 4a9e3173075..24461c29db7 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -149,6 +149,7 @@ package body Einfo is -- Alias Node18 -- Corresponding_Concurrent_Type Node18 + -- Corresponding_Protected_Entry Node18 -- Corresponding_Record_Type Node18 -- Delta_Value Ureal18 -- Enclosing_Scope Node18 @@ -455,6 +456,7 @@ package body Einfo is -- Is_Primitive_Wrapper Flag195 -- Was_Hidden Flag196 -- Is_Limited_Interface Flag197 + -- Has_Pragma_Ordered Flag198 -- Has_Anon_Block_Suffix Flag201 -- Itype_Printed Flag202 @@ -508,7 +510,6 @@ package body Einfo is -- Is_Underlying_Record_View Flag246 -- OK_To_Rename Flag247 - -- (unused) Flag198 -- (unused) Flag199 -- (unused) Flag200 @@ -723,6 +724,12 @@ package body Einfo is return Node13 (Id); end Corresponding_Equality; + function Corresponding_Protected_Entry (Id : E) return E is + begin + pragma Assert (Ekind (Id) = E_Subprogram_Body); + return Node18 (Id); + end Corresponding_Protected_Entry; + function Corresponding_Record_Type (Id : E) return E is begin pragma Assert (Is_Concurrent_Type (Id)); @@ -1336,6 +1343,12 @@ package body Einfo is return Flag230 (Id); end Has_Pragma_Inline_Always; + function Has_Pragma_Ordered (Id : E) return B is + begin + pragma Assert (Is_Enumeration_Type (Id)); + return Flag198 (Implementation_Base_Type (Id)); + end Has_Pragma_Ordered; + function Has_Pragma_Pack (Id : E) return B is begin pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id)); @@ -2731,6 +2744,11 @@ package body Einfo is return Ekind (Id) in Access_Subprogram_Kind; end Is_Access_Subprogram_Type; + function Is_Aggregate_Type (Id : E) return B is + begin + return Ekind (Id) in Aggregate_Kind; + end Is_Aggregate_Type; + function Is_Array_Type (Id : E) return B is begin return Ekind (Id) in Array_Kind; @@ -3104,6 +3122,12 @@ package body Einfo is Set_Node13 (Id, V); end Set_Corresponding_Equality; + procedure Set_Corresponding_Protected_Entry (Id : E; V : E) is + begin + pragma Assert (Ekind_In (Id, E_Void, E_Subprogram_Body)); + Set_Node18 (Id, V); + end Set_Corresponding_Protected_Entry; + procedure Set_Corresponding_Record_Type (Id : E; V : E) is begin pragma Assert (Is_Concurrent_Type (Id)); @@ -3735,6 +3759,13 @@ package body Einfo is Set_Flag230 (Id, V); end Set_Has_Pragma_Inline_Always; + procedure Set_Has_Pragma_Ordered (Id : E; V : B := True) is + begin + pragma Assert (Is_Enumeration_Type (Id)); + pragma Assert (Id = Base_Type (Id)); + Set_Flag198 (Id, V); + end Set_Has_Pragma_Ordered; + procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is begin pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id)); @@ -6883,6 +6914,7 @@ package body Einfo is W ("Has_Pragma_Elaborate_Body", Flag150 (Id)); W ("Has_Pragma_Inline", Flag157 (Id)); W ("Has_Pragma_Inline_Always", Flag230 (Id)); + W ("Has_Pragma_Ordered", Flag198 (Id)); W ("Has_Pragma_Pack", Flag121 (Id)); W ("Has_Pragma_Preelab_Init", Flag221 (Id)); W ("Has_Pragma_Pure", Flag203 (Id)); @@ -7643,6 +7675,9 @@ package body Einfo is when E_Record_Type => Write_Str ("Corresponding_Concurrent_Type"); + when E_Subprogram_Body => + Write_Str ("Corresponding_Protected_Entry"); + when E_Entry_Index_Parameter => Write_Str ("Entry_Index_Constant"); diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index de742cd46d4..7a396c75ad1 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -631,6 +631,10 @@ package Einfo is -- other function entities, only in implicit inequality routines, -- where Comes_From_Source is always False. +-- Corresponding_Protected_Entry (Node18) +-- Present in subrogram bodies. Set for subprogram bodies that implement +-- a protected type entry to point to the entity for the entry. + -- Corresponding_Record_Type (Node18) -- Present in protected and task types and subtypes. References the -- entity for the corresponding record type constructed by the expander @@ -1574,6 +1578,12 @@ package Einfo is -- pragma Inline_Always applies. Note that if this flag is set, the flag -- Has_Pragma_Inline is also set. +-- Has_Pragma_Ordered (Flag198) [implementation base type only] +-- Present in entities for enumeration types. If set indicates that a +-- valid pragma Ordered was given for the type. This flag is inherited +-- by derived enumeration types. We don't need to distinguish the derived +-- case since we allow multiple occurrences of this pragma anyway. + -- Has_Pragma_Pack (Flag121) [implementation base type only] -- Present in all entities. If set, indicates that a valid pragma Pack -- was given for the type. Note that this flag is not inherited by @@ -4209,6 +4219,17 @@ package Einfo is E_Access_Protected_Subprogram_Type .. E_Anonymous_Access_Protected_Subprogram_Type; + subtype Aggregate_Kind is Entity_Kind range + E_Array_Type .. + -- E_Array_Subtype + -- E_String_Type + -- E_String_Subtype + -- E_String_Literal_Subtype + -- E_Class_Wide_Type + -- E_Class_Wide_Subtype + -- E_Record_Type + E_Record_Subtype; + subtype Array_Kind is Entity_Kind range E_Array_Type .. -- E_Array_Subtype @@ -4952,6 +4973,7 @@ package Einfo is -- Has_Biased_Representation (Flag139) -- Has_Contiguous_Rep (Flag181) -- Has_Enumeration_Rep_Clause (Flag66) + -- Has_Pragma_Ordered (Flag198) (base type only) -- Nonzero_Is_True (Flag162) (base type only) -- Type_Low_Bound (synth) -- Type_High_Bound (synth) @@ -5424,6 +5446,7 @@ package Einfo is -- E_Subprogram_Body -- Mechanism (Uint8) -- First_Entity (Node17) + -- Corresponding_Protected_Entry (Node18) -- Last_Entity (Node20) -- Scope_Depth_Value (Uint22) -- Scope_Depth (synth) @@ -5754,6 +5777,7 @@ package Einfo is function Corresponding_Concurrent_Type (Id : E) return E; function Corresponding_Discriminant (Id : E) return E; function Corresponding_Equality (Id : E) return E; + function Corresponding_Protected_Entry (Id : E) return E; function Corresponding_Record_Type (Id : E) return E; function Corresponding_Remote_Type (Id : E) return E; function Current_Use_Clause (Id : E) return E; @@ -5862,6 +5886,7 @@ package Einfo is function Has_Pragma_Elaborate_Body (Id : E) return B; function Has_Pragma_Inline (Id : E) return B; function Has_Pragma_Inline_Always (Id : E) return B; + function Has_Pragma_Ordered (Id : E) return B; function Has_Pragma_Pack (Id : E) return B; function Has_Pragma_Preelab_Init (Id : E) return B; function Has_Pragma_Pure (Id : E) return B; @@ -6115,6 +6140,7 @@ package Einfo is function Is_Access_Type (Id : E) return B; function Is_Access_Protected_Subprogram_Type (Id : E) return B; function Is_Access_Subprogram_Type (Id : E) return B; + function Is_Aggregate_Type (Id : E) return B; function Is_Array_Type (Id : E) return B; function Is_Assignable (Id : E) return B; function Is_Class_Wide_Type (Id : E) return B; @@ -6314,6 +6340,7 @@ package Einfo is procedure Set_Corresponding_Concurrent_Type (Id : E; V : E); procedure Set_Corresponding_Discriminant (Id : E; V : E); procedure Set_Corresponding_Equality (Id : E; V : E); + procedure Set_Corresponding_Protected_Entry (Id : E; V : E); procedure Set_Corresponding_Record_Type (Id : E; V : E); procedure Set_Corresponding_Remote_Type (Id : E; V : E); procedure Set_Current_Use_Clause (Id : E; V : E); @@ -6419,6 +6446,7 @@ package Einfo is procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True); procedure Set_Has_Pragma_Inline (Id : E; V : B := True); procedure Set_Has_Pragma_Inline_Always (Id : E; V : B := True); + procedure Set_Has_Pragma_Ordered (Id : E; V : B := True); procedure Set_Has_Pragma_Pack (Id : E; V : B := True); procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True); procedure Set_Has_Pragma_Pure (Id : E; V : B := True); @@ -6970,6 +6998,7 @@ package Einfo is pragma Inline (Corresponding_Concurrent_Type); pragma Inline (Corresponding_Discriminant); pragma Inline (Corresponding_Equality); + pragma Inline (Corresponding_Protected_Entry); pragma Inline (Corresponding_Record_Type); pragma Inline (Corresponding_Remote_Type); pragma Inline (Current_Use_Clause); @@ -7075,6 +7104,7 @@ package Einfo is pragma Inline (Has_Pragma_Elaborate_Body); pragma Inline (Has_Pragma_Inline); pragma Inline (Has_Pragma_Inline_Always); + pragma Inline (Has_Pragma_Ordered); pragma Inline (Has_Pragma_Pack); pragma Inline (Has_Pragma_Preelab_Init); pragma Inline (Has_Pragma_Pure); @@ -7125,6 +7155,7 @@ package Einfo is pragma Inline (Is_Access_Type); pragma Inline (Is_Access_Protected_Subprogram_Type); pragma Inline (Is_Access_Subprogram_Type); + pragma Inline (Is_Aggregate_Type); pragma Inline (Is_Aliased); pragma Inline (Is_Array_Type); pragma Inline (Is_Assignable); @@ -7400,6 +7431,7 @@ package Einfo is pragma Inline (Set_Corresponding_Concurrent_Type); pragma Inline (Set_Corresponding_Discriminant); pragma Inline (Set_Corresponding_Equality); + pragma Inline (Set_Corresponding_Protected_Entry); pragma Inline (Set_Corresponding_Record_Type); pragma Inline (Set_Corresponding_Remote_Type); pragma Inline (Set_Current_Use_Clause); @@ -7504,6 +7536,7 @@ package Einfo is pragma Inline (Set_Has_Pragma_Elaborate_Body); pragma Inline (Set_Has_Pragma_Inline); pragma Inline (Set_Has_Pragma_Inline_Always); + pragma Inline (Set_Has_Pragma_Ordered); pragma Inline (Set_Has_Pragma_Pack); pragma Inline (Set_Has_Pragma_Preelab_Init); pragma Inline (Set_Has_Pragma_Pure); diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index 4aea9d87d6d..795811473a2 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -60,13 +60,6 @@ package Errout is -- the use of constructs not permitted by the library in use, or improper -- constructs in No_Run_Time mode). - type Compiler_State_Type is (Parsing, Analyzing); - Compiler_State : Compiler_State_Type; - -- Indicates current state of compilation. This is put in the Errout spec - -- because it affects the action of the error message handling. In - -- particular, an attempt is made by Errout to suppress cascaded error - -- messages in Parsing mode, but not in the other modes. - Current_Error_Source_File : Source_File_Index renames Err_Vars.Current_Error_Source_File; -- Id of current messages. Used to post file name when unit changes. This diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index e2bd125399f..27ad463a1b4 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4946,7 +4946,7 @@ package body Exp_Aggr is end if; -- If the semantic analyzer has determined that aggregate N will raise - -- Constraint_Error at run-time, then the aggregate node has been + -- Constraint_Error at run time, then the aggregate node has been -- replaced with an N_Raise_Constraint_Error node and we should -- never get here. diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 7bb6285f5e2..ab48159b2ac 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -3011,7 +3011,8 @@ package body Exp_Attr is and then Chars (Defining_Entity (Subp)) /= Name_uPostconditions; end loop; - -- Insert the assignment at the start of the declarations + -- Insert the initialized object declaration at the start of the + -- subprogram's declarations. Asn_Stm := Make_Object_Declaration (Loc, @@ -3020,6 +3021,16 @@ package body Exp_Attr is Object_Definition => New_Occurrence_Of (Etype (N), Loc), Expression => Pref); + -- Push the subprogram's scope, so that the object will be analyzed + -- in that context (rather than the context of the Precondition + -- subprogram) and will have its Scope set properly. + + if Present (Corresponding_Spec (Subp)) then + Push_Scope (Corresponding_Spec (Subp)); + else + Push_Scope (Defining_Entity (Subp)); + end if; + if Is_Empty_List (Declarations (Subp)) then Set_Declarations (Subp, New_List (Asn_Stm)); Analyze (Asn_Stm); @@ -3027,6 +3038,8 @@ package body Exp_Attr is Insert_Action (First (Declarations (Subp)), Asn_Stm); end if; + Pop_Scope; + Rewrite (N, New_Occurrence_Of (Tnn, Loc)); end Old; @@ -5506,9 +5519,11 @@ package body Exp_Attr is -- the compiler will generate in-place stream routines for string types -- that appear in GNAT's library, but will generate calls via rtsfind -- to library routines for user code. + -- ??? For now, disable this code for JVM, since this generates a - -- VerifyError exception at run-time on e.g. c330001. - -- This is disabled for AAMP, to avoid making dependences on files not + -- VerifyError exception at run time on e.g. c330001. + + -- This is disabled for AAMP, to avoid creating dependences on files not -- supported in the AAMP library (such as s-fileio.adb). if VM_Target /= JVM_Target diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb index e7decc8f1e7..84b1ee94277 100644 --- a/gcc/ada/exp_cg.adb +++ b/gcc/ada/exp_cg.adb @@ -129,6 +129,14 @@ package body Exp_CG is Write_Call_Info (N); else pragma Assert (Nkind (N) = N_Defining_Identifier); + + -- The type may be a private untagged type whose completion is + -- tagged, in which case we must use the full tagged view. + + if not Is_Tagged_Type (N) and then Is_Private_Type (N) then + N := Full_View (N); + end if; + pragma Assert (Is_Tagged_Type (N)); Write_Type_Info (N); @@ -193,7 +201,7 @@ package body Exp_CG is declare Result : Natural := Prefix_Length + 1; begin - while Nr > 10 loop + while Nr >= 10 loop Result := Result + 1; Nr := Nr / 10; end loop; @@ -265,18 +273,43 @@ package body Exp_CG is Name_uDisp_Requeue, Name_uDisp_Timed_Select); - Suffix_Length : constant Natural := Homonym_Suffix_Length (E); + Suffix_Length : Natural; begin + -- Search for and strip suffix for body-nested package entities + + Suffix_Length := Homonym_Suffix_Length (E); + for J in reverse Full_Name'First + 2 .. Full_Name'Last loop + if Full_Name (J) = 'X' then + + -- Include the "X", "Xb", "Xn", ... in the part of the + -- suffix to be removed. + + Suffix_Length := Suffix_Length + Full_Name'Last - J + 1; + exit; + end if; + + exit when Full_Name (J) /= 'b' and then Full_Name (J) /= 'n'; + end loop; + for J in Predef_Names_95'Range loop Get_Name_String (Predef_Names_95 (J)); - if Full_Name'Last - Suffix_Length > Name_Len + -- The predefined primitive operations are identified by the + -- names "_size", "_alignment", etc. If we try a pattern + -- matching against this string, we can wrongly match other + -- primitive operations like "get_size". To avoid this, we + -- add the "__" scope separator, which can only prepend + -- predefined primitive operations because other primitive + -- operations can neither start with an underline nor + -- contain two consecutive underlines in its name. + + if Full_Name'Last - Suffix_Length > Name_Len + 2 and then Full_Name - (Full_Name'Last - Name_Len - Suffix_Length + 1 + (Full_Name'Last - Name_Len - 2 - Suffix_Length + 1 .. Full_Name'Last - Suffix_Length) = - Name_Buffer (1 .. Name_Len) + "__" & Name_Buffer (1 .. Name_Len) then -- For the equality operator the type of the two operands -- must also match. @@ -291,12 +324,12 @@ package body Exp_CG is for J in Predef_Names_05'Range loop Get_Name_String (Predef_Names_05 (J)); - if Full_Name'Last - Suffix_Length > Name_Len + if Full_Name'Last - Suffix_Length > Name_Len + 2 and then Full_Name - (Full_Name'Last - Name_Len - Suffix_Length + 1 + (Full_Name'Last - Name_Len - 2 - Suffix_Length + 1 .. Full_Name'Last - Suffix_Length) = - Name_Buffer (1 .. Name_Len) + "__" & Name_Buffer (1 .. Name_Len) then return True; end if; @@ -324,12 +357,22 @@ package body Exp_CG is declare Copy : constant Node_Id := New_Copy (N); + Par : Node_Id; begin - -- Copy the link to the parent to allow climbing up the tree - -- when the call-graph information is generated + -- Determine the enclosing scope to use when generating the + -- call graph. This must be done now to avoid problems with + -- control structures that may be rewritten during expansion. + + Par := Parent (N); + while Nkind (Par) /= N_Subprogram_Body + and then Nkind (Parent (Par)) /= N_Compilation_Unit + loop + Par := Parent (Par); + pragma Assert (Present (Par)); + end loop; - Set_Parent (Copy, Parent (N)); + Set_Parent (Copy, Par); Call_Graph_Nodes.Append (Copy); end; end if; @@ -378,23 +421,26 @@ package body Exp_CG is Ctrl_Arg : constant Node_Id := Controlling_Argument (Call); Ctrl_Typ : constant Entity_Id := Base_Type (Etype (Ctrl_Arg)); Prim : constant Entity_Id := Entity (Sinfo.Name (Call)); - P : Node_Id; + P : constant Node_Id := Parent (Call); begin - -- Locate the enclosing context: a subprogram (if available) or the - -- enclosing library-level package - - P := Parent (Call); - while Nkind (P) /= N_Subprogram_Body - and then Nkind (Parent (P)) /= N_Compilation_Unit - loop - P := Parent (P); - pragma Assert (Present (P)); - end loop; - Write_Str ("edge: { sourcename: "); Write_Char ('"'); - Get_External_Name (Defining_Entity (P), Has_Suffix => False); + + -- The parent node is the construct that contains the call: subprogram + -- body or library-level package. Display the qualified name of the + -- entity of the construct. For a subprogram, it is the entity of the + -- spec, which carries a homonym counter when it is overloaded. + + if Nkind (P) = N_Subprogram_Body + and then not Acts_As_Spec (P) + then + Get_External_Name (Corresponding_Spec (P), Has_Suffix => False); + + else + Get_External_Name (Defining_Entity (P), Has_Suffix => False); + end if; + Write_Str (Name_Buffer (1 .. Name_Len)); if Nkind (P) = N_Package_Declaration then diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index 111bc182fe7..2efee394a17 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -2006,7 +2006,7 @@ package body Exp_Ch11 is procedure Warn_If_No_Propagation (N : Node_Id) is begin - if Restriction_Active (No_Exception_Propagation) + if Restriction_Check_Required (No_Exception_Propagation) and then Warn_On_Non_Local_Exception then Warn_No_Exception_Propagation_Active (N); diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 1bfa9f2de67..ee44dd9e0a7 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -41,8 +41,8 @@ with Exp_Strm; use Exp_Strm; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; -with Nlists; use Nlists; with Namet; use Namet; +with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; with Restrict; use Restrict; @@ -141,6 +141,12 @@ package body Exp_Ch3 is -- the code expansion for controlled components (when control actions -- are active) can lead to very large blocks that GCC3 handles poorly. + procedure Build_Untagged_Equality (Typ : Entity_Id); + -- AI05-0123: Equality on untagged records composes. This procedure + -- builds the equality routine for an untagged record that has components + -- of a record type that has user-defined primitive equality operations. + -- The resulting operation is a TSS subprogram. + procedure Build_Variant_Record_Equality (Typ : Entity_Id); -- Create An Equality function for the non-tagged variant record 'Typ' -- and attach it to the TSS list @@ -220,6 +226,13 @@ package body Exp_Ch3 is function Is_Variable_Size_Record (E : Entity_Id) return Boolean; -- Returns true if E has variable size components + function Make_Eq_Body + (Typ : Entity_Id; + Eq_Name : Name_Id) return Node_Id; + -- Build the body of a primitive equality operation for a tagged record + -- type, or in Ada2012 for any record type that has components with a + -- user-defined equality. Factored out of Predefined_Primitive_Bodies. + function Make_Eq_Case (E : Entity_Id; CL : Node_Id; @@ -299,9 +312,7 @@ package body Exp_Ch3 is -- invoking the inherited subprogram's parent subprogram and extended -- with a null association list. - procedure Make_Null_Procedure_Specs - (Tag_Typ : Entity_Id; - Decl_List : out List_Id); + function Make_Null_Procedure_Specs (Tag_Typ : Entity_Id) return List_Id; -- Ada 2005 (AI-251): Makes specs for null procedures associated with any -- null procedures inherited from an interface type that have not been -- overridden. Only one null procedure will be created for a given set of @@ -787,6 +798,7 @@ package body Exp_Ch3 is Decl : Node_Id; P : Node_Id; Par : Node_Id; + Scop : Entity_Id; begin -- Nothing to do if there is no task hierarchy @@ -805,9 +817,11 @@ package body Exp_Ch3 is P := Parent (T); end if; + Scop := Find_Master_Scope (T); + -- Nothing to do if we already built a master entity for this scope - if not Has_Master_Entity (Scope (T)) then + if not Has_Master_Entity (Scop) then -- First build the master entity -- _Master : constant Master_Id := Current_Master.all; @@ -823,9 +837,9 @@ package body Exp_Ch3 is Make_Explicit_Dereference (Loc, New_Reference_To (RTE (RE_Current_Master), Loc))); + Set_Has_Master_Entity (Scop); Insert_Action (P, Decl); Analyze (Decl); - Set_Has_Master_Entity (Scope (T)); -- Now mark the containing scope as a task master. Masters -- associated with return statements are already marked at @@ -1467,12 +1481,8 @@ package body Exp_Ch3 is if Has_Task (Full_Type) then if Restriction_Active (No_Task_Hierarchy) then - - -- 3 is System.Tasking.Library_Task_Level - -- (should be rtsfindable constant ???) - - Append_To (Args, Make_Integer_Literal (Loc, 3)); - + Append_To (Args, + New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc)); else Append_To (Args, Make_Identifier (Loc, Name_uMaster)); end if; @@ -2028,10 +2038,8 @@ package body Exp_Ch3 is if Has_Task (Rec_Type) then if Restriction_Active (No_Task_Hierarchy) then - - -- 3 is System.Tasking.Library_Task_Level - - Append_To (Args, Make_Integer_Literal (Loc, 3)); + Append_To (Args, + New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc)); else Append_To (Args, Make_Identifier (Loc, Name_uMaster)); end if; @@ -3745,6 +3753,149 @@ package body Exp_Ch3 is Set_Is_Pure (Proc_Name); end Build_Slice_Assignment; + ----------------------------- + -- Build_Untagged_Equality -- + ----------------------------- + + procedure Build_Untagged_Equality (Typ : Entity_Id) is + Build_Eq : Boolean; + Comp : Entity_Id; + Decl : Node_Id; + Op : Entity_Id; + Prim : Elmt_Id; + Eq_Op : Entity_Id; + + function User_Defined_Eq (T : Entity_Id) return Entity_Id; + -- Check whether the type T has a user-defined primitive equality. If so + -- return it, else return Empty. If true for a component of Typ, we have + -- to build the primitive equality for it. + + --------------------- + -- User_Defined_Eq -- + --------------------- + + function User_Defined_Eq (T : Entity_Id) return Entity_Id is + Prim : Elmt_Id; + Op : Entity_Id; + + begin + Op := TSS (T, TSS_Composite_Equality); + + if Present (Op) then + return Op; + end if; + + Prim := First_Elmt (Collect_Primitive_Operations (T)); + while Present (Prim) loop + Op := Node (Prim); + + if Chars (Op) = Name_Op_Eq + and then Etype (Op) = Standard_Boolean + and then Etype (First_Formal (Op)) = T + and then Etype (Next_Formal (First_Formal (Op))) = T + then + return Op; + end if; + + Next_Elmt (Prim); + end loop; + + return Empty; + end User_Defined_Eq; + + -- Start of processing for Build_Untagged_Equality + + begin + -- If a record component has a primitive equality operation, we must + -- build the corresponding one for the current type. + + Build_Eq := False; + Comp := First_Component (Typ); + while Present (Comp) loop + if Is_Record_Type (Etype (Comp)) + and then Present (User_Defined_Eq (Etype (Comp))) + then + Build_Eq := True; + end if; + + Next_Component (Comp); + end loop; + + -- If there is a user-defined equality for the type, we do not create + -- the implicit one. + + Prim := First_Elmt (Collect_Primitive_Operations (Typ)); + Eq_Op := Empty; + while Present (Prim) loop + if Chars (Node (Prim)) = Name_Op_Eq + and then Comes_From_Source (Node (Prim)) + + -- Don't we also need to check formal types and return type as in + -- User_Defined_Eq above??? + + then + Eq_Op := Node (Prim); + Build_Eq := False; + exit; + end if; + + Next_Elmt (Prim); + end loop; + + -- If the type is derived, inherit the operation, if present, from the + -- parent type. It may have been declared after the type derivation. If + -- the parent type itself is derived, it may have inherited an operation + -- that has itself been overridden, so update its alias and related + -- flags. Ditto for inequality. + + if No (Eq_Op) and then Is_Derived_Type (Typ) then + Prim := First_Elmt (Collect_Primitive_Operations (Etype (Typ))); + while Present (Prim) loop + if Chars (Node (Prim)) = Name_Op_Eq then + Copy_TSS (Node (Prim), Typ); + Build_Eq := False; + + declare + Op : constant Entity_Id := User_Defined_Eq (Typ); + Eq_Op : constant Entity_Id := Node (Prim); + NE_Op : constant Entity_Id := Next_Entity (Eq_Op); + + begin + if Present (Op) then + Set_Alias (Op, Eq_Op); + Set_Is_Abstract_Subprogram + (Op, Is_Abstract_Subprogram (Eq_Op)); + + if Chars (Next_Entity (Op)) = Name_Op_Ne then + Set_Is_Abstract_Subprogram + (Next_Entity (Op), Is_Abstract_Subprogram (NE_Op)); + end if; + end if; + end; + + exit; + end if; + + Next_Elmt (Prim); + end loop; + end if; + + -- If not inherited and not user-defined, build body as for a type with + -- tagged components. + + if Build_Eq then + Decl := + Make_Eq_Body (Typ, Make_TSS_Name (Typ, TSS_Composite_Equality)); + Op := Defining_Entity (Decl); + Set_TSS (Typ, Op); + Set_Is_Pure (Op); + + if Is_Library_Level_Entity (Typ) then + Set_Is_Public (Op); + end if; + end if; + end Build_Untagged_Equality; + ------------------------------------ -- Build_Variant_Record_Equality -- ------------------------------------ @@ -4843,7 +4994,10 @@ package body Exp_Ch3 is and then No_Initialization (Expr) then null; - else + + -- Otherwise apply a constraint check now if no prev error + + elsif Nkind (Expr) /= N_Error then Apply_Constraint_Check (Expr, Typ); -- If the expression has been marked as requiring a range @@ -5730,9 +5884,8 @@ package body Exp_Ch3 is -- user-defined equality function). Used to pass this entity from -- Make_Predefined_Primitive_Specs to Predefined_Primitive_Bodies. - Wrapper_Decl_List : List_Id := No_List; - Wrapper_Body_List : List_Id := No_List; - Null_Proc_Decl_List : List_Id := No_List; + Wrapper_Decl_List : List_Id := No_List; + Wrapper_Body_List : List_Id := No_List; -- Start of processing for Expand_Freeze_Record_Type @@ -5944,9 +6097,9 @@ package body Exp_Ch3 is if Ada_Version >= Ada_05 and then Etype (Def_Id) /= Def_Id and then not Is_Abstract_Type (Def_Id) + and then Has_Interfaces (Def_Id) then - Make_Null_Procedure_Specs (Def_Id, Null_Proc_Decl_List); - Insert_Actions (N, Null_Proc_Decl_List); + Insert_Actions (N, Make_Null_Procedure_Specs (Def_Id)); end if; Set_Is_Frozen (Def_Id); @@ -6026,8 +6179,10 @@ package body Exp_Ch3 is end if; end if; - -- In the non-tagged case, an equality function is provided only for - -- variant records (that are not unchecked unions). + -- In the non-tagged case, ever since Ada83 an equality function must + -- be provided for variant records that are not unchecked unions. + -- In Ada2012 the equality function composes, and thus must be built + -- explicitly just as for tagged records. elsif Has_Discriminants (Def_Id) and then not Is_Limited_Type (Def_Id) @@ -6043,6 +6198,12 @@ package body Exp_Ch3 is Build_Variant_Record_Equality (Def_Id); end if; end; + + elsif Ada_Version >= Ada_12 + and then Comes_From_Source (Def_Id) + and then Convention (Def_Id) = Convention_Ada + then + Build_Untagged_Equality (Def_Id); end if; -- Before building the record initialization procedure, if we are @@ -7638,6 +7799,79 @@ package body Exp_Ch3 is end loop; end Make_Controlling_Function_Wrappers; + ------------------- + -- Make_Eq_Body -- + ------------------- + + function Make_Eq_Body + (Typ : Entity_Id; + Eq_Name : Name_Id) return Node_Id + is + Loc : constant Source_Ptr := Sloc (Parent (Typ)); + Decl : Node_Id; + Def : constant Node_Id := Parent (Typ); + Stmts : constant List_Id := New_List; + Variant_Case : Boolean := Has_Discriminants (Typ); + Comps : Node_Id := Empty; + Typ_Def : Node_Id := Type_Definition (Def); + + begin + Decl := + Predef_Spec_Or_Body (Loc, + Tag_Typ => Typ, + Name => Eq_Name, + Profile => New_List ( + Make_Parameter_Specification (Loc, + Defining_Identifier => + Make_Defining_Identifier (Loc, Name_X), + Parameter_Type => New_Reference_To (Typ, Loc)), + + Make_Parameter_Specification (Loc, + Defining_Identifier => + Make_Defining_Identifier (Loc, Name_Y), + Parameter_Type => New_Reference_To (Typ, Loc))), + + Ret_Type => Standard_Boolean, + For_Body => True); + + if Variant_Case then + if Nkind (Typ_Def) = N_Derived_Type_Definition then + Typ_Def := Record_Extension_Part (Typ_Def); + end if; + + if Present (Typ_Def) then + Comps := Component_List (Typ_Def); + end if; + + Variant_Case := + Present (Comps) and then Present (Variant_Part (Comps)); + end if; + + if Variant_Case then + Append_To (Stmts, + Make_Eq_If (Typ, Discriminant_Specifications (Def))); + Append_List_To (Stmts, Make_Eq_Case (Typ, Comps)); + Append_To (Stmts, + Make_Simple_Return_Statement (Loc, + Expression => New_Reference_To (Standard_True, Loc))); + + else + Append_To (Stmts, + Make_Simple_Return_Statement (Loc, + Expression => + Expand_Record_Equality + (Typ, + Typ => Typ, + Lhs => Make_Identifier (Loc, Name_X), + Rhs => Make_Identifier (Loc, Name_Y), + Bodies => Declarations (Decl)))); + end if; + + Set_Handled_Statement_Sequence + (Decl, Make_Handled_Sequence_Of_Statements (Loc, Stmts)); + return Decl; + end Make_Eq_Body; + ------------------ -- Make_Eq_Case -- ------------------ @@ -7790,40 +8024,17 @@ package body Exp_Ch3 is -- Make_Null_Procedure_Specs -- ------------------------------- - procedure Make_Null_Procedure_Specs - (Tag_Typ : Entity_Id; - Decl_List : out List_Id) - is - Loc : constant Source_Ptr := Sloc (Tag_Typ); - + function Make_Null_Procedure_Specs (Tag_Typ : Entity_Id) return List_Id is + Decl_List : constant List_Id := New_List; + Loc : constant Source_Ptr := Sloc (Tag_Typ); Formal : Entity_Id; Formal_List : List_Id; New_Param_Spec : Node_Id; Parent_Subp : Entity_Id; Prim_Elmt : Elmt_Id; - Proc_Decl : Node_Id; Subp : Entity_Id; - function Is_Null_Interface_Primitive (E : Entity_Id) return Boolean; - -- Returns True if E is a null procedure that is an interface primitive - - --------------------------------- - -- Is_Null_Interface_Primitive -- - --------------------------------- - - function Is_Null_Interface_Primitive (E : Entity_Id) return Boolean is - begin - return Comes_From_Source (E) - and then Is_Dispatching_Operation (E) - and then Ekind (E) = E_Procedure - and then Null_Present (Parent (E)) - and then Is_Interface (Find_Dispatching_Type (E)); - end Is_Null_Interface_Primitive; - - -- Start of processing for Make_Null_Procedure_Specs - begin - Decl_List := New_List; Prim_Elmt := First_Elmt (Primitive_Operations (Tag_Typ)); while Present (Prim_Elmt) loop Subp := Node (Prim_Elmt); @@ -7883,19 +8094,19 @@ package body Exp_Ch3 is end loop; end if; - Proc_Decl := + Append_To (Decl_List, Make_Subprogram_Declaration (Loc, Make_Procedure_Specification (Loc, Defining_Unit_Name => Make_Defining_Identifier (Loc, Chars (Subp)), Parameter_Specifications => Formal_List, - Null_Present => True)); - Append_To (Decl_List, Proc_Decl); - Analyze (Proc_Decl); + Null_Present => True))); end if; Next_Elmt (Prim_Elmt); end loop; + + return Decl_List; end Make_Null_Procedure_Specs; ------------------------------------- @@ -8667,67 +8878,7 @@ package body Exp_Ch3 is -- Body for equality if Eq_Needed then - Decl := - Predef_Spec_Or_Body (Loc, - Tag_Typ => Tag_Typ, - Name => Eq_Name, - Profile => New_List ( - Make_Parameter_Specification (Loc, - Defining_Identifier => - Make_Defining_Identifier (Loc, Name_X), - Parameter_Type => New_Reference_To (Tag_Typ, Loc)), - - Make_Parameter_Specification (Loc, - Defining_Identifier => - Make_Defining_Identifier (Loc, Name_Y), - Parameter_Type => New_Reference_To (Tag_Typ, Loc))), - - Ret_Type => Standard_Boolean, - For_Body => True); - - declare - Def : constant Node_Id := Parent (Tag_Typ); - Stmts : constant List_Id := New_List; - Variant_Case : Boolean := Has_Discriminants (Tag_Typ); - Comps : Node_Id := Empty; - Typ_Def : Node_Id := Type_Definition (Def); - - begin - if Variant_Case then - if Nkind (Typ_Def) = N_Derived_Type_Definition then - Typ_Def := Record_Extension_Part (Typ_Def); - end if; - - if Present (Typ_Def) then - Comps := Component_List (Typ_Def); - end if; - - Variant_Case := Present (Comps) - and then Present (Variant_Part (Comps)); - end if; - - if Variant_Case then - Append_To (Stmts, - Make_Eq_If (Tag_Typ, Discriminant_Specifications (Def))); - Append_List_To (Stmts, Make_Eq_Case (Tag_Typ, Comps)); - Append_To (Stmts, - Make_Simple_Return_Statement (Loc, - Expression => New_Reference_To (Standard_True, Loc))); - - else - Append_To (Stmts, - Make_Simple_Return_Statement (Loc, - Expression => - Expand_Record_Equality (Tag_Typ, - Typ => Tag_Typ, - Lhs => Make_Identifier (Loc, Name_X), - Rhs => Make_Identifier (Loc, Name_Y), - Bodies => Declarations (Decl)))); - end if; - - Set_Handled_Statement_Sequence (Decl, - Make_Handled_Sequence_Of_Statements (Loc, Stmts)); - end; + Decl := Make_Eq_Body (Tag_Typ, Eq_Name); Append_To (Res, Decl); end if; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 0e7af41de90..dad493cbe06 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -2170,22 +2170,54 @@ package body Exp_Ch4 is Lhs_Discr_Val, Rhs_Discr_Val)); end; + + else + return + Make_Function_Call (Loc, + Name => New_Reference_To (Eq_Op, Loc), + Parameter_Associations => New_List (Lhs, Rhs)); end if; + end if; - -- Shouldn't this be an else, we can't fall through the above - -- IF, right??? + elsif Ada_Version >= Ada_12 then - return - Make_Function_Call (Loc, - Name => New_Reference_To (Eq_Op, Loc), - Parameter_Associations => New_List (Lhs, Rhs)); - end if; + -- if no TSS has been created for the type, check whether there is + -- a primitive equality declared for it. If it is abstract replace + -- the call with an explicit raise. + + declare + Prim : Elmt_Id; + + begin + Prim := First_Elmt (Collect_Primitive_Operations (Full_Type)); + while Present (Prim) loop + if Chars (Node (Prim)) = Name_Op_Eq then + if Is_Abstract_Subprogram (Node (Prim)) then + return + Make_Raise_Program_Error (Loc, + Reason => PE_Explicit_Raise); + else + return + Make_Function_Call (Loc, + Name => New_Reference_To (Node (Prim), Loc), + Parameter_Associations => New_List (Lhs, Rhs)); + end if; + end if; + + Next_Elmt (Prim); + end loop; + end; + + -- Predfined equality applies iff no user-defined primitive exists + + return Make_Op_Eq (Loc, Lhs, Rhs); else return Expand_Record_Equality (Nod, Full_Type, Lhs, Rhs, Bodies); end if; else + -- It can be a simple record or the full view of a scalar private return Make_Op_Eq (Loc, Left_Opnd => Lhs, Right_Opnd => Rhs); @@ -3692,8 +3724,8 @@ package body Exp_Ch4 is end if; if Restriction_Active (No_Task_Hierarchy) then - -- 3 is System.Tasking.Library_Task_Level - Append_To (Args, Make_Integer_Literal (Loc, 3)); + Append_To (Args, + New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc)); else Append_To (Args, New_Reference_To diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 71b58ae358e..8760cb7aae2 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1007,6 +1007,60 @@ package body Exp_Ch5 is F_Or_L : Name_Id; S_Or_P : Name_Id; + function Build_Step (J : Nat) return Node_Id; + -- The increment step for the index of the right-hand side is written + -- as an attribute reference (Succ or Pred). This function returns + -- the corresponding node, which is placed at the end of the loop body. + + ---------------- + -- Build_Step -- + ---------------- + + function Build_Step (J : Nat) return Node_Id is + Step : Node_Id; + Lim : Name_Id; + + begin + if Rev then + Lim := Name_First; + else + Lim := Name_Last; + end if; + + Step := + Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of (Rnn (J), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of (R_Index_Type (J), Loc), + Attribute_Name => S_Or_P, + Expressions => New_List ( + New_Occurrence_Of (Rnn (J), Loc)))); + + -- Note that on the last iteration of the loop, the index is increased + -- (or decreased) past the corresponding bound. This is consistent with + -- the C semantics of the back-end, where such an off-by-one value on a + -- dead index variable is OK. However, in CodePeer mode this leads to + -- spurious warnings, and thus we place a guard around the attribute + -- reference. For obvious reasons we only do this for CodePeer. + + if CodePeer_Mode then + Step := + Make_If_Statement (Loc, + Condition => + Make_Op_Ne (Loc, + Left_Opnd => New_Occurrence_Of (Lnn (J), Loc), + Right_Opnd => + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (L_Index_Type (J), Loc), + Attribute_Name => Lim)), + Then_Statements => New_List (Step)); + end if; + + return Step; + end Build_Step; + begin if Rev then F_Or_L := Name_Last; @@ -1103,18 +1157,7 @@ package body Exp_Ch5 is Discrete_Subtype_Definition => New_Reference_To (L_Index_Type (J), Loc))), - Statements => New_List ( - Assign, - - Make_Assignment_Statement (Loc, - Name => New_Occurrence_Of (Rnn (J), Loc), - Expression => - Make_Attribute_Reference (Loc, - Prefix => - New_Occurrence_Of (R_Index_Type (J), Loc), - Attribute_Name => S_Or_P, - Expressions => New_List ( - New_Occurrence_Of (Rnn (J), Loc))))))))); + Statements => New_List (Assign, Build_Step (J)))))); end loop; return Assign; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 11a2161e99d..eb30d804ee0 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -1795,9 +1795,8 @@ package body Exp_Ch6 is Append_To (Extra_Actuals, Make_Parameter_Association (Loc, - Explicit_Actual_Parameter => Expr, - Selector_Name => - Make_Identifier (Loc, Chars (EF)))); + Selector_Name => Make_Identifier (Loc, Chars (EF)), + Explicit_Actual_Parameter => Expr)); Analyze_And_Resolve (Expr, Etype (EF)); @@ -2174,8 +2173,8 @@ package body Exp_Ch6 is Prev_Orig := Prev; end if; - -- Ada 2005 (AI-251): Thunks must propagate the extra actuals - -- of accessibility levels. + -- Ada 2005 (AI-251): Thunks must propagate the extra actuals of + -- accessibility levels. if Ekind (Current_Scope) in Subprogram_Kind and then Is_Thunk (Current_Scope) @@ -2299,7 +2298,7 @@ package body Exp_Ch6 is Extra_Accessibility (Formal)); -- No other cases of attributes returning access - -- values that can be passed to access parameters + -- values that can be passed to access parameters. when others => raise Program_Error; @@ -2331,17 +2330,22 @@ package body Exp_Ch6 is end if; -- Perform the check of 4.6(49) that prevents a null value from being - -- passed as an actual to an access parameter. Note that the check is - -- elided in the common cases of passing an access attribute or + -- passed as an actual to an access parameter. Note that the check + -- is elided in the common cases of passing an access attribute or -- access parameter as an actual. Also, we currently don't enforce -- this check for expander-generated actuals and when -gnatdj is set. if Ada_Version >= Ada_05 then - -- Ada 2005 (AI-231): Check null-excluding access types + -- Ada 2005 (AI-231): Check null-excluding access types. Note that + -- the intent of 6.4.1(13) is that null-exclusion checks should + -- not be done for 'out' parameters, even though it refers only + -- to constraint checks, and a null_exlusion is not a constraint. + -- Note that AI05-0196-1 corrects this mistake in the RM. if Is_Access_Type (Etype (Formal)) and then Can_Never_Be_Null (Etype (Formal)) + and then Ekind (Formal) /= E_Out_Parameter and then Nkind (Prev) /= N_Raise_Constraint_Error and then (Known_Null (Prev) or else not Can_Never_Be_Null (Etype (Prev))) @@ -2425,10 +2429,10 @@ package body Exp_Ch6 is -- since this is a left side reference. We only do this for calls -- from the source program since we assume that compiler generated -- calls explicitly generate any required checks. We also need it - -- only if we are doing standard validity checks, since clearly it - -- is not needed if validity checks are off, and in subscript - -- validity checking mode, all indexed components are checked with - -- a call directly from Expand_N_Indexed_Component. + -- only if we are doing standard validity checks, since clearly it is + -- not needed if validity checks are off, and in subscript validity + -- checking mode, all indexed components are checked with a call + -- directly from Expand_N_Indexed_Component. if Comes_From_Source (N) and then Ekind (Formal) /= E_In_Parameter @@ -2594,11 +2598,11 @@ package body Exp_Ch6 is -- Deals with Dispatch_Call if we still have a call, before expanding -- extra actuals since this will be done on the re-analysis of the - -- dispatching call. Note that we do not try to shorten the actual - -- list for a dispatching call, it would not make sense to do so. - -- Expansion of dispatching calls is suppressed when VM_Target, because - -- the VM back-ends directly handle the generation of dispatching - -- calls and would have to undo any expansion to an indirect call. + -- dispatching call. Note that we do not try to shorten the actual list + -- for a dispatching call, it would not make sense to do so. Expansion + -- of dispatching calls is suppressed when VM_Target, because the VM + -- back-ends directly handle the generation of dispatching calls and + -- would have to undo any expansion to an indirect call. if Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement) and then Present (Controlling_Argument (N)) @@ -2606,8 +2610,8 @@ package body Exp_Ch6 is if Tagged_Type_Expansion then Expand_Dispatching_Call (N); - -- The following return is worrisome. Is it really OK to - -- skip all remaining processing in this procedure ??? + -- The following return is worrisome. Is it really OK to skip all + -- remaining processing in this procedure ??? return; @@ -2625,8 +2629,8 @@ package body Exp_Ch6 is -- Similarly, expand calls to RCI subprograms on which pragma -- All_Calls_Remote applies. The rewriting will be reanalyzed - -- later. Do this only when the call comes from source since we do - -- not want such a rewriting to occur in expanded code. + -- later. Do this only when the call comes from source since we + -- do not want such a rewriting to occur in expanded code. if Is_All_Remote_Call (N) then Expand_All_Calls_Remote_Subprogram_Call (N); @@ -2651,15 +2655,15 @@ package body Exp_Ch6 is end loop; end if; - -- At this point we have all the actuals, so this is the point at - -- which the various expansion activities for actuals is carried out. + -- At this point we have all the actuals, so this is the point at which + -- the various expansion activities for actuals is carried out. Expand_Actuals (N, Subp); - -- If the subprogram is a renaming, or if it is inherited, replace it - -- in the call with the name of the actual subprogram being called. - -- If this is a dispatching call, the run-time decides what to call. - -- The Alias attribute does not apply to entries. + -- If the subprogram is a renaming, or if it is inherited, replace it in + -- the call with the name of the actual subprogram being called. If this + -- is a dispatching call, the run-time decides what to call. The Alias + -- attribute does not apply to entries. if Nkind (N) /= N_Entry_Call_Statement and then No (Controlling_Argument (N)) @@ -2828,10 +2832,10 @@ package body Exp_Ch6 is if Is_Access_Protected_Subprogram_Type (Base_Type (Etype (Prefix (Name (N))))) then - -- If this is a call through an access to protected operation, - -- the prefix has the form (object'address, operation'access). - -- Rewrite as a for other protected calls: the object is the - -- first parameter of the list of actuals. + -- If this is a call through an access to protected operation, the + -- prefix has the form (object'address, operation'access). Rewrite + -- as a for other protected calls: the object is the 1st parameter + -- of the list of actuals. declare Call : Node_Id; @@ -2906,11 +2910,11 @@ package body Exp_Ch6 is -- In the case where the intrinsic is to be processed by the back end, -- the call to Expand_Intrinsic_Call will do nothing, which is fine, - -- since the idea in this case is to pass the call unchanged. - -- If the intrinsic is an inherited unchecked conversion, and the - -- derived type is the target type of the conversion, we must retain - -- it as the return type of the expression. Otherwise the expansion - -- below, which uses the parent operation, will yield the wrong type. + -- since the idea in this case is to pass the call unchanged. If the + -- intrinsic is an inherited unchecked conversion, and the derived type + -- is the target type of the conversion, we must retain it as the return + -- type of the expression. Otherwise the expansion below, which uses the + -- parent operation, will yield the wrong type. if Is_Intrinsic_Subprogram (Subp) then Expand_Intrinsic_Call (N, Subp); @@ -3101,14 +3105,30 @@ package body Exp_Ch6 is -- To prevent a double attachment, check that the current call is -- not a rewriting of a protected function call. - if Needs_Finalization (Etype (Subp)) - and then not Is_Inherently_Limited_Type (Etype (Subp)) - and then - (No (First_Formal (Subp)) - or else - not Is_Concurrent_Record_Type (Etype (First_Formal (Subp)))) - then - Expand_Ctrl_Function_Call (N); + if Needs_Finalization (Etype (Subp)) then + if not Is_Inherently_Limited_Type (Etype (Subp)) + and then + (No (First_Formal (Subp)) + or else + not Is_Concurrent_Record_Type (Etype (First_Formal (Subp)))) + then + Expand_Ctrl_Function_Call (N); + + -- Build-in-place function calls which appear in anonymous contexts + -- need a transient scope to ensure the proper finalization of the + -- intermediate result after its use. + + elsif Is_Build_In_Place_Function_Call (N) + and then Nkind_In (Parent (N), N_Attribute_Reference, + N_Function_Call, + N_Indexed_Component, + N_Object_Renaming_Declaration, + N_Procedure_Call_Statement, + N_Selected_Component, + N_Slice) + then + Establish_Transient_Scope (N, Sec_Stack => True); + end if; end if; -- Test for First_Optional_Parameter, and if so, truncate parameter list @@ -4097,6 +4117,8 @@ package body Exp_Ch6 is -- Initialize scalar out parameters if Initialize/Normalize_Scalars -- Reset Pure indication if any parameter has root type System.Address + -- or has any parameters of limited types, where limited means that the + -- run-time view is limited (i.e. the full type is limited). -- Wrap thread body @@ -4288,7 +4310,14 @@ package body Exp_Ch6 is begin F := First_Formal (Spec_Id); while Present (F) loop - if Is_Descendent_Of_Address (Etype (F)) then + if Is_Descendent_Of_Address (Etype (F)) + + -- Note that this test is being made in the body of the + -- subprogram, not the spec, so we are testing the full + -- type for being limited here, as required. + + or else Is_Limited_Type (Etype (F)) + then Set_Is_Pure (Spec_Id, False); if Spec_Id /= Body_Id then @@ -5328,7 +5357,6 @@ package body Exp_Ch6 is -- scope is established to ensure eventual cleanup of the result. else - -- Pass an allocation parameter indicating that the function should -- allocate its result on the secondary stack. @@ -5346,8 +5374,6 @@ package body Exp_Ch6 is Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Empty); - - Establish_Transient_Scope (Func_Call, Sec_Stack => True); end if; end Make_Build_In_Place_Call_In_Anonymous_Context; @@ -5776,6 +5802,7 @@ package body Exp_Ch6 is Make_Explicit_Dereference (Loc, Prefix => New_Reference_To (Def_Id, Loc)); + Loc := Sloc (Object_Decl); Rewrite (Object_Decl, Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Make_Temporary (Loc, 'D'), @@ -5813,6 +5840,14 @@ package body Exp_Ch6 is Set_Homonym (Renaming_Def_Id, Homonym (Obj_Def_Id)); Exchange_Entities (Renaming_Def_Id, Obj_Def_Id); + + -- Preserve source indication of original declaration, so that + -- xref information is properly generated for the right entity. + + Preserve_Comes_From_Source + (Object_Decl, Original_Node (Object_Decl)); + Set_Comes_From_Source (Obj_Def_Id, True); + Set_Comes_From_Source (Renaming_Def_Id, False); end; end if; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 308021472c2..c299dc17f12 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1098,7 +1098,7 @@ package body Exp_Ch7 is -- releasing or some finalizations are needed or in the context -- of tasking - if Uses_Sec_Stack (Current_Scope) + if Uses_Sec_Stack (Current_Scope) and then not Sec_Stack_Needed_For_Return (Current_Scope) then null; diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb index fc283715941..39c0fc656eb 100644 --- a/gcc/ada/exp_ch8.adb +++ b/gcc/ada/exp_ch8.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -25,16 +25,22 @@ with Atree; use Atree; with Einfo; use Einfo; +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 Freeze; use Freeze; +with Namet; use Namet; +with Nmake; use Nmake; with Nlists; use Nlists; with Opt; use Opt; with Sem; use Sem; with Sem_Ch8; use Sem_Ch8; +with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; +with Snames; use Snames; with Stand; use Stand; +with Tbuild; use Tbuild; package body Exp_Ch8 is @@ -350,6 +356,75 @@ package body Exp_Ch8 is elsif Nkind (Nam) = N_Explicit_Dereference then Force_Evaluation (Prefix (Nam)); end if; + + -- Check whether this is a renaming of a predefined equality on an + -- untagged record type (AI05-0123). + + if Is_Entity_Name (Nam) + and then Chars (Entity (Nam)) = Name_Op_Eq + and then Scope (Entity (Nam)) = Standard_Standard + and then Ada_Version >= Ada_2012 + then + declare + Loc : constant Source_Ptr := Sloc (N); + Id : constant Entity_Id := Defining_Entity (N); + Typ : constant Entity_Id := Etype (First_Formal (Id)); + + Decl : Node_Id; + Body_Id : constant Entity_Id := + Make_Defining_Identifier (Sloc (N), Chars (Id)); + + begin + if Is_Record_Type (Typ) + and then not Is_Tagged_Type (Typ) + and then not Is_Frozen (Typ) + then + -- Build body for renamed equality, to capture its current + -- meaning. It may be redefined later, but the renaming is + -- elaborated where it occurs. This is technically known as + -- Squirreling semantics. Renaming is rewritten as a subprogram + -- declaration, and the body is inserted at the end of the + -- current declaration list to prevent premature freezing. + + Set_Alias (Id, Empty); + Set_Has_Completion (Id, False); + Rewrite (N, + Make_Subprogram_Declaration (Sloc (N), + Specification => Specification (N))); + Set_Has_Delayed_Freeze (Id); + + Decl := Make_Subprogram_Body (Loc, + Specification => + Make_Function_Specification (Loc, + Defining_Unit_Name => Body_Id, + Parameter_Specifications => + Copy_Parameter_List (Id), + Result_Definition => + New_Occurrence_Of (Standard_Boolean, Loc)), + Declarations => Empty_List, + Handled_Statement_Sequence => Empty); + + Set_Handled_Statement_Sequence (Decl, + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List ( + Make_Simple_Return_Statement (Loc, + Expression => + Expand_Record_Equality ( + Id, + Typ => Typ, + Lhs => + Make_Identifier (Loc, + Chars (First_Formal (Id))), + Rhs => + Make_Identifier (Loc, + Chars (Next_Formal (First_Formal (Id)))), + Bodies => Declarations (Decl)))))); + + Append (Decl, List_Containing (N)); + Set_Debug_Info_Needed (Body_Id); + end if; + end; + end if; end Expand_N_Subprogram_Renaming_Declaration; end Exp_Ch8; diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 2aec546e91a..a91ec6a4c22 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -829,10 +829,12 @@ package body Exp_Ch9 is begin -- Loop to find enclosing construct containing activation chain variable + -- The construct is a body, a block, or an extended return. P := Parent (N); while not Nkind_In (P, N_Subprogram_Body, + N_Entry_Body, N_Package_Declaration, N_Package_Body, N_Block_Statement, @@ -2479,31 +2481,7 @@ package body Exp_Ch9 is S : Entity_Id; begin - S := Scope (E); - - -- Ada 2005 (AI-287): Do not set/get the has_master_entity reminder - -- in internal scopes, unless present already.. Required for nested - -- limited aggregates, where the expansion of task components may - -- generate inner blocks. If the block is the rewriting of a call - -- or the scope is an extended return statement this is valid master. - -- The master in an extended return is only used within the return, - -- and is subsequently overwritten in Move_Activation_Chain, but it - -- must exist now. - - if Ada_Version >= Ada_05 then - while Is_Internal (S) loop - if Nkind (Parent (S)) = N_Block_Statement - and then - Nkind (Original_Node (Parent (S))) = N_Procedure_Call_Statement - then - exit; - elsif Ekind (S) = E_Return_Statement then - exit; - else - S := Scope (S); - end if; - end loop; - end if; + S := Find_Master_Scope (E); -- Nothing to do if we already built a master entity for this scope -- or if there is no task hierarchy. @@ -2532,14 +2510,7 @@ package body Exp_Ch9 is Insert_Before (P, Decl); Analyze (Decl); - -- Ada 2005 (AI-287): Set the has_master_entity reminder in the - -- non-internal scope selected above. - - if Ada_Version >= Ada_05 then - Set_Has_Master_Entity (S); - else - Set_Has_Master_Entity (Scope (E)); - end if; + Set_Has_Master_Entity (S); -- Now mark the containing scope as a task master @@ -2749,6 +2720,10 @@ package body Exp_Ch9 is raise Program_Error; end case; + -- Establish link between subprogram body entity and source entry. + + Set_Corresponding_Protected_Entry (Edef, Ent); + -- Create body of entry procedure. The renaming declarations are -- placed ahead of the block that contains the actual entry body. @@ -5284,6 +5259,11 @@ package body Exp_Ch9 is Declarations => Declarations (N), Handled_Statement_Sequence => Build_Accept_Body (N)); + -- For the analysis of the generated declarations, the parent node + -- must be properly set. + + Set_Parent (Block, Parent (N)); + -- Prepend call to Accept_Call to main statement sequence If the -- accept has exception handlers, the statement sequence is wrapped -- in a block. Insert call and renaming declarations in the @@ -11134,6 +11114,43 @@ package body Exp_Ch9 is Make_Integer_Literal (Loc, 0))); end Family_Size; + ----------------------- + -- Find_Master_Scope -- + ----------------------- + + function Find_Master_Scope (E : Entity_Id) return Entity_Id is + S : Entity_Id; + + begin + -- In Ada2005, the master is the innermost enclosing scope that is not + -- transient. If the enclosing block is the rewriting of a call or the + -- scope is an extended return statement this is valid master. The + -- master in an extended return is only used within the return, and is + -- subsequently overwritten in Move_Activation_Chain, but it must exist + -- now before that overwriting occurs. + + S := Scope (E); + + if Ada_Version >= Ada_05 then + while Is_Internal (S) loop + if Nkind (Parent (S)) = N_Block_Statement + and then + Nkind (Original_Node (Parent (S))) = N_Procedure_Call_Statement + then + exit; + + elsif Ekind (S) = E_Return_Statement then + exit; + + else + S := Scope (S); + end if; + end loop; + end if; + + return S; + end Find_Master_Scope; + ----------------------------------- -- Find_Task_Or_Protected_Pragma -- ----------------------------------- @@ -12121,13 +12138,14 @@ package body Exp_Ch9 is -- Master parameter. This is a reference to the _Master parameter of -- the initialization procedure, except in the case of the pragma - -- Restrictions (No_Task_Hierarchy) where the value is fixed to 3 - -- (3 is System.Tasking.Library_Task_Level). + -- Restrictions (No_Task_Hierarchy) where the value is fixed to + -- System.Tasking.Library_Task_Level. if Restriction_Active (No_Task_Hierarchy) = False then Append_To (Args, Make_Identifier (Loc, Name_uMaster)); else - Append_To (Args, Make_Integer_Literal (Loc, 3)); + Append_To (Args, + New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc)); end if; end if; diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads index 80d870ad8a1..13e3f796ef0 100644 --- a/gcc/ada/exp_ch9.ads +++ b/gcc/ada/exp_ch9.ads @@ -263,6 +263,15 @@ package Exp_Ch9 is -- return the external version of a protected operation, which locks -- the object before invoking the internal protected subprogram body. + function Find_Master_Scope (E : Entity_Id) return Entity_Id; + -- When a type includes tasks, a master entity is created in the scope, to + -- be used by the runtime during activation. In general the master is the + -- immediate scope in which the type is declared, but in Ada2005, in the + -- presence of synchronized classwide interfaces, the immediate scope of + -- an anonymous access type may be a transient scope, which has no run-time + -- presence. In this case, the scope of the master is the innermost scope + -- that comes from source. + function First_Protected_Operation (D : List_Id) return Node_Id; -- Given the declarations list for a protected body, find the -- first protected operation body. diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads index 99a61d4efd3..b4cf44b6d1d 100644 --- a/gcc/ada/exp_dbug.ads +++ b/gcc/ada/exp_dbug.ads @@ -37,11 +37,11 @@ package Exp_Dbug is -- Encoding and Qualification of Names of Entities -- ----------------------------------------------------- - -- This section describes how the names of entities are encoded in - -- the generated debugging information. + -- This section describes how the names of entities are encoded in the + -- generated debugging information. - -- An entity in Ada has a name of the form X.Y.Z ... E where X,Y,Z - -- are the enclosing scopes (not including Standard at the start). + -- An entity in Ada has a name of the form X.Y.Z ... E where X,Y,Z are the + -- enclosing scopes (not including Standard at the start). -- The encoding of the name follows this basic qualified naming scheme, -- where the encoding of individual entity names is as described in Namet @@ -306,13 +306,13 @@ package Exp_Dbug is -- Interface Names -- --------------------- - -- Note: if an interface name is present, then the external name - -- is taken from the specified interface name. Given the current - -- limitations of the gcc backend, this means that the debugging - -- name is also set to the interface name, but conceptually, it - -- would be possible (and indeed desirable) to have the debugging - -- information still use the Ada name as qualified above, so we - -- still fully qualify the name in the front end. + -- Note: if an interface name is present, then the external name is + -- taken from the specified interface name. Given current limitations of + -- the gcc backend, this means that the debugging name is also set to + -- the interface name, but conceptually, it would be possible (and + -- indeed desirable) to have the debugging information still use the Ada + -- name as qualified above, so we still fully qualify the name in the + -- front end. ------------------------------------- -- Encodings Related to Task Types -- @@ -330,7 +330,7 @@ package Exp_Dbug is -- end TaskObj; -- end P; -- - -- The name of subprogram TaskObj.F1 is encoded as p__taskobjTK__f1, + -- The name of subprogram TaskObj.F1 is encoded as p__taskobjTK__f1. -- The body, B, is contained in a subprogram whose name is -- p__taskobjTKB. @@ -413,22 +413,21 @@ package Exp_Dbug is No_Dollar_In_Label : constant Boolean := True; -- True iff the target does not allow dollar signs ("$") in external names - -- ??? We want to migrate all platforms to use the same convention. - -- As a first step, we force this constant to always be True. This - -- constant will eventually be deleted after we have verified that - -- the migration does not cause any unforseen adverse impact. - -- We chose "__" because it is supported on all platforms, which is - -- not the case of "$". + -- ??? We want to migrate all platforms to use the same convention. As a + -- first step, we force this constant to always be True. This constant will + -- eventually be deleted after we have verified that the migration does not + -- cause any unforseen adverse impact. We chose "__" because it is + -- supported on all platforms, which is not the case of "$". procedure Get_External_Name (Entity : Entity_Id; Has_Suffix : Boolean); - -- Set Name_Buffer and Name_Len to the external name of entity E. - -- The external name is the Interface_Name, if specified, unless - -- the entity has an address clause or a suffix. + -- Set Name_Buffer and Name_Len to the external name of entity E. The + -- external name is the Interface_Name, if specified, unless the entity + -- has an address clause or a suffix. -- - -- If the Interface is not present, or not used, the external name - -- is the concatenation of: + -- If the Interface is not present, or not used, the external name is the + -- concatenation of: -- -- - the string "_ada_", if the entity is a library subprogram, -- - the names of any enclosing scopes, each followed by "__", @@ -441,9 +440,9 @@ package Exp_Dbug is procedure Get_External_Name_With_Suffix (Entity : Entity_Id; Suffix : String); - -- Set Name_Buffer and Name_Len to the external name of entity E. - -- If Suffix is the empty string the external name is as above, - -- otherwise the external name is the concatenation of: + -- Set Name_Buffer and Name_Len to the external name of entity E. If + -- Suffix is the empty string the external name is as above, otherwise + -- the external name is the concatenation of: -- -- - the string "_ada_", if the entity is a library subprogram, -- - the names of any enclosing scopes, each followed by "__", @@ -483,33 +482,33 @@ package Exp_Dbug is -- output of names for debugging purposes (which is why we are doing -- the name changes in the first place. - -- Note: the routines Get_Unqualified_[Decoded]_Name_String in Namet - -- are useful to remove qualification from a name qualified by the - -- call to Qualify_All_Entity_Names. + -- Note: the routines Get_Unqualified_[Decoded]_Name_String in Namet are + -- useful to remove qualification from a name qualified by the call to + -- Qualify_All_Entity_Names. -------------------------------- -- Handling of Numeric Values -- -------------------------------- - -- All numeric values here are encoded as strings of decimal digits. - -- Only integer values need to be encoded. A negative value is encoded - -- as the corresponding positive value followed by a lower case m for - -- minus to indicate that the value is negative (e.g. 2m for -2). + -- All numeric values here are encoded as strings of decimal digits. Only + -- integer values need to be encoded. A negative value is encoded as the + -- corresponding positive value followed by a lower case m for minus to + -- indicate that the value is negative (e.g. 2m for -2). ------------------------- -- Type Name Encodings -- ------------------------- - -- In the following typ is the name of the type as normally encoded by - -- the debugger rules, i.e. a non-qualified name, all in lower case, - -- with standard encoding of upper half and wide characters + -- In the following typ is the name of the type as normally encoded by the + -- debugger rules, i.e. a non-qualified name, all in lower case, with + -- standard encoding of upper half and wide characters ------------------------ -- Encapsulated Types -- ------------------------ - -- In some cases, the compiler encapsulates a type by wrapping it in - -- a structure. For example, this is used when a size or alignment + -- In some cases, the compiler encapsulates a type by wrapping it in a + -- structure. For example, this is used when a size or alignment -- specification requires a larger type. Consider: -- type y is mod 2 ** 64; @@ -523,34 +522,34 @@ package Exp_Dbug is -- a size of 256 for a signed integer value, then a typical choice is -- to wrap a 64-bit integer in a 256 bit PAD structure. - -- A similar encapsulation is done for some packed array types, - -- in which case the structure type is y___JM and the field name - -- is OBJECT. This is used in the case of a packed array stored - -- in modular representation (see section on representation of - -- packed array objects). In this case the JM wrapping is used to - -- achieve correct positioning of the packed array value (left or - -- right justified in its field depending on endianness. - - -- When the debugger sees an object of a type whose name has a - -- suffix of ___PAD or ___JM, the type will be a record containing - -- a single field, and the name of that field will be all upper case. - -- In this case, it should look inside to get the value of the inner - -- field, and neither the outer structure name, nor the field name - -- should appear when the value is printed. + -- A similar encapsulation is done for some packed array types, in which + -- case the structure type is y___JM and the field name is OBJECT. + -- This is used in the case of a packed array stored using modular + -- representation (see section on representation of packed array + -- objects). In this case the JM wrapping is used to achieve correct + -- positioning of the packed array value (left or right justified in its + -- field depending on endianness. + + -- When the debugger sees an object of a type whose name has a suffix of + -- ___PAD or ___JM, the type will be a record containing a single field, + -- and the name of that field will be all upper case. In this case, it + -- should look inside to get the value of the inner field, and neither + -- the outer structure name, nor the field name should appear when the + -- value is printed. -- When the debugger sees a record named REP being a field inside - -- another record, it should treat the fields inside REP as being - -- part of the outer record (this REP field is only present for - -- code generation purposes). The REP record should not appear in - -- the values printed by the debugger. + -- another record, it should treat the fields inside REP as being part + -- of the outer record (this REP field is only present for code + -- generation purposes). The REP record should not appear in the values + -- printed by the debugger. ----------------------- -- Fixed-Point Types -- ----------------------- -- Fixed-point types are encoded using a suffix that indicates the - -- delta and small values. The actual type itself is a normal - -- integer type. + -- delta and small values. The actual type itself is a normal integer + -- type. -- typ___XF_nn_dd -- typ___XF_nn_dd_nn_dd @@ -576,9 +575,9 @@ package Exp_Dbug is -- typ___XFG -- representing the Vax F Float, D Float, and G Float types. The - -- debugger must treat these specially. In particular, printing - -- these values can be achieved using the debug procedures that - -- are provided in package System.Vax_Float_Operations: + -- debugger must treat these specially. In particular, printing these + -- values can be achieved using the debug procedures that are provided + -- in package System.Vax_Float_Operations: -- procedure Debug_Output_D (Arg : D); -- procedure Debug_Output_F (Arg : F); @@ -592,17 +591,15 @@ package Exp_Dbug is -- Discrete Types -- -------------------- - -- Discrete types are coded with a suffix indicating the range in - -- the case where one or both of the bounds are discriminants or - -- variable. + -- Discrete types are coded with a suffix indicating the range in the + -- case where one or both of the bounds are discriminants or variable. - -- Note: at the current time, we also encode compile time known - -- bounds if they do not match the natural machine type bounds, - -- but this may be removed in the future, since it is redundant - -- for most debugging formats. However, we do not ever need XD - -- encoding for enumeration base types, since here it is always - -- clear what the bounds are from the total number of enumeration - -- literals. + -- Note: at the current time, we also encode compile time known bounds + -- if they do not match the natural machine type bounds, but this may + -- be removed in the future, since it is redundant for most debugging + -- formats. However, we do not ever need XD encoding for enumeration + -- base types, since here it is always clear what the bounds are from + -- the total number of enumeration literals. -- typ___XD -- typ___XDL_lowerbound @@ -615,27 +612,26 @@ package Exp_Dbug is -- constrained range that does not correspond to the size or that -- has discriminant references or other compile time known bounds. - -- The first form is used if both bounds are dynamic, in which case - -- two constant objects are present whose names are typ___L and - -- typ___U in the same scope as typ, and the values of these constants - -- indicate the bounds. As far as the debugger is concerned, these - -- are simply variables that can be accessed like any other variables. - -- In the enumeration case, these values correspond to the Enum_Rep - -- values for the lower and upper bounds. - - -- The second form is used if the upper bound is dynamic, but the - -- lower bound is either constant or depends on a discriminant of - -- the record with which the type is associated. The upper bound - -- is stored in a constant object of name typ___U as previously - -- described, but the lower bound is encoded directly into the - -- name as either a decimal integer, or as the discriminant name. - - -- The third form is similarly used if the lower bound is dynamic, - -- but the upper bound is compile time known or a discriminant - -- reference, in which case the lower bound is stored in a constant - -- object of name typ___L, and the upper bound is encoded directly - -- into the name as either a decimal integer, or as the discriminant - -- name. + -- The first form is used if both bounds are dynamic, in which case two + -- constant objects are present whose names are typ___L and typ___U in + -- the same scope as typ, and the values of these constants indicate + -- the bounds. As far as the debugger is concerned, these are simply + -- variables that can be accessed like any other variables. In the + -- enumeration case, these values correspond to the Enum_Rep values for + -- the lower and upper bounds. + + -- The second form is used if the upper bound is dynamic, but the lower + -- bound is either constant or depends on a discriminant of the record + -- with which the type is associated. The upper bound is stored in a + -- constant object of name typ___U as previously described, but the + -- lower bound is encoded directly into the name as either a decimal + -- integer, or as the discriminant name. + + -- The third form is similarly used if the lower bound is dynamic, but + -- the upper bound is compile time known or a discriminant reference, + -- in which case the lower bound is stored in a constant object of name + -- typ___L, and the upper bound is encoded directly into the name as + -- either a decimal integer, or as the discriminant name. -- The fourth form is used if both bounds are discriminant references -- or compile time known values, with the encoding first for the lower @@ -650,9 +646,9 @@ package Exp_Dbug is -- type x is mod N; -- Is encoded as a subrange of an unsigned base type with lower bound - -- 0 and upper bound N. That is, there is no name encoding. We use - -- the standard encodings provided by the debugging format. Thus - -- we give these types a non-standard interpretation: the standard + -- zero and upper bound N. That is, there is no name encoding. We use + -- the standard encodings provided by the debugging format. Thus we + -- give these types a non-standard interpretation: the standard -- interpretation of our encoding would not, in general, imply that -- arithmetic on type x was to be performed modulo N (especially not -- when N is not a power of 2). @@ -661,23 +657,22 @@ package Exp_Dbug is -- Biased Types -- ------------------ - -- Only discrete types can be biased, and the fact that they are - -- biased is indicated by a suffix of the form: + -- Only discrete types can be biased, and the fact that they are biased + -- is indicated by a suffix of the form: -- typ___XB_lowerbound__upperbound - -- Here lowerbound and upperbound are decimal integers, with the - -- usual (postfix "m") encoding for negative numbers. Biased - -- types are only possible where the bounds are compile time - -- known, and the values are represented as unsigned offsets - -- from the lower bound given. For example: + -- Here lowerbound and upperbound are decimal integers, with the usual + -- (postfix "m") encoding for negative numbers. Biased types are only + -- possible where the bounds are compile time known, and the values are + -- represented as unsigned offsets from the lower bound given. For + -- example: -- type Q is range 10 .. 15; -- for Q'size use 3; - -- The size clause will force values of type Q in memory to be - -- stored in biased form (e.g. 11 will be represented by the - -- bit pattern 001). + -- The size clause will force values of type Q in memory to be stored + -- in biased form (e.g. 11 will be represented by the bit pattern 001). ---------------------------------------------- -- Record Types with Variable-Length Fields -- @@ -692,10 +687,10 @@ package Exp_Dbug is -- type___XVU -- The former name is used for a record and the latter for the union - -- that is made for a variant record (see below) if that record or - -- union has a field of variable size or if the record or union itself - -- has a variable size. These encodings suffix any other encodings that - -- that might be suffixed to the type name. + -- that is made for a variant record (see below) if that record or union + -- has a field of variable size or if the record or union itself has a + -- variable size. These encodings suffix any other encodings that that + -- might be suffixed to the type name. -- The idea here is to provide all the needed information to interpret -- objects of the original type in the form of a "fixed up" type, which @@ -706,23 +701,22 @@ package Exp_Dbug is -- To deal with this, we encode *all* the field bit positions of the -- special ___XV type in a non-standard manner. - -- The idea is to encode not the position, but rather information - -- that allows computing the position of a field from the position - -- of the previous field. The algorithm for computing the actual - -- positions of all fields and the length of the record is as - -- follows. In this description, let P represent the current - -- bit position in the record. + -- The idea is to encode not the position, but rather information that + -- allows computing the position of a field from the position of the + -- previous field. The algorithm for computing the actual positions of + -- all fields and the length of the record is as follows. In this + -- description, let P represent the current bit position in the record. -- 1. Initialize P to 0 -- 2. For each field in the record: - -- 2a. If an alignment is given (see below), then round P - -- up, if needed, to the next multiple of that alignment. + -- 2a. If an alignment is given (see below), then round P up, if + -- needed, to the next multiple of that alignment. - -- 2b. If a bit position is given, then increment P by that - -- amount (that is, treat it as an offset from the end of the - -- preceding record). + -- 2b. If a bit position is given, then increment P by that amount + -- (that is, treat it as an offset from the end of the preceding + -- record). -- 2c. Assign P as the actual position of the field @@ -738,15 +732,15 @@ package Exp_Dbug is -- where the nn after the XVA indicates the alignment value in storage -- units. This encoding is present only if an alignment is present. - -- The size of the record described by an XVE-encoded type (in bits) - -- is generally the maximum value attained by P' in step 2d above, - -- rounded up according to the record's alignment. + -- The size of the record described by an XVE-encoded type (in bits) is + -- generally the maximum value attained by P' in step 2d above, rounded + -- up according to the record's alignment. -- Second, the variable-length fields themselves are represented by - -- replacing the type by a special access type. The designated type - -- of this access type is the original variable-length type, and the - -- fact that this field has been transformed in this way is signalled - -- by encoding the field name as: + -- replacing the type by a special access type. The designated type of + -- this access type is the original variable-length type, and the fact + -- that this field has been transformed in this way is signalled by + -- encoding the field name as: -- field___XVL @@ -757,24 +751,24 @@ package Exp_Dbug is -- field___XVLnn -- Note: the reason that we change the type is so that the resulting - -- type has no variable-length fields. At least some of the formats - -- used for debugging information simply cannot tolerate variable- - -- length fields, so the encoded information would get lost. - - -- Third, in the case of a variant record, the special union - -- that contains the variants is replaced by a normal C union. - -- In this case, the positions are all zero. - - -- Discriminants appear before any variable-length fields that depend - -- on them, with one exception. In some cases, a discriminant - -- governing the choice of a variant clause may appear in the list - -- of fields of an XVE type after the entry for the variant clause - -- itself (this can happen in the presence of a representation clause - -- for the record type in the source program). However, when this - -- happens, the discriminant's position may be determined by first - -- applying the rules described in this section, ignoring the variant - -- clause. As a result, discriminants can always be located - -- independently of the variable-length fields that depend on them. + -- type has no variable-length fields. At least some of the formats used + -- for debugging information simply cannot tolerate variable- length + -- fields, so the encoded information would get lost. + + -- Third, in the case of a variant record, the special union that + -- contains the variants is replaced by a normal C union. In this case, + -- the positions are all zero. + + -- Discriminants appear before any variable-length fields that depend on + -- them, with one exception. In some cases, a discriminant governing the + -- choice of a variant clause may appear in the list of fields of an XVE + -- type after the entry for the variant clause itself (this can happen + -- in the presence of a representation clause for the record type in the + -- source program). However, when this happens, the discriminant's + -- position may be determined by first applying the rules described in + -- this section, ignoring the variant clause. As a result, discriminants + -- can always be located independently of the variable-length fields + -- that depend on them. -- The size of the ___XVE or ___XVU record or union is set to the -- alignment (in bytes) of the original object so that the debugger @@ -815,20 +809,18 @@ package Exp_Dbug is -- Notes: - -- 1) The B field could also have been encoded by using a position - -- of zero, and an alignment of 4, but in such a case, the coding by - -- position is preferred (since it takes up less space). We have used - -- the (illegal) notation access xxx as field types in the example - -- above. + -- 1) The B field could also have been encoded by using a position of + -- zero and an alignment of 4, but in such a case the coding by position + -- is preferred (since it takes up less space). We have used the + -- (illegal) notation access xxx as field types in the example above. - -- 2) The E field does not actually need the alignment indication - -- but this may not be detected in this case by the conversion - -- routines. + -- 2) The E field does not actually need the alignment indication but + -- this may not be detected in this case by the conversion routines. -- 3) Our conventions do not cover all XVE-encoded records in which - -- some, but not all, fields have representation clauses. Such - -- records may, therefore, be displayed incorrectly by debuggers. - -- This situation is not common. + -- some, but not all, fields have representation clauses. Such records + -- may, therefore, be displayed incorrectly by debuggers. This situation + -- is not common. ----------------------- -- Base Record Types -- @@ -853,7 +845,7 @@ package Exp_Dbug is -- The size of the objects typed as x should be obtained from the -- structure of x (and x___XVE, if applicable) as for ordinary types -- unless there is a variable named x___XVZ, which, if present, will - -- hold the size (in bytes) of x; in this latter case, the size of the + -- hold the size (in bytes) of x. In this latter case, the size of the -- x___XVS type will not be a constant but a reference to x___XVZ. -- The type x will either be a subtype of y (see also Subtypes of @@ -903,10 +895,10 @@ package Exp_Dbug is ----------------- -- Since there is no way for the debugger to obtain the index subtypes - -- for an array type, we produce a type that has the name of the - -- array type followed by "___XA" and is a record whose field names - -- are the names of the types for the bounds. The types of these - -- fields is an integer type which is meaningless. + -- for an array type, we produce a type that has the name of the array + -- type followed by "___XA" and is a record type whose field types are + -- the respective types for the bounds (and whose field names are the + -- names of these types). -- To conserve space, we do not produce this type unless one of the -- index types is either an enumeration type, has a variable upper @@ -965,8 +957,8 @@ package Exp_Dbug is -- Renaming -- -------------- - -- Debugging information is generated for exception, object, package, - -- and subprogram renaming (generic renamings are not significant, since + -- Debugging information is generated for exception, object, package, and + -- subprogram renaming (generic renamings are not significant, since -- generic templates are not relevant at debugging time). -- Consider a renaming declaration of the form @@ -997,8 +989,8 @@ package Exp_Dbug is -- Note: subprogram renamings are not encoded at the present time - -- The suffix of the variable name describing the renamed object is - -- defined to use the following encoding: + -- The suffix of the variable name describing the renamed object is defined + -- to use the following encoding: -- For the simple entity case, where y is just an entity name, the suffix -- is of the form: @@ -1099,13 +1091,13 @@ package Exp_Dbug is -- For every constrained packed array, two types are created, and both -- appear in the debugging output: - -- The original declared array type is a perfectly normal array type, - -- and its index bounds indicate the original bounds of the array. + -- The original declared array type is a perfectly normal array type, and + -- its index bounds indicate the original bounds of the array. -- The corresponding packed array type, which may be a modular type, or - -- may be an array of bytes type (see Exp_Pakd for full details). This - -- is the type that is actually used in the generated code and for - -- debugging information for all objects of the packed type. + -- may be an array of bytes type (see Exp_Pakd for full details). This is + -- the type that is actually used in the generated code and for debugging + -- information for all objects of the packed type. -- The name of the corresponding packed array type is: @@ -1138,16 +1130,16 @@ package Exp_Dbug is -- Packed Array Representation in Memory -- ------------------------------------------- - -- Packed arrays are represented in tightly packed form, with no extra - -- bits between components. This is true even when the component size - -- is not a factor of the storage unit size, so that as a result it is - -- possible for components to cross storage unit boundaries. + -- Packed arrays are represented in tightly packed form, with no extra bits + -- between components. This is true even when the component size is not a + -- factor of the storage unit size, so that as a result it is possible for + -- components to cross storage unit boundaries. -- The layout in storage is identical, regardless of whether the - -- implementation type is a modular type or an array-of-bytes type. - -- See Exp_Pakd for details of how these implementation types are used, - -- but for the purpose of the debugger, only the starting address of - -- the object in memory is significant. + -- implementation type is a modular type or an array-of-bytes type. See + -- Exp_Pakd for details of how these implementation types are used, but for + -- the purpose of the debugger, only the starting address of the object in + -- memory is significant. -- The following example should show clearly how the packing works in -- the little-endian and big-endian cases: @@ -1187,8 +1179,8 @@ package Exp_Dbug is -- For example, in the normal modular case, if we have a 6-bit modular -- type, declared as mod 2**6, and we allocate an 8-bit object for this -- type, then we extend the value with two bits on the most significant - -- end, and in either the little-endian or big-endian case, the value 63 is - -- represented as 00111111 in binary in memory. + -- end, and in either the little-endian or big-endian case, the value 63 + -- is represented as 00111111 in binary in memory. -- For a modular type used to represent a packed array, the rule is -- different. In this case, if we have to extend the value, then we do it @@ -1225,11 +1217,11 @@ package Exp_Dbug is -- However, in the equality case, it is important to ensure that the -- undefined bits do not participate in an equality test. - -- If a modular packed array value is assigned to a register, then - -- logically it could always be held right justified, to avoid any need to - -- shift, e.g. when doing comparisons. But probably this is a bad choice, - -- as it would mean that an assignment such as a := above would require - -- shifts when one value is in a register and the other value is in memory. + -- If a modular packed array value is assigned to a register then logically + -- it could always be held right justified, to avoid any need to shift, + -- e.g. when doing comparisons. But probably this is a bad choice, as it + -- would mean that an assignment such as a := above would require shifts + -- when one value is in a register and the other value is in memory. ------------------------------------------------------ -- Subprograms for Handling Packed Array Type Names -- diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 5411f04d05d..cdb9e880599 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -3681,7 +3681,7 @@ package body Exp_Disp is -- Calculate the number of slots of the dispatch table. If the number -- of primitives of Typ is 0 we reserve a dummy single entry for its - -- DT because at run-time the pointer to this dummy entry will be + -- DT because at run time the pointer to this dummy entry will be -- used as the tag. if Num_Iface_Prims = 0 then @@ -4489,6 +4489,9 @@ package body Exp_Disp is (RTE_Record_Component (RE_NDT_Prims_Ptr), Loc)), Attribute_Name => Name_Address)))); + Set_Is_Statically_Allocated (DT_Ptr, + Is_Library_Level_Tagged_Type (Typ)); + -- Generate the SCIL node for the previous object declaration -- because it has a tag initialization. @@ -4554,6 +4557,9 @@ package body Exp_Disp is (RTE_Record_Component (RE_Prims_Ptr), Loc)), Attribute_Name => Name_Address)))); + Set_Is_Statically_Allocated (DT_Ptr, + Is_Library_Level_Tagged_Type (Typ)); + -- Generate the SCIL node for the previous object declaration -- because it has a tag initialization. @@ -5089,7 +5095,7 @@ package body Exp_Disp is Is_Library_Level_Tagged_Type (Typ)); -- The table of interfaces is not constant; its slots are - -- filled at run-time by the IP routine using attribute + -- filled at run time by the IP routine using attribute -- 'Position to know the location of the tag components -- (and this attribute cannot be safely used before the -- object is initialized). @@ -6305,12 +6311,13 @@ package body Exp_Disp is Set_Related_Type (DT_Ptr, Typ); -- For CPP types there is no need to build the dispatch tables since - -- they are imported from the C++ side. If the CPP type has an IP - -- then we declare now the variable that will store the copy of the - -- C++ tag. + -- they are imported from the C++ side. If the CPP type has an IP then + -- we declare now the variable that will store the copy of the C++ tag. + -- If the CPP type is an interface, we need the variable as well, + -- because it becomes the pointer to the corresponding secondary table. if Is_CPP_Class (Typ) then - if Has_CPP_Constructors (Typ) then + if Has_CPP_Constructors (Typ) or else Is_Interface (Typ) then Append_To (Result, Make_Object_Declaration (Loc, Defining_Identifier => DT_Ptr, @@ -6639,6 +6646,13 @@ package body Exp_Disp is Analyze_List (Result); Set_Suppress_Init_Proc (Base_Type (DT_Prims)); + -- Disable backend optimizations based on assumptions about the + -- aliasing status of objects designated by the access to the + -- dispatch table. Required to handle dispatch tables imported + -- from C++. + + Set_No_Strict_Aliasing (Base_Type (DT_Prims_Acc)); + -- Add the freezing nodes of these declarations; required to avoid -- generating these freezing nodes in wrong scopes (for example in -- the IC routine of a derivation of Typ). @@ -6653,8 +6667,8 @@ package body Exp_Disp is end; end if; - -- Mark entities of dispatch table. Required by the back end to - -- handle them properly. + -- Mark entities of dispatch table. Required by the back end to handle + -- them properly. if Present (DT) then Set_Is_Dispatch_Table_Entity (DT); diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index 5817d7ac73e..00bdeaf5113 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -8427,6 +8427,15 @@ package body Exp_Dist is Fnam := Find_Inherited_TSS (U_Type, TSS_From_Any); + -- For the subtype representing a generic actual type, go to the + -- actual type. + + if Is_Generic_Actual_Type (U_Type) then + U_Type := Underlying_Type (Base_Type (U_Type)); + end if; + + -- For a standard subtype, go to the base type + if Sloc (U_Type) <= Standard_Location then U_Type := Base_Type (U_Type); end if; @@ -8516,13 +8525,6 @@ package body Exp_Dist is Decl : Entity_Id; begin - -- For the subtype representing a generic actual type, go - -- to the base type. - - if Is_Generic_Actual_Type (U_Type) then - U_Type := Base_Type (U_Type); - end if; - Build_From_Any_Function (Loc, U_Type, Decl, Fnam); Append_To (Decls, Decl); end; @@ -8769,7 +8771,7 @@ package body Exp_Dist is -- Struct_Counter should be reset before -- handling a variant part. Indeed only one -- of the case statement alternatives will be - -- executed at run-time, so the counter must + -- executed at run time, so the counter must -- start at 0 for every case statement. Struct_Counter := 0; @@ -9240,12 +9242,14 @@ package body Exp_Dist is Fnam := Find_Inherited_TSS (U_Type, TSS_To_Any); - -- Check first for Boolean and Character. These are enumeration - -- types, but we treat them specially, since they may require - -- special handling in the transfer protocol. However, this - -- special handling only applies if they have standard - -- representation, otherwise they are treated like any other - -- enumeration type. + -- For the subtype representing a generic actual type, go to the + -- actual type. + + if Is_Generic_Actual_Type (U_Type) then + U_Type := Underlying_Type (Base_Type (U_Type)); + end if; + + -- For a standard subtype, go to the base type if Sloc (U_Type) <= Standard_Location then U_Type := Base_Type (U_Type); @@ -9254,6 +9258,13 @@ package body Exp_Dist is if Present (Fnam) then null; + -- Check first for Boolean and Character. These are enumeration + -- types, but we treat them specially, since they may require + -- special handling in the transfer protocol. However, this + -- special handling only applies if they have standard + -- representation, otherwise they are treated like any other + -- enumeration type. + elsif U_Type = Standard_Boolean then Lib_RE := RE_TA_B; @@ -9380,14 +9391,11 @@ package body Exp_Dist is Decls : constant List_Id := New_List; Stms : constant List_Id := New_List; - Expr_Parameter : constant Entity_Id := - Make_Defining_Identifier (Loc, Name_E); - - Any : constant Entity_Id := - Make_Defining_Identifier (Loc, Name_A); + Expr_Parameter : Entity_Id; + Any : Entity_Id; + Result_TC : Node_Id; Any_Decl : Node_Id; - Result_TC : Node_Id := Build_TypeCode_Call (Loc, Typ, Decls); Use_Opaque_Representation : Boolean; -- When True, use stream attributes and represent type as an @@ -9401,13 +9409,17 @@ package body Exp_Dist is if Is_Itype (Typ) and then Typ /= Base_Type (Typ) then Build_To_Any_Function - (Loc => Loc, + (Loc => Loc, Typ => Etype (Typ), Decl => Decl, Fnam => Fnam); return; end if; + Expr_Parameter := Make_Defining_Identifier (Loc, Name_E); + Any := Make_Defining_Identifier (Loc, Name_A); + Result_TC := Build_TypeCode_Call (Loc, Typ, Decls); + Fnam := Make_Helper_Function_Name (Loc, Typ, Name_To_Any); Spec := @@ -9655,7 +9667,7 @@ package body Exp_Dist is -- Struct_Counter should be reset before -- handling a variant part. Indeed only one -- of the case statement alternatives will be - -- executed at run-time, so the counter must + -- executed at run time, so the counter must -- start at 0 for every case statement. Struct_Counter := 0; @@ -10017,15 +10029,20 @@ package body Exp_Dist is Fnam := Find_Inherited_TSS (U_Type, TSS_TypeCode); end if; - if No (Fnam) then - if Sloc (U_Type) <= Standard_Location then + -- For the subtype representing a generic actual type, go to the + -- actual type. + + if Is_Generic_Actual_Type (U_Type) then + U_Type := Underlying_Type (Base_Type (U_Type)); + end if; - -- Do not try to build alias typecodes for subtypes from - -- Standard. + -- For a standard subtype, go to the base type - U_Type := Base_Type (U_Type); - end if; + if Sloc (U_Type) <= Standard_Location then + U_Type := Base_Type (U_Type); + end if; + if No (Fnam) then if U_Type = Standard_Boolean then Lib_RE := RE_TC_B; diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index 0c4a67cb684..ecf10265056 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -1014,6 +1014,10 @@ package body Exp_Intr is Append_To (Stmts, Free_Node); Set_Storage_Pool (Free_Node, Pool); + -- Attach to tree before analysis of generated subtypes below. + + Set_Parent (Stmts, Parent (N)); + -- Deal with storage pool if Present (Pool) then diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index bd8a69771a4..3b1a4cf0973 100644 --- a/gcc/ada/exp_pakd.adb +++ b/gcc/ada/exp_pakd.adb @@ -1340,6 +1340,14 @@ package body Exp_Pakd is Ctyp := Component_Type (Atyp); Csiz := UI_To_Int (Component_Size (Atyp)); + -- We remove side effects, in case the rhs modifies the lhs, because we + -- are about to transform the rhs into an expression that first READS + -- the lhs, so we can do the necessary shifting and masking. Example: + -- "X(2) := F(...);" where F modifies X(3). Otherwise, the side effect + -- will be lost. + + Remove_Side_Effects (Rhs); + -- We convert the right hand side to the proper subtype to ensure -- that an appropriate range check is made (since the normal range -- check from assignment will be lost in the transformations). This diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 987cddc0bbd..d8b8ad0efa4 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -392,7 +392,7 @@ package body Exp_Prag is then return; elsif Nam = Name_Assertion then - Error_Msg_N ("?assertion will fail at run-time", N); + Error_Msg_N ("?assertion will fail at run time", N); else Error_Msg_N ("?check will fail at run time", N); end if; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index c4408526912..99ec49ad21c 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1216,14 +1216,15 @@ package body Exp_Util is begin -- In general we cannot build the subtype if expansion is disabled, -- because internal entities may not have been defined. However, to - -- avoid some cascaded errors, we try to continue when the expression - -- is an array (or string), because it is safe to compute the bounds. - -- It is in fact required to do so even in a generic context, because - -- there may be constants that depend on bounds of string literal. + -- avoid some cascaded errors, we try to continue when the expression is + -- an array (or string), because it is safe to compute the bounds. It is + -- in fact required to do so even in a generic context, because there + -- may be constants that depend on the bounds of a string literal, both + -- standard string types and more generally arrays of characters. if not Expander_Active and then (No (Etype (Exp)) - or else Base_Type (Etype (Exp)) /= Standard_String) + or else not Is_String_Type (Etype (Exp))) then return; end if; @@ -4777,6 +4778,18 @@ package body Exp_Util is Set_Etype (Def_Id, Exp_Type); Res := New_Reference_To (Def_Id, Loc); + -- If the expression is a packed reference, it must be reanalyzed + -- and expanded, depending on context. This is the case for actuals + -- where a constraint check may capture the actual before expansion + -- of the call is complete. + + if Nkind (Exp) = N_Indexed_Component + and then Is_Packed (Etype (Prefix (Exp))) + then + Set_Analyzed (Exp, False); + Set_Analyzed (Prefix (Exp), False); + end if; + E := Make_Object_Declaration (Loc, Defining_Identifier => Def_Id, diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 8a48f9ca78d..bda6e79dab2 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1089,7 +1089,9 @@ package body Freeze is -- Do not attempt to analyze case where range was in error - if Error_Posted (Scalar_Range (E)) then + if No (Scalar_Range (E)) + or else Error_Posted (Scalar_Range (E)) + then return; end if; diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index fb5eb4319f1..31c8feaa9c1 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -121,12 +121,17 @@ begin Lib.Load.Load_Main_Source; - -- Return immediately if the main source could not be parsed + -- Return immediately if the main source could not be found if Sinput.Main_Source_File = No_Source_File then return; end if; + -- We set Parsing_Main_Extended_Source true here to cover processing of all + -- the configuration pragma files, as well as the main source unit itself. + + Parsing_Main_Extended_Source := True; + -- Read and process configuration pragma files if present declare @@ -161,7 +166,6 @@ begin if Source_gnat_adc /= No_Source_File then Initialize_Scanner (No_Unit, Source_gnat_adc); Config_Pragmas := Par (Configuration_Pragmas => True); - else Config_Pragmas := Empty_List; end if; @@ -230,9 +234,9 @@ begin Optimize_Alignment := 'T'; end if; - -- We have now processed the command line switches, and the gnat.adc - -- file, so this is the point at which we want to capture the values - -- of the configuration switches (see Opt for further details). + -- We have now processed the command line switches, and the configuration + -- pragma files, so this is the point at which we want to capture the + -- values of the configuration switches (see Opt for further details). Opt.Register_Opt_Config_Switches; @@ -253,6 +257,7 @@ begin -- semantics in any case). Discard_List (Par (Configuration_Pragmas => False)); + Parsing_Main_Extended_Source := False; -- The main unit is now loaded, and subunits of it can be loaded, -- without reporting spurious loading circularities. @@ -290,7 +295,7 @@ begin -- explicit switch turning off Warn_On_Non_Local_Exception, then turn on -- this warning by default if we have encountered an exception handler. - if Restriction_Active (No_Exception_Propagation) + if Restriction_Check_Required (No_Exception_Propagation) and then not No_Warn_On_Non_Local_Exception and then Exception_Handler_Encountered then diff --git a/gcc/ada/g-calend.ads b/gcc/ada/g-calend.ads index 39ca20371a0..9dd5ae00a84 100644 --- a/gcc/ada/g-calend.ads +++ b/gcc/ada/g-calend.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1999-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,11 +33,11 @@ -- Second_Duration and Day_Of_Week and Day_In_Year from Calendar.Time. -- Second_Duration precision depends on the target clock precision. -- --- GNAT.Calendar provides the same kind of abstraction found in --- Ada.Calendar. It provides Split and Time_Of to build and split a Time --- data. And it provides accessor functions to get only one of Hour, Minute, --- Second, Second_Duration. Other functions are to access more advanced --- values like Day_Of_Week, Day_In_Year and Week_In_Year. +-- GNAT.Calendar provides the same kind of abstraction found in Ada.Calendar. +-- It provides Split and Time_Of to build and split a Time data. And it +-- provides accessor functions to get only one of Hour, Minute, Second, +-- Second_Duration. Other functions are to access more advanced values like +-- Day_Of_Week, Day_In_Year and Week_In_Year. with Ada.Calendar; with Interfaces.C; @@ -46,6 +46,7 @@ package GNAT.Calendar is type Day_Name is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); + pragma Ordered (Day_Name); subtype Hour_Number is Natural range 0 .. 23; subtype Minute_Number is Natural range 0 .. 59; diff --git a/gcc/ada/g-comver.adb b/gcc/ada/g-comver.adb index 7a6baa102f7..b71cadcf856 100644 --- a/gcc/ada/g-comver.adb +++ b/gcc/ada/g-comver.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2008, AdaCore -- +-- Copyright (C) 2002-2010, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -42,7 +42,8 @@ package body GNAT.Compiler_Version is -- import this directly since run-time units cannot WITH compiler units. Ver_Prefix : constant String := "GNAT Version: "; - -- Prefix generated by binder + -- This is logically a reference to Gnatvsn.Ver_Prefix but we cannot + -- import this directly since run-time units cannot WITH compiler units. GNAT_Version : constant String (1 .. Ver_Len_Max + Ver_Prefix'Length); pragma Import (C, GNAT_Version, "__gnat_version"); diff --git a/gcc/ada/g-expect.ads b/gcc/ada/g-expect.ads index 9a00cf0571e..18cf995891f 100644 --- a/gcc/ada/g-expect.ads +++ b/gcc/ada/g-expect.ads @@ -184,6 +184,9 @@ package GNAT.Expect is -- subprograms to also match on output on standard error. -- -- Invalid_Process is raised if the process could not be spawned. + -- + -- For information about spawning processes from tasking programs, see the + -- "NOTE: Spawn in tasking programs" in System.OS_Lib (s-os_lib.ads). procedure Close (Descriptor : in out Process_Descriptor); -- Terminate the process and close the pipes to it. It implicitly does the diff --git a/gcc/ada/g-pehage.adb b/gcc/ada/g-pehage.adb index b59e1ecec98..c637d1c0d0b 100644 --- a/gcc/ada/g-pehage.adb +++ b/gcc/ada/g-pehage.adb @@ -553,10 +553,18 @@ package body GNAT.Perfect_Hash_Generators is -- Allocate -- -------------- - function Allocate (N : Natural; S : Natural := 1) return Table_Id is + function Allocate (N : Natural; S : Natural := 1) return Table_Id is L : constant Integer := IT.Last; begin IT.Set_Last (L + N * S); + + -- Initialize, so debugging printouts don't trip over uninitialized + -- components. + + for J in L + 1 .. IT.Last loop + IT.Table (J) := -1; + end loop; + return L + 1; end Allocate; @@ -1423,8 +1431,11 @@ package body GNAT.Perfect_Hash_Generators is -- Produce -- ------------- - procedure Produce (Pkg_Name : String := Default_Pkg_Name) is - File : File_Descriptor; + procedure Produce + (Pkg_Name : String := Default_Pkg_Name; + Use_Stdout : Boolean := False) + is + File : File_Descriptor := Standout; Status : Boolean; -- For call to Close @@ -1517,23 +1528,25 @@ package body GNAT.Perfect_Hash_Generators is P : Natural; FName : String := Ada_File_Base_Name (Pkg_Name) & ".ads"; - -- Initially, the name of the spec file; then modified to be the name of - -- the body file. + -- Initially, the name of the spec file, then modified to be the name of + -- the body file. Not used if Use_Stdout is True. -- Start of processing for Produce begin - if Verbose then + if Verbose and then not Use_Stdout then Put (Output, "Producing " & Ada.Directories.Current_Directory & "/" & FName); New_Line (Output); end if; - File := Create_File (FName, Binary); + if not Use_Stdout then + File := Create_File (FName, Binary); - if File = Invalid_FD then - raise Program_Error with "cannot create: " & FName; + if File = Invalid_FD then + raise Program_Error with "cannot create: " & FName; + end if; end if; Put (File, "package "); @@ -1546,18 +1559,26 @@ package body GNAT.Perfect_Hash_Generators is Put (File, Pkg_Name); Put (File, ";"); New_Line (File); - Close (File, Status); - if not Status then - raise Device_Error; + if not Use_Stdout then + Close (File, Status); + + if not Status then + raise Device_Error; + end if; end if; - FName (FName'Last) := 'b'; -- Set to body file name + if not Use_Stdout then + + -- Set to body file name + + FName (FName'Last) := 'b'; - File := Create_File (FName, Binary); + File := Create_File (FName, Binary); - if File = Invalid_FD then - raise Program_Error with "cannot create: " & FName; + if File = Invalid_FD then + raise Program_Error with "cannot create: " & FName; + end if; end if; Put (File, "with Interfaces; use Interfaces;"); @@ -1730,10 +1751,13 @@ package body GNAT.Perfect_Hash_Generators is Put (File, Pkg_Name); Put (File, ";"); New_Line (File); - Close (File, Status); - if not Status then - raise Device_Error; + if not Use_Stdout then + Close (File, Status); + + if not Status then + raise Device_Error; + end if; end if; end Produce; diff --git a/gcc/ada/g-pehage.ads b/gcc/ada/g-pehage.ads index dfe926ef782..8e72088e36d 100644 --- a/gcc/ada/g-pehage.ads +++ b/gcc/ada/g-pehage.ads @@ -131,11 +131,14 @@ package GNAT.Perfect_Hash_Generators is -- Raise Too_Many_Tries if the algorithm does not succeed within Tries -- attempts (see Initialize). - procedure Produce (Pkg_Name : String := Default_Pkg_Name); + procedure Produce + (Pkg_Name : String := Default_Pkg_Name; + Use_Stdout : Boolean := False); -- Generate the hash function package Pkg_Name. This package includes the - -- minimal perfect Hash function. The output is placed in the current - -- directory, in files X.ads and X.adb, where X is the standard GNAT file - -- name for a package named Pkg_Name. + -- minimal perfect Hash function. The output is normally placed in the + -- current directory, in files X.ads and X.adb, where X is the standard + -- GNAT file name for a package named Pkg_Name. If Use_Stdout is True, the + -- output goes to standard output, and no files are written. ---------------------------------------------------------------- diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 1cb612d2a7a..427f8081163 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -841,24 +841,16 @@ ada.install-common: # -if [ -f gnat1$(exeext) ] ; \ then \ - if [ -f gnatsym$(exeext) ] ; \ + if [ -f gnatsym-cross$(exeext) ] ; \ then \ + $(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatsym$(exeext); \ + $(INSTALL_PROGRAM) gnatsym-cross$(exeext) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatsym$(exeext); \ + else \ $(RM) $(DESTDIR)$(bindir)/gnatsym$(exeext); \ $(INSTALL_PROGRAM) gnatsym$(exeext) $(DESTDIR)$(bindir)/gnatsym$(exeext); \ fi ; \ fi # -# Gnatlbr is only used on VMS. -# - -if [ -f gnat1$(exeext) ] ; \ - then \ - if [ -f gnatlbr$(exeext) ] ; \ - then \ - $(RM) $(DESTDIR)$(bindir)/gnatlbr$(exeext); \ - $(INSTALL_PROGRAM) gnatlbr$(exeext) $(DESTDIR)$(bindir)/gnatlbr$(exeext); \ - fi ; \ - fi -# # Gnatdll is only used on Windows. # -if [ -f gnat1$(exeext) ] ; \ @@ -903,7 +895,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(bindir)/gnatfind$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatdll$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatkr$(exeext) - -$(RM) $(DESTDIR)$(bindir)/gnatlbr$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatlink$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatls$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatmake$(exeext) @@ -918,7 +909,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatfind$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatdll$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatkr$(exeext) - -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatlbr$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatlink$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatls$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatmake$(exeext) @@ -933,7 +923,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(tooldir)/bin/gnatfind$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatdll$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatkr$(exeext) - -$(RM) $(DESTDIR)$(tooldir)/bin/gnatlbr$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatlink$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatls$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatmake$(exeext) @@ -942,8 +931,8 @@ ada.uninstall: -$(RM) $(DESTDIR)$(tooldir)/bin/gnatxref$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatclean$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatsym$(exeext) -# Gnatlbr and Gnatchop are only used on VMS - -$(RM) $(DESTDIR)$(bindir)/gnatlbr$(exeext) $(DESTDIR)$(bindir)/gnatchop$(exeext) +# Gnatchop is only used on VMS + -$(RM) $(DESTDIR)$(bindir)/gnatchop$(exeext) # Clean hooks: # A lot of the ancillary files are deleted by the main makefile. @@ -970,8 +959,6 @@ ada.distclean: -$(RM) gnatxref$(exeext) -$(RM) gnatclean$(exeext) -$(RM) gnatsym$(exeext) -# Gnatlbr is only used on VMS - -$(RM) gnatlbr$(exeext) -$(RM) ada/rts/* -$(RMDIR) ada/rts -$(RM) ada/tools/* @@ -1273,9 +1260,8 @@ ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TARGET_H) function.h langhooks.h $(CGRAPH_H) \ $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h \ ada/gcc-interface/ada.h ada/types.h ada/atree.h ada/elists.h ada/namet.h \ - ada/nlists.h ada/snames.h ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h \ - ada/einfo.h $(ADA_TREE_H) ada/gcc-interface/gigi.h gt-ada-utils.h \ - gtype-ada.h + ada/nlists.h ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h ada/einfo.h \ + $(ADA_TREE_H) ada/gcc-interface/gigi.h gt-ada-utils.h gtype-ada.h $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@ ada/utils2.o : ada/gcc-interface/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ @@ -1684,14 +1670,15 @@ ada/exp_atag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/exp_atag.ads ada/exp_atag.adb ada/exp_dist.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/fname-uf.ads \ - ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ - ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/sem.ads \ - ada/sem_aux.ads ada/sem_ch7.ads ada/sem_dist.ads ada/sem_util.ads \ - ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/erroutc.ads ada/exp_atag.ads ada/exp_atag.adb ada/exp_disp.ads \ + ada/exp_dist.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/fname-uf.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \ + ada/lib.ads ada/lib-load.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \ + ada/sem.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_ch7.ads \ + ada/sem_disp.ads ada/sem_dist.ads ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ @@ -1985,22 +1972,23 @@ ada/exp_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_aggr.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch8.ads \ - ada/exp_ch8.adb ada/exp_dbug.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/exp_util.adb ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ - ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads ada/sem_ch8.ads \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ - ada/s-rident.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/exp_aggr.ads ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads \ + ada/exp_ch8.ads ada/exp_ch8.adb ada/exp_dbug.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \ + ada/itypes.ads ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads \ + ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ + ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-stalib.ads \ + ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/validsw.ads ada/exp_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -2443,18 +2431,18 @@ ada/freeze.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads \ ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb \ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ - ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \ - ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ - ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ - ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/targparm.ads ada/tbuild.ads ada/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/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ + ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \ + ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/validsw.ads ada/widechar.ads ada/frontend.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3044,8 +3032,9 @@ ada/s-assert.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ ada/s-stoele.adb ada/s-traent.ads -ada/s-bitops.o : ada/ada.ads ada/a-unccon.ads ada/system.ads \ - ada/s-bitops.ads ada/s-bitops.adb ada/s-unstyp.ads +ada/s-bitops.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ + ada/system.ads ada/s-bitops.ads ada/s-bitops.adb ada/s-parame.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-carun8.o : ada/ada.ads ada/a-unccon.ads ada/system.ads \ ada/s-addope.ads ada/s-addope.adb ada/s-carun8.ads ada/s-carun8.adb @@ -3318,19 +3307,20 @@ ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \ ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \ ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \ - ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \ - ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \ - ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \ - ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ - ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ - ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ - ada/ttypef.ads ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads \ - ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/urealp.adb ada/validsw.ads ada/widechar.ads + ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/snames.adb ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/stylesw.ads ada/system.ads ada/s-carun8.ads ada/s-crc32.ads \ + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads \ + ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \ + ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \ + ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/validsw.ads ada/widechar.ads ada/sem_aux.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3476,27 +3466,27 @@ ada/sem_ch12.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ - ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/exp_dist.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/fname.ads ada/fname-uf.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-hesorg.ads ada/g-hesorg.adb ada/g-htable.ads ada/hostparm.ads \ - ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \ - ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ - ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \ - ada/sem.ads ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch13.adb \ - ada/sem_ch3.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ - ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ - ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/urealp.adb + ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/exp_disp.ads ada/exp_dist.ads \ + ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/fname-uf.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-hesorg.adb \ + ada/g-htable.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \ + ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ + ada/rtsfind.ads ada/rtsfind.adb ada/sem.ads ada/sem_aux.ads \ + ada/sem_ch13.ads ada/sem_ch13.adb ada/sem_ch3.ads ada/sem_ch7.ads \ + ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ + ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3520,31 +3510,31 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads \ ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \ ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/freeze.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads \ - ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \ - ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \ + ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \ + ada/itypes.ads ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ - ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ - ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ - ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_case.ads \ - ada/sem_case.adb ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch13.ads \ - ada/sem_ch3.ads ada/sem_ch3.adb ada/sem_ch6.ads ada/sem_ch7.ads \ - ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elim.ads \ - ada/sem_eval.ads ada/sem_eval.adb ada/sem_mech.ads ada/sem_res.ads \ - ada/sem_smem.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \ - ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ - ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ - ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ - ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ - ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ - ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \ + ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \ + ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \ + ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_cat.adb \ + ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch3.adb ada/sem_ch6.ads \ + ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \ + ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_mech.ads \ + ada/sem_res.ads ada/sem_smem.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ + ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ + ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ ada/validsw.ads ada/widechar.ads @@ -3555,31 +3545,32 @@ ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch6.ads ada/exp_ch7.ads \ ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \ - ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \ - ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ - ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \ - ada/namet-sp.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ - ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \ - ada/scng.adb ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \ - ada/sem_aux.ads ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads \ - ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch4.adb \ - ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \ - ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \ - ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads \ - ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \ - ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \ - ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ - ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ - ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads + ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \ + ada/namet.adb ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \ + ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \ + ada/sem_attr.ads ada/sem_aux.ads ada/sem_case.ads ada/sem_case.adb \ + ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads \ + ada/sem_ch4.adb ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \ + ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \ + ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ + ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \ + ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/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/atree.ads ada/atree.adb \ @@ -3602,18 +3593,18 @@ ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \ ada/sem_intr.ads ada/sem_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/sinput.ads ada/snames.ads \ - ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \ - ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \ - ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ - ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ - ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/validsw.ads ada/widechar.ads + ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \ + ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ + ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ + ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3732,18 +3723,19 @@ ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_ch9.adb ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \ ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads \ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \ - ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ - ada/sinput.adb ada/snames.ads ada/sprint.ads ada/stand.ads \ - ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \ - ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ - ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ - ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \ + ada/sinput.ads ada/sinput.adb ada/snames.ads ada/sprint.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ + ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ + ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \ + ada/widechar.ads ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3858,18 +3850,19 @@ ada/sem_eval.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \ ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads \ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \ - ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/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-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ - ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ - ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/widechar.ads + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ + ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ + ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/widechar.ads ada/sem_intr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3965,19 +3958,19 @@ ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \ ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads \ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \ - ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ - ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \ - ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \ - ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ - ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ - ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ - ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ - ada/validsw.ads ada/widechar.ads + ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb \ + ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/stylesw.ads ada/system.ads ada/s-carun8.ads ada/s-crc32.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ + ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ + ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/urealp.adb ada/validsw.ads ada/widechar.ads ada/sem_scil.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -4153,19 +4146,19 @@ ada/sinput-l.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ ada/gnat.ads ada/g-dyntab.ads ada/g-dyntab.adb ada/g-hesorg.ads \ - ada/hostparm.ads ada/interfac.ads ada/namet.ads ada/nlists.ads \ - ada/nlists.adb ada/opt.ads ada/osint.ads ada/output.ads ada/prep.ads \ - ada/prepcomp.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \ - ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput-l.ads \ - ada/sinput-l.adb ada/snames.ads ada/stringt.ads ada/style.ads \ - ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \ - ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads ada/s-imenne.ads \ - ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/widechar.ads + ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/output.ads \ + ada/prep.ads ada/prepcomp.ads ada/scans.ads ada/scn.ads ada/scng.ads \ + ada/scng.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput-l.ads ada/sinput-l.adb ada/snames.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \ + ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ + ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads ada/sinput.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index ee65cb2fdd1..6eedaa58984 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1572,10 +1572,7 @@ adamsg.o: adamsg.msg EXTRA_LIBGNAT_OBJS+=adamsg.o EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o EXTRA_GNATTOOLS = \ - ../../gnatlbr$(exeext) \ - ../../gnatsym$(exeext) \ - ../../vms_help$(exeext) \ - ../../gnat.hlp + ../../gnatsym$(exeext) # This command transforms (YYYYMMDD) into YY,MMDD GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/') TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe @@ -2425,7 +2422,12 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR) # Remove files to be replaced by target dependent sources $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \ $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)))) - $(RM) $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb + for f in $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb; do \ + case "$$f" in \ + $(RTSDIR)/s-stratt-*) ;; \ + *) $(RM) $$f ;; \ + esac; \ + done # Copy new target dependent sources $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \ $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \ @@ -2791,19 +2793,3 @@ tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 force: - -# Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS - -../../gnatlbr$(exeext): ../../prefix.o - $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)" - $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr - $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS) - -../../vms_help$(exeext): - $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)" - $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help - $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS) - -../../gnat.hlp: ../../vms_help$(exeext) - ../../vms_help$(exeext) $(fsrcdir)/ada/gnat.help_in \ - $(fsrcdir)/ada/vms_data.ads ../../gnat.hlp diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 2e68eaadf26..06698755b5e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -60,27 +60,20 @@ #define Has_Stdcall_Convention(E) (0) #endif -/* Stack realignment for functions with foreign conventions is provided on a - per back-end basis now, as it is handled by the prologue expanders and not - as part of the function's body any more. It might be requested by way of a - dedicated function type attribute on the targets that support it. - - We need a way to avoid setting the attribute on the targets that don't - support it and use FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN for this purpose. - - It is defined on targets where the circuitry is available, and indicates - whether the realignment is needed for 'main'. We use this to decide for - foreign subprograms as well. - - It is not defined on targets where the circuitry is not implemented, and - we just never set the attribute in these cases. - - Whether it is defined on all targets that would need it in theory is - not entirely clear. We currently trust the base GCC settings for this - purpose. */ - -#ifndef FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN -#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN 0 +/* Stack realignment is necessary for functions with foreign conventions when + the ABI doesn't mandate as much as what the compiler assumes - that is, up + to PREFERRED_STACK_BOUNDARY. + + Such realignment can be requested with a dedicated function type attribute + on the targets that support it. We define FOREIGN_FORCE_REALIGN_STACK to + characterize the situations where the attribute should be set. We rely on + compiler configuration settings for 'main' to decide. */ + +#ifdef MAIN_STACK_BOUNDARY +#define FOREIGN_FORCE_REALIGN_STACK \ + (MAIN_STACK_BOUNDARY < PREFERRED_STACK_BOUNDARY) +#else +#define FOREIGN_FORCE_REALIGN_STACK 0 #endif struct incomplete @@ -364,10 +357,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) another compilation unit) public entities, show we are at global level for the purpose of computing scopes. Don't do this for components or discriminants since the relevant test is whether or not the record is - being defined. */ + being defined. Don't do this for constants either as we'll look into + their defining expression in the local context. */ if (!definition && kind != E_Component && kind != E_Discriminant + && kind != E_Constant && Is_Public (gnat_entity) && !Is_Statically_Allocated (gnat_entity)) force_global++, this_global = true; @@ -428,18 +423,37 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If we have an external constant that we are not defining, get the - expression that is was defined to represent. We may throw that - expression away later if it is not a constant. Do not retrieve the - expression if it is an aggregate or allocator, because in complex - instantiation contexts it may not be expanded */ + expression that is was defined to represent. We may throw it away + later if it is not a constant. But do not retrieve the expression + if it is an allocator because the designated type might be dummy + at this point. */ if (!definition - && Present (Expression (Declaration_Node (gnat_entity))) && !No_Initialization (Declaration_Node (gnat_entity)) - && (Nkind (Expression (Declaration_Node (gnat_entity))) - != N_Aggregate) - && (Nkind (Expression (Declaration_Node (gnat_entity))) - != N_Allocator)) - gnu_expr = gnat_to_gnu (Expression (Declaration_Node (gnat_entity))); + && Present (Expression (Declaration_Node (gnat_entity))) + && Nkind (Expression (Declaration_Node (gnat_entity))) + != N_Allocator) + { + bool went_into_elab_proc = false; + + /* The expression may contain N_Expression_With_Actions nodes and + thus object declarations from other units. In this case, even + though the expression will eventually be discarded since not a + constant, the declarations would be stuck either in the global + varpool or in the current scope. Therefore we force the local + context and create a fake scope that we'll zap at the end. */ + if (!current_function_decl) + { + current_function_decl = get_elaboration_procedure (); + went_into_elab_proc = true; + } + gnat_pushlevel (); + + gnu_expr = gnat_to_gnu (Expression (Declaration_Node (gnat_entity))); + + gnat_zaplevel (); + if (went_into_elab_proc) + current_function_decl = NULL_TREE; + } /* Ignore deferred constant definitions without address clause since they are processed fully in the front-end. If No_Initialization @@ -935,10 +949,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) that for the renaming. At the global level, we can only do this if we know no SAVE_EXPRs need be made, because the expression we return might be used in arbitrary conditional - branches so we must force the SAVE_EXPRs evaluation - immediately and this requires a function context. */ + branches so we must force the evaluation of the SAVE_EXPRs + immediately and this requires a proper function context. + Note that an external constant is at the global level. */ if (!Materialize_Entity (gnat_entity) - && (!global_bindings_p () + && (!((!definition && kind == E_Constant) + || global_bindings_p ()) || (staticp (gnu_expr) && !TREE_SIDE_EFFECTS (gnu_expr)))) { @@ -949,7 +965,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) { /* ??? No DECL_EXPR is created so we need to mark the expression manually lest it is shared. */ - if (global_bindings_p ()) + if ((!definition && kind == E_Constant) + || global_bindings_p ()) MARK_VISITED (maybe_stable_expr); gnu_decl = maybe_stable_expr; save_gnu_tree (gnat_entity, gnu_decl, true); @@ -1368,11 +1385,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If this is a renaming pointer, attach the renamed object to it and - register it if we are at top level. */ + register it if we are at the global level. Note that an external + constant is at the global level. */ if (TREE_CODE (gnu_decl) == VAR_DECL && renamed_obj) { SET_DECL_RENAMED_OBJECT (gnu_decl, renamed_obj); - if (global_bindings_p ()) + if ((!definition && kind == E_Constant) || global_bindings_p ()) { DECL_RENAMING_GLOBAL_P (gnu_decl) = 1; record_global_renaming_pointer (gnu_decl); @@ -1507,7 +1525,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, gnu_type, gnu_value, true, false, false, false, NULL, gnat_literal); - + /* Do not generate debug info for individual enumerators. */ + DECL_IGNORED_P (gnu_literal) = 1; save_gnu_tree (gnat_literal, gnu_literal, false); gnu_literal_list = tree_cons (DECL_NAME (gnu_literal), gnu_value, gnu_literal_list); @@ -2051,7 +2070,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Now build the array type. */ for (index = ndim - 1; index >= 0; index--) { - tem = build_array_type (tem, gnu_index_types[index]); + tem = build_nonshared_array_type (tem, gnu_index_types[index]); TYPE_MULTI_ARRAY_P (tem) = (index > 0); if (array_type_has_nonaliased_component (tem, gnat_entity)) TYPE_NONALIASED_COMPONENT (tem) = 1; @@ -2384,7 +2403,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Now build the array type. */ for (index = ndim - 1; index >= 0; index --) { - gnu_type = build_array_type (gnu_type, gnu_index_types[index]); + gnu_type = build_nonshared_array_type (gnu_type, + gnu_index_types[index]); TYPE_MULTI_ARRAY_P (gnu_type) = (index > 0); if (array_type_has_nonaliased_component (gnu_type, gnat_entity)) TYPE_NONALIASED_COMPONENT (gnu_type) = 1; @@ -2630,8 +2650,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnat_entity); gnu_type - = build_array_type (gnat_to_gnu_type (Component_Type (gnat_entity)), - gnu_index_type); + = build_nonshared_array_type (gnat_to_gnu_type + (Component_Type (gnat_entity)), + gnu_index_type); if (array_type_has_nonaliased_component (gnu_type, gnat_entity)) TYPE_NONALIASED_COMPONENT (gnu_type) = 1; relate_alias_sets (gnu_type, gnu_string_type, ALIAS_SET_COPY); @@ -3519,7 +3540,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) && TYPE_IS_DUMMY_P (TREE_TYPE (get_gnu_tree (gnat_desig_equiv)))) || (!in_main_unit - && defer_incomplete_level + && defer_incomplete_level != 0 && !present_gnu_tree (gnat_desig_equiv)) || (in_main_unit && is_from_limited_with @@ -3540,7 +3561,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_type = TYPE_POINTER_TO (gnu_desig_type); if (!gnu_type) { - tree gnu_template_type = make_node (ENUMERAL_TYPE); + tree gnu_template_type = make_node (RECORD_TYPE); tree gnu_ptr_template = build_pointer_type (gnu_template_type); tree gnu_array_type = make_node (ENUMERAL_TYPE); tree gnu_ptr_array = build_pointer_type (gnu_array_type); @@ -3603,7 +3624,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) access type may be the full view of a private type. Note that the unconstrained array case is handled above. */ || ((!in_main_unit || imported_p) - && defer_incomplete_level + && defer_incomplete_level != 0 && !present_gnu_tree (gnat_desig_equiv) && (Is_Record_Type (gnat_desig_rep) || Is_Array_Type (gnat_desig_rep))) @@ -3737,7 +3758,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) Besides, variants of this non-dummy type might have been created along the way. update_pointer_to is expected to properly take care of those situations. */ - if (!defer_incomplete_level && !is_from_limited_with_in_main_unit) + if (defer_incomplete_level == 0 + && !is_from_limited_with_in_main_unit) update_pointer_to (TYPE_MAIN_VARIANT (gnu_old_desig_type), gnat_to_gnu_type (gnat_desig_equiv)); else @@ -4208,13 +4230,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) get_identifier ("stdcall"), NULL_TREE, gnat_entity); - /* If we are on a target where stack realignment is needed for 'main' - to honor GCC's implicit expectations (stack alignment greater than - what the base ABI guarantees), ensure we do the same for foreign - convention subprograms as they might be used as callbacks from code - breaking such expectations. Note that this applies to task entry - points in particular. */ - if (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN + /* If we should request stack realignment for a foreign convention + subprogram, do so. Note that this applies to task entry points in + particular. */ + if (FOREIGN_FORCE_REALIGN_STACK && Has_Foreign_Convention (gnat_entity)) prepend_one_attribute_to (&attr_list, ATTR_MACHINE_ATTRIBUTE, @@ -5057,7 +5076,7 @@ rest_of_type_decl_compilation (tree decl) { /* We need to defer finalizing the type if incomplete types are being deferred or if they are being processed. */ - if (defer_incomplete_level || defer_finalize_level) + if (defer_incomplete_level != 0 || defer_finalize_level != 0) VEC_safe_push (tree, heap, defer_finalize_list, decl); else rest_of_type_decl_compilation_no_defer (decl); @@ -5988,7 +6007,7 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name, IDENTIFIER_POINTER (gnu_name)), NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, !need_debug, Is_Public (gnat_entity), - !definition, false, NULL, gnat_entity); + !definition, expr_global, NULL, gnat_entity); /* We only need to use this variable if we are in global context since GCC can do the right thing in the local case. */ @@ -8593,7 +8612,7 @@ substitute_in_type (tree t, tree f, tree r) if (component == TREE_TYPE (t) && domain == TYPE_DOMAIN (t)) return t; - nt = build_array_type (component, domain); + nt = build_nonshared_array_type (component, domain); TYPE_ALIGN (nt) = TYPE_ALIGN (t); TYPE_USER_ALIGN (nt) = TYPE_USER_ALIGN (t); SET_TYPE_MODE (nt, TYPE_MODE (t)); diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 767700f6f76..dd30b246bb9 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -259,6 +259,9 @@ extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent, if none. */ extern tree get_exception_label (char kind); +/* Return the decl for the current elaboration procedure. */ +extern tree get_elaboration_procedure (void); + /* If nonzero, pretend we are allocating at global level. */ extern int force_global; @@ -403,6 +406,7 @@ extern int global_bindings_p (void); /* Enter and exit a new binding level. */ extern void gnat_pushlevel (void); extern void gnat_poplevel (void); +extern void gnat_zaplevel (void); /* Set SUPERCONTEXT of the BLOCK for the current binding level to FNDECL and point FNDECL to this BLOCK. */ @@ -443,6 +447,9 @@ extern tree gnat_signed_type (tree type_node); transparently converted to each other. */ extern int gnat_types_compatible_p (tree t1, tree t2); +/* Return true if T, a FUNCTION_TYPE, has the specified list of flags. */ +extern bool fntype_same_flags_p (const_tree, tree, bool, bool, bool); + /* Create an expression whose value is that of EXPR, converted to type TYPE. The TREE_TYPE of the value is always TYPE. This function implements all reasonable diff --git a/gcc/ada/gcc-interface/lang.opt b/gcc/ada/gcc-interface/lang.opt index 586b0e6326e..3b9129b32cc 100644 --- a/gcc/ada/gcc-interface/lang.opt +++ b/gcc/ada/gcc-interface/lang.opt @@ -1,5 +1,5 @@ ; Options for the Ada front end. -; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. +; Copyright (C) 2003, 2007, 2008, 2010 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -25,6 +25,24 @@ Language Ada +-all-warnings +Ada Alias(Wall) + +-include-barrier +Ada Alias(I, -) + +-include-directory +Ada Separate Alias(I) + +-include-directory= +Ada Joined Alias(I) + +-no-standard-includes +Ada Alias(nostdinc) + +-no-standard-libraries +Ada Alias(nostdlib) + I Ada Joined Separate ; Documented for C diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index c104e2935df..1167f0361e0 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -72,6 +72,7 @@ static void gnat_print_decl (FILE *, tree, int); static void gnat_print_type (FILE *, tree, int); static const char *gnat_printable_name (tree, int); static const char *gnat_dwarf_name (tree, int); +static bool gnat_type_hash_eq (const_tree, const_tree); static tree gnat_return_tree (tree); static void gnat_parse_file (int); static void internal_error_function (diagnostic_context *, @@ -98,8 +99,8 @@ static tree gnat_eh_personality (void); #define LANG_HOOKS_POST_OPTIONS gnat_post_options #undef LANG_HOOKS_PARSE_FILE #define LANG_HOOKS_PARSE_FILE gnat_parse_file -#undef LANG_HOOKS_HASH_TYPES -#define LANG_HOOKS_HASH_TYPES false +#undef LANG_HOOKS_TYPE_HASH_EQ +#define LANG_HOOKS_TYPE_HASH_EQ gnat_type_hash_eq #undef LANG_HOOKS_GETDECLS #define LANG_HOOKS_GETDECLS lhd_return_null_tree_v #undef LANG_HOOKS_PUSHDECL @@ -273,13 +274,24 @@ gnat_init_options (unsigned int decoded_options_count, for (i = 0; i < decoded_options_count; i++) { if (decoded_options[i].errors - || decoded_options[i].opt_index == OPT_SPECIAL_unknown) + || decoded_options[i].opt_index == OPT_SPECIAL_unknown + || decoded_options[i].canonical_option_num_elements == 0) continue; - gcc_assert (decoded_options[i].canonical_option_num_elements >= 1 - && decoded_options[i].canonical_option_num_elements <= 2); - save_argv[save_argc++] = decoded_options[i].canonical_option[0]; - if (decoded_options[i].canonical_option_num_elements >= 2) - save_argv[save_argc++] = decoded_options[i].canonical_option[1]; + if (decoded_options[i].opt_index == OPT_I) + { + gcc_assert (decoded_options[i].canonical_option_num_elements == 2); + save_argv[save_argc++] + = concat (decoded_options[i].canonical_option[0], + decoded_options[i].canonical_option[1], NULL); + } + else + { + gcc_assert (decoded_options[i].canonical_option_num_elements >= 1 + && decoded_options[i].canonical_option_num_elements <= 2); + save_argv[save_argc++] = decoded_options[i].canonical_option[0]; + if (decoded_options[i].canonical_option_num_elements >= 2) + save_argv[save_argc++] = decoded_options[i].canonical_option[1]; + } } save_argv[save_argc] = NULL; @@ -293,7 +305,7 @@ gnat_init_options (unsigned int decoded_options_count, /* Post-switch processing. */ -bool +static bool gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED) { /* Excess precision other than "fast" requires front-end @@ -584,6 +596,20 @@ gnat_dwarf_name (tree decl, int verbosity ATTRIBUTE_UNUSED) return (const char *) IDENTIFIER_POINTER (DECL_NAME (decl)); } +/* Return true if types T1 and T2 are identical for type hashing purposes. + Called only after doing all language independent checks. At present, + this function is only called when both types are FUNCTION_TYPE. */ + +static bool +gnat_type_hash_eq (const_tree t1, const_tree t2) +{ + gcc_assert (TREE_CODE (t1) == FUNCTION_TYPE); + return fntype_same_flags_p (t1, TYPE_CI_CO_LIST (t2), + TYPE_RETURN_UNCONSTRAINED_P (t2), + TYPE_RETURN_BY_DIRECT_REF_P (t2), + TREE_ADDRESSABLE (t2)); +} + /* Do nothing (return the tree node passed). */ static tree diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index d32639aeee5..7031bfb447c 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -593,12 +593,14 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, others_decl = create_var_decl (get_identifier ("OTHERS"), get_identifier ("__gnat_others_value"), - integer_type_node, 0, 1, 0, 1, 1, 0, Empty); + integer_type_node, NULL_TREE, true, false, true, false, + NULL, Empty); all_others_decl = create_var_decl (get_identifier ("ALL_OTHERS"), get_identifier ("__gnat_all_others_value"), - integer_type_node, 0, 1, 0, 1, 1, 0, Empty); + integer_type_node, NULL_TREE, true, false, true, false, + NULL, Empty); main_identifier_node = get_identifier ("main"); @@ -2453,40 +2455,48 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) begin_subprog_body (gnu_subprog_decl); - /* If there are Out parameters, we need to ensure that the return statement - properly copies them out. We do this by making a new block and converting - any inner return into a goto to a label at the end of the block. */ + /* If there are In Out or Out parameters, we need to ensure that the return + statement properly copies them out. We do this by making a new block and + converting any return into a goto to a label at the end of the block. */ gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); - VEC_safe_push (tree, gc, gnu_return_label_stack, - gnu_cico_list - ? create_artificial_label (input_location) - : NULL_TREE); + if (gnu_cico_list) + { + VEC_safe_push (tree, gc, gnu_return_label_stack, + create_artificial_label (input_location)); + + start_stmt_group (); + gnat_pushlevel (); + + /* See whether there are parameters for which we don't have a GCC tree + yet. These must be Out parameters. Make a VAR_DECL for them and + put it into TYPE_CI_CO_LIST, which must contain an empty entry too. + We can match up the entries because TYPE_CI_CO_LIST is in the order + of the parameters. */ + for (gnat_param = First_Formal_With_Extras (gnat_subprog_id); + Present (gnat_param); + gnat_param = Next_Formal_With_Extras (gnat_param)) + if (!present_gnu_tree (gnat_param)) + { + tree gnu_cico_entry = gnu_cico_list; + + /* Skip any entries that have been already filled in; they must + correspond to In Out parameters. */ + while (gnu_cico_entry && TREE_VALUE (gnu_cico_entry)) + gnu_cico_entry = TREE_CHAIN (gnu_cico_entry); + + /* Do any needed references for padded types. */ + TREE_VALUE (gnu_cico_entry) + = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_entry)), + gnat_to_gnu_entity (gnat_param, NULL_TREE, 1)); + } + } + else + VEC_safe_push (tree, gc, gnu_return_label_stack, NULL_TREE); /* Get a tree corresponding to the code for the subprogram. */ start_stmt_group (); gnat_pushlevel (); - /* See if there are any parameters for which we don't yet have GCC entities. - These must be for Out parameters for which we will be making VAR_DECL - nodes here. Fill them in to TYPE_CI_CO_LIST, which must contain the empty - entry as well. We can match up the entries because TYPE_CI_CO_LIST is in - the order of the parameters. */ - for (gnat_param = First_Formal_With_Extras (gnat_subprog_id); - Present (gnat_param); - gnat_param = Next_Formal_With_Extras (gnat_param)) - if (!present_gnu_tree (gnat_param)) - { - /* Skip any entries that have been already filled in; they must - correspond to In Out parameters. */ - while (gnu_cico_list && TREE_VALUE (gnu_cico_list)) - gnu_cico_list = TREE_CHAIN (gnu_cico_list); - - /* Do any needed references for padded types. */ - TREE_VALUE (gnu_cico_list) - = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_list)), - gnat_to_gnu_entity (gnat_param, NULL_TREE, 1)); - } - /* On VMS, establish our condition handler to possibly turn a condition into the corresponding exception if the subprogram has a foreign convention or is exported. @@ -2511,6 +2521,40 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) gnat_poplevel (); gnu_result = end_stmt_group (); + /* If we are dealing with a return from an Ada procedure with parameters + passed by copy-in/copy-out, we need to return a record containing the + final values of these parameters. If the list contains only one entry, + return just that entry though. + + For a full description of the copy-in/copy-out parameter mechanism, see + the part of the gnat_to_gnu_entity routine dealing with the translation + of subprograms. + + We need to make a block that contains the definition of that label and + the copying of the return value. It first contains the function, then + the label and copy statement. */ + if (gnu_cico_list) + { + tree gnu_retval; + + add_stmt (gnu_result); + add_stmt (build1 (LABEL_EXPR, void_type_node, + VEC_last (tree, gnu_return_label_stack))); + + if (list_length (gnu_cico_list) == 1) + gnu_retval = TREE_VALUE (gnu_cico_list); + else + gnu_retval = build_constructor_from_list (TREE_TYPE (gnu_subprog_type), + gnu_cico_list); + + add_stmt_with_node (build_return_expr (gnu_result_decl, gnu_retval), + End_Label (Handled_Statement_Sequence (gnat_node))); + gnat_poplevel (); + gnu_result = end_stmt_group (); + } + + VEC_pop (tree, gnu_return_label_stack); + /* If we populated the parameter attributes cache, we need to make sure that the cached expressions are evaluated on all possible paths. */ cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache; @@ -2535,43 +2579,6 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) gnu_result = end_stmt_group (); } - /* If we are dealing with a return from an Ada procedure with parameters - passed by copy-in/copy-out, we need to return a record containing the - final values of these parameters. If the list contains only one entry, - return just that entry though. - - For a full description of the copy-in/copy-out parameter mechanism, see - the part of the gnat_to_gnu_entity routine dealing with the translation - of subprograms. - - We need to make a block that contains the definition of that label and - the copying of the return value. It first contains the function, then - the label and copy statement. */ - if (VEC_last (tree, gnu_return_label_stack)) - { - tree gnu_retval; - - start_stmt_group (); - gnat_pushlevel (); - add_stmt (gnu_result); - add_stmt (build1 (LABEL_EXPR, void_type_node, - VEC_last (tree, gnu_return_label_stack))); - - gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); - if (list_length (gnu_cico_list) == 1) - gnu_retval = TREE_VALUE (gnu_cico_list); - else - gnu_retval = build_constructor_from_list (TREE_TYPE (gnu_subprog_type), - gnu_cico_list); - - add_stmt_with_node (build_return_expr (gnu_result_decl, gnu_retval), - End_Label (Handled_Statement_Sequence (gnat_node))); - gnat_poplevel (); - gnu_result = end_stmt_group (); - } - - VEC_pop (tree, gnu_return_label_stack); - /* Set the end location. */ Sloc_to_locus ((Present (End_Label (Handled_Statement_Sequence (gnat_node))) @@ -2673,7 +2680,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) so we can give them the scope of the elaboration routine at top level. */ else if (!current_function_decl) { - current_function_decl = VEC_last (tree, gnu_elab_proc_stack); + current_function_decl = get_elaboration_procedure (); went_into_elab_proc = true; } @@ -2788,8 +2795,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) /* Create an explicit temporary holding the copy. This ensures that its lifetime is as narrow as possible around a statement. */ gnu_temp = create_var_decl (create_tmp_var_name ("A"), NULL_TREE, - TREE_TYPE (gnu_name), NULL_TREE, false, - false, false, false, NULL, Empty); + TREE_TYPE (gnu_name), NULL_TREE, + false, false, false, false, NULL, Empty); DECL_ARTIFICIAL (gnu_temp) = 1; DECL_IGNORED_P (gnu_temp) = 1; @@ -2992,6 +2999,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) if (gnu_target) { Node_Id gnat_parent = Parent (gnat_node); + tree gnu_result_type = TREE_TYPE (gnu_subprog_type); enum tree_code op_code; /* If range check is needed, emit code to generate it. */ @@ -3002,11 +3010,15 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) /* ??? If the return type has non-constant size, then force the return slot optimization as we would not be able to generate - a temporary. That's what has been done historically. */ - if (TREE_CONSTANT (TYPE_SIZE (TREE_TYPE (gnu_subprog_type)))) - op_code = MODIFY_EXPR; - else + a temporary. Likewise if it was unconstrained as we would + copy too much data. That's what has been done historically. */ + if (!TREE_CONSTANT (TYPE_SIZE (gnu_result_type)) + || (TYPE_IS_PADDING_P (gnu_result_type) + && CONTAINS_PLACEHOLDER_P + (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_result_type)))))) op_code = INIT_EXPR; + else + op_code = MODIFY_EXPR; gnu_result = build_binary_op (op_code, NULL_TREE, gnu_target, gnu_result); @@ -3205,8 +3217,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) gnu_jmpsave_decl = create_var_decl (get_identifier ("JMPBUF_SAVE"), NULL_TREE, jmpbuf_ptr_type, build_call_0_expr (get_jmpbuf_decl), - false, false, false, false, NULL, - gnat_node); + false, false, false, false, + NULL, gnat_node); DECL_ARTIFICIAL (gnu_jmpsave_decl) = 1; /* The __builtin_setjmp receivers will immediately reinstall it. Now @@ -3215,8 +3227,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) it is uninitialized, although they will never be actually taken. */ TREE_NO_WARNING (gnu_jmpsave_decl) = 1; gnu_jmpbuf_decl = create_var_decl (get_identifier ("JMP_BUF"), - NULL_TREE, jmpbuf_type, - NULL_TREE, false, false, false, false, + NULL_TREE, jmpbuf_type, NULL_TREE, + false, false, false, false, NULL, gnat_node); DECL_ARTIFICIAL (gnu_jmpbuf_decl) = 1; @@ -3268,12 +3280,11 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) gnat_pushlevel (); VEC_safe_push (tree, gc, gnu_except_ptr_stack, - create_var_decl (get_identifier ("EXCEPT_PTR"), - NULL_TREE, + create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE, build_pointer_type (except_type_node), build_call_0_expr (get_excptr_decl), - false, - false, false, false, NULL, gnat_node)); + false, false, false, false, + NULL, gnat_node)); /* Generate code for each handler. The N_Exception_Handler case does the real work and returns a COND_EXPR for each handler, which we chain @@ -3532,8 +3543,8 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) 1, integer_zero_node); gnu_incoming_exc_ptr = create_var_decl (get_identifier ("EXPTR"), NULL_TREE, ptr_type_node, gnu_current_exc_ptr, - false, false, false, false, NULL, - gnat_node); + false, false, false, false, + NULL, gnat_node); add_stmt_with_node (build_call_1_expr (begin_handler_decl, gnu_incoming_exc_ptr), @@ -3749,11 +3760,13 @@ gnat_to_gnu (Node_Id gnat_node) || kind == N_Handled_Sequence_Of_Statements || (IN (kind, N_Raise_xxx_Error) && Ekind (Etype (gnat_node)) == E_Void)) { + tree current_elab_proc = get_elaboration_procedure (); + /* If this is a statement and we are at top level, it must be part of the elaboration procedure, so mark us as being in that procedure. */ if (!current_function_decl) { - current_function_decl = VEC_last (tree, gnu_elab_proc_stack); + current_function_decl = current_elab_proc; went_into_elab_proc = true; } @@ -3764,7 +3777,7 @@ gnat_to_gnu (Node_Id gnat_node) every nested real statement instead. This also avoids triggering spurious errors on dummy (empty) sequences created by the front-end for package bodies in some cases. */ - if (current_function_decl == VEC_last (tree, gnu_elab_proc_stack) + if (current_function_decl == current_elab_proc && kind != N_Handled_Sequence_Of_Statements) Check_Elaboration_Code_Allowed (gnat_node); } @@ -3992,13 +4005,14 @@ gnat_to_gnu (Node_Id gnat_node) is frozen. */ if (Present (Freeze_Node (gnat_temp))) { - if ((Is_Public (gnat_temp) || global_bindings_p ()) - && !TREE_CONSTANT (gnu_expr)) + if (TREE_CONSTANT (gnu_expr)) + ; + else if (global_bindings_p ()) gnu_expr = create_var_decl (create_concat_name (gnat_temp, "init"), - NULL_TREE, TREE_TYPE (gnu_expr), - gnu_expr, false, Is_Public (gnat_temp), - false, false, NULL, gnat_temp); + NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, + false, false, false, false, + NULL, gnat_temp); else gnu_expr = gnat_save_expr (gnu_expr); @@ -5800,7 +5814,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity) || TREE_CODE (type) == QUAL_UNION_TYPE)) MARK_VISITED (TYPE_ADA_SIZE (type)); } - else + else if (!DECL_EXTERNAL (gnu_decl)) add_stmt_with_node (gnu_stmt, gnat_entity); /* If this is a variable and an initializer is attached to it, it must be @@ -7656,4 +7670,12 @@ get_exception_label (char kind) return NULL_TREE; } +/* Return the decl for the current elaboration procedure. */ + +tree +get_elaboration_procedure (void) +{ + return VEC_last (tree, gnu_elab_proc_stack); +} + #include "gt-ada-trans.h" diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index cef72322e1b..3fab92b0c1e 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -411,6 +411,22 @@ gnat_poplevel (void) free_binding_level = level; } +/* Exit a binding level and discard the associated BLOCK. */ + +void +gnat_zaplevel (void) +{ + struct gnat_binding_level *level = current_binding_level; + tree block = level->block; + + BLOCK_CHAIN (block) = free_block_chain; + free_block_chain = block; + + /* Free this binding structure. */ + current_binding_level = level->chain; + level->chain = free_binding_level; + free_binding_level = level; +} /* Records a ..._DECL node DECL as belonging to the current lexical scope and uses GNAT_NODE for location information and propagating flags. */ @@ -418,11 +434,8 @@ gnat_poplevel (void) void gnat_pushdecl (tree decl, Node_Id gnat_node) { - /* If this decl is public external or at toplevel, there is no context. - But PARM_DECLs always go in the level of its function. */ - if (TREE_CODE (decl) != PARM_DECL - && ((DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) - || global_bindings_p ())) + /* If this decl is public external or at toplevel, there is no context. */ + if ((TREE_PUBLIC (decl) && DECL_EXTERNAL (decl)) || global_bindings_p ()) DECL_CONTEXT (decl) = 0; else { @@ -444,13 +457,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) add_decl_expr (decl, gnat_node); /* Put the declaration on the list. The list of declarations is in reverse - order. The list will be reversed later. Put global variables in the - globals list and builtin functions in a dedicated list to speed up - further lookups. Don't put TYPE_DECLs for UNCONSTRAINED_ARRAY_TYPE into - the list, as they will cause trouble with the debugger and aren't needed - anyway. */ - if (TREE_CODE (decl) != TYPE_DECL - || TREE_CODE (TREE_TYPE (decl)) != UNCONSTRAINED_ARRAY_TYPE) + order. The list will be reversed later. Put global declarations in the + globals list and local ones in the current block. But skip TYPE_DECLs + for UNCONSTRAINED_ARRAY_TYPE in both cases, as they will cause trouble + with the debugger and aren't needed anyway. */ + if (!(TREE_CODE (decl) == TYPE_DECL + && TREE_CODE (TREE_TYPE (decl)) == UNCONSTRAINED_ARRAY_TYPE)) { if (global_bindings_p ()) { @@ -459,7 +471,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) VEC_safe_push (tree, gc, builtin_decls, decl); } - else + else if (!DECL_EXTERNAL (decl)) { DECL_CHAIN (decl) = BLOCK_VARS (current_binding_level->block); BLOCK_VARS (current_binding_level->block) = decl; @@ -1094,10 +1106,8 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list, /* TYPE may have been shared since GCC hashes types. If it has a different CICO_LIST, make a copy. Likewise for the various flags. */ - if (TYPE_CI_CO_LIST (type) != cico_list - || TYPE_RETURN_UNCONSTRAINED_P (type) != return_unconstrained_p - || TYPE_RETURN_BY_DIRECT_REF_P (type) != return_by_direct_ref_p - || TREE_ADDRESSABLE (type) != return_by_invisi_ref_p) + if (!fntype_same_flags_p (type, cico_list, return_unconstrained_p, + return_by_direct_ref_p, return_by_invisi_ref_p)) { type = copy_type (type); TYPE_CI_CO_LIST (type) = cico_list; @@ -1153,17 +1163,9 @@ tree create_index_type (tree min, tree max, tree index, Node_Id gnat_node) { /* First build a type for the desired range. */ - tree type = build_index_2_type (min, max); - - /* If this type has the TYPE_INDEX_TYPE we want, return it. */ - if (TYPE_INDEX_TYPE (type) == index) - return type; - - /* Otherwise, if TYPE_INDEX_TYPE is set, make a copy. Note that we have - no way of sharing these types, but that's only a small hole. */ - if (TYPE_INDEX_TYPE (type)) - type = copy_type (type); + tree type = build_nonshared_range_type (sizetype, min, max); + /* Then set the index type. */ SET_TYPE_INDEX_TYPE (type, index); create_type_decl (NULL_TREE, type, NULL, true, false, gnat_node); @@ -1182,26 +1184,12 @@ create_range_type (tree type, tree min, tree max) type = sizetype; /* First build a type with the base range. */ - range_type - = build_range_type (type, TYPE_MIN_VALUE (type), TYPE_MAX_VALUE (type)); - - min = convert (type, min); - max = convert (type, max); - - /* If this type has the TYPE_RM_{MIN,MAX}_VALUE we want, return it. */ - if (TYPE_RM_MIN_VALUE (range_type) - && TYPE_RM_MAX_VALUE (range_type) - && operand_equal_p (TYPE_RM_MIN_VALUE (range_type), min, 0) - && operand_equal_p (TYPE_RM_MAX_VALUE (range_type), max, 0)) - return range_type; - - /* Otherwise, if TYPE_RM_{MIN,MAX}_VALUE is set, make a copy. */ - if (TYPE_RM_MIN_VALUE (range_type) || TYPE_RM_MAX_VALUE (range_type)) - range_type = copy_type (range_type); + range_type = build_nonshared_range_type (type, TYPE_MIN_VALUE (type), + TYPE_MAX_VALUE (type)); /* Then set the actual range. */ - SET_TYPE_RM_MIN_VALUE (range_type, min); - SET_TYPE_RM_MAX_VALUE (range_type, max); + SET_TYPE_RM_MIN_VALUE (range_type, convert (type, min)); + SET_TYPE_RM_MAX_VALUE (range_type, convert (type, max)); return range_type; } @@ -1368,12 +1356,11 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, && !have_global_bss_p ()) DECL_COMMON (var_decl) = 1; - /* If it's public and not external, always allocate storage for it. - At the global binding level we need to allocate static storage for the - variable if and only if it's not external. If we are not at the top level - we allocate automatic storage unless requested not to. */ + /* At the global binding level, we need to allocate static storage for the + variable if it isn't external. Otherwise, we allocate automatic storage + unless requested not to. */ TREE_STATIC (var_decl) - = !extern_flag && (public_flag || static_flag || global_bindings_p ()); + = !extern_flag && (static_flag || global_bindings_p ()); /* For an external constant whose initializer is not absolute, do not emit debug info. In DWARF this would mean a global relocation in a read-only @@ -1878,9 +1865,7 @@ end_subprog_body (tree body) { tree fndecl = current_function_decl; - /* Mark the BLOCK for this level as being for this function and pop the - level. Since the vars in it are the parameters, clear them. */ - BLOCK_VARS (current_binding_level->block) = NULL_TREE; + /* Attach the BLOCK for this level to the function and pop the level. */ BLOCK_SUPERCONTEXT (current_binding_level->block) = fndecl; DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); @@ -1892,6 +1877,13 @@ end_subprog_body (tree body) /* Mark the RESULT_DECL as being in this subprogram. */ DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; + /* The body should be a BIND_EXPR whose BLOCK is the top-level one. */ + if (TREE_CODE (body) == BIND_EXPR) + { + BLOCK_SUPERCONTEXT (BIND_EXPR_BLOCK (body)) = fndecl; + DECL_INITIAL (fndecl) = BIND_EXPR_BLOCK (body); + } + DECL_SAVED_TREE (fndecl) = body; current_function_decl = DECL_CONTEXT (fndecl); @@ -2105,6 +2097,18 @@ gnat_types_compatible_p (tree t1, tree t2) return 0; } + +/* Return true if T, a FUNCTION_TYPE, has the specified list of flags. */ + +bool +fntype_same_flags_p (const_tree t, tree cico_list, bool return_unconstrained_p, + bool return_by_direct_ref_p, bool return_by_invisi_ref_p) +{ + return TYPE_CI_CO_LIST (t) == cico_list + && TYPE_RETURN_UNCONSTRAINED_P (t) == return_unconstrained_p + && TYPE_RETURN_BY_DIRECT_REF_P (t) == return_by_direct_ref_p + && TREE_ADDRESSABLE (t) == return_by_invisi_ref_p; +} /* EXP is an expression for the size of an object. If this size contains discriminant references, replace them with the maximum (if MAX_P) or @@ -3213,15 +3217,18 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog) tree gnu_subprog_type, gnu_subprog_addr, gnu_subprog_call; tree gnu_stub_param, gnu_arg_types, gnu_param; tree gnu_stub_decl = DECL_FUNCTION_STUB (gnu_subprog); - tree gnu_body; VEC(tree,gc) *gnu_param_vec = NULL; gnu_subprog_type = TREE_TYPE (gnu_subprog); + /* Initialize the information structure for the function. */ + allocate_struct_function (gnu_stub_decl, false); + set_cfun (NULL); + begin_subprog_body (gnu_stub_decl); - gnat_pushlevel (); start_stmt_group (); + gnat_pushlevel (); /* Loop over the parameters of the stub and translate any of them passed by descriptor into a by reference one. */ @@ -3243,8 +3250,6 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog) VEC_safe_push (tree, gc, gnu_param_vec, gnu_param); } - gnu_body = end_stmt_group (); - /* Invoke the internal subprogram. */ gnu_subprog_addr = build1 (ADDR_EXPR, build_pointer_type (gnu_subprog_type), gnu_subprog); @@ -3253,16 +3258,13 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog) /* Propagate the return value, if any. */ if (VOID_TYPE_P (TREE_TYPE (gnu_subprog_type))) - append_to_statement_list (gnu_subprog_call, &gnu_body); + add_stmt (gnu_subprog_call); else - append_to_statement_list (build_return_expr (DECL_RESULT (gnu_stub_decl), - gnu_subprog_call), - &gnu_body); + add_stmt (build_return_expr (DECL_RESULT (gnu_stub_decl), + gnu_subprog_call)); gnat_poplevel (); - - allocate_struct_function (gnu_stub_decl, false); - end_subprog_body (gnu_body); + end_subprog_body (end_stmt_group ()); } /* Build a type to be used to represent an aliased object whose nominal type diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index bd78686e240..c40223f8e36 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -1603,10 +1603,9 @@ build_simple_component_ref (tree record_variable, tree component, if (!field) return NULL_TREE; - /* If this field is not in the specified record, see if we can find - something in the record whose original field is the same as this one. */ + /* If this field is not in the specified record, see if we can find a field + in the specified record whose original field is the same as this one. */ if (DECL_CONTEXT (field) != record_type) - /* Check if there is a field with name COMPONENT in the record. */ { tree new_field; @@ -1616,6 +1615,21 @@ build_simple_component_ref (tree record_variable, tree component, if (SAME_FIELD_P (field, new_field)) break; + /* Next, see if we're looking for an inherited component in an extension. + If so, look thru the extension directly. */ + if (!new_field + && TREE_CODE (record_variable) == VIEW_CONVERT_EXPR + && TYPE_ALIGN_OK (record_type) + && TREE_CODE (TREE_TYPE (TREE_OPERAND (record_variable, 0))) + == RECORD_TYPE + && TYPE_ALIGN_OK (TREE_TYPE (TREE_OPERAND (record_variable, 0)))) + { + ref = build_simple_component_ref (TREE_OPERAND (record_variable, 0), + NULL_TREE, field, no_fold_p); + if (ref) + return ref; + } + /* Next, loop thru DECL_INTERNAL_P components if we haven't found the component in the first search. Doing this search in 2 steps is required to avoiding hidden homonymous fields in the diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 7af2d6436eb..7a72e190405 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -355,11 +355,6 @@ procedure Gnat1drv is elsif Debug_Flag_Dot_YY then Use_Expression_With_Actions := False; - -- If no debug flags, usage off for SCIL - - elsif Generate_SCIL then - Use_Expression_With_Actions := False; - -- Otherwise this feature is implemented, so we allow its use else @@ -610,7 +605,6 @@ begin Uintp.Initialize; Urealp.Initialize; Errout.Initialize; - Namet.Initialize; SCOs.Initialize; Snames.Initialize; Stringt.Initialize; diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index e4a39e1671b..4481da95495 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -173,6 +173,7 @@ Implementation Defined Pragmas * Pragma Normalize_Scalars:: * Pragma Obsolescent:: * Pragma Optimize_Alignment:: +* Pragma Ordered:: * Pragma Passive:: * Pragma Persistent_BSS:: * Pragma Polling:: @@ -185,6 +186,7 @@ Implementation Defined Pragmas * Pragma Restriction_Warnings:: * Pragma Shared:: * Pragma Short_Circuit_And_Or:: +* Pragma Short_Descriptors:: * Pragma Source_File_Name:: * Pragma Source_File_Name_Project:: * Pragma Source_Reference:: @@ -789,6 +791,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Normalize_Scalars:: * Pragma Obsolescent:: * Pragma Optimize_Alignment:: +* Pragma Ordered:: * Pragma Passive:: * Pragma Persistent_BSS:: * Pragma Polling:: @@ -801,6 +804,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Restriction_Warnings:: * Pragma Shared:: * Pragma Short_Circuit_And_Or:: +* Pragma Short_Descriptors:: * Pragma Source_File_Name:: * Pragma Source_File_Name_Project:: * Pragma Source_Reference:: @@ -2206,8 +2210,9 @@ you can construct your own extension unit following the above definition. Note that such a package is a child of @code{System} and thus is considered part of the implementation. To compile it you will have to use the appropriate switch for compiling -system units. @xref{Top, @value{EDITION} User's Guide, About This -Guide,, gnat_ugn, @value{EDITION} User's Guide}, for details. +system units. +@xref{Top, @value{EDITION} User's Guide, About This Guide, gnat_ugn, @value{EDITION} User's Guide}, +for details. @node Pragma Extensions_Allowed @unnumberedsec Pragma Extensions_Allowed @@ -2426,9 +2431,7 @@ floating point types declared in the packages @code{Standard} and be @code{IEEE_Float} and the pragma has no effect. On OpenVMS, the argument may be @code{VAX_Float} to specify the use of the VAX float format for the floating-point types in Standard. This requires that -the standard runtime libraries be recompiled. @xref{The GNAT Run-Time -Library Builder gnatlbr,,, gnat_ugn, @value{EDITION} User's Guide -OpenVMS}, for a description of the @code{GNAT LIBRARY} command. +the standard runtime libraries be recompiled. The two argument form specifies the representation to be used for the specified floating-point type. On all systems other than OpenVMS, @@ -3344,9 +3347,6 @@ type @code{Long_Float} and for floating point type representations with For further details on this pragma, see the @cite{DEC Ada Language Reference Manual}, section 3.5.7b. Note that to use this pragma, the standard runtime libraries must be recompiled. -@xref{The GNAT Run-Time Library Builder gnatlbr,,, gnat_ugn, -@value{EDITION} User's Guide OpenVMS}, for a description of the -@code{GNAT LIBRARY} command. @node Pragma Machine_Attribute @unnumberedsec Pragma Machine_Attribute @@ -3731,6 +3731,101 @@ unit are excluded from the consistency check, as are all predefined units. The latter are compiled by default in pragma Optimize_Alignment (Off) mode if no pragma appears at the start of the file. +@node Pragma Ordered +@unnumberedsec Pragma Ordered +@findex Ordered +@findex pragma @code{Ordered} +@noindent +Syntax: + +@smallexample @c ada +pragma Ordered (enumeration_first_subtype_LOCAL_NAME); +@end smallexample + +@noindent +Most enumeration types are from a conceptual point of view unordered. +For example, consider: + +@smallexample @c ada +type Color is (Red, Blue, Green, Yellow); +@end smallexample + +@noindent +By Ada semantics @code{Blue > Red} and @code{Green > Blue}, +but really these relations make no sense; the enumeration type merely +specifies a set of possible colors, and the order is unimportant. + +For unordered enumeration types, it is generally a good idea if +clients avoid comparisons (other than equality or inequality) and +explicit ranges. (A @emph{client} is a unit where the type is referenced, +other than the unit where the type is declared, its body, and its subunits.) +For example, if code buried in some client says: + +@smallexample @c ada +if Current_Color < Yellow then ... +if Current_Color in Blue .. Green then ... +@end smallexample + +@noindent +then the client code is relying on the order, which is undesirable. +It makes the code hard to read and creates maintenance difficulties if +entries have to be added to the enumeration type. Instead, +the code in the client should list the possibilities, or an +appropriate subtype should be declared in the unit that declares +the original enumeration type. E.g., the following subtype could +be declared along with the type @code{Color}: + +@smallexample @c ada +subtype RBG is Color range Red .. Green; +@end smallexample + +@noindent +and then the client could write: + +@smallexample @c ada +if Current_Color in RBG then ... +if Current_Color = Blue or Current_Color = Green then ... +@end smallexample + +@noindent +However, some enumeration types are legitimately ordered from a conceptual +point of view. For example, if you declare: + +@smallexample @c ada +type Day is (Mon, Tue, Wed, Thu, Fri, Sat, Sun); +@end smallexample + +@noindent +then the ordering imposed by the language is reasonable, and +clients can depend on it, writing for example: + +@smallexample @c ada +if D in Mon .. Fri then ... +if D < Wed then ... +@end smallexample + +@noindent +The pragma @option{Ordered} is provided to mark enumeration types that +are conceptually ordered, alerting the reader that clients may depend +on the ordering. GNAT provides a pragma to mark enumerations as ordered +rather than one to mark them as unordered, since in our experience, +the great majority of enumeration types are conceptually unordered. + +The types @code{Boolean}, @code{Character}, @code{Wide_Character}, +and @code{Wide_Wide_Character} +are considered to be ordered types, so each is declared with a +pragma @code{Ordered} in package @code{Standard}. + +Normally pragma @code{Ordered} serves only as documentation and a guide for +coding standards, but GNAT provides a warning switch @option{-gnatw.u} that +requests warnings for inappropriate uses (comparisons and explicit +subranges) for unordered types. If this switch is used, then any +enumeration type not marked with pragma @code{Ordered} will be considered +as unordered, and will generate warnings for inappropriate uses. + +For additional information please refer to the description of the +@option{-gnatw.u} switch in the @value{EDITION} User's Guide. + @node Pragma Passive @unnumberedsec Pragma Passive @findex Passive @@ -4274,6 +4369,14 @@ modifies a global variable (the count). Memo functions are another example (where a table of previous calls is kept and consulted to avoid re-computation). +Note also that the normal rules excluding optimization of subprograms +in pure units (when parameter types are descended from System.Address, +or when the full view of a parameter type is limited), do not apply +for the Pure_Function case. If you explicitly specify Pure_Function, +the compiler may optimize away calls with identical arguments, and +if that results in unexpected behavior, the proper action is not to +use the pragma for subprograms that are not (conceptually) pure. + @findex Pure Note: Most functions in a @code{Pure} package are automatically pure, and there is no need to use pragma @code{Pure_Function} for such functions. One @@ -4338,7 +4441,23 @@ short-circuited logical operators. If this configuration pragma occurs locally within the file being compiled, it applies only to the file being compiled. There is no requirement that all units in a partition use this option. -semantics are identical to pragma Atomic. +@node Pragma Short_Descriptors +@unnumberedsec Pragma Short_Descriptors +@findex Short_Descriptors +@noindent +Syntax: + +@smallexample @c ada +pragma Short_Descriptors +@end smallexample + +@noindent +In VMS versions of the compiler, this configuration pragma causes all +occurrences of the mechanism types Descriptor[_xxx] to be treated as +Short_Descriptor[_xxx]. This is helpful in porting legacy applications from a +32-bit environment to a 64-bit environment. This pragma is ignored for non-VMS +versions. + @node Pragma Source_File_Name @unnumberedsec Pragma Source_File_Name @findex Source_File_Name @@ -5745,11 +5864,11 @@ may raise @code{Constraint_Error}. @cindex Representation of enums @findex Enum_Val @noindent -For every enumeration subtype @var{S}, @code{@var{S}'Enum_Rep} denotes a +For every enumeration subtype @var{S}, @code{@var{S}'Enum_Val} denotes a function with the following spec: @smallexample @c ada -function @var{S}'Enum_Rep (Arg : @i{Universal_Integer) +function @var{S}'Enum_Val (Arg : @i{Universal_Integer) return @var{S}'Base}; @end smallexample @@ -7095,16 +7214,16 @@ for scalar types. @cindex Stream oriented attributes The XDR implementation is provided as an alternative body of the @code{System.Stream_Attributes} package, in the file -@file{s-strxdr.adb} in the GNAT library. -There is no @file{s-strxdr.ads} file. +@file{s-stratt-xdr.adb} in the GNAT library. +There is no @file{s-stratt-xdr.ads} file. In order to install the XDR implementation, do the following: @enumerate @item Replace the default implementation of the @code{System.Stream_Attributes} package with the XDR implementation. For example on a Unix platform issue the commands: @smallexample -$ mv s-stratt.adb s-strold.adb -$ mv s-strxdr.adb s-stratt.adb +$ mv s-stratt.adb s-stratt-default.adb +$ mv s-stratt-xdr.adb s-stratt.adb @end smallexample @item diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index e18baef53d5..80086022476 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -7,7 +7,7 @@ @c o @c G N A T _ U G N o @c o -@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o +@c Copyright (C) 1992-2010, AdaCore o @c o @c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo @@ -182,9 +182,6 @@ AdaCore@* * The GNAT Metric Tool gnatmetric:: * File Name Krunching Using gnatkr:: * Preprocessing Using gnatprep:: -@ifset vms -* The GNAT Run-Time Library Builder gnatlbr:: -@end ifset * The GNAT Library Browser gnatls:: * Cleaning Up Using gnatclean:: @ifclear vms @@ -409,14 +406,6 @@ Preprocessing Using gnatprep * Form of Definitions File:: * Form of Input Text for gnatprep:: -@ifset vms -The GNAT Run-Time Library Builder gnatlbr - -* Running gnatlbr:: -* Switches for gnatlbr:: -* Examples of gnatlbr Usage:: -@end ifset - The GNAT Library Browser gnatls * Running gnatls:: @@ -792,13 +781,6 @@ preprocessor utility that allows a single source file to be used to generate multiple or parameterized source files by means of macro substitution. -@ifset vms -@item -@ref{The GNAT Run-Time Library Builder gnatlbr}, describes @command{gnatlbr}, -a tool for rebuilding the GNAT run time with user-supplied -configuration pragmas. -@end ifset - @item @ref{The GNAT Library Browser gnatls}, describes @code{gnatls}, a utility that displays information about compiled units, including dependences @@ -1796,8 +1778,8 @@ of the compiler (@pxref{Character Set Control}). @noindent The basic character set is Latin-1. This character set is defined by ISO standard 8859, part 1. The lower half (character codes @code{16#00#} -@dots{} @code{16#7F#)} is identical to standard ASCII coding, but the upper half -is used to represent additional characters. These include extended letters +@dots{} @code{16#7F#)} is identical to standard ASCII coding, but the upper +half is used to represent additional characters. These include extended letters used by European languages, such as French accents, the vowels with umlauts used in German, and the extra letter A-ring used in Swedish. @@ -3841,7 +3823,8 @@ compiled. @cindex cannot generate code If you attempt to compile any of these files, you will get one of the -following error messages (where @var{fff} is the name of the file you compiled): +following error messages (where @var{fff} is the name of the file you +compiled): @smallexample cannot generate code for file @var{fff} (package spec) @@ -3997,7 +3980,7 @@ effect if this switch is present. @item -fno-inline-functions @cindex @option{-fno-inline-functions} (@command{gcc}) -Suppresses automatic inlining of simple subprograms, which is enabled +Suppresses automatic inlining of subprograms, which is enabled if @option{-O3} is used. @item -fno-inline-small-functions @@ -5073,6 +5056,7 @@ individually controlled. The warnings that are not turned on by this switch are @option{-gnatwd} (implicit dereferencing), @option{-gnatwh} (hiding), +@option{-gnatw.h} (holes (gaps) in record layouts) @option{-gnatwl} (elaboration warnings), @option{-gnatw.o} (warn on values set by out parameters ignored) and @option{-gnatwt} (tracking of deleted conditional code). @@ -5275,6 +5259,22 @@ Note that @option{-gnatwa} does not affect the setting of this warning option. @cindex @option{-gnatwH} (@command{gcc}) This switch suppresses warnings on hiding declarations. +@item -gnatw.h +@emph{Activate warnings on holes/gaps in records.} +@cindex @option{-gnatw.h} (@command{gcc}) +@cindex Record Representation (gaps) +This switch activates warnings on component clauses in record +representation clauses that leave holes (gaps) in the record layout. +If this warning option is active, then record representation clauses +should specify a contiguous layout, adding unused fill fields if needed. +Note that @option{-gnatwa} does not affect the setting of this warning option. + +@item -gnatw.H +@emph{Suppress warnings on holes/gaps in records.} +@cindex @option{-gnatw.H} (@command{gcc}) +This switch suppresses warnings on component clauses in record +representation clauses that leave holes (haps) in the record layout. + @item -gnatwi @emph{Activate warnings on implementation units.} @cindex @option{-gnatwi} (@command{gcc}) @@ -5582,6 +5582,25 @@ To suppress these back end warnings as well, use the switch @option{-w} in addition to @option{-gnatws}. Also this switch has no effect on the handling of style check messages. +@item -gnatw.s +@emph{Activate warnings on overridden size clauses.} +@cindex @option{-gnatw.s} (@command{gcc}) +@cindex Record Representation (component sizes) +This switch activates warnings on component clauses in record +representation clauses where the length given overrides that +specified by an explicit size clause for the component type. A +warning is similarly given in the array case if a specified +component size overrides an explicit size clause for the array +component type. +Note that @option{-gnatwa} does not affect the setting of this warning option. + +@item -gnatw.S +@emph{Suppress warnings on overriddebn size clauses.} +@cindex @option{-gnatw.S} (@command{gcc}) +This switch suppresses warnings on component clauses in record +representation clauses that override size clauses, and similar +warnings when an array component size overrides a size clause. + @item -gnatwt @emph{Activate warnings for tracking of deleted conditional code.} @cindex @option{-gnatwt} (@command{gcc}) @@ -5627,6 +5646,24 @@ This switch suppresses warnings for unused entities and packages. It also turns off warnings on unreferenced formals (and thus includes the effect of @option{-gnatwF}). +@item -gnatw.u +@emph{Activate warnings on unordered enumeration types.} +@cindex @option{-gnatw.u} (@command{gcc}) +This switch causes enumeration types to be considered as conceptually +unordered, unless an explicit pragma @code{Ordered} is given for the type. +The effect is to generate warnings in clients that use explicit comparisons +or subranges, since these constructs both treat objects of the type as +ordered. (A @emph{client} is defined as a unit that is other than the unit in +which the type is declared, or its body or subunits.) Please refer to +the description of pragma @code{Ordered} in the +@cite{@value{EDITION} Reference Manual} for further details. + +@item -gnatw.U +@emph{Deactivate warnings on unordered enumeration types.} +@cindex @option{-gnatw.U} (@command{gcc}) +This switch causes all enumeration types to be considered as ordered, so +that no warnings are given for comparisons or subranges for any type. + @item -gnatwv @emph{Activate warnings on unassigned variables.} @cindex @option{-gnatwv} (@command{gcc}) @@ -6143,6 +6180,17 @@ specified style check, an appropriate message is given, preceded by the character sequence ``(style)''. This message does not prevent successful compilation (unless the @option{-gnatwe} switch is used). +Note that this is by no means intended to be a general facility for +checking arbitrary coding standards. It is simply an embedding of the +style rules we have chosen for the GNAT sources. If you are starting +a project which does not have established style standards, you may +find it useful to adopt the entire set of GNAT coding standards, or +some subset of them. If you already have an established set of coding +standards, then it may be that selected style checking options do +indeed correspond to choices you have made, but for general checking +of an existing set of coding rules, you should look to the gnatcheck +tool, which is designed for that purpose. + @ifset vms @code{(option,option,@dots{})} is a sequence of keywords @end ifset @@ -6207,8 +6255,8 @@ Comments that follow other tokens on a line must have at least one blank following the ``@code{--}'' at the start of the comment. @item -Full line comments must have two blanks following the ``@code{--}'' that -starts the comment, with the following exceptions. +Full line comments must have at least two blanks following the +``@code{--}'' that starts the comment, with the following exceptions. @item A line consisting only of the ``@code{--}'' characters, possibly preceded @@ -8045,6 +8093,7 @@ be presented in subsequent sections. * Binder Error Message Control:: * Elaboration Control:: * Output Control:: +* Dynamic Allocation Control:: * Binding with Non-Ada Main Programs:: * Binding Programs with No Main Subprogram:: @end menu @@ -8130,7 +8179,6 @@ Output complete list of elaboration-order dependencies. @item ^-E^/STORE_TRACEBACKS^ @cindex @option{^-E^/STORE_TRACEBACKS^} (@command{gnatbind}) Store tracebacks in exception occurrences when the target supports it. -This is the default with the zero cost exception mechanism. @ignore @c The following may get moved to an appendix This option is currently supported on the following targets: @@ -8157,6 +8205,17 @@ flag checks are generated. @cindex @option{^-h^/HELP^} (@command{gnatbind}) Output usage (help) information +@item ^-H32^/32_MALLOC^ +@cindex @option{^-H32^/32_MALLOC^} (@command{gnatbind}) +Use 32-bit allocations for @code{__gnat_malloc} (and thus for access types). +For further details see @ref{Dynamic Allocation Control}. + +@item ^-H64^/64_MALLOC^ +@cindex @option{^-H32^/32_MALLOC^} (@command{gnatbind}) +Use 64-bit allocations for @code{__gnat_malloc} (and thus for access types). +@cindex @code{__gnat_malloc} +For further details see @ref{Dynamic Allocation Control}. + @item ^-I^/SEARCH^ @cindex @option{^-I^/SEARCH^} (@command{gnatbind}) Specify directory to be searched for source and ALI files. @@ -8585,6 +8644,35 @@ be used to improve code generation in some cases. @end table +@node Dynamic Allocation Control +@subsection Dynamic Allocation Control + +@noindent +The heap control switches -- @option{-H32} and @option{-H64} -- +determine whether dynamic allocation uses 32-bit or 64-bit memory. +They only affect compiler-generated allocations via @code{__gnat_malloc}; +explicit calls to @code{malloc} and related functions from the C +run-time library are unaffected. + +@table @option +@item -H32 +Allocate memory on 32-bit heap + +@item -H64 +Allocate memory on 64-bit heap. This is the default +unless explicitly overridden by a @code{'Size} clause on the access type. +@end table + +@ifset vms +@noindent +See also @ref{Access types and 32/64-bit allocation}. +@end ifset +@ifclear vms +@noindent +These switches are only effective on VMS platforms. +@end ifclear + + @node Binding with Non-Ada Main Programs @subsection Binding with Non-Ada Main Programs @@ -9243,13 +9331,28 @@ itself must not include any embedded spaces. @item ^--subdirs^/SUBDIRS^=subdir Actual object directory of each project file is the subdirectory subdir of the -object directory specified or defauted in the project file. +object directory specified or defaulted in the project file. + +@item ^--single-compile-per-obj-dir^/SINGLE_COMPILE_PER_OBJ_DIR^ +Disallow simultaneous compilations in the same object directory when +project files are used. @item ^--unchecked-shared-lib-imports^/UNCHECKED_SHARED_LIB_IMPORTS^ By default, shared library projects are not allowed to import static library projects. When this switch is used on the command line, this restriction is relaxed. +@ifclear vms +@item --create-map-file +When linking an executable, create a map file. The name of the map file +has the same name as the executable with extension ".map". + +@item --create-map-file=mapfile +When linking an executable, create a map file. The name of the map file is +"mapfile". + +@end ifclear + @item ^-a^/ALL_FILES^ @cindex @option{^-a^/ALL_FILES^} (@command{gnatmake}) Consider all files in the make process, even the GNAT internal system @@ -10105,12 +10208,12 @@ generates highly optimized code and has the slowest compilation time. @item ^-O3^/OPTIMIZE=INLINING^ -Full optimization as in @option{-O2}, -and also attempts automatic inlining of small -subprograms within a unit (@pxref{Inlining of Subprograms}). +Full optimization as in @option{-O2}; +also uses more aggressive automatic inlining of subprograms within a unit +(@pxref{Inlining of Subprograms}) and attemps to vectorize loops. @item ^-Os^/OPTIMIZE=SPACE^ -Optimize space usage of resulting program. +Optimize space usage (code and data) of resulting program. @end table @noindent @@ -10139,7 +10242,7 @@ levels. Note regarding the use of @option{-O3}: The use of this optimization level is generally discouraged with GNAT, since it often results in larger -executables which run more slowly. See further discussion of this point +executables which may run more slowly. See further discussion of this point in @ref{Inlining of Subprograms}. @node Debugging Optimized Code @@ -10289,9 +10392,10 @@ subprograms. @item @cindex pragma Inline @findex Inline -Either @code{pragma Inline} applies to the subprogram, or it is local -to the unit and called once from within it, or it is small and automatic -inlining (optimization level @option{-O3}) is specified. +Either @code{pragma Inline} applies to the subprogram, or it is local to +the unit and called once from within it, or it is small and optimization +level @option{-O2} is specified, or automatic inlining (optimization level +@option{-O3}) is specified. @end itemize @noindent @@ -10375,7 +10479,11 @@ this switch is used to suppress the resulting inlining actions. @cindex @option{-fno-inline-functions} (@command{gcc}) Note: The @option{-fno-inline-functions} switch can be used to prevent -automatic inlining of small subprograms if @option{-O3} is used. +automatic inlining of subprograms if @option{-O3} is used. + +@cindex @option{-fno-inline-small-functions} (@command{gcc}) +Note: The @option{-fno-inline-small-functions} switch can be used to prevent +automatic inlining of small subprograms if @option{-O2} is used. @cindex @option{-fno-inline-functions-called-once} (@command{gcc}) Note: The @option{-fno-inline-functions-called-once} switch @@ -10752,7 +10860,9 @@ the file name may contain path information. @command{gcc}. They will be passed on to all compiler invocations made by @command{gnatelim} to generate the 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 etc. +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. @code{gnatelim} has the following switches: @@ -12649,7 +12759,9 @@ follow the GNAT file naming rules @command{gcc}. They will be passed on to all compiler invocations made by @command{gnatelim} to generate the 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 etc. +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. @end itemize @menu @@ -13763,7 +13875,9 @@ Including both a @option{-files} switch and one or more @command{gcc}. They will be passed on to all compiler invocations made by @command{gnatmetric} to generate the ASIS trees. Here you can provide @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, -and use the @option{-gnatec} switch to set the configuration file. +and 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. @end itemize @menu @@ -14975,76 +15089,6 @@ Header : String := $XYZ; @noindent and then the substitution will occur as desired. -@ifset vms -@node The GNAT Run-Time Library Builder gnatlbr -@chapter The GNAT Run-Time Library Builder @code{gnatlbr} -@findex gnatlbr -@cindex Library builder - -@noindent -@code{gnatlbr} is a tool for rebuilding the GNAT run time with user -supplied configuration pragmas. - -@menu -* Running gnatlbr:: -* Switches for gnatlbr:: -* Examples of gnatlbr Usage:: -@end menu - -@node Running gnatlbr -@section Running @code{gnatlbr} - -@noindent -The @code{gnatlbr} command has the form - -@smallexample -$ GNAT LIBRARY /@r{[}CREATE@r{|}SET@r{|}DELETE@r{]}=directory @r{[}/CONFIG=file@r{]} -@end smallexample - -@node Switches for gnatlbr -@section Switches for @code{gnatlbr} - -@noindent -@code{gnatlbr} recognizes the following switches: - -@table @option -@c !sort! -@item /CREATE=directory -@cindex @code{/CREATE} (@code{gnatlbr}) -Create the new run-time library in the specified directory. - -@item /SET=directory -@cindex @code{/SET} (@code{gnatlbr}) -Make the library in the specified directory the current run-time library. - -@item /DELETE=directory -@cindex @code{/DELETE} (@code{gnatlbr}) -Delete the run-time library in the specified directory. - -@item /CONFIG=file -@cindex @code{/CONFIG} (@code{gnatlbr}) -With /CREATE: Use the configuration pragmas in the specified file when -building the library. - -With /SET: Use the configuration pragmas in the specified file when -compiling. - -@end table - -@node Examples of gnatlbr Usage -@section Example of @code{gnatlbr} Usage - -@smallexample -Contents of VAXFLOAT.ADC: -pragma Float_Representation (VAX_Float); - -$ GNAT LIBRARY /CREATE=[.VAXFLOAT] /CONFIG=VAXFLOAT.ADC - -GNAT LIBRARY rebuilds the run-time library in directory [.VAXFLOAT] - -@end smallexample -@end ifset - @node The GNAT Library Browser gnatls @chapter The GNAT Library Browser @code{gnatls} @findex gnatls @@ -17218,7 +17262,9 @@ or line breaks. @command{gcc}. They will be passed on to all compiler invocations made by @command{gnatcheck} to generate the ASIS trees. Here you can provide @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, -and use the @option{-gnatec} switch to set the configuration file. +and 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. @item @var{rule_options} is a list of options for controlling a set of @@ -17883,7 +17929,9 @@ current directory) @command{gcc}. They will be passed on to all compiler invocations made by @command{gnatelim} to generate the 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 etc. +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. @item switches is an optional sequence of switches as described in the next section @@ -18699,9 +18747,9 @@ gnatmake -f -pg -P my_project @end smallexample @noindent -Note that only the objects that were compiled with the @samp{-pg} switch will be -profiled; if you need to profile your whole project, use the -@samp{-f} gnatmake switch to force full recompilation. +Note that only the objects that were compiled with the @samp{-pg} switch will +be profiled; if you need to profile your whole project, use the @samp{-f} +gnatmake switch to force full recompilation. @node Program execution @subsection Program execution @@ -24931,8 +24979,8 @@ Note that in this approach, both declarations are analyzed by the compiler so this can only be used where both declarations are legal, even though one of them will not be used. -Another approach is to define integer constants, e.g.@: @code{Bits_Per_Word}, or -Boolean constants, e.g.@: @code{Little_Endian}, and then write declarations +Another approach is to define integer constants, e.g.@: @code{Bits_Per_Word}, +or Boolean constants, e.g.@: @code{Little_Endian}, and then write declarations that are parameterized by these constants. For example @smallexample @c ada @@ -26538,10 +26586,11 @@ Such code will be referred to below as @emph{64-bit code}. @menu * Address types:: -* Access types:: +* Access types and 32/64-bit allocation:: * Unchecked conversions:: * Predefined constants:: * Interfacing with C:: +* 32/64-bit descriptors:: * Experience with source compatibility:: @end menu @@ -26556,9 +26605,13 @@ approach has been taken: @itemize @bullet @item @code{System.Address} always has a size of 64 bits +@cindex @code{System.Address} size +@cindex @code{Address} size @item @code{System.Short_Address} is a 32-bit subtype of @code{System.Address} +@cindex @code{System.Short_Address} size +@cindex @code{Short_Address} size @end itemize @noindent @@ -26597,31 +26650,64 @@ required in any code setting or accessing the field; the compiler will automatically perform any needed conversions between address formats. -@node Access types -@subsubsection Access types +@node Access types and 32/64-bit allocation +@subsubsection Access types and 32/64-bit allocation +@cindex 32-bit allocation +@cindex 64-bit allocation @noindent -By default, objects designated by access values are always -allocated in the 32-bit -address space. Thus legacy code will never contain -any objects that are not addressable with 32-bit addresses, and -the compiler will never raise exceptions as result of mixing -32-bit and 64-bit addresses. +By default, objects designated by access values are always allocated in +the 64-bit address space, and access values themselves are represented +in 64 bits. If these defaults are not appropriate, and 32-bit allocation +is required (for example if the address of an allocated object is assigned +to a @code{Short_Address} variable), then several alternatives are available: -However, the access values themselves are represented in 64 bits, for optimum -performance and future compatibility with 64-bit code. As was -the case with @code{System.Address}, the compiler will give an error message -if an object or record component has a representation clause that -requires the access value to fit in 32 bits. In such a situation, -an explicit size clause for the access type, specifying 32 bits, -will have the desired effect. +@itemize @bullet +@item +A pool-specific access type (ie, an @w{Ada 83} access type, whose +definition is @code{access T} versus @code{access all T} or +@code{access constant T}), may be declared with a @code{'Size} representation +clause that establishes the size as 32 bits. +In such circumstances allocations for that type will +be from the 32-bit heap. Such a clause is not permitted +for a general access type (declared with @code{access all} or +@code{access constant}) as values of such types must be able to refer +to any object of the designated type, including objects residing outside +the 32-bit address range. Existing @w{Ada 83} code will not contain such +type definitions, however, since general access types were introduced +in @w{Ada 95}. + +@item +Switches for @command{GNAT BIND} control whether the internal GNAT +allocation routine @code{__gnat_malloc} uses 64-bit or 32-bit allocations. +@cindex @code{__gnat_malloc} +The switches are respectively @option{-H64} (the default) and +@option{-H32}. +@cindex @option{-H32} (@command{gnatbind}) +@cindex @option{-H64} (@command{gnatbind}) + +@item +The environment variable (logical name) @code{GNAT$NO_MALLOC_64} +@cindex @code{GNAT$NO_MALLOC_64} environment variable +may be used to force @code{__gnat_malloc} to use 32-bit allocation. +If this variable is left +undefined, or defined as @code{"DISABLE"}, @code{"FALSE"}, or @code{"0"}, +then the default (64-bit) allocation is used. +If defined as @code{"ENABLE"}, @code{"TRUE"}, or @code{"1"}, +then 32-bit allocation is used. The gnatbind qualifiers described above +override this logical name. + +@item +A ^gcc switch^gcc switch^ for OpenVMS, @option{-mno-malloc64}, operates +@cindex @option{-mno-malloc64} (^gcc^gcc^) +at a low level to convert explicit calls to @code{malloc} and related +functions from the C run-time library so that they perform allocations +in the 32-bit heap. +Since all internal allocations from GNAT use @code{__gnat_malloc}, +this switch is not required unless the program makes explicit calls on +@code{malloc} (or related functions) from interfaced C code. +@end itemize -General access types (declared with @code{access all}) can never be -32 bits, as values of such types must be able to refer to any object -of the designated type, -including objects residing outside the 32-bit address range. -Existing Ada 83 code will not contain such type definitions, -however, since general access types were introduced in Ada 95. @node Unchecked conversions @subsubsection Unchecked conversions @@ -26694,6 +26780,20 @@ pragma Convention(C, int_star); for int_star'Size use 64; -- Necessary to get 64 and not 32 bits @end smallexample +@node 32/64-bit descriptors +@subsubsection 32/64-bit descriptors + +@noindent +By default, GNAT uses a 64-bit descriptor mechanism. For an imported +subprogram (i.e., a subprogram identified by pragma @code{Import_Function}, +@code{Import_Procedure}, or @code{Import_Valued_Procedure}) that specifies +@code{Short_Descriptor} as its mechanism, a 32-bit descriptor is used. +@cindex @code{Short_Descriptor} mechanism for imported subprograms + +If the configuration pragma @code{Short_Descriptors} is supplied, then +all descriptors will be 32 bits. +@cindex pragma @code{Short_Descriptors} + @node Experience with source compatibility @subsubsection Experience with source compatibility @@ -26726,8 +26826,6 @@ these sorts of potential source code porting problems. * Making code 64 bit clean:: * Allocating memory from the 64 bit storage pool:: * Restrictions on use of 64 bit objects:: -* Using 64 bit storage pools by default:: -* General access types:: * STARLET and other predefined libraries:: @end menu @@ -26771,13 +26869,10 @@ Any attempt to do this will raise @code{Constraint_Error}. @subsubsection Allocating memory from the 64-bit storage pool @noindent -For any access type @code{T} that potentially requires memory allocations -beyond the 32-bit address space, -use the following representation clause: - -@smallexample @c ada - for T'Storage_Pool use System.Pool_64; -@end smallexample +By default, all allocations -- for both pool-specific and general +access types -- use the 64-bit storage pool. To override +this default, for an individual access type or globally, see +@ref{Access types and 32/64-bit allocation}. @node Restrictions on use of 64 bit objects @subsubsection Restrictions on use of 64-bit objects @@ -26792,46 +26887,6 @@ or assigning it to a variable of type @code{Short_Address}, will cause no exception is raised and execution will become erroneous. -@node Using 64 bit storage pools by default -@subsubsection Using 64-bit storage pools by default - -@noindent -In some cases it may be desirable to have the compiler allocate -from 64-bit storage pools by default. This may be the case for -libraries that are 64-bit clean, but may be used in both 32-bit -and 64-bit contexts. For these cases the following configuration -pragma may be specified: - -@smallexample @c ada - pragma Pool_64_Default; -@end smallexample - -@noindent -Any code compiled in the context of this pragma will by default -use the @code{System.Pool_64} storage pool. This default may be overridden -for a specific access type @code{T} by the representation clause: - -@smallexample @c ada - for T'Storage_Pool use System.Pool_32; -@end smallexample - -@noindent -Any object whose address may be passed to a subprogram with a -@code{Short_Address} argument, or assigned to a variable of type -@code{Short_Address}, needs to be allocated from this pool. - -@node General access types -@subsubsection General access types - -@noindent -Objects designated by access values from a -general access type (declared with @code{access all}) are never allocated -from a 64-bit storage pool. Code that uses general access types will -accept objects allocated in either 32-bit or 64-bit address spaces, -but never allocate objects outside the 32-bit address space. -Using general access types ensures maximum compatibility with both -32-bit and 64-bit code. - @node STARLET and other predefined libraries @subsubsection STARLET and other predefined libraries @@ -26891,8 +26946,8 @@ platforms (NT, 2000, and XP Professional). * Windows Calling Conventions:: * Introduction to Dynamic Link Libraries (DLLs):: * Using DLLs with GNAT:: -* Building DLLs with GNAT:: * Building DLLs with GNAT Project files:: +* Building DLLs with GNAT:: * Building DLLs with gnatdll:: * GNAT and Windows Resources:: * Debugging a DLL:: @@ -26953,11 +27008,7 @@ features are not used, but it is not guaranteed to work. @item It is not possible to link against Microsoft libraries except for -import libraries. The library must be built to be compatible with -@file{MSVCRT.LIB} (/MD Microsoft compiler option), @file{LIBC.LIB} and -@file{LIBCMT.LIB} (/ML or /MT Microsoft compiler options) are known to -not be compatible with the GNAT runtime. Even if the library is -compatible with @file{MSVCRT.LIB} it is not guaranteed to work. +import libraries. Interfacing must be done by the mean of DLLs. @item When the compilation environment is located on FAT32 drives, users may @@ -27048,29 +27099,8 @@ interoperability strategy. If you use @command{gcc} to compile the non-Ada part of your application, there are no Windows-specific restrictions that affect the overall -interoperability with your Ada code. If you plan to use -Microsoft tools (e.g.@: Microsoft Visual C/C++), you should be aware of -the following limitations: - -@itemize @bullet -@item -You cannot link your Ada code with an object or library generated with -Microsoft tools if these use the @code{.tls} section (Thread Local -Storage section) since the GNAT linker does not yet support this section. - -@item -You cannot link your Ada code with an object or library generated with -Microsoft tools if these use I/O routines other than those provided in -the Microsoft DLL: @code{msvcrt.dll}. This is because the GNAT run time -uses the services of @code{msvcrt.dll} for its I/Os. Use of other I/O -libraries can cause a conflict with @code{msvcrt.dll} services. For -instance Visual C++ I/O stream routines conflict with those in -@code{msvcrt.dll}. -@end itemize - -@noindent -If you do want to use the Microsoft tools for your non-Ada code and hit one -of the above limitations, you have two choices: +interoperability with your Ada code. If you do want to use the +Microsoft tools for your non-Ada code, you have two choices: @enumerate @item @@ -27082,8 +27112,8 @@ build the DLL and use GNAT to build your executable @item Or you can encapsulate your Ada code in a DLL to be linked with the other part of your application. In this case, use GNAT to build the DLL -(@pxref{Building DLLs with GNAT}) and use the Microsoft or whatever -environment to build your executable. +(@pxref{Building DLLs with GNAT Project files}) and use the Microsoft +or whatever environment to build your executable. @end enumerate @node Windows Calling Conventions @@ -27091,6 +27121,10 @@ environment to build your executable. @findex Stdcall @findex APIENTRY +This section pertain only to Win32. On Win64 there is a single native +calling convention. All convention specifiers are ignored on this +platform. + @menu * C Calling Convention:: * Stdcall Calling Convention:: @@ -27394,11 +27428,23 @@ $ gnatmake my_ada_app -largs -lAPI @noindent The argument @option{-largs -lAPI} at the end of the @command{gnatmake} command -tells the GNAT linker to look first for a library named @file{API.lib} -(Microsoft-style name) and if not found for a libraries named -@file{libAPI.dll.a}, @file{API.dll.a} or @file{libAPI.a}. -(GNAT-style name). Note that if the Ada package spec for @file{API.dll} -contains the following pragma +tells the GNAT linker to look for an import library. The linker will +look for a library name in this specific order: + +@enumerate +@item @file{libAPI.dll.a} +@item @file{API.dll.a} +@item @file{libAPI.a} +@item @file{API.lib} +@item @file{libAPI.dll} +@item @file{API.dll} +@end enumerate + +The first three are the GNU style import libraries. The third is the +Microsoft style import libraries. The last two are the DLL themself. + +Note that if the Ada package spec for @file{API.dll} contains the +following pragma @smallexample @c ada pragma Linker_Options ("-lAPI"); @@ -27456,7 +27502,7 @@ end API; @noindent Note that a variable is -@strong{always imported with a Stdcall convention}. A function +@strong{always imported with a DLL convention}. A function can have @code{C} or @code{Stdcall} convention. (@pxref{Windows Calling Conventions}). @@ -27637,6 +27683,19 @@ See the Microsoft documentation for further details about the usage of @code{lib}. @end enumerate +@node Building DLLs with GNAT Project files +@section Building DLLs with GNAT Project files +@cindex DLLs, building + +@noindent +There is nothing specific to Windows in the build process. +@pxref{Library Projects}. + +@noindent +Due to a system limitation, it is not possible under Windows to create threads +when inside the @code{DllMain} routine which is used for auto-initialization +of shared libraries, so it is not possible to have library level tasks in SALs. + @node Building DLLs with GNAT @section Building DLLs with GNAT @cindex DLLs, building @@ -27699,19 +27758,6 @@ option. $ gnatmake main -Iapilib -bargs -shared -largs -Lapilib -lAPI @end smallexample -@node Building DLLs with GNAT Project files -@section Building DLLs with GNAT Project files -@cindex DLLs, building - -@noindent -There is nothing specific to Windows in the build process. -@pxref{Library Projects}. - -@noindent -Due to a system limitation, it is not possible under Windows to create threads -when inside the @code{DllMain} routine which is used for auto-initialization -of shared libraries, so it is not possible to have library level tasks in SALs. - @node Building DLLs with gnatdll @section Building DLLs with gnatdll @cindex DLLs, building @@ -27727,9 +27773,9 @@ of shared libraries, so it is not possible to have library level tasks in SALs. @end menu @noindent -Note that it is preferred to use the built-in GNAT DLL support -(@pxref{Building DLLs with GNAT}) or GNAT Project files -(@pxref{Building DLLs with GNAT Project files}) to build DLLs. +Note that it is preferred to use GNAT Project files +(@pxref{Building DLLs with GNAT Project files}) or the built-in GNAT +DLL support (@pxref{Building DLLs with GNAT}) or to build DLLs. This section explains how to build DLLs containing Ada code using @code{gnatdll}. These DLLs will be referred to as Ada DLLs in the @@ -28474,7 +28520,6 @@ The program is built with foreign tools and the DLL is built with @item The program is built with @code{GCC/GNAT} and the DLL is built with foreign tools. -@item @end enumerate @noindent diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb index cb234d262e6..d3882589fde 100644 --- a/gcc/ada/gnatbind.adb +++ b/gcc/ada/gnatbind.adb @@ -583,13 +583,11 @@ begin Osint.Add_Default_Search_Dirs; -- Carry out package initializations. These are initializations which - -- might logically be performed at elaboration time, but Namet at least - -- can't be done that way (because it is used in the Compiler), and we - -- decide to be consistent. Like elaboration, the order in which these - -- calls are made is in some cases important. + -- might logically be performed at elaboration time, and we decide to be + -- consistent. Like elaboration, the order in which these calls are made + -- is in some cases important. Csets.Initialize; - Namet.Initialize; Snames.Initialize; -- Acquire target parameters diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 0f3810144e4..93f7d1c6b93 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -26,6 +26,7 @@ with GNAT.Directory_Operations; use GNAT.Directory_Operations; with Csets; +with Hostparm; use Hostparm; with Makeutl; use Makeutl; with MLib.Tgt; use MLib.Tgt; with MLib.Utl; @@ -46,16 +47,14 @@ with Table; with Targparm; with Tempdir; with Types; use Types; -with Hostparm; use Hostparm; --- Used to determine if we are in VMS or not for error message purposes +with VMS_Conv; use VMS_Conv; +with VMS_Cmds; use VMS_Cmds; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; -with GNAT.OS_Lib; use GNAT.OS_Lib; - -with VMS_Conv; use VMS_Conv; +with GNAT.OS_Lib; use GNAT.OS_Lib; procedure GNATCmd is Project_Node_Tree : Project_Node_Tree_Ref; @@ -806,8 +805,6 @@ procedure GNATCmd is Return_Code => Return_Code, Err_To_Out => True); - Close (FD); - -- Read the output of the invocation of gnatmake Open (File, In_File, Get_Name_String (Name)); @@ -1320,9 +1317,7 @@ procedure GNATCmd is begin -- Initializations - Namet.Initialize; Csets.Initialize; - Snames.Initialize; Project_Node_Tree := new Project_Node_Tree_Data; @@ -1352,6 +1347,19 @@ begin Targparm.Get_Target_Parameters; + -- Put the command line in environment variable GNAT_DRIVER_COMMAND_LINE, + -- so that the spawned tool may know the way the GNAT driver was invoked. + + Name_Len := 0; + Add_Str_To_Name_Buffer (Command_Name); + + for J in 1 .. Argument_Count loop + Add_Char_To_Name_Buffer (' '); + Add_Str_To_Name_Buffer (Argument (J)); + end loop; + + Setenv ("GNAT_DRIVER_COMMAND_LINE", Name_Buffer (1 .. Name_Len)); + -- Add the directory where the GNAT driver is invoked in front of the path, -- if the GNAT driver is invoked with directory information. Do not do this -- for VMS, where the notion of path does not really exist. diff --git a/gcc/ada/gnatlbr.adb b/gcc/ada/gnatlbr.adb deleted file mode 100644 index 7be1d494baf..00000000000 --- a/gcc/ada/gnatlbr.adb +++ /dev/null @@ -1,346 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- G N A T L B R -- --- -- --- B o d y -- --- -- --- Copyright (C) 1997-2008, Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING3. If not, go to -- --- http://www.gnu.org/licenses for a complete copy of the license. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- Program to create, set, or delete an alternate runtime library - --- Works by calling an appropriate target specific Makefile residing --- in the default library object (e.g. adalib) directory from the context --- of the new library objects directory. - --- Command line arguments are: --- 1st: --[create | set | delete]= --- --create : Build a library --- --set : Set environment variables to point to a library --- --delete : Delete a library - --- 2nd: --config= --- A -gnatg valid file containing desired configuration pragmas - --- This program is currently used only on Alpha/VMS - -with Ada.Command_Line; use Ada.Command_Line; -with Ada.Text_IO; use Ada.Text_IO; -with GNAT.OS_Lib; use GNAT.OS_Lib; -with Gnatvsn; use Gnatvsn; -with Interfaces.C_Streams; use Interfaces.C_Streams; -with Osint; use Osint; -with System; - -procedure GnatLbr is - pragma Ident (Gnat_Static_Version_String); - - type Lib_Mode is (None, Create, Set, Delete); - Next_Arg : Integer; - Mode : Lib_Mode := None; - ADC_File : String_Access := null; - Lib_Dir : String_Access := null; - Make : constant String := "make"; - Make_Path : String_Access; - - procedure Create_Directory (Name : System.Address; Mode : Integer); - pragma Import (C, Create_Directory, "decc$mkdir"); - -begin - if Argument_Count = 0 then - Put ("Usage: "); - Put_Line - ("gnatlbr --[create|set|delete]= [--config=]"); - Exit_Program (E_Fatal); - end if; - - Next_Arg := 1; - - loop - exit when Next_Arg > Argument_Count; - - Process_One_Arg : declare - Arg : constant String := Argument (Next_Arg); - - begin - if Arg'Length > 9 and then Arg (1 .. 9) = "--create=" then - if Mode = None then - Mode := Create; - Lib_Dir := new String'(Arg (10 .. Arg'Last)); - else - Put_Line (Standard_Error, "Error: Multiple modes specified"); - Exit_Program (E_Fatal); - end if; - - elsif Arg'Length > 6 and then Arg (1 .. 6) = "--set=" then - if Mode = None then - Mode := Set; - Lib_Dir := new String'(Arg (7 .. Arg'Last)); - else - Put_Line (Standard_Error, "Error: Multiple modes specified"); - Exit_Program (E_Fatal); - end if; - - elsif Arg'Length > 9 and then Arg (1 .. 9) = "--delete=" then - if Mode = None then - Mode := Delete; - Lib_Dir := new String'(Arg (10 .. Arg'Last)); - else - Put_Line (Standard_Error, "Error: Multiple modes specified"); - Exit_Program (E_Fatal); - end if; - - elsif Arg'Length > 9 and then Arg (1 .. 9) = "--config=" then - if ADC_File /= null then - Put_Line (Standard_Error, - "Error: Multiple gnat.adc files specified"); - Exit_Program (E_Fatal); - end if; - - ADC_File := new String'(Arg (10 .. Arg'Last)); - - else - Put_Line (Standard_Error, "Error: Unrecognized option: " & Arg); - Exit_Program (E_Fatal); - - end if; - end Process_One_Arg; - - Next_Arg := Next_Arg + 1; - end loop; - - case Mode is - when Create => - - -- Validate arguments - - if Lib_Dir = null then - Put_Line (Standard_Error, "Error: No library directory specified"); - Exit_Program (E_Fatal); - end if; - - if Is_Directory (Lib_Dir.all) then - Put_Line (Standard_Error, - "Error:" & Lib_Dir.all & " already exists"); - Exit_Program (E_Fatal); - end if; - - if ADC_File = null then - Put_Line (Standard_Error, - "Error: No configuration file specified"); - Exit_Program (E_Fatal); - end if; - - if not Is_Regular_File (ADC_File.all) then - Put_Line (Standard_Error, - "Error: " & ADC_File.all & " doesn't exist"); - Exit_Program (E_Fatal); - end if; - - Create_Block : declare - Success : Boolean; - Make_Args : Argument_List (1 .. 9); - C_Lib_Dir : String := Lib_Dir.all & ASCII.NUL; - C_ADC_File : String := ADC_File.all & ASCII.NUL; - F_ADC_File : String (1 .. max_path_len); - F_ADC_File_Len : Integer := max_path_len; - Include_Dirs : Integer; - Object_Dirs : Integer; - Include_Dir : array (Integer range 1 .. 256) of String_Access; - Object_Dir : array (Integer range 1 .. 256) of String_Access; - Include_Dir_Name : String_Access; - Object_Dir_Name : String_Access; - - begin - -- Create the new top level library directory - - if not Is_Directory (Lib_Dir.all) then - Create_Directory (C_Lib_Dir'Address, 8#755#); - end if; - - full_name (C_ADC_File'Address, F_ADC_File'Address); - - for I in 1 .. max_path_len loop - if F_ADC_File (I) = ASCII.NUL then - F_ADC_File_Len := I - 1; - exit; - end if; - end loop; - - -- - -- Make a list of the default library source and object - -- directories. Usually only one, except on VMS where - -- there are two. - -- - Include_Dirs := 0; - Include_Dir_Name := new String'(Include_Dir_Default_Prefix); - Get_Next_Dir_In_Path_Init (Include_Dir_Name); - - loop - declare - Dir : constant String_Access := String_Access - (Get_Next_Dir_In_Path (Include_Dir_Name)); - begin - exit when Dir = null; - Include_Dirs := Include_Dirs + 1; - Include_Dir (Include_Dirs) := - String_Access (Normalize_Directory_Name (Dir.all)); - end; - end loop; - - Object_Dirs := 0; - Object_Dir_Name := new String'(Object_Dir_Default_Prefix); - Get_Next_Dir_In_Path_Init (Object_Dir_Name); - - loop - declare - Dir : constant String_Access := - String_Access - (Get_Next_Dir_In_Path (Object_Dir_Name)); - begin - exit when Dir = null; - Object_Dirs := Object_Dirs + 1; - Object_Dir (Object_Dirs) - := String_Access (Normalize_Directory_Name (Dir.all)); - end; - end loop; - - -- "Make" an alternate sublibrary for each default sublibrary - - for Dirs in 1 .. Object_Dirs loop - Make_Args (1) := - new String'("-C"); - - Make_Args (2) := - new String'(Lib_Dir.all); - - -- Resolve /gnu on VMS by converting to host format and then - -- convert resolved path back to canonical format for the - -- make program. This fixes the problem that can occur when - -- GNU: is a search path pointing to multiple versions of GNAT. - - Make_Args (3) := - new String'("ADA_INCLUDE_PATH=" & - To_Canonical_Dir_Spec - (To_Host_Dir_Spec - (Include_Dir (Dirs).all, True).all, True).all); - - Make_Args (4) := - new String'("ADA_OBJECTS_PATH=" & - To_Canonical_Dir_Spec - (To_Host_Dir_Spec - (Object_Dir (Dirs).all, True).all, True).all); - - Make_Args (5) := - new String'("GNAT_ADC_FILE=" - & F_ADC_File (1 .. F_ADC_File_Len)); - - Make_Args (6) := - new String'("LIBRARY_VERSION=" & '"' & - Verbose_Library_Version & '"'); - - Make_Args (7) := - new String'("-f"); - - Make_Args (8) := - new String'(Object_Dir (Dirs).all & "Makefile.lib"); - - Make_Args (9) := - new String'("create"); - - Make_Path := Locate_Exec_On_Path (Make); - Put (Make); - - for J in 1 .. Make_Args'Last loop - Put (" "); - Put (Make_Args (J).all); - end loop; - - New_Line; - Spawn (Make_Path.all, Make_Args, Success); - - if not Success then - Put_Line (Standard_Error, "Error: Make failed"); - Exit_Program (E_Fatal); - end if; - end loop; - end Create_Block; - - when Set => - - -- Validate arguments - - if Lib_Dir = null then - Put_Line (Standard_Error, - "Error: No library directory specified"); - Exit_Program (E_Fatal); - end if; - - if not Is_Directory (Lib_Dir.all) then - Put_Line (Standard_Error, - "Error: " & Lib_Dir.all & " doesn't exist"); - Exit_Program (E_Fatal); - end if; - - if ADC_File = null then - Put_Line (Standard_Error, - "Error: No configuration file specified"); - Exit_Program (E_Fatal); - end if; - - if not Is_Regular_File (ADC_File.all) then - Put_Line (Standard_Error, - "Error: " & ADC_File.all & " doesn't exist"); - Exit_Program (E_Fatal); - end if; - - -- Give instructions - - Put_Line ("Copy the contents of " - & ADC_File.all & " into your GNAT.ADC file"); - Put_Line ("and use GNAT Make qualifier /OBJECT_SEARCH=(" - & To_Host_Dir_Spec - (Lib_Dir (Lib_Dir'First .. Lib_Dir'Last) & "/declib", False).all - & "," - & To_Host_Dir_Spec - (Lib_Dir (Lib_Dir'First .. Lib_Dir'Last) & "/adalib", False).all - & ")"); - Put_Line ("or else define ADA_OBJECTS_PATH as " & '"' - & To_Host_Dir_Spec - (Lib_Dir (Lib_Dir'First .. Lib_Dir'Last) & "/declib", False).all - & ',' - & To_Host_Dir_Spec - (Lib_Dir (Lib_Dir'First .. Lib_Dir'Last) & "/adalib", False).all - & '"'); - - when Delete => - - -- Give instructions - - Put_Line ("GNAT Librarian DELETE not yet implemented."); - Put_Line ("Use appropriate system tools to remove library"); - - when None => - Put_Line (Standard_Error, - "Error: No mode (create|set|delete) specified"); - Exit_Program (E_Fatal); - - end case; - -end GnatLbr; diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 675d9a364e4..47397c5c92c 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -41,10 +41,10 @@ with Table; with Targparm; use Targparm; with Types; -with Ada.Command_Line; use Ada.Command_Line; -with Ada.Exceptions; use Ada.Exceptions; +with Ada.Command_Line; use Ada.Command_Line; +with Ada.Exceptions; use Ada.Exceptions; -with System.OS_Lib; use System.OS_Lib; +with System.OS_Lib; use System.OS_Lib; with System.CRTL; with Interfaces.C_Streams; use Interfaces.C_Streams; @@ -199,6 +199,13 @@ procedure Gnatlink is function Base_Name (File_Name : String) return String; -- Return just the file name part without the extension (if present) + procedure Check_Existing_Executable (File_Name : String); + -- Delete any existing executable to avoid accidentally updating the target + -- of a symbolic link, but produce a Fatail_Error if File_Name matches any + -- of the source file names. This avoids overwriting of extensionless + -- source files by accident on systems where executables do not have + -- extensions. + procedure Delete (Name : String); -- Wrapper to unlink as status is ignored by this application @@ -258,6 +265,32 @@ procedure Gnatlink is return File_Name (Findex1 .. Findex2 - 1); end Base_Name; + ------------------------------- + -- Check_Existing_Executable -- + ------------------------------- + + procedure Check_Existing_Executable (File_Name : String) is + Ename : String := File_Name; + Efile : File_Name_Type; + Sfile : File_Name_Type; + + begin + Canonical_Case_File_Name (Ename); + Name_Len := 0; + Add_Str_To_Name_Buffer (Ename); + Efile := Name_Find; + + for J in Units.Table'First .. Units.Last loop + Sfile := Units.Table (J).Sfile; + if Sfile = Efile then + Exit_With_Error ("executable name """ & File_Name & """ matches " + & "source file name """ & Get_Name_String (Sfile) & """"); + end if; + end loop; + + Delete (File_Name); + end Check_Existing_Executable; + ------------ -- Delete -- ------------ @@ -1537,7 +1570,6 @@ begin -- Initialize packages to be used - Namet.Initialize; Csets.Initialize; Snames.Initialize; @@ -1561,7 +1593,6 @@ begin -- the binder generated file if Compile_Bind_File and then Standard_Gcc then - Initialize_ALI; Name_Len := Ali_File_Name'Length; Name_Buffer (1 .. Name_Len) := Ali_File_Name.all; @@ -1761,16 +1792,7 @@ begin new String'(Output_File_Name.all); end if; - -- Delete existing executable, in case it is a symbolic link, to avoid - -- modifying the target of the symbolic link. - - declare - Dummy : Boolean; - pragma Unreferenced (Dummy); - - begin - Delete_File (Output_File_Name.all, Dummy); - end; + Check_Existing_Executable (Output_File_Name.all); -- Warn if main program is called "test", as that may be a built-in command -- on Unix. On non-Unix systems executables have a suffix, so the warning @@ -2146,15 +2168,16 @@ begin -- Remove duplicate IDENTIFICATION directives (VMS) - if Linker_Options.Table (J)'Length > 27 - and then Linker_Options.Table (J) (1 .. 28) - = "--for-linker=IDENTIFICATION=" + if Linker_Options.Table (J)'Length > 29 + and then Linker_Options.Table (J) (1 .. 30) = + "--for-linker=--identification=" then if IDENT_Op then Linker_Options.Table (J .. Linker_Options.Last - 1) := Linker_Options.Table (J + 1 .. Linker_Options.Last); Linker_Options.Decrement_Last; Num_Args := Num_Args - 1; + else IDENT_Op := True; end if; diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb index b5a3f49df16..b684ebbc8ed 100644 --- a/gcc/ada/gnatls.adb +++ b/gcc/ada/gnatls.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -1362,13 +1362,11 @@ procedure Gnatls is declare Src_Path_Name : constant String_Ptr := - String_Ptr - (Get_RTS_Search_Dir - (Argv (7 .. Argv'Last), Include)); + Get_RTS_Search_Dir + (Argv (7 .. Argv'Last), Include); Lib_Path_Name : constant String_Ptr := - String_Ptr - (Get_RTS_Search_Dir - (Argv (7 .. Argv'Last), Objects)); + Get_RTS_Search_Dir + (Argv (7 .. Argv'Last), Objects); begin if Src_Path_Name /= null @@ -1524,7 +1522,6 @@ procedure Gnatls is begin -- Initialize standard packages - Namet.Initialize; Csets.Initialize; Snames.Initialize; diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads index 684a3bb4d79..f112c96c259 100644 --- a/gcc/ada/gnatvsn.ads +++ b/gcc/ada/gnatvsn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2010 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -77,6 +77,10 @@ package Gnatvsn is -- value should never be decreased in the future, but it would be -- OK to increase it if absolutely necessary. + Ver_Prefix : constant String := "GNAT Version: "; + -- Prefix generated by binder. If it is changed, be sure to change + -- GNAT.Compiler_Version.Ver_Prefix as well. + Library_Version : constant String := "4.6"; -- Library version. This value must be updated whenever any change to the -- compiler affects the library formats in such a way as to obsolete diff --git a/gcc/ada/gprep.adb b/gcc/ada/gprep.adb index b5e6b063cac..88710d6206c 100644 --- a/gcc/ada/gprep.adb +++ b/gcc/ada/gprep.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2010, 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- -- @@ -91,9 +91,6 @@ package body GPrep is procedure Display_Copyright; -- Display the copyright notice - procedure Obsolescent_Check (S : Source_Ptr); - -- Null procedure, needed by instantiation of Scng below - procedure Post_Scan; -- Null procedure, needed by instantiation of Scng below @@ -103,7 +100,6 @@ package body GPrep is Errutil.Error_Msg_S, Errutil.Error_Msg_SC, Errutil.Error_Msg_SP, - Obsolescent_Check, Errutil.Style); -- The scanner for the preprocessor @@ -172,7 +168,6 @@ package body GPrep is -- Do some initializations (order is important here!) Csets.Initialize; - Namet.Initialize; Snames.Initialize; Stringt.Initialize; Prep.Initialize; @@ -312,16 +307,6 @@ package body GPrep is New_Line (Outfile.all); end New_EOL_To_Outfile; - ----------------------- - -- Obsolescent_Check -- - ----------------------- - - procedure Obsolescent_Check (S : Source_Ptr) is - pragma Warnings (Off, S); - begin - null; - end Obsolescent_Check; - --------------- -- Post_Scan -- --------------- diff --git a/gcc/ada/i-cexten.ads b/gcc/ada/i-cexten.ads index 93f8dc68b51..c2dd33b48db 100644 --- a/gcc/ada/i-cexten.ads +++ b/gcc/ada/i-cexten.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,17 +36,23 @@ with System; package Interfaces.C.Extensions is - -- Following 7 declarations need comments ??? + -- Definitions for C "void" and "void*" types subtype void is System.Address; subtype void_ptr is System.Address; + -- Definitions for C incomplete/unknown structs + subtype opaque_structure_def is System.Address; type opaque_structure_def_ptr is access opaque_structure_def; + -- Definitions for C++ incomplete/unknown classes + subtype incomplete_class_def is System.Address; type incomplete_class_def_ptr is access incomplete_class_def; + -- C bool + subtype bool is plain_char; -- 64bit integer types @@ -54,6 +60,15 @@ package Interfaces.C.Extensions is subtype long_long is Long_Long_Integer; type unsigned_long_long is mod 2 ** 64; + -- 128bit integer type available on 64bit platforms: + -- typedef int signed_128 __attribute__ ((mode (TI))); + + type Signed_128 is record + low, high : unsigned_long_long; + end record; + pragma Convention (C_Pass_By_Copy, Signed_128); + for Signed_128'Alignment use unsigned_long_long'Alignment * 2; + -- Types for bitfields type Unsigned_1 is mod 2 ** 1; diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index 53f47830d66..fe89924333e 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -55,7 +55,7 @@ package body Impunit is Non_Imp_File_Names_95 : constant File_List := ( ------------------------------------------------------ - -- Ada Hierarchy Units from Ada-83 Reference Manual -- + -- Ada Hierarchy Units from Ada-95 Reference Manual -- ------------------------------------------------------ "a-astaco", -- Ada.Asynchronous_Task_Control @@ -395,6 +395,7 @@ package body Impunit is "a-envvar", -- Ada.Environment_Variables "a-exetim", -- Ada.Execution_Time "a-extiti", -- Ada.Execution_Time.Timers + "a-izteio", -- Ada.Integer_Wide_Wide_Text_IO "a-rttiev", -- Ada.Real_Time.Timing_Events "a-ngcoar", -- Ada.Numerics.Generic_Complex_Arrays "a-ngrear", -- Ada.Numerics.Generic_Real_Arrays diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb index 535dddc6e8b..4b39c0a4913 100644 --- a/gcc/ada/lib-load.adb +++ b/gcc/ada/lib-load.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -344,7 +344,8 @@ package body Lib.Load is Subunit : Boolean; Corr_Body : Unit_Number_Type := No_Unit; Renamings : Boolean := False; - With_Node : Node_Id := Empty) return Unit_Number_Type + With_Node : Node_Id := Empty; + PMES : Boolean := False) return Unit_Number_Type is Calling_Unit : Unit_Number_Type; Uname_Actual : Unit_Name_Type; @@ -352,10 +353,11 @@ package body Lib.Load is Unump : Unit_Number_Type; Fname : File_Name_Type; Src_Ind : Source_File_Index; - - -- Start of processing for Load_Unit + Save_PMES : constant Boolean := Parsing_Main_Extended_Source; begin + Parsing_Main_Extended_Source := PMES; + -- If renamings are allowed and we have a child unit name, then we -- must first load the parent to deal with finding the real name. -- Retain the with_clause that names the child, so that if it is @@ -372,6 +374,7 @@ package body Lib.Load is With_Node => With_Node); if Unump = No_Unit then + Parsing_Main_Extended_Source := Save_PMES; return No_Unit; end if; @@ -513,7 +516,6 @@ package body Lib.Load is -- See if we already have an entry for this unit Unum := Main_Unit; - while Unum <= Units.Last loop exit when Uname_Actual = Units.Table (Unum).Unit_Name; Unum := Unum + 1; @@ -553,10 +555,12 @@ package body Lib.Load is end if; Write_Dependency_Chain; - return No_Unit; + Unum := No_Unit; + goto Done; else - return No_Unit; + Unum := No_Unit; + goto Done; end if; end if; end loop; @@ -601,7 +605,8 @@ package body Lib.Load is Load_Stack.Decrement_Last; end if; - return No_Unit; + Unum := No_Unit; + goto Done; end if; if Debug_Flag_L then @@ -611,7 +616,7 @@ package body Lib.Load is end if; Load_Stack.Decrement_Last; - return Unum; + goto Done; -- Unit is not already in table, so try to open the file @@ -658,12 +663,22 @@ package body Lib.Load is -- Parse the new unit declare - Save_Index : constant Nat := Multiple_Unit_Index; + Save_Index : constant Nat := Multiple_Unit_Index; + Save_PMES : constant Boolean := Parsing_Main_Extended_Source; + begin Multiple_Unit_Index := Get_Unit_Index (Uname_Actual); Units.Table (Unum).Munit_Index := Multiple_Unit_Index; Initialize_Scanner (Unum, Source_Index (Unum)); + + if Calling_Unit = Main_Unit and then Subunit then + Parsing_Main_Extended_Source := True; + end if; + Discard_List (Par (Configuration_Pragmas => False)); + + Parsing_Main_Extended_Source := Save_PMES; + Multiple_Unit_Index := Save_Index; Set_Loading (Unum, False); end; @@ -680,7 +695,8 @@ package body Lib.Load is Error_Msg ("\incorrect spec in file { must be removed first!", Load_Msg_Sloc); - return No_Unit; + Unum := No_Unit; + goto Done; end if; -- If loaded unit had a fatal error, then caller inherits it! @@ -697,7 +713,7 @@ package body Lib.Load is -- All done, return unit number - return Unum; + goto Done; -- Case of file not found @@ -751,9 +767,16 @@ package body Lib.Load is Units.Decrement_Last; end if; - return No_Unit; + Unum := No_Unit; + goto Done; end if; end if; + + -- Here to exit, with result in Unum + + <> + Parsing_Main_Extended_Source := Save_PMES; + return Unum; end Load_Unit; -------------------------- diff --git a/gcc/ada/lib-load.ads b/gcc/ada/lib-load.ads index 97abc71473a..d2856aa41f2 100644 --- a/gcc/ada/lib-load.ads +++ b/gcc/ada/lib-load.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -109,7 +109,8 @@ package Lib.Load is Subunit : Boolean; Corr_Body : Unit_Number_Type := No_Unit; Renamings : Boolean := False; - With_Node : Node_Id := Empty) return Unit_Number_Type; + With_Node : Node_Id := Empty; + PMES : Boolean := False) return Unit_Number_Type; -- This function loads and parses the unit specified by Load_Name (or -- returns the unit number for the previously constructed units table -- entry if this is not the first call for this unit). Required indicates @@ -151,6 +152,9 @@ package Lib.Load is -- With_Node is set to the with_clause or limited_with_clause causing -- the unit to be loaded, and is used to bypass the circular dependency -- check in the case of a limited_with_clause (Ada 2005, AI-50217). + -- + -- PMES indicates the required setting of Parsing_Main_Extended_Unit during + -- loading of the unit. This flag is saved and restored over the call. procedure Change_Main_Unit_To_Spec; -- This procedure is called if the main unit file contains a No_Body pragma diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb index 940527fc64d..893c4cfbbb2 100644 --- a/gcc/ada/lib.adb +++ b/gcc/ada/lib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -701,11 +701,10 @@ package body Lib is Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit)); begin - -- If Mloc is not set, it means we are still parsing the main unit, - -- so everything so far is in the extended main source unit. + -- If parsing, then use the global flag to indicate result - if Mloc = No_Location then - return True; + if Compiler_State = Parsing then + return Parsing_Main_Extended_Source; -- Special value cases @@ -741,11 +740,10 @@ package body Lib is Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit)); begin - -- If Mloc is not set, it means we are still parsing the main unit, - -- so everything so far is in the extended main source unit. + -- If parsing, then use the global flag to indicate result - if Mloc = No_Location then - return True; + if Compiler_State = Parsing then + return Parsing_Main_Extended_Source; -- Special value cases diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index 4a956b5118f..0aac6f04da4 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -39,6 +39,16 @@ with Types; use Types; package Lib is + type Compiler_State_Type is (Parsing, Analyzing); + Compiler_State : Compiler_State_Type; + -- Indicates current state of compilation. This is used to implement the + -- function In_Extended_Main_Source_Unit. + + Parsing_Main_Extended_Source : Boolean := False; + -- Set True if we are currently parsing a file that is part of the main + -- extended source (the main unit, its spec, or one of its subunits). This + -- flag to implement In_Extended_Main_Source_Unit. + -------------------------------------------- -- General Approach to Library Management -- -------------------------------------------- diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index d1cafbf32d3..79a8390569f 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -71,6 +71,7 @@ with Ada.Command_Line; use Ada.Command_Line; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables; +with GNAT.HTable; with GNAT.Case_Util; use GNAT.Case_Util; with GNAT.OS_Lib; use GNAT.OS_Lib; @@ -135,49 +136,6 @@ package body Make is -- complex, for example in main.1.ada, the termination in this name is -- ".1.ada" and in main_.ada the termination is "_.ada". - ------------------------------------- - -- Queue (Q) Manipulation Routines -- - ------------------------------------- - - -- The Q is used in Compile_Sources below. Its implementation uses the GNAT - -- generic package Table (basically an extensible array). Q_Front points to - -- the first valid element in the Q, whereas Q.First is the first element - -- ever enqueued, while Q.Last - 1 is the last element in the Q. - -- - -- +---+--------------+---+---+---+-----------+---+-------- - -- Q | | ........ | | | | ....... | | - -- +---+--------------+---+---+---+-----------+---+-------- - -- ^ ^ ^ - -- Q.First Q_Front Q.Last-1 - -- - -- The elements comprised between Q.First and Q_Front-1 are the elements - -- that have been enqueued and then dequeued, while the elements between - -- Q_Front and Q.Last-1 are the elements currently in the Q. When the Q - -- is initialized Q_Front = Q.First = Q.Last. After Compile_Sources has - -- terminated its execution, Q_Front = Q.Last and the elements contained - -- between Q.First and Q.Last-1 are those that were explored and thus - -- marked by Compile_Sources. Whenever the Q is reinitialized, the elements - -- between Q.First and Q.Last-1 are unmarked. - - procedure Init_Q; - -- Must be called to (re)initialize the Q - - procedure Insert_Q - (Source_File : File_Name_Type; - Source_Unit : Unit_Name_Type := No_Unit_Name; - Index : Int := 0); - -- Inserts Source_File at the end of Q. Provide Source_Unit when possible - -- for external use (gnatdist). Provide index for multi-unit sources. - - function Empty_Q return Boolean; - -- Returns True if Q is empty - - procedure Extract_From_Q - (Source_File : out File_Name_Type; - Source_Unit : out Unit_Name_Type; - Source_Index : out Int); - -- Extracts the first element from the Q - procedure Insert_Project_Sources (The_Project : Project_Id; All_Projects : Boolean; @@ -190,12 +148,6 @@ package body Make is -- including, if The_Project is an extending project, sources inherited -- from projects being extended. - First_Q_Initialization : Boolean := True; - -- Will be set to false after Init_Q has been called once - - Q_Front : Natural; - -- Points to the first valid element in the Q - Unique_Compile : Boolean := False; -- Set to True if -u or -U or a project file with no main is used @@ -216,24 +168,55 @@ package body Make is N_M_Switch : Natural := 0; -- Used to count -mxxx switches that can affect multilib - type Q_Record is record - File : File_Name_Type; - Unit : Unit_Name_Type; - Index : Int; - end record; - -- File is the name of the file to compile. Unit is for gnatdist - -- use in order to easily get the unit name of a file to compile - -- when its name is krunched or declared in gnat.adc. Index, when not 0, - -- is the index of the unit in a multi-unit source. + package Queue is + --------------------------------- + -- Queue Manipulation Routines -- + --------------------------------- - package Q is new Table.Table ( - Table_Component_Type => Q_Record, - Table_Index_Type => Natural, - Table_Low_Bound => 0, - Table_Initial => 4000, - Table_Increment => 100, - Table_Name => "Make.Q"); - -- This is the actual Q + procedure Initialize (Queue_Per_Obj_Dir : Boolean); + -- Initialize the queue + + function Is_Empty return Boolean; + -- Returns True if the queue is empty + + function Is_Virtually_Empty return Boolean; + -- Returns True if the queue is empty or if all object directories are + -- busy. + + procedure Insert + (Source_File_Name : File_Name_Type; + Project : Project_Id; + Source_Unit : Unit_Name_Type := No_Unit_Name; + Index : Int := 0); + -- Insert source in the queue + + procedure Extract + (Source_File_Name : out File_Name_Type; + Source_Unit : out Unit_Name_Type; + Source_Index : out Int); + -- Get the first source that can be compiled from the queue. If no + -- source may be compiled, return No_File/No_Source. + + function Size return Natural; + -- Return the total size of the queue, including the sources already + -- extracted. + + function Processed return Natural; + -- Return the number of source in the queue that have aready been + -- processed. + + procedure Set_Obj_Dir_Busy (Obj_Dir : Path_Name_Type); + -- Indicate that this object directory is busy, so that when + -- One_Compilation_Per_Obj_Dir is True no other compilation occurs in + -- this object directory. + + procedure Set_Obj_Dir_Free (Obj_Dir : Path_Name_Type); + -- Indicate that there is no compilation for this object directory + + function Element (Rank : Positive) return File_Name_Type; + -- Get the file name for element of index Rank in the queue + + end Queue; -- The 3 following packages are used to store gcc, gnatbind and gnatlink -- switches found in the project files. @@ -370,6 +353,9 @@ package body Make is -- calling Change_Dir if the current working directory is already this -- directory. + Map_File : String_Access := null; + -- Value of switch --create-map-file + -- Packages of project files where unknown attributes are errors Naming_String : aliased String := "naming"; @@ -1417,7 +1403,7 @@ package body Make is when Directory_Error => Make_Failed ("unable to change to object directory """ & Path_Or_File_Name - (Project.Object_Directory.Name) & + (Project.Object_Directory.Display_Name) & """ of project " & Get_Name_String (Project.Display_Name)); end Change_To_Object_Directory; @@ -2325,7 +2311,7 @@ package body Make is New_Args : Argument_List (1 .. Number); Last_New : Natural := 0; Dir_Path : constant String := Get_Name_String - (Arguments_Project.Directory.Name); + (Arguments_Project.Directory.Display_Name); begin Current := Switches.Values; @@ -2368,7 +2354,8 @@ package body Make is (Name_Buffer (1 .. Name_Len))); Dir_Path : constant String := Get_Name_String - (Arguments_Project.Directory.Name); + (Arguments_Project. + Directory.Display_Name); begin Test_If_Relative_Path @@ -2503,8 +2490,13 @@ package body Make is -- library file name. Process_Id of the process spawned to execute the -- compilation. + type ALI_Project is record + ALI : ALI_Id; + Project : Project_Id; + end record; + package Good_ALI is new Table.Table ( - Table_Component_Type => ALI_Id, + Table_Component_Type => ALI_Project, Table_Index_Type => Natural, Table_Low_Bound => 1, Table_Initial => 50, @@ -2519,7 +2511,7 @@ package body Make is -- Get a mapping file name. If there is one to be reused, reuse it. -- Otherwise, create a new mapping file. - function Get_Next_Good_ALI return ALI_Id; + function Get_Next_Good_ALI return ALI_Project; -- Returns the next good ALI_Id record procedure Record_Failure @@ -2530,7 +2522,7 @@ package body Make is -- If Found is False then the compilation of File failed because we -- could not find it. Records also Unit when possible. - procedure Record_Good_ALI (A : ALI_Id); + procedure Record_Good_ALI (A : ALI_Id; Project : Project_Id); -- Records in the previous set the Id of an ALI file function Must_Exit_Because_Of_Error return Boolean; @@ -2586,6 +2578,10 @@ package body Make is Project => Arguments_Project); Outstanding_Compiles := OC1; + + if Arguments_Project /= No_Project then + Queue.Set_Obj_Dir_Busy (Arguments_Project.Object_Directory.Name); + end if; end Add_Process; -------------------- @@ -2624,6 +2620,10 @@ package body Make is Data := Running_Compile (J); Project := Running_Compile (J).Project; + if Project /= No_Project then + Queue.Set_Obj_Dir_Free (Project.Object_Directory.Name); + end if; + -- If a mapping file was used by this compilation, get its -- file name for reuse by a subsequent compilation. @@ -2704,7 +2704,7 @@ package body Make is end if; else - Insert_Q (Sfile, Index => 0); + Queue.Insert (Sfile, Project => No_Project, Index => 0); Mark (Sfile, Index => 0); end if; end if; @@ -3013,6 +3013,7 @@ package body Make is ------------------------------- procedure Fill_Queue_From_ALI_Files is + ALI_P : ALI_Project; ALI : ALI_Id; Source_Index : Int; Sfile : File_Name_Type; @@ -3022,8 +3023,9 @@ package body Make is begin while Good_ALI_Present loop - ALI := Get_Next_Good_ALI; - Source_Index := Unit_Index_Of (ALIs.Table (ALI).Afile); + ALI_P := Get_Next_Good_ALI; + ALI := ALI_P.ALI; + Source_Index := Unit_Index_Of (ALIs.Table (ALI_P.ALI).Afile); -- If we are processing the library file corresponding to the -- main source file check if this source can be a main unit. @@ -3109,8 +3111,11 @@ package body Make is Debug_Msg ("Skipping internal file:", Sfile); else - Insert_Q - (Sfile, Withs.Table (K).Uname, Source_Index); + Queue.Insert + (Sfile, + ALI_P.Project, + Withs.Table (K).Uname, + Source_Index); Mark (Sfile, Source_Index); end if; end if; @@ -3156,14 +3161,14 @@ package body Make is -- Get_Next_Good_ALI -- ----------------------- - function Get_Next_Good_ALI return ALI_Id is - ALI : ALI_Id; + function Get_Next_Good_ALI return ALI_Project is + ALIP : ALI_Project; begin pragma Assert (Good_ALI_Present); - ALI := Good_ALI.Table (Good_ALI.Last); + ALIP := Good_ALI.Table (Good_ALI.Last); Good_ALI.Decrement_Last; - return ALI; + return ALIP; end Get_Next_Good_ALI; ---------------------- @@ -3217,10 +3222,10 @@ package body Make is -- Record_Good_ALI -- --------------------- - procedure Record_Good_ALI (A : ALI_Id) is + procedure Record_Good_ALI (A : ALI_Id; Project : Project_Id) is begin Good_ALI.Increment_Last; - Good_ALI.Table (Good_ALI.Last) := A; + Good_ALI.Table (Good_ALI.Last) := (A, Project); end Record_Good_ALI; ------------------------------- @@ -3256,8 +3261,10 @@ package body Make is -- The object file begin - if not Empty_Q and then Outstanding_Compiles < Max_Process then - Extract_From_Q (Source_File, Source_Unit, Source_Index); + if not Queue.Is_Virtually_Empty and then + Outstanding_Compiles < Max_Process + then + Queue.Extract (Source_File, Source_Unit, Source_Index); Osint.Full_Source_Name (Source_File, @@ -3387,7 +3394,7 @@ package body Make is -- The ALI file is up-to-date; record its Id - Record_Good_ALI (ALI); + Record_Good_ALI (ALI, Arguments_Project); -- Record the time stamp of the most recent object -- file as long as no (re)compilations are needed. @@ -3493,7 +3500,7 @@ package body Make is then Get_Name_String (Project_Of_Current_Object_Directory - .Object_Directory.Name); + .Object_Directory.Display_Name); Add_Str_To_Name_Buffer (Get_Name_String (Lib_File)); Full_Lib_File := Name_Find; @@ -3542,7 +3549,7 @@ package body Make is begin if Outstanding_Compiles = Max_Process - or else (Empty_Q + or else (Queue.Is_Virtually_Empty and then not Good_ALI_Present and then Outstanding_Compiles > 0) then @@ -3603,7 +3610,7 @@ package body Make is end if; else - Record_Good_ALI (ALI); + Record_Good_ALI (ALI, Data.Project); end if; Free (Text); @@ -3639,10 +3646,6 @@ package body Make is Good_ALI.Init; - if First_Q_Initialization then - Init_Q; - end if; - if Initialize_ALI_Data then Initialize_ALI; Initialize_ALI_Source; @@ -3662,7 +3665,7 @@ package body Make is -- compilations if -jnnn is used. if not Is_Marked (Main_Source, Main_Index) then - Insert_Q (Main_Source, Index => Main_Index); + Queue.Insert (Main_Source, Main_Project, Index => Main_Index); Mark (Main_Source, Main_Index); end if; @@ -3674,7 +3677,8 @@ package body Make is -- Keep looping until there is no more work to do (the Q is empty) -- and all the outstanding compilations have terminated. - Make_Loop : while not Empty_Q or else Outstanding_Compiles > 0 loop + Make_Loop : + while not Queue.Is_Empty or else Outstanding_Compiles > 0 loop exit Make_Loop when Must_Exit_Because_Of_Error; exit Make_Loop when Start_Compile_If_Possible (Args); @@ -3687,11 +3691,11 @@ package body Make is if Display_Compilation_Progress then Write_Str ("completed "); - Write_Int (Int (Q_Front)); + Write_Int (Int (Queue.Processed)); Write_Str (" out of "); - Write_Int (Int (Q.Last)); + Write_Int (Int (Queue.Size)); Write_Str (" ("); - Write_Int (Int ((Q_Front * 100) / (Q.Last - Q.First))); + Write_Int (Int ((Queue.Processed * 100) / Queue.Size)); Write_Str ("%)..."); Write_Eol; end if; @@ -4052,29 +4056,6 @@ package body Make is Display_Executed_Programs := Display; end Display_Commands; - ------------- - -- Empty_Q -- - ------------- - - function Empty_Q return Boolean is - begin - if Debug.Debug_Flag_P then - Write_Str (" Q := ["); - - for J in Q_Front .. Q.Last - 1 loop - Write_Str (" "); - Write_Name (Q.Table (J).File); - Write_Eol; - Write_Str (" "); - end loop; - - Write_Str ("]"); - Write_Eol; - end if; - - return Q_Front >= Q.Last; - end Empty_Q; - -------------------------- -- Enter_Into_Obsoleted -- -------------------------- @@ -4106,39 +4087,6 @@ package body Make is Obsoleted.Set (F2, True); end Enter_Into_Obsoleted; - -------------------- - -- Extract_From_Q -- - -------------------- - - procedure Extract_From_Q - (Source_File : out File_Name_Type; - Source_Unit : out Unit_Name_Type; - Source_Index : out Int) - is - File : constant File_Name_Type := Q.Table (Q_Front).File; - Unit : constant Unit_Name_Type := Q.Table (Q_Front).Unit; - Index : constant Int := Q.Table (Q_Front).Index; - - begin - if Debug.Debug_Flag_Q then - Write_Str (" Q := Q - [ "); - Write_Name (File); - - if Index /= 0 then - Write_Str (", "); - Write_Int (Index); - end if; - - Write_Str (" ]"); - Write_Eol; - end if; - - Q_Front := Q_Front + 1; - Source_File := File; - Source_Unit := Unit; - Source_Index := Index; - end Extract_From_Q; - -------------- -- Gnatmake -- -------------- @@ -4188,10 +4136,6 @@ package body Make is -- Check that the main subprograms do exist and that they all -- belong to the same project file. - procedure Create_Binder_Mapping_File - (Args : in out Argument_List; Last_Arg : in out Natural); - -- Create a binder mapping file and add the necessary switch - ----------------- -- Check_Mains -- ----------------- @@ -4334,185 +4278,6 @@ package body Make is end loop; end Check_Mains; - -------------------------------- - -- Create_Binder_Mapping_File -- - -------------------------------- - - procedure Create_Binder_Mapping_File - (Args : in out Argument_List; Last_Arg : in out Natural) - is - Mapping_FD : File_Descriptor := Invalid_FD; - -- A File Descriptor for an eventual mapping file - - ALI_Unit : Unit_Name_Type := No_Unit_Name; - -- The unit name of an ALI file - - ALI_Name : File_Name_Type := No_File; - -- The file name of the ALI file - - ALI_Project : Project_Id := No_Project; - -- The project of the ALI file - - Bytes : Integer; - OK : Boolean := True; - Unit : Unit_Index; - - Status : Boolean; - -- For call to Close - - begin - Tempdir.Create_Temp_File (Mapping_FD, Mapping_Path); - Record_Temp_File (Project_Tree, Mapping_Path); - - if Mapping_FD /= Invalid_FD then - - -- Traverse all units - - Unit := Units_Htable.Get_First (Project_Tree.Units_HT); - - while Unit /= No_Unit_Index loop - if Unit.Name /= No_Name then - - -- If there is a body, put it in the mapping - - if Unit.File_Names (Impl) /= No_Source - and then Unit.File_Names (Impl).Project /= - No_Project - then - Get_Name_String (Unit.Name); - Add_Str_To_Name_Buffer ("%b"); - ALI_Unit := Name_Find; - ALI_Name := - Lib_File_Name - (Unit.File_Names (Impl).Display_File); - ALI_Project := Unit.File_Names (Impl).Project; - - -- Otherwise, if there is a spec, put it in the mapping - - elsif Unit.File_Names (Spec) /= No_Source - and then Unit.File_Names (Spec).Project /= No_Project - then - Get_Name_String (Unit.Name); - Add_Str_To_Name_Buffer ("%s"); - ALI_Unit := Name_Find; - ALI_Name := - Lib_File_Name - (Unit.File_Names (Spec).Display_File); - ALI_Project := Unit.File_Names (Spec).Project; - - else - ALI_Name := No_File; - end if; - - -- If we have something to put in the mapping then do it - -- now. However, if the project is extended, we don't put - -- anything in the mapping file, because we don't know where - -- the ALI file is: it might be in the extended project - -- object directory as well as in the extending project - -- object directory. - - if ALI_Name /= No_File - and then ALI_Project.Extended_By = No_Project - and then ALI_Project.Extends = No_Project - then - -- First check if the ALI file exists. If it does not, - -- do not put the unit in the mapping file. - - declare - ALI : constant String := Get_Name_String (ALI_Name); - - begin - -- For library projects, use the library directory, - -- for other projects, use the object directory. - - if ALI_Project.Library then - Get_Name_String (ALI_Project.Library_Dir.Name); - else - Get_Name_String - (ALI_Project.Object_Directory.Name); - end if; - - if not - Is_Directory_Separator (Name_Buffer (Name_Len)) - then - Add_Char_To_Name_Buffer (Directory_Separator); - end if; - - Add_Str_To_Name_Buffer (ALI); - Add_Char_To_Name_Buffer (ASCII.LF); - - declare - ALI_Path_Name : constant String := - Name_Buffer (1 .. Name_Len); - - begin - if Is_Regular_File - (ALI_Path_Name (1 .. ALI_Path_Name'Last - 1)) - then - -- First line is the unit name - - Get_Name_String (ALI_Unit); - Add_Char_To_Name_Buffer (ASCII.LF); - Bytes := - Write - (Mapping_FD, - Name_Buffer (1)'Address, - Name_Len); - OK := Bytes = Name_Len; - - exit when not OK; - - -- Second line it the ALI file name - - Get_Name_String (ALI_Name); - Add_Char_To_Name_Buffer (ASCII.LF); - Bytes := - Write - (Mapping_FD, - Name_Buffer (1)'Address, - Name_Len); - OK := (Bytes = Name_Len); - - exit when not OK; - - -- Third line it the ALI path name - - Bytes := - Write - (Mapping_FD, - ALI_Path_Name (1)'Address, - ALI_Path_Name'Length); - OK := (Bytes = ALI_Path_Name'Length); - - -- If OK is False, it means we were unable to - -- write a line. No point in continuing with the - -- other units. - - exit when not OK; - end if; - end; - end; - end if; - end if; - - Unit := Units_Htable.Get_Next (Project_Tree.Units_HT); - end loop; - - Close (Mapping_FD, Status); - - OK := OK and Status; - - -- If the creation of the mapping file was successful, we add the - -- switch to the arguments of gnatbind. - - if OK then - Last_Arg := Last_Arg + 1; - Args (Last_Arg) := - new String'("-F=" & Get_Name_String (Mapping_Path)); - end if; - end if; - end Create_Binder_Mapping_File; - -- Start of processing for Gnatmake -- This body is very long, should be broken down??? @@ -4575,10 +4340,10 @@ package body Make is Add_Switch ("-n", Binder, And_Save => True); - for J in Q.First .. Q.Last - 1 loop + for J in 1 .. Queue.Size loop Add_Switch (Get_Name_String - (Lib_File_Name (Q.Table (J).File)), + (Lib_File_Name (Queue.Element (J))), Binder, And_Save => True); end loop; end if; @@ -5312,7 +5077,8 @@ package body Make is begin if not Is_Absolute_Path (Exec_File_Name) then - Get_Name_String (Main_Project.Exec_Directory.Name); + Get_Name_String + (Main_Project.Exec_Directory.Display_Name); if not Is_Directory_Separator (Name_Buffer (Name_Len)) @@ -5337,7 +5103,7 @@ package body Make is declare Dir_Path : constant String := - Get_Name_String (Main_Project.Directory.Name); + Get_Name_String (Main_Project.Directory.Display_Name); begin for J in 1 .. Binder_Switches.Last loop Test_If_Relative_Path @@ -5595,6 +5361,10 @@ package body Make is Args (J) := Gcc_Switches.Table (J); end loop; + Queue.Initialize + (Main_Project /= No_Project and then + One_Compilation_Per_Obj_Dir); + -- Now we invoke Compile_Sources for the current main Compile_Sources @@ -5619,10 +5389,6 @@ package body Make is Write_Eol; end if; - -- Make sure the queue will be reinitialized for the next round - - First_Q_Initialization := True; - Total_Compilation_Failures := Total_Compilation_Failures + Compilation_Failures; @@ -6064,7 +5830,13 @@ package body Make is -- If switch -C was specified, create a binder mapping file if Create_Mapping_File then - Create_Binder_Mapping_File (Args, Last_Arg); + Mapping_Path := Create_Binder_Mapping_File; + + if Mapping_Path /= No_Path then + Last_Arg := Last_Arg + 1; + Args (Last_Arg) := + new String'("-F=" & Get_Name_String (Mapping_Path)); + end if; end if; end if; @@ -6308,6 +6080,15 @@ package body Make is end; end if; + -- Add switch -M to gnatlink if buider switch --create-map-file + -- has been specified. + + if Map_File /= null then + Linker_Switches.Increment_Last; + Linker_Switches.Table (Linker_Switches.Last) := + new String'("-M" & Map_File.all); + end if; + declare Args : Argument_List (Linker_Switches.First .. Linker_Switches.Last + 2); @@ -6523,7 +6304,7 @@ package body Make is declare Dir_Path : constant String := Get_Name_String - (Main_Project.Directory.Name); + (Main_Project.Directory.Display_Name); begin for @@ -6688,17 +6469,6 @@ package body Make is File_Index := Data.Last_Mapping_File_Names; end Init_Mapping_File; - ------------ - -- Init_Q -- - ------------ - - procedure Init_Q is - begin - First_Q_Initialization := False; - Q_Front := Q.First; - Q.Set_Last (Q.First); - end Init_Q; - ---------------- -- Initialize -- ---------------- @@ -6725,7 +6495,7 @@ package body Make is Check_Object_Consistency := True; - -- Package initializations. The order of calls is important here + -- Package initializations (the order of calls is important here) Output.Set_Standard_Error; @@ -6734,8 +6504,6 @@ package body Make is Linker_Switches.Init; Csets.Initialize; - Namet.Initialize; - Snames.Initialize; Prj.Initialize (Project_Tree); @@ -6971,6 +6739,7 @@ package body Make is Unit : Unit_Index; Sfile : File_Name_Type; Index : Int; + Project : Project_Id; Extending : constant Boolean := The_Project.Extends /= No_Project; @@ -7012,8 +6781,9 @@ package body Make is Unit := Units_Htable.Get_First (Project_Tree.Units_HT); while Unit /= null loop - Sfile := No_File; - Index := 0; + Sfile := No_File; + Index := 0; + Project := No_Project; -- If there is a source for the body, and the body has not been -- locally removed. @@ -7024,6 +6794,7 @@ package body Make is -- And it is a source for the specified project if Check_Project (Unit.File_Names (Impl).Project) then + Project := Unit.File_Names (Impl).Project; -- If we don't have a spec, we cannot consider the source -- if it is a subunit. @@ -7046,7 +6817,7 @@ package body Make is begin Src_Ind := Sinput.P.Load_Project_File (Get_Name_String - (Unit.File_Names (Impl).Path.Name)); + (Unit.File_Names (Impl).Path.Display_Name)); -- If it is a subunit, discard it @@ -7074,38 +6845,36 @@ package body Make is Sfile := Unit.File_Names (Spec).Display_File; Index := Unit.File_Names (Spec).Index; + Project := Unit.File_Names (Spec).Project; end if; - -- If Put_In_Q is True, we insert into the Q + -- For the first source inserted into the Q, we need to initialize + -- the Q, but not for the subsequent sources. - if Put_In_Q then + Queue.Initialize + (Main_Project /= No_Project and then + One_Compilation_Per_Obj_Dir); - -- For the first source inserted into the Q, we need to initialize - -- the Q, but not for the subsequent sources. + -- And of course, only insert in the Q if the source is not marked - if First_Q_Initialization then - Init_Q; + if Sfile /= No_File and then not Is_Marked (Sfile, Index) then + if Verbose_Mode then + Write_Str ("Adding """); + Write_Str (Get_Name_String (Sfile)); + Write_Line (""" to the queue"); end if; - -- And of course, only insert in the Q if the source is not marked - - if Sfile /= No_File and then not Is_Marked (Sfile, Index) then - if Verbose_Mode then - Write_Str ("Adding """); - Write_Str (Get_Name_String (Sfile)); - Write_Line (""" to the queue"); - end if; - - Insert_Q (Sfile, Index => Index); - Mark (Sfile, Index); - end if; + Queue.Insert (Sfile, Project, Index => Index); + Mark (Sfile, Index); + end if; - elsif Sfile /= No_File then + if not Put_In_Q and then Sfile /= No_File then -- If Put_In_Q is False, we add the source as if it were specified -- on the command line, and we set Put_In_Q to True, so that the - -- following sources will be put directly in the queue. This will - -- allow parallel compilation processes if -jx switch is used. + -- following sources will only be put in the queue. The source is + -- aready in the Q, but we need at least one fake main to call + -- Compile_Sources. if Verbose_Mode then Write_Str ("Adding """); @@ -7115,49 +6884,12 @@ package body Make is Osint.Add_File (Get_Name_String (Sfile), Index); Put_In_Q := True; - - -- As we may look into the Q later, ensure the Q has been - -- initialized to avoid errors. - - if First_Q_Initialization then - Init_Q; - end if; end if; Unit := Units_Htable.Get_Next (Project_Tree.Units_HT); end loop; end Insert_Project_Sources; - -------------- - -- Insert_Q -- - -------------- - - procedure Insert_Q - (Source_File : File_Name_Type; - Source_Unit : Unit_Name_Type := No_Unit_Name; - Index : Int := 0) - is - begin - if Debug.Debug_Flag_Q then - Write_Str (" Q := Q + [ "); - Write_Name (Source_File); - - if Index /= 0 then - Write_Str (", "); - Write_Int (Index); - end if; - - Write_Str (" ] "); - Write_Eol; - end if; - - Q.Table (Q.Last) := - (File => Source_File, - Unit => Source_Unit, - Index => Index); - Q.Increment_Last; - end Insert_Q; - --------------------- -- Is_In_Obsoleted -- --------------------- @@ -7570,6 +7302,290 @@ package body Make is (Project_Node_Tree, "--RTS=" & Line (1 .. N_Read), And_Save => True); end Process_Multilib; + ----------- + -- Queue -- + ----------- + + package body Queue is + + type Q_Record is record + File : File_Name_Type; + Unit : Unit_Name_Type; + Index : Int; + Project : Project_Id; + Processed : Boolean; + end record; + -- File is the name of the file to compile. Unit is for gnatdist use in + -- order to easily get the unit name of a file to compile when its name + -- is krunched or declared in gnat.adc. Index, when not 0, is the index + -- of the unit in a multi-unit source. + + package Q is new Table.Table + (Table_Component_Type => Q_Record, + Table_Index_Type => Positive, + Table_Low_Bound => 1, + Table_Initial => 4000, + Table_Increment => 100, + Table_Name => "Make.Queue.Q"); + -- This is the actual Q + + package Busy_Obj_Dirs is new GNAT.HTable.Simple_HTable + (Header_Num => Prj.Header_Num, + Element => Boolean, + No_Element => False, + Key => Path_Name_Type, + Hash => Hash, + Equal => "="); + + Q_First : Natural := 1; + -- Points to the first valid element in the queue + + Q_Processed : Natural := 0; + One_Queue_Per_Obj_Dir : Boolean := False; + Q_Initialized : Boolean := False; + + ------------- + -- Element -- + ------------- + + function Element (Rank : Positive) return File_Name_Type is + begin + if Rank <= Q.Last then + return Q.Table (Rank).File; + else + return No_File; + end if; + end Element; + + ------------- + -- Extract -- + ------------- + + -- This body needs commenting ??? + + procedure Extract + (Source_File_Name : out File_Name_Type; + Source_Unit : out Unit_Name_Type; + Source_Index : out Int) + is + Found : Boolean := False; + + begin + if One_Queue_Per_Obj_Dir then + for J in Q_First .. Q.Last loop + if not Q.Table (J).Processed + and then (Q.Table (J).Project = No_Project + or else not + Busy_Obj_Dirs.Get + (Q.Table (J).Project.Object_Directory.Name)) + then + Found := True; + Source_File_Name := Q.Table (J).File; + Source_Unit := Q.Table (J).Unit; + Source_Index := Q.Table (J).Index; + Q.Table (J).Processed := True; + + if J = Q_First then + while Q_First <= Q.Last + and then Q.Table (Q_First).Processed + loop + Q_First := Q_First + 1; + end loop; + end if; + + exit; + end if; + end loop; + + elsif Q_First <= Q.Last then + Source_File_Name := Q.Table (Q_First).File; + Source_Unit := Q.Table (Q_First).Unit; + Source_Index := Q.Table (Q_First).Index; + Q.Table (Q_First).Processed := True; + Q_First := Q_First + 1; + Found := True; + end if; + + if Found then + Q_Processed := Q_Processed + 1; + else + Source_File_Name := No_File; + Source_Unit := No_Unit_Name; + Source_Index := 0; + end if; + + if Found and then Debug.Debug_Flag_Q then + Write_Str (" Q := Q - [ "); + Write_Name (Source_File_Name); + + if Source_Index /= 0 then + Write_Str (", "); + Write_Int (Source_Index); + end if; + + Write_Str (" ]"); + Write_Eol; + + Write_Str (" Q_First ="); + Write_Int (Int (Q_First)); + Write_Eol; + + Write_Str (" Q.Last ="); + Write_Int (Int (Q.Last)); + Write_Eol; + end if; + end Extract; + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize (Queue_Per_Obj_Dir : Boolean) is + begin + if not Q_Initialized then + One_Queue_Per_Obj_Dir := Queue_Per_Obj_Dir; + Q.Init; + Q_Initialized := True; + Q_Processed := 0; + Q_First := 1; + end if; + end Initialize; + + ------------ + -- Insert -- + ------------ + + -- This body needs commenting ??? + + procedure Insert + (Source_File_Name : File_Name_Type; + Project : Project_Id; + Source_Unit : Unit_Name_Type := No_Unit_Name; + Index : Int := 0) + is + begin + Q.Append + ((File => Source_File_Name, + Project => Project, + Unit => Source_Unit, + Index => Index, + Processed => False)); + + if Debug.Debug_Flag_Q then + Write_Str (" Q := Q + [ "); + Write_Name (Source_File_Name); + + if Index /= 0 then + Write_Str (", "); + Write_Int (Index); + end if; + + Write_Str (" ] "); + Write_Eol; + + Write_Str (" Q_First ="); + Write_Int (Int (Q_First)); + Write_Eol; + + Write_Str (" Q.Last ="); + Write_Int (Int (Q.Last)); + Write_Eol; + end if; + end Insert; + + -------------- + -- Is_Empty -- + -------------- + + function Is_Empty return Boolean is + begin + if Debug.Debug_Flag_P then + Write_Str (" Q := ["); + + for J in Q_First .. Q.Last loop + if not Q.Table (J).Processed then + Write_Str (" "); + Write_Name (Q.Table (J).File); + Write_Eol; + Write_Str (" "); + end if; + end loop; + + Write_Str ("]"); + Write_Eol; + end if; + + return Q_First > Q.Last; + end Is_Empty; + + ------------------------ + -- Is_Virtually_Empty -- + ------------------------ + + function Is_Virtually_Empty return Boolean is + begin + if One_Queue_Per_Obj_Dir then + for J in Q_First .. Q.Last loop + if not Q.Table (J).Processed + and then + (Q.Table (J).Project = No_Project + or else not + Busy_Obj_Dirs.Get + (Q.Table (J).Project.Object_Directory.Name)) + then + return False; + end if; + end loop; + + return True; + + else + return Is_Empty; + end if; + end Is_Virtually_Empty; + + --------------- + -- Processed -- + --------------- + + function Processed return Natural is + begin + return Q_Processed; + end Processed; + + ---------------------- + -- Set_Obj_Dir_Busy -- + ---------------------- + + procedure Set_Obj_Dir_Busy (Obj_Dir : Path_Name_Type) is + begin + if One_Queue_Per_Obj_Dir then + Busy_Obj_Dirs.Set (Obj_Dir, True); + end if; + end Set_Obj_Dir_Busy; + + ---------------------- + -- Set_Obj_Dir_Free -- + ---------------------- + + procedure Set_Obj_Dir_Free (Obj_Dir : Path_Name_Type) is + begin + if One_Queue_Per_Obj_Dir then + Busy_Obj_Dirs.Set (Obj_Dir, False); + end if; + end Set_Obj_Dir_Free; + + ---------- + -- Size -- + ---------- + + function Size return Natural is + begin + return Q.Last; + end Size; + + end Queue; + ----------------------------- -- Recursive_Compute_Depth -- ----------------------------- @@ -7940,6 +7956,19 @@ package body Make is Add_Switch (Argv, Compiler, And_Save => And_Save); Add_Switch (Argv, Linker, And_Save => And_Save); + elsif Argv = Create_Map_File_Switch then + Map_File := new String'(""); + + elsif Argv'Length > Create_Map_File_Switch'Length + 1 + and then + Argv (1 .. Create_Map_File_Switch'Length) = Create_Map_File_Switch + and then + Argv (Create_Map_File_Switch'Length + 1) = '=' + then + Map_File := + new String' + (Argv (Create_Map_File_Switch'Length + 2 .. Argv'Last)); + else Scan_Make_Switches (Project_Node_Tree, Argv, Success); end if; diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb index e07bebbad6b..a11f2613496 100644 --- a/gcc/ada/makeutl.adb +++ b/gcc/ada/makeutl.adb @@ -34,6 +34,7 @@ with Prj.Ext; with Prj.Util; with Snames; use Snames; with Table; +with Tempdir; with Ada.Command_Line; use Ada.Command_Line; @@ -295,6 +296,183 @@ package body Makeutl is return True; end Check_Source_Info_In_ALI; + -------------------------------- + -- Create_Binder_Mapping_File -- + -------------------------------- + + function Create_Binder_Mapping_File return Path_Name_Type is + Mapping_Path : Path_Name_Type := No_Path; + + Mapping_FD : File_Descriptor := Invalid_FD; + -- A File Descriptor for an eventual mapping file + + ALI_Unit : Unit_Name_Type := No_Unit_Name; + -- The unit name of an ALI file + + ALI_Name : File_Name_Type := No_File; + -- The file name of the ALI file + + ALI_Project : Project_Id := No_Project; + -- The project of the ALI file + + Bytes : Integer; + OK : Boolean := False; + Unit : Unit_Index; + + Status : Boolean; + -- For call to Close + + begin + Tempdir.Create_Temp_File (Mapping_FD, Mapping_Path); + Record_Temp_File (Project_Tree, Mapping_Path); + + if Mapping_FD /= Invalid_FD then + OK := True; + + -- Traverse all units + + Unit := Units_Htable.Get_First (Project_Tree.Units_HT); + while Unit /= No_Unit_Index loop + if Unit.Name /= No_Name then + + -- If there is a body, put it in the mapping + + if Unit.File_Names (Impl) /= No_Source + and then Unit.File_Names (Impl).Project /= No_Project + then + Get_Name_String (Unit.Name); + Add_Str_To_Name_Buffer ("%b"); + ALI_Unit := Name_Find; + ALI_Name := + Lib_File_Name (Unit.File_Names (Impl).Display_File); + ALI_Project := Unit.File_Names (Impl).Project; + + -- Otherwise, if there is a spec, put it in the mapping + + elsif Unit.File_Names (Spec) /= No_Source + and then Unit.File_Names (Spec).Project /= No_Project + then + Get_Name_String (Unit.Name); + Add_Str_To_Name_Buffer ("%s"); + ALI_Unit := Name_Find; + ALI_Name := + Lib_File_Name (Unit.File_Names (Spec).Display_File); + ALI_Project := Unit.File_Names (Spec).Project; + + else + ALI_Name := No_File; + end if; + + -- If we have something to put in the mapping then do it now. + -- However, if the project is extended, we don't put anything + -- in the mapping file, since we don't know where the ALI file + -- is: it might be in the extended project object directory as + -- well as in the extending project object directory. + + if ALI_Name /= No_File + and then ALI_Project.Extended_By = No_Project + and then ALI_Project.Extends = No_Project + then + -- First check if the ALI file exists. If it does not, do + -- not put the unit in the mapping file. + + declare + ALI : constant String := Get_Name_String (ALI_Name); + + begin + -- For library projects, use the library ALI directory, + -- for other projects, use the object directory. + + if ALI_Project.Library then + Get_Name_String + (ALI_Project.Library_ALI_Dir.Display_Name); + else + Get_Name_String + (ALI_Project.Object_Directory.Display_Name); + end if; + + if not + Is_Directory_Separator (Name_Buffer (Name_Len)) + then + Add_Char_To_Name_Buffer (Directory_Separator); + end if; + + Add_Str_To_Name_Buffer (ALI); + Add_Char_To_Name_Buffer (ASCII.LF); + + declare + ALI_Path_Name : constant String := + Name_Buffer (1 .. Name_Len); + + begin + if Is_Regular_File + (ALI_Path_Name (1 .. ALI_Path_Name'Last - 1)) + then + -- First line is the unit name + + Get_Name_String (ALI_Unit); + Add_Char_To_Name_Buffer (ASCII.LF); + Bytes := + Write + (Mapping_FD, + Name_Buffer (1)'Address, + Name_Len); + OK := Bytes = Name_Len; + + exit when not OK; + + -- Second line it the ALI file name + + Get_Name_String (ALI_Name); + Add_Char_To_Name_Buffer (ASCII.LF); + Bytes := + Write + (Mapping_FD, + Name_Buffer (1)'Address, + Name_Len); + OK := (Bytes = Name_Len); + + exit when not OK; + + -- Third line it the ALI path name + + Bytes := + Write + (Mapping_FD, + ALI_Path_Name (1)'Address, + ALI_Path_Name'Length); + OK := (Bytes = ALI_Path_Name'Length); + + -- If OK is False, it means we were unable to + -- write a line. No point in continuing with the + -- other units. + + exit when not OK; + end if; + end; + end; + end if; + end if; + + Unit := Units_Htable.Get_Next (Project_Tree.Units_HT); + end loop; + + Close (Mapping_FD, Status); + + OK := OK and Status; + end if; + + -- If the creation of the mapping file was successful, we add the switch + -- to the arguments of gnatbind. + + if OK then + return Mapping_Path; + + else + return No_Path; + end if; + end Create_Binder_Mapping_File; + ----------------- -- Create_Name -- ----------------- diff --git a/gcc/ada/makeutl.ads b/gcc/ada/makeutl.ads index fd286a8ebcc..bb1c91515cb 100644 --- a/gcc/ada/makeutl.ads +++ b/gcc/ada/makeutl.ads @@ -52,6 +52,14 @@ package Makeutl is -- Command line switch to allow shared library projects to import projects -- that are not shared library projects. + Single_Compile_Per_Obj_Dir_Switch : constant String := + "--single-compile-per-obj-dir"; + -- Switch to forbid simultaneous compilations for the same object directory + -- when project files are used. + + Create_Map_File_Switch : constant String := "--create-map-file"; + -- Switch to create a map file when an executable is linked + procedure Add (Option : String_Access; To : in out String_List_Access; @@ -62,6 +70,9 @@ package Makeutl is Last : in out Natural); -- Add a string to a list of strings + function Create_Binder_Mapping_File return Path_Name_Type; + -- Create a binder mapping file and returns its path name + function Create_Name (Name : String) return File_Name_Type; function Create_Name (Name : String) return Name_Id; function Create_Name (Name : String) return Path_Name_Type; diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb index 97a4c16180f..8c0d4e1b06f 100644 --- a/gcc/ada/mlib-prj.adb +++ b/gcc/ada/mlib-prj.adb @@ -1374,12 +1374,12 @@ package body MLib.Prj is (Object_Dir_Path & Directory_Separator & Filename (1 .. Last)); + Object_File : constant String := + Filename (1 .. Last); - C_Object_Path : String := Object_Path; - C_Filename : String := Filename (1 .. Last); + C_Filename : String := Object_File; begin - Canonical_Case_File_Name (C_Object_Path); Canonical_Case_File_Name (C_Filename); -- If in the object directory of an extended @@ -1390,20 +1390,17 @@ package body MLib.Prj is or else C_Filename (1 .. B_Start'Length) /= B_Start.all then - Name_Len := Last; - Name_Buffer (1 .. Name_Len) := - C_Filename (1 .. Last); + Name_Len := 0; + Add_Str_To_Name_Buffer (C_Filename); Id := Name_Find; if not Objects_Htable.Get (Id) then declare ALI_File : constant String := - Ext_To - (C_Filename - (1 .. Last), "ali"); + Ext_To (C_Filename, "ali"); ALI_Path : constant String := - Ext_To (C_Object_Path, "ali"); + Ext_To (Object_Path, "ali"); Add_It : Boolean; Fname : File_Name_Type; @@ -1801,7 +1798,7 @@ package body MLib.Prj is -- the library file and any ALI file of a source of the project. begin - Get_Name_String (For_Project.Library_Dir.Name); + Get_Name_String (For_Project.Library_Dir.Display_Name); Change_Dir (Name_Buffer (1 .. Name_Len)); exception @@ -1942,7 +1939,7 @@ package body MLib.Prj is Copy_ALI_Files (Files => Ali_Files.all, - To => For_Project.Library_ALI_Dir.Name, + To => For_Project.Library_ALI_Dir.Display_Name, Interfaces => Arguments (1 .. Argument_Number)); -- Copy interface sources if Library_Src_Dir specified @@ -1954,7 +1951,7 @@ package body MLib.Prj is -- could be a source of the project. begin - Get_Name_String (For_Project.Library_Src_Dir.Name); + Get_Name_String (For_Project.Library_Src_Dir.Display_Name); Change_Dir (Name_Buffer (1 .. Name_Len)); exception @@ -2085,7 +2082,8 @@ package body MLib.Prj is Lib_Name : constant File_Name_Type := Library_File_Name_For (For_Project, In_Tree); begin - Change_Dir (Get_Name_String (For_Project.Library_Dir.Name)); + Change_Dir + (Get_Name_String (For_Project.Library_Dir.Display_Name)); Lib_TS := File_Stamp (Lib_Name); For_Project.Library_TS := Lib_TS; end; @@ -2107,7 +2105,7 @@ package body MLib.Prj is -- be Empty_Time_Stamp, earlier than any other time stamp. Change_Dir - (Get_Name_String (For_Project.Object_Directory.Name)); + (Get_Name_String (For_Project.Object_Directory.Display_Name)); Open (Dir => Object_Dir, Dir_Name => "."); -- For all entries in the object directory @@ -2212,7 +2210,7 @@ package body MLib.Prj is begin -- Change the working directory to the object directory - Change_Dir (Get_Name_String (For_Project.Object_Directory.Name)); + Change_Dir (Get_Name_String (For_Project.Object_Directory.Display_Name)); for Index in Interfaces'Range loop diff --git a/gcc/ada/mlib-tgt.adb b/gcc/ada/mlib-tgt.adb index b07bb74d687..4d8597c1f73 100644 --- a/gcc/ada/mlib-tgt.adb +++ b/gcc/ada/mlib-tgt.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, AdaCore -- +-- Copyright (C) 2001-2010, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -343,7 +343,7 @@ package body MLib.Tgt is else declare Lib_Dir : constant String := - Get_Name_String (Project.Library_Dir.Name); + Get_Name_String (Project.Library_Dir.Display_Name); Lib_Name : constant String := Get_Name_String (Project.Library_Name); diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb index 799e48662ba..d13918cd60a 100644 --- a/gcc/ada/namet.adb +++ b/gcc/ada/namet.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -864,29 +864,7 @@ package body Namet is procedure Initialize is begin - Name_Chars.Init; - Name_Entries.Init; - - -- Initialize entries for one character names - - for C in Character loop - Name_Entries.Append - ((Name_Chars_Index => Name_Chars.Last, - Name_Len => 1, - Byte_Info => 0, - Int_Info => 0, - Name_Has_No_Encodings => True, - Hash_Link => No_Name)); - - Name_Chars.Append (C); - Name_Chars.Append (ASCII.NUL); - end loop; - - -- Clear hash table - - for J in Hash_Index_Type loop - Hash_Table (J) := No_Name; - end loop; + null; end Initialize; ---------------------- @@ -1133,6 +1111,37 @@ package body Namet is end if; end Name_Find; + ------------------ + -- Reinitialize -- + ------------------ + + procedure Reinitialize is + begin + Name_Chars.Init; + Name_Entries.Init; + + -- Initialize entries for one character names + + for C in Character loop + Name_Entries.Append + ((Name_Chars_Index => Name_Chars.Last, + Name_Len => 1, + Byte_Info => 0, + Int_Info => 0, + Name_Has_No_Encodings => True, + Hash_Link => No_Name)); + + Name_Chars.Append (C); + Name_Chars.Append (ASCII.NUL); + end loop; + + -- Clear hash table + + for J in Hash_Index_Type loop + Hash_Table (J) := No_Name; + end loop; + end Reinitialize; + ---------------------- -- Reset_Name_Table -- ---------------------- @@ -1399,4 +1408,8 @@ package body Namet is end if; end Write_Name_Decoded; +-- Package initialization, initialize tables + +begin + Reinitialize; end Namet; diff --git a/gcc/ada/namet.ads b/gcc/ada/namet.ads index f3383b168af..729fec1a5fa 100644 --- a/gcc/ada/namet.ads +++ b/gcc/ada/namet.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -239,14 +239,20 @@ package Namet is -- is, it starts with an upper case O). procedure Initialize; - -- Initializes the names table, including initializing the first 26 - -- entries in the table (for the 1-character lower case names a-z) Note - -- that Initialize must not be called if Tree_Read is used. + -- This is a dummy procedure. It is retained for easy compatibility with + -- clients who used to call Initialize when this call was required. Now + -- initialization is performed automatically during package elaboration. + -- Note that this change fixes problems which existed prior to the change + -- of Initialize being called more than once. See also Reinitialize which + -- allows reinitialiation of the tables. procedure Lock; -- Lock name tables before calling back end. We reserve some extra space -- before locking to avoid unnecessary inefficiencies when we unlock. + procedure Reinitialize; + -- Clears the name tables and removes all existing entries from the table. + procedure Unlock; -- Unlocks the name table to allow use of the extra space reserved by the -- call to Lock. See gnat1drv for details of the need for this. diff --git a/gcc/ada/nlists.adb b/gcc/ada/nlists.adb index fe4d27c24c4..453e665eccc 100644 --- a/gcc/ada/nlists.adb +++ b/gcc/ada/nlists.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -52,10 +52,10 @@ package body Nlists is -- three fields: type List_Header is record - First : Node_Id; + First : Node_Or_Entity_Id; -- Pointer to first node in list. Empty if list is empty - Last : Node_Id; + Last : Node_Or_Entity_Id; -- Pointer to last node in list. Empty if list is empty Parent : Node_Id; @@ -85,16 +85,16 @@ package body Nlists is -- list and Prev_Node is Empty at the start of a list. package Next_Node is new Table.Table ( - Table_Component_Type => Node_Id, - Table_Index_Type => Node_Id'Base, + Table_Component_Type => Node_Or_Entity_Id, + Table_Index_Type => Node_Or_Entity_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Orig_Nodes_Initial, Table_Increment => Alloc.Orig_Nodes_Increment, Table_Name => "Next_Node"); package Prev_Node is new Table.Table ( - Table_Component_Type => Node_Id, - Table_Index_Type => Node_Id'Base, + Table_Component_Type => Node_Or_Entity_Id, + Table_Index_Type => Node_Or_Entity_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Orig_Nodes_Initial, Table_Increment => Alloc.Orig_Nodes_Increment, @@ -104,23 +104,23 @@ package body Nlists is -- Local Subprograms -- ----------------------- - procedure Set_First (List : List_Id; To : Node_Id); + procedure Set_First (List : List_Id; To : Node_Or_Entity_Id); pragma Inline (Set_First); -- Sets First field of list header List to reference To - procedure Set_Last (List : List_Id; To : Node_Id); + procedure Set_Last (List : List_Id; To : Node_Or_Entity_Id); pragma Inline (Set_Last); -- Sets Last field of list header List to reference To - procedure Set_List_Link (Node : Node_Id; To : List_Id); + procedure Set_List_Link (Node : Node_Or_Entity_Id; To : List_Id); pragma Inline (Set_List_Link); -- Sets list link of Node to list header To - procedure Set_Next (Node : Node_Id; To : Node_Id); + procedure Set_Next (Node : Node_Or_Entity_Id; To : Node_Or_Entity_Id); pragma Inline (Set_Next); -- Sets the Next_Node pointer for Node to reference To - procedure Set_Prev (Node : Node_Id; To : Node_Id); + procedure Set_Prev (Node : Node_Or_Entity_Id; To : Node_Or_Entity_Id); pragma Inline (Set_Prev); -- Sets the Prev_Node pointer for Node to reference To @@ -128,8 +128,8 @@ package body Nlists is -- Allocate_List_Tables -- -------------------------- - procedure Allocate_List_Tables (N : Node_Id) is - Old_Last : constant Node_Id'Base := Next_Node.Last; + procedure Allocate_List_Tables (N : Node_Or_Entity_Id) is + Old_Last : constant Node_Or_Entity_Id'Base := Next_Node.Last; begin pragma Assert (N >= Old_Last); @@ -149,8 +149,8 @@ package body Nlists is -- Append -- ------------ - procedure Append (Node : Node_Id; To : List_Id) is - L : constant Node_Id := Last (To); + procedure Append (Node : Node_Or_Entity_Id; To : List_Id) is + L : constant Node_Or_Entity_Id := Last (To); procedure Append_Debug; pragma Inline (Append_Debug); @@ -230,9 +230,9 @@ package body Nlists is else declare - L : constant Node_Id := Last (To); - F : constant Node_Id := First (List); - N : Node_Id; + L : constant Node_Or_Entity_Id := Last (To); + F : constant Node_Or_Entity_Id := First (List); + N : Node_Or_Entity_Id; begin pragma Debug (Append_List_Debug); @@ -272,7 +272,7 @@ package body Nlists is -- Append_To -- --------------- - procedure Append_To (To : List_Id; Node : Node_Id) is + procedure Append_To (To : List_Id; Node : Node_Or_Entity_Id) is begin Append (Node, To); end Append_To; @@ -281,7 +281,7 @@ package body Nlists is -- First -- ----------- - function First (List : List_Id) return Node_Id is + function First (List : List_Id) return Node_Or_Entity_Id is begin if List = No_List then return Empty; @@ -295,8 +295,8 @@ package body Nlists is -- First_Non_Pragma -- ---------------------- - function First_Non_Pragma (List : List_Id) return Node_Id is - N : constant Node_Id := First (List); + function First_Non_Pragma (List : List_Id) return Node_Or_Entity_Id is + N : constant Node_Or_Entity_Id := First (List); begin if Nkind (N) /= N_Pragma and then @@ -329,11 +329,22 @@ package body Nlists is end Initialize; ------------------ - -- Insert_After -- + -- In_Same_List -- ------------------ - procedure Insert_After (After : Node_Id; Node : Node_Id) is + function In_Same_List (N1, N2 : Node_Or_Entity_Id) return Boolean is + begin + return List_Containing (N1) = List_Containing (N2); + end In_Same_List; + ------------------ + -- Insert_After -- + ------------------ + + procedure Insert_After + (After : Node_Or_Entity_Id; + Node : Node_Or_Entity_Id) + is procedure Insert_After_Debug; pragma Inline (Insert_After_Debug); -- Output debug information if Debug_Flag_N set @@ -366,8 +377,8 @@ package body Nlists is pragma Debug (Insert_After_Debug); declare - Before : constant Node_Id := Next (After); - LC : constant List_Id := List_Containing (After); + Before : constant Node_Or_Entity_Id := Next (After); + LC : constant List_Id := List_Containing (After); begin if Present (Before) then @@ -390,8 +401,10 @@ package body Nlists is -- Insert_Before -- ------------------- - procedure Insert_Before (Before : Node_Id; Node : Node_Id) is - + procedure Insert_Before + (Before : Node_Or_Entity_Id; + Node : Node_Or_Entity_Id) + is procedure Insert_Before_Debug; pragma Inline (Insert_Before_Debug); -- Output debug information if Debug_Flag_N set @@ -424,8 +437,8 @@ package body Nlists is pragma Debug (Insert_Before_Debug); declare - After : constant Node_Id := Prev (Before); - LC : constant List_Id := List_Containing (Before); + After : constant Node_Or_Entity_Id := Prev (Before); + LC : constant List_Id := List_Containing (Before); begin if Present (After) then @@ -448,7 +461,7 @@ package body Nlists is -- Insert_List_After -- ----------------------- - procedure Insert_List_After (After : Node_Id; List : List_Id) is + procedure Insert_List_After (After : Node_Or_Entity_Id; List : List_Id) is procedure Insert_List_After_Debug; pragma Inline (Insert_List_After_Debug); @@ -479,11 +492,11 @@ package body Nlists is else declare - Before : constant Node_Id := Next (After); - LC : constant List_Id := List_Containing (After); - F : constant Node_Id := First (List); - L : constant Node_Id := Last (List); - N : Node_Id; + Before : constant Node_Or_Entity_Id := Next (After); + LC : constant List_Id := List_Containing (After); + F : constant Node_Or_Entity_Id := First (List); + L : constant Node_Or_Entity_Id := Last (List); + N : Node_Or_Entity_Id; begin pragma Debug (Insert_List_After_Debug); @@ -515,7 +528,7 @@ package body Nlists is -- Insert_List_Before -- ------------------------ - procedure Insert_List_Before (Before : Node_Id; List : List_Id) is + procedure Insert_List_Before (Before : Node_Or_Entity_Id; List : List_Id) is procedure Insert_List_Before_Debug; pragma Inline (Insert_List_Before_Debug); @@ -546,11 +559,11 @@ package body Nlists is else declare - After : constant Node_Id := Prev (Before); - LC : constant List_Id := List_Containing (Before); - F : constant Node_Id := First (List); - L : constant Node_Id := Last (List); - N : Node_Id; + After : constant Node_Or_Entity_Id := Prev (Before); + LC : constant List_Id := List_Containing (Before); + F : constant Node_Or_Entity_Id := First (List); + L : constant Node_Or_Entity_Id := Last (List); + N : Node_Or_Entity_Id; begin pragma Debug (Insert_List_Before_Debug); @@ -591,7 +604,7 @@ package body Nlists is -- Is_List_Member -- -------------------- - function Is_List_Member (Node : Node_Id) return Boolean is + function Is_List_Member (Node : Node_Or_Entity_Id) return Boolean is begin return Nodes.Table (Node).In_List; end Is_List_Member; @@ -609,7 +622,7 @@ package body Nlists is -- Last -- ---------- - function Last (List : List_Id) return Node_Id is + function Last (List : List_Id) return Node_Or_Entity_Id is begin pragma Assert (List <= Lists.Last); return Lists.Table (List).Last; @@ -628,8 +641,8 @@ package body Nlists is -- Last_Non_Pragma -- --------------------- - function Last_Non_Pragma (List : List_Id) return Node_Id is - N : constant Node_Id := Last (List); + function Last_Non_Pragma (List : List_Id) return Node_Or_Entity_Id is + N : constant Node_Or_Entity_Id := Last (List); begin if Nkind (N) /= N_Pragma then return N; @@ -642,7 +655,7 @@ package body Nlists is -- List_Containing -- --------------------- - function List_Containing (Node : Node_Id) return List_Id is + function List_Containing (Node : Node_Or_Entity_Id) return List_Id is begin pragma Assert (Is_List_Member (Node)); return List_Id (Nodes.Table (Node).Link); @@ -654,7 +667,7 @@ package body Nlists is function List_Length (List : List_Id) return Nat is Result : Nat; - Node : Node_Id; + Node : Node_Or_Entity_Id; begin Result := 0; @@ -698,7 +711,7 @@ package body Nlists is function New_Copy_List (List : List_Id) return List_Id is NL : List_Id; - E : Node_Id; + E : Node_Or_Entity_Id; begin if List = No_List then @@ -723,7 +736,7 @@ package body Nlists is function New_Copy_List_Original (List : List_Id) return List_Id is NL : List_Id; - E : Node_Id; + E : Node_Or_Entity_Id; begin if List = No_List then @@ -790,7 +803,7 @@ package body Nlists is -- list directly, rather than first building an empty list and then doing -- the insertion, which results in some unnecessary work. - function New_List (Node : Node_Id) return List_Id is + function New_List (Node : Node_Or_Entity_Id) return List_Id is procedure New_List_Debug; pragma Inline (New_List_Debug); @@ -838,14 +851,21 @@ package body Nlists is end if; end New_List; - function New_List (Node1, Node2 : Node_Id) return List_Id is + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id) return List_Id + is L : constant List_Id := New_List (Node1); begin Append (Node2, L); return L; end New_List; - function New_List (Node1, Node2, Node3 : Node_Id) return List_Id is + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id) return List_Id + is L : constant List_Id := New_List (Node1); begin Append (Node2, L); @@ -853,7 +873,12 @@ package body Nlists is return L; end New_List; - function New_List (Node1, Node2, Node3, Node4 : Node_Id) return List_Id is + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id) return List_Id + is L : constant List_Id := New_List (Node1); begin Append (Node2, L); @@ -863,11 +888,11 @@ package body Nlists is end New_List; function New_List - (Node1 : Node_Id; - Node2 : Node_Id; - Node3 : Node_Id; - Node4 : Node_Id; - Node5 : Node_Id) return List_Id + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id; + Node5 : Node_Or_Entity_Id) return List_Id is L : constant List_Id := New_List (Node1); begin @@ -879,12 +904,12 @@ package body Nlists is end New_List; function New_List - (Node1 : Node_Id; - Node2 : Node_Id; - Node3 : Node_Id; - Node4 : Node_Id; - Node5 : Node_Id; - Node6 : Node_Id) return List_Id + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id; + Node5 : Node_Or_Entity_Id; + Node6 : Node_Or_Entity_Id) return List_Id is L : constant List_Id := New_List (Node1); begin @@ -900,13 +925,13 @@ package body Nlists is -- Next -- ---------- - function Next (Node : Node_Id) return Node_Id is + function Next (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id is begin pragma Assert (Is_List_Member (Node)); return Next_Node.Table (Node); end Next; - procedure Next (Node : in out Node_Id) is + procedure Next (Node : in out Node_Or_Entity_Id) is begin Node := Next (Node); end Next; @@ -924,22 +949,22 @@ package body Nlists is -- Next_Non_Pragma -- --------------------- - function Next_Non_Pragma (Node : Node_Id) return Node_Id is - N : Node_Id; + function Next_Non_Pragma + (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id + is + N : Node_Or_Entity_Id; begin N := Node; loop N := Next (N); - exit when Nkind (N) /= N_Pragma - and then - Nkind (N) /= N_Null_Statement; + exit when not Nkind_In (N, N_Pragma, N_Null_Statement); end loop; return N; end Next_Non_Pragma; - procedure Next_Non_Pragma (Node : in out Node_Id) is + procedure Next_Non_Pragma (Node : in out Node_Or_Entity_Id) is begin Node := Next_Non_Pragma (Node); end Next_Non_Pragma; @@ -966,10 +991,10 @@ package body Nlists is -- p -- ------- - function p (U : Union_Id) return Node_Id is + function p (U : Union_Id) return Node_Or_Entity_Id is begin if U in Node_Range then - return Parent (Node_Id (U)); + return Parent (Node_Or_Entity_Id (U)); elsif U in List_Range then return Parent (List_Id (U)); else @@ -981,7 +1006,7 @@ package body Nlists is -- Parent -- ------------ - function Parent (List : List_Id) return Node_Id is + function Parent (List : List_Id) return Node_Or_Entity_Id is begin pragma Assert (List <= Lists.Last); return Lists.Table (List).Parent; @@ -991,8 +1016,8 @@ package body Nlists is -- Pick -- ---------- - function Pick (List : List_Id; Index : Pos) return Node_Id is - Elmt : Node_Id; + function Pick (List : List_Id; Index : Pos) return Node_Or_Entity_Id is + Elmt : Node_Or_Entity_Id; begin Elmt := First (List); @@ -1007,8 +1032,8 @@ package body Nlists is -- Prepend -- ------------- - procedure Prepend (Node : Node_Id; To : List_Id) is - F : constant Node_Id := First (To); + procedure Prepend (Node : Node_Or_Entity_Id; To : List_Id) is + F : constant Node_Or_Entity_Id := First (To); procedure Prepend_Debug; pragma Inline (Prepend_Debug); @@ -1088,9 +1113,9 @@ package body Nlists is else declare - F : constant Node_Id := First (To); - L : constant Node_Id := Last (List); - N : Node_Id; + F : constant Node_Or_Entity_Id := First (To); + L : constant Node_Or_Entity_Id := Last (List); + N : Node_Or_Entity_Id; begin pragma Debug (Prepend_List_Debug); @@ -1130,7 +1155,7 @@ package body Nlists is -- Prepend_To -- ---------------- - procedure Prepend_To (To : List_Id; Node : Node_Id) is + procedure Prepend_To (To : List_Id; Node : Node_Or_Entity_Id) is begin Prepend (Node, To); end Prepend_To; @@ -1148,13 +1173,13 @@ package body Nlists is -- Prev -- ---------- - function Prev (Node : Node_Id) return Node_Id is + function Prev (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id is begin pragma Assert (Is_List_Member (Node)); return Prev_Node.Table (Node); end Prev; - procedure Prev (Node : in out Node_Id) is + procedure Prev (Node : in out Node_Or_Entity_Id) is begin Node := Prev (Node); end Prev; @@ -1172,8 +1197,10 @@ package body Nlists is -- Prev_Non_Pragma -- --------------------- - function Prev_Non_Pragma (Node : Node_Id) return Node_Id is - N : Node_Id; + function Prev_Non_Pragma + (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id + is + N : Node_Or_Entity_Id; begin N := Node; @@ -1185,7 +1212,7 @@ package body Nlists is return N; end Prev_Non_Pragma; - procedure Prev_Non_Pragma (Node : in out Node_Id) is + procedure Prev_Non_Pragma (Node : in out Node_Or_Entity_Id) is begin Node := Prev_Non_Pragma (Node); end Prev_Non_Pragma; @@ -1194,10 +1221,10 @@ package body Nlists is -- Remove -- ------------ - procedure Remove (Node : Node_Id) is - Lst : constant List_Id := List_Containing (Node); - Prv : constant Node_Id := Prev (Node); - Nxt : constant Node_Id := Next (Node); + procedure Remove (Node : Node_Or_Entity_Id) is + Lst : constant List_Id := List_Containing (Node); + Prv : constant Node_Or_Entity_Id := Prev (Node); + Nxt : constant Node_Or_Entity_Id := Next (Node); procedure Remove_Debug; pragma Inline (Remove_Debug); @@ -1241,8 +1268,8 @@ package body Nlists is -- Remove_Head -- ----------------- - function Remove_Head (List : List_Id) return Node_Id is - Frst : constant Node_Id := First (List); + function Remove_Head (List : List_Id) return Node_Or_Entity_Id is + Frst : constant Node_Or_Entity_Id := First (List); procedure Remove_Head_Debug; pragma Inline (Remove_Head_Debug); @@ -1271,7 +1298,7 @@ package body Nlists is else declare - Nxt : constant Node_Id := Next (Frst); + Nxt : constant Node_Or_Entity_Id := Next (Frst); begin Set_First (List, Nxt); @@ -1293,8 +1320,10 @@ package body Nlists is -- Remove_Next -- ----------------- - function Remove_Next (Node : Node_Id) return Node_Id is - Nxt : constant Node_Id := Next (Node); + function Remove_Next + (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id + is + Nxt : constant Node_Or_Entity_Id := Next (Node); procedure Remove_Next_Debug; pragma Inline (Remove_Next_Debug); @@ -1318,8 +1347,8 @@ package body Nlists is begin if Present (Nxt) then declare - Nxt2 : constant Node_Id := Next (Nxt); - LC : constant List_Id := List_Containing (Node); + Nxt2 : constant Node_Or_Entity_Id := Next (Nxt); + LC : constant List_Id := List_Containing (Node); begin pragma Debug (Remove_Next_Debug); @@ -1343,7 +1372,7 @@ package body Nlists is -- Set_First -- --------------- - procedure Set_First (List : List_Id; To : Node_Id) is + procedure Set_First (List : List_Id; To : Node_Or_Entity_Id) is begin Lists.Table (List).First := To; end Set_First; @@ -1352,7 +1381,7 @@ package body Nlists is -- Set_Last -- -------------- - procedure Set_Last (List : List_Id; To : Node_Id) is + procedure Set_Last (List : List_Id; To : Node_Or_Entity_Id) is begin Lists.Table (List).Last := To; end Set_Last; @@ -1361,7 +1390,7 @@ package body Nlists is -- Set_List_Link -- ------------------- - procedure Set_List_Link (Node : Node_Id; To : List_Id) is + procedure Set_List_Link (Node : Node_Or_Entity_Id; To : List_Id) is begin Nodes.Table (Node).Link := Union_Id (To); end Set_List_Link; @@ -1370,7 +1399,7 @@ package body Nlists is -- Set_Next -- -------------- - procedure Set_Next (Node : Node_Id; To : Node_Id) is + procedure Set_Next (Node : Node_Or_Entity_Id; To : Node_Or_Entity_Id) is begin Next_Node.Table (Node) := To; end Set_Next; @@ -1379,7 +1408,7 @@ package body Nlists is -- Set_Parent -- ---------------- - procedure Set_Parent (List : List_Id; Node : Node_Id) is + procedure Set_Parent (List : List_Id; Node : Node_Or_Entity_Id) is begin pragma Assert (List <= Lists.Last); Lists.Table (List).Parent := Node; @@ -1389,7 +1418,7 @@ package body Nlists is -- Set_Prev -- -------------- - procedure Set_Prev (Node : Node_Id; To : Node_Id) is + procedure Set_Prev (Node : Node_Or_Entity_Id; To : Node_Or_Entity_Id) is begin Prev_Node.Table (Node) := To; end Set_Prev; diff --git a/gcc/ada/nlists.ads b/gcc/ada/nlists.ads index cecf3a21db4..10c04ed9021 100644 --- a/gcc/ada/nlists.ads +++ b/gcc/ada/nlists.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -49,6 +49,10 @@ package Nlists is -- Note: node lists can contain either nodes or entities (extended nodes) -- or a mixture of nodes and extended nodes. + function In_Same_List (N1, N2 : Node_Or_Entity_Id) return Boolean; + pragma Inline (In_Same_List); + -- Equivalent to List_Containing (N1) = List_Containing (N2) + function Last_List_Id return List_Id; pragma Inline (Last_List_Id); -- Returns Id of last allocated list header @@ -70,33 +74,42 @@ package Nlists is -- Used in contexts where an empty list (as opposed to an initially empty -- list to be filled in) is required. - function New_List (Node : Node_Id) return List_Id; + function New_List + (Node : Node_Or_Entity_Id) return List_Id; -- Build a new list initially containing the given node - function New_List (Node1, Node2 : Node_Id) return List_Id; + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id) return List_Id; -- Build a new list initially containing the two given nodes - function New_List (Node1, Node2, Node3 : Node_Id) return List_Id; + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id) return List_Id; -- Build a new list initially containing the three given nodes - function New_List (Node1, Node2, Node3, Node4 : Node_Id) return List_Id; - -- Build a new list initially containing the four given nodes + function New_List + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id) return List_Id; function New_List - (Node1 : Node_Id; - Node2 : Node_Id; - Node3 : Node_Id; - Node4 : Node_Id; - Node5 : Node_Id) return List_Id; + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id; + Node5 : Node_Or_Entity_Id) return List_Id; -- Build a new list initially containing the five given nodes function New_List - (Node1 : Node_Id; - Node2 : Node_Id; - Node3 : Node_Id; - Node4 : Node_Id; - Node5 : Node_Id; - Node6 : Node_Id) return List_Id; + (Node1 : Node_Or_Entity_Id; + Node2 : Node_Or_Entity_Id; + Node3 : Node_Or_Entity_Id; + Node4 : Node_Or_Entity_Id; + Node5 : Node_Or_Entity_Id; + Node6 : Node_Or_Entity_Id) return List_Id; -- Build a new list initially containing the six given nodes function New_Copy_List (List : List_Id) return List_Id; @@ -108,12 +121,12 @@ package Nlists is function New_Copy_List_Original (List : List_Id) return List_Id; -- Same as New_Copy_List but copies only nodes coming from source - function First (List : List_Id) return Node_Id; + function First (List : List_Id) return Node_Or_Entity_Id; pragma Inline (First); -- Obtains the first element of the given node list or, if the node list -- has no items or is equal to No_List, then Empty is returned. - function First_Non_Pragma (List : List_Id) return Node_Id; + function First_Non_Pragma (List : List_Id) return Node_Or_Entity_Id; -- Used when dealing with a list that can contain pragmas to skip past -- any initial pragmas and return the first element that is not a pragma. -- If the list is empty, or if it contains only pragmas, then Empty is @@ -122,14 +135,14 @@ package Nlists is -- This function also skips N_Null nodes which can result from rewriting -- unrecognized or incorrect pragmas. - function Last (List : List_Id) return Node_Id; + function Last (List : List_Id) return Node_Or_Entity_Id; pragma Inline (Last); -- Obtains the last element of the given node list or, if the node list -- has no items, then Empty is returned. It is an error to call Last with -- a Node_Id or No_List. (No_List is not considered to be the same as an -- empty node list). - function Last_Non_Pragma (List : List_Id) return Node_Id; + function Last_Non_Pragma (List : List_Id) return Node_Or_Entity_Id; -- Obtains the last element of a given node list that is not a pragma. -- If the list is empty, or if it contains only pragmas, then Empty is -- returned. It is an error to call Last_Non_Pragma with a Node_Id or @@ -141,42 +154,44 @@ package Nlists is -- this function with No_List (No_List is not considered to be the same -- as an empty list). - function Next (Node : Node_Id) return Node_Id; + function Next (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id; pragma Inline (Next); -- This function returns the next node on a node list, or Empty if Node is -- the last element of the node list. The argument must be a member of a -- node list. - procedure Next (Node : in out Node_Id); + procedure Next (Node : in out Node_Or_Entity_Id); pragma Inline (Next); -- Equivalent to Node := Next (Node); - function Next_Non_Pragma (Node : Node_Id) return Node_Id; + function Next_Non_Pragma + (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id; -- This function returns the next node on a node list, skipping past any -- pragmas, or Empty if there is no non-pragma entry left. The argument -- must be a member of a node list. This function also skips N_Null nodes -- which can result from rewriting unrecognized or incorrect pragmas. - procedure Next_Non_Pragma (Node : in out Node_Id); + procedure Next_Non_Pragma (Node : in out Node_Or_Entity_Id); pragma Inline (Next_Non_Pragma); -- Equivalent to Node := Next_Non_Pragma (Node); - function Prev (Node : Node_Id) return Node_Id; + function Prev (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id; pragma Inline (Prev); -- This function returns the previous node on a node list, or Empty -- if Node is the first element of the node list. The argument must be -- a member of a node list. Note: the implementation does maintain back -- pointers, so this function executes quickly in constant time. - function Pick (List : List_Id; Index : Pos) return Node_Id; + function Pick (List : List_Id; Index : Pos) return Node_Or_Entity_Id; -- Given a list, picks out the Index'th entry (1 = first entry). The -- caller must ensure that Index is in range. - procedure Prev (Node : in out Node_Id); + procedure Prev (Node : in out Node_Or_Entity_Id); pragma Inline (Prev); -- Equivalent to Node := Prev (Node); - function Prev_Non_Pragma (Node : Node_Id) return Node_Id; + function Prev_Non_Pragma + (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id; pragma Inline (Prev_Non_Pragma); -- This function returns the previous node on a node list, skipping any -- pragmas. If Node is the first element of the list, or if the only @@ -185,7 +200,7 @@ package Nlists is -- does maintain back pointers, so this function executes quickly in -- constant time. - procedure Prev_Non_Pragma (Node : in out Node_Id); + procedure Prev_Non_Pragma (Node : in out Node_Or_Entity_Id); pragma Inline (Prev_Non_Pragma); -- Equivalent to Node := Prev_Non_Pragma (Node); @@ -199,23 +214,23 @@ package Nlists is -- This function determines if a given list id references a node list that -- contains at least one item. No_List as an argument returns False. - function Is_List_Member (Node : Node_Id) return Boolean; + function Is_List_Member (Node : Node_Or_Entity_Id) return Boolean; pragma Inline (Is_List_Member); -- This function determines if a given node is a member of a node list. -- It is an error for Node to be Empty, or to be a node list. - function List_Containing (Node : Node_Id) return List_Id; + function List_Containing (Node : Node_Or_Entity_Id) return List_Id; pragma Inline (List_Containing); -- This function provides a pointer to the node list containing Node. -- Node must be a member of a node list. - procedure Append (Node : Node_Id; To : List_Id); + procedure Append (Node : Node_Or_Entity_Id; To : List_Id); -- Appends Node at the end of node list To. Node must be a non-empty node -- that is not already a member of a node list, and To must be a -- node list. An attempt to append an error node is ignored without -- complaint and the list is unchanged. - procedure Append_To (To : List_Id; Node : Node_Id); + procedure Append_To (To : List_Id; Node : Node_Or_Entity_Id); pragma Inline (Append_To); -- Like Append, but arguments are the other way round @@ -227,56 +242,72 @@ package Nlists is pragma Inline (Append_List_To); -- Like Append_List, but arguments are the other way round - procedure Insert_After (After : Node_Id; Node : Node_Id); + procedure Insert_After + (After : Node_Or_Entity_Id; + Node : Node_Or_Entity_Id); -- Insert Node, which must be a non-empty node that is not already a -- member of a node list, immediately past node After, which must be a -- node that is currently a member of a node list. An attempt to insert -- an error node is ignored without complaint (and the list is unchanged). - procedure Insert_List_After (After : Node_Id; List : List_Id); + procedure Insert_List_After + (After : Node_Or_Entity_Id; + List : List_Id); -- Inserts the entire contents of node list List immediately after node -- After, which must be a member of a node list. On return, the node list -- List is reset to be the empty node list. - procedure Insert_Before (Before : Node_Id; Node : Node_Id); + procedure Insert_Before + (Before : Node_Or_Entity_Id; + Node : Node_Or_Entity_Id); -- Insert Node, which must be a non-empty node that is not already a -- member of a node list, immediately before Before, which must be a node -- that is currently a member of a node list. An attempt to insert an -- error node is ignored without complaint (and the list is unchanged). - procedure Insert_List_Before (Before : Node_Id; List : List_Id); + procedure Insert_List_Before + (Before : Node_Or_Entity_Id; + List : List_Id); -- Inserts the entire contents of node list List immediately before node -- Before, which must be a member of a node list. On return, the node list -- List is reset to be the empty node list. - procedure Prepend (Node : Node_Id; To : List_Id); + procedure Prepend + (Node : Node_Or_Entity_Id; + To : List_Id); -- Prepends Node at the start of node list To. Node must be a non-empty -- node that is not already a member of a node list, and To must be a -- node list. An attempt to prepend an error node is ignored without -- complaint and the list is unchanged. - procedure Prepend_To (To : List_Id; Node : Node_Id); + procedure Prepend_To + (To : List_Id; + Node : Node_Or_Entity_Id); pragma Inline (Prepend_To); -- Like Prepend, but arguments are the other way round - procedure Prepend_List (List : List_Id; To : List_Id); + procedure Prepend_List + (List : List_Id; + To : List_Id); -- Prepends node list List to the start of node list To. On return, -- List is reset to be empty. - procedure Prepend_List_To (To : List_Id; List : List_Id); + procedure Prepend_List_To + (To : List_Id; + List : List_Id); pragma Inline (Prepend_List_To); -- Like Prepend_List, but arguments are the other way round - procedure Remove (Node : Node_Id); + procedure Remove (Node : Node_Or_Entity_Id); -- Removes Node, which must be a node that is a member of a node list, -- from this node list. The contents of Node are not otherwise affected. - function Remove_Head (List : List_Id) return Node_Id; + function Remove_Head (List : List_Id) return Node_Or_Entity_Id; -- Removes the head element of a node list, and returns the node (whose -- contents are not otherwise affected) as the result. If the node list -- is empty, then Empty is returned. - function Remove_Next (Node : Node_Id) return Node_Id; + function Remove_Next (Node : Node_Or_Entity_Id) return Node_Or_Entity_Id; -- Removes the item immediately following the given node, and returns it -- as the result. If Node is the last element of the list, then Empty is -- returned. Node must be a member of a list. Unlike Remove, Remove_Next @@ -302,13 +333,13 @@ package Nlists is -- Writes out internal tables to current tree file using the relevant -- Table.Tree_Write routines. - function Parent (List : List_Id) return Node_Id; + function Parent (List : List_Id) return Node_Or_Entity_Id; pragma Inline (Parent); -- Node lists may have a parent in the same way as a node. The function -- accesses the Parent value, which is either Empty when a list header -- is first created, or the value that has been set by Set_Parent. - procedure Set_Parent (List : List_Id; Node : Node_Id); + procedure Set_Parent (List : List_Id; Node : Node_Or_Entity_Id); pragma Inline (Set_Parent); -- Sets the parent field of the given list to reference the given node @@ -322,7 +353,7 @@ package Nlists is -- Tests given Id for inequality with No_List. This allows notations like -- "if Present (Statements)" as opposed to "if Statements /= No_List". - procedure Allocate_List_Tables (N : Node_Id); + procedure Allocate_List_Tables (N : Node_Or_Entity_Id); -- Called when nodes table is expanded to include node N. This call -- makes sure that list structures internal to Nlists are adjusted -- appropriately to reflect this increase in the size of the nodes table. @@ -332,7 +363,7 @@ package Nlists is -- These functions return the addresses of the Next_Node and Prev_Node -- tables (used in Back_End for Gigi). - function p (U : Union_Id) return Node_Id; + function p (U : Union_Id) return Node_Or_Entity_Id; -- This function is intended for use from the debugger, it determines -- whether U is a Node_Id or List_Id, and calls the appropriate Parent -- function and returns the parent Node in either case. This is shorter diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb index 65c5726b901..445349ac8c1 100644 --- a/gcc/ada/opt.adb +++ b/gcc/ada/opt.adb @@ -61,6 +61,7 @@ package body Opt is Optimize_Alignment_Config := Optimize_Alignment; Persistent_BSS_Mode_Config := Persistent_BSS_Mode; Polling_Required_Config := Polling_Required; + Short_Descriptors_Config := Short_Descriptors; Use_VADS_Size_Config := Use_VADS_Size; -- Reset the indication that Optimize_Alignment was set locally, since @@ -94,6 +95,7 @@ package body Opt is Optimize_Alignment_Local := Save.Optimize_Alignment_Local; Persistent_BSS_Mode := Save.Persistent_BSS_Mode; Polling_Required := Save.Polling_Required; + Short_Descriptors := Save.Short_Descriptors; Use_VADS_Size := Save.Use_VADS_Size; end Restore_Opt_Config_Switches; @@ -121,6 +123,7 @@ package body Opt is Save.Optimize_Alignment_Local := Optimize_Alignment_Local; Save.Persistent_BSS_Mode := Persistent_BSS_Mode; Save.Polling_Required := Polling_Required; + Save.Short_Descriptors := Short_Descriptors; Save.Use_VADS_Size := Use_VADS_Size; end Save_Opt_Config_Switches; @@ -193,6 +196,7 @@ package body Opt is Fast_Math := Fast_Math_Config; Optimize_Alignment := Optimize_Alignment_Config; Polling_Required := Polling_Required_Config; + Short_Descriptors := Short_Descriptors_Config; end Set_Opt_Config_Switches; --------------- diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 1ca04ae7caf..59658c63c02 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -65,6 +65,7 @@ package Opt is -- Set True if binder file to be generated in Ada rather than C type Ada_Version_Type is (Ada_83, Ada_95, Ada_05, Ada_12); + pragma Ordered (Ada_Version_Type); -- Versions of Ada for Ada_Version below. Note that these are ordered, -- so that tests like Ada_Version >= Ada_95 are legitimate and useful. @@ -910,6 +911,12 @@ package Opt is -- GNATMAKE -- Set to True when an object directory is specified with option -D + One_Compilation_Per_Obj_Dir : Boolean := False; + -- GNATMAKE, GPRBUILD + -- Set to True with switch --single-compile-per-obj-dir. When True, there + -- cannot be simultaneous compilations with the object files in the same + -- object directory, if project files are used. + type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code); Operating_Mode : Operating_Mode_Type := Generate_Code; -- GNAT @@ -1082,7 +1089,12 @@ package Opt is -- GNAT -- Set True if a pragma Short_Circuit_And_Or applies to the current unit. + Short_Descriptors : Boolean := False; + -- GNAT + -- Set True if a pragma Short_Descriptors applies to the current unit. + Sprint_Line_Limit : Nat := 72; + -- GNAT -- Limit values for chopping long lines in Sprint output, can be reset -- by use of NNN parameter with -gnatG or -gnatD switches. @@ -1299,6 +1311,7 @@ package Opt is -- information sent to standard output, also header, copyright and summary) type Verbosity_Level_Type is (None, Low, Medium, High); + pragma Ordered (Verbosity_Level_Type); Verbosity_Level : Verbosity_Level_Type := High; -- GNATMAKE, GPRMAKE -- Modified by gnatmake or gprmake switches -v, -vl, -vm, -vh. Indicates @@ -1450,6 +1463,13 @@ package Opt is -- non-portable semantics (e.g. because sizes of types differ). The default -- is that this warning is enabled. + Warn_On_Unordered_Enumeration_Type : Boolean := False; + -- GNAT + -- Set to True to generate warnings for inappropriate uses (comparisons + -- and explicit ranges) on unordered enumeration types (which includes + -- all enumeration types for which pragma Ordered is not given). The + -- default is that this warning is disabled. + Warn_On_Unrecognized_Pragma : Boolean := True; -- GNAT -- Set to True to generate warnings for unrecognized pragmas. The default @@ -1636,6 +1656,14 @@ package Opt is -- flag is used to set the initial value for Polling_Required at the start -- of analyzing each unit. + Short_Descriptors_Config : Boolean; + -- GNAT + -- This is the value of the configuration switch that controls the use of + -- Short_Descriptors for setting descriptor default sizes. It can be set + -- True by the use of the pragma Short_Descriptors in the gnat.adc file. + -- This flag is used to set the initial value for Short_Descriptors at the + -- start of analyzing each unit. + Use_VADS_Size_Config : Boolean; -- GNAT -- This is the value of the configuration switch that controls the use of @@ -1765,6 +1793,7 @@ private Optimize_Alignment_Local : Boolean; Persistent_BSS_Mode : Boolean; Polling_Required : Boolean; + Short_Descriptors : Boolean; Use_VADS_Size : Boolean; end record; diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb index 75995e3fca4..f4f879fec9d 100644 --- a/gcc/ada/osint.adb +++ b/gcc/ada/osint.adb @@ -688,23 +688,24 @@ package body Osint is -- Canonical_Case_File_Name -- ------------------------------ - -- For now, we only deal with the case of a-z. Eventually we should - -- worry about other Latin-1 letters on systems that support this ??? - procedure Canonical_Case_File_Name (S : in out String) is begin if not File_Names_Case_Sensitive then - for J in S'Range loop - if S (J) in 'A' .. 'Z' then - S (J) := Character'Val ( - Character'Pos (S (J)) + - Character'Pos ('a') - - Character'Pos ('A')); - end if; - end loop; + To_Lower (S); end if; end Canonical_Case_File_Name; + --------------------------------- + -- Canonical_Case_Env_Var_Name -- + --------------------------------- + + procedure Canonical_Case_Env_Var_Name (S : in out String) is + begin + if not Env_Vars_Case_Sensitive then + To_Lower (S); + end if; + end Canonical_Case_Env_Var_Name; + --------------------------- -- Create_File_And_Check -- --------------------------- diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads index a1d9d05d4c4..9ec26bff3b4 100644 --- a/gcc/ada/osint.ads +++ b/gcc/ada/osint.ads @@ -94,6 +94,23 @@ package Osint is -- this call converts the given string to canonical all lower case form, -- so that two file names compare equal if they refer to the same file. + function Get_Env_Vars_Case_Sensitive return Int; + pragma Import (C, Get_Env_Vars_Case_Sensitive, + "__gnat_get_env_vars_case_sensitive"); + Env_Vars_Case_Sensitive : constant Boolean := + Get_Env_Vars_Case_Sensitive /= 0; + -- Set to indicate whether the operating system convention is for + -- environment variable names to be case sensitive (e.g., in Unix, set + -- True), or non case sensitive (e.g., in Windows, set False). + + procedure Canonical_Case_Env_Var_Name (S : in out String); + -- Given an environment variable name, converts it to canonical case form. + -- For systems where environment variable names are case sensitive, this + -- procedure has no effect. If environment variable names are not case + -- sensitive, then this call converts the given string to canonical all + -- lower case form, so that two environment variable names compare equal if + -- they refer to the same environment variable. + function Number_Of_Files return Int; -- Gives the total number of filenames found on the command line diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb index 8210d3f258f..5ac680176b8 100644 --- a/gcc/ada/output.adb +++ b/gcc/ada/output.adb @@ -129,8 +129,9 @@ package body Output is else declare - Indented_Buffer : constant String - := (1 .. Cur_Indentation => ' ') & Buffer (1 .. Len); + Indented_Buffer : constant String := + (1 .. Cur_Indentation => ' ') & + Buffer (1 .. Len); begin Write_Buffer (Indented_Buffer); end; @@ -138,9 +139,10 @@ package body Output is exception when Write_Error => - -- If there are errors with standard error, just quit. - -- Otherwise, set the output to standard error before reporting - -- a failure and quitting. + + -- If there are errors with standard error just quit. Otherwise + -- set the output to standard error before reporting a failure + -- and quitting. if Current_FD /= Standerr then Current_FD := Standerr; diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index def8ef5c521..f0a0bcebf6c 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -501,11 +501,16 @@ package body Ch2 is Id_Present := False; end if; - if Identifier_Seen and not Id_Present then - Error_Msg_SC - ("|pragma argument identifier required here"); - Error_Msg_SC - ("\since previous argument had identifier (RM 2.8(4))"); + -- Diagnose error of "positional" argument for pragma appearing after + -- a "named" argument (quotes here are because that's not quite accurate + -- Ada RM terminology). + + -- Since older GNAT versions did not generate this error, disable this + -- message in codepeer mode to help legacy code using codepeer. + + if Identifier_Seen and not Id_Present and not CodePeer_Mode then + Error_Msg_SC ("|pragma argument identifier required here"); + Error_Msg_SC ("\since previous argument had identifier (RM 2.8(4))"); end if; if Id_Present then diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index d1bc039b969..ae1ba6643e8 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -2250,7 +2250,6 @@ package body Ch3 is function P_Defining_Character_Literal return Node_Id is Literal_Node : Node_Id; - begin Literal_Node := Token_Node; Change_Character_Literal_To_Defining_Character_Literal (Literal_Node); diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 2b4e6215562..2d388f67b5a 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -1153,6 +1153,33 @@ package body Ch4 is Lparen_Sloc : Source_Ptr; Scan_State : Saved_Scan_State; + procedure Box_Error; + -- Called if <> is encountered as positional aggregate element. Issues + -- error message and sets Expr_Node to Error. + + --------------- + -- Box_Error -- + --------------- + + procedure Box_Error is + begin + if Ada_Version < Ada_2005 then + Error_Msg_SC ("box in aggregate is an Ada 2005 extension"); + end if; + + -- Ada 2005 (AI-287): The box notation is allowed only with named + -- notation because positional notation might be error prone. For + -- example, in "(X, <>, Y, <>)", there is no type associated with + -- the boxes, so you might not be leaving out the components you + -- thought you were leaving out. + + Error_Msg_SC ("(Ada 2005) box only allowed with named notation"); + Scan; -- past box + Expr_Node := Error; + end Box_Error; + + -- Start of processsing for P_Aggregate_Or_Paren_Expr + begin Lparen_Sloc := Token_Ptr; T_Left_Paren; @@ -1196,26 +1223,17 @@ package body Ch4 is end if; end if; - -- Ada 2005 (AI-287): The box notation is allowed only with named - -- notation because positional notation might be error prone. For - -- example, in "(X, <>, Y, <>)", there is no type associated with - -- the boxes, so you might not be leaving out the components you - -- thought you were leaving out. + -- Scan expression, handling box appearing as positional argument - if Ada_Version >= Ada_05 and then Token = Tok_Box then - Error_Msg_SC ("(Ada 2005) box notation only allowed with " - & "named notation"); - Scan; -- past BOX - Aggregate_Node := New_Node (N_Aggregate, Lparen_Sloc); - return Aggregate_Node; + if Token = Tok_Box then + Box_Error; + else + Expr_Node := P_Expression_Or_Range_Attribute_If_OK; end if; - Expr_Node := P_Expression_Or_Range_Attribute_If_OK; - -- Extension aggregate case if Token = Tok_With then - if Nkind (Expr_Node) = N_Attribute_Reference and then Attribute_Name (Expr_Node) = Name_Range then @@ -1316,8 +1334,7 @@ package body Ch4 is "extension aggregate"); raise Error_Resync; - -- A range attribute can only appear as part of a discrete choice - -- list. + -- Range attribute can only appear as part of a discrete choice list elsif Nkind (Expr_Node) = N_Attribute_Reference and then Attribute_Name (Expr_Node) = Name_Range @@ -1386,11 +1403,17 @@ package body Ch4 is exit; end if; + -- Deal with misused box + + if Token = Tok_Box then + Box_Error; + -- Otherwise initiate for reentry to top of loop by scanning an -- initial expression, unless the first token is OTHERS. - if Token = Tok_Others then + elsif Token = Tok_Others then Expr_Node := Empty; + else Save_Scan_State (Scan_State); -- at start of expression Expr_Node := P_Expression_Or_Range_Attribute_If_OK; @@ -2765,7 +2788,7 @@ package body Ch4 is end if; Scan; -- past IF or ELSIF - Append_To (Exprs, P_Expression_No_Right_Paren); + Append_To (Exprs, P_Condition); TF_Then; Append_To (Exprs, P_Expression); diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index ec1bcebb8fe..30433ef208e 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -34,7 +34,6 @@ package body Ch5 is function P_Case_Statement return Node_Id; function P_Case_Statement_Alternative return Node_Id; - function P_Condition return Node_Id; function P_Exit_Statement return Node_Id; function P_Goto_Statement return Node_Id; function P_If_Statement return Node_Id; @@ -193,8 +192,27 @@ package body Ch5 is procedure Test_Statement_Required is begin if Statement_Required then - Error_Msg_BC -- CODEFIX - ("statement expected"); + + -- Check no statement required after label in Ada 2012 + + if Ada_Version >= Ada_2012 + and then not Is_Empty_List (Statement_List) + and then Nkind (Last (Statement_List)) = N_Label + then + declare + Null_Stm : constant Node_Id := + Make_Null_Statement (Token_Ptr); + begin + Set_Comes_From_Source (Null_Stm, False); + Append_To (Statement_List, Null_Stm); + end; + + -- If not Ada 2012, or not special case above, give error message + + else + Error_Msg_BC -- CODEFIX + ("statement expected"); + end if; end if; end Test_Statement_Required; @@ -334,10 +352,10 @@ package body Ch5 is when Tok_Exception => Test_Statement_Required; - -- If Extm not set and the exception is not to the left - -- of the expected column of the end for this sequence, then - -- we assume it belongs to the current sequence, even though - -- it is not permitted. + -- If Extm not set and the exception is not to the left of + -- the expected column of the end for this sequence, then we + -- assume it belongs to the current sequence, even though it + -- is not permitted. if not SS_Flags.Extm and then Start_Column >= Scope.Table (Scope.Last).Ecol @@ -350,7 +368,7 @@ package body Ch5 is -- Always return, in the case where we scanned out handlers -- that we did not expect, Parse_Exception_Handlers returned - -- with Token being either end or EOF, so we are OK + -- with Token being either end or EOF, so we are OK. exit; @@ -358,8 +376,8 @@ package body Ch5 is when Tok_Or => - -- Terminate if Ortm set or if the or is to the left - -- of the expected column of the end for this sequence + -- Terminate if Ortm set or if the or is to the left of the + -- expected column of the end for this sequence. if SS_Flags.Ortm or else Start_Column < Scope.Table (Scope.Last).Ecol @@ -385,9 +403,9 @@ package body Ch5 is exit when SS_Flags.Tatm and then Token = Tok_Abort; - -- Otherwise we treat THEN as some kind of mess where we - -- did not see the associated IF, but we pick up assuming - -- it had been there! + -- Otherwise we treat THEN as some kind of mess where we did + -- not see the associated IF, but we pick up assuming it had + -- been there! Restore_Scan_State (Scan_State); -- to THEN Append_To (Statement_List, P_If_Statement); @@ -397,8 +415,8 @@ package body Ch5 is when Tok_When | Tok_Others => - -- Terminate if Whtm set or if the WHEN is to the left - -- of the expected column of the end for this sequence + -- Terminate if Whtm set or if the WHEN is to the left of + -- the expected column of the end for this sequence. if SS_Flags.Whtm or else Start_Column < Scope.Table (Scope.Last).Ecol diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index fc9a3741366..3830e05cb1a 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -211,7 +211,7 @@ package body Ch6 is Is_Overriding := True; end if; - if (Is_Overriding or else Not_Overriding) then + if Is_Overriding or else Not_Overriding then -- Note that if we are not in Ada_05 mode, error messages have -- already been given, so no need to give another message here. diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb index 23b27c7774e..1388a92e143 100644 --- a/gcc/ada/par-ch9.adb +++ b/gcc/ada/par-ch9.adb @@ -639,7 +639,7 @@ package body Ch9 is Is_Overriding := True; end if; - if (Is_Overriding or else Not_Overriding) then + if Is_Overriding or else Not_Overriding then if Ada_Version < Ada_05 then Error_Msg_SP ("overriding indicator is an Ada 2005 extension"); Error_Msg_SP ("\unit must be compiled with -gnat05 switch"); @@ -823,7 +823,7 @@ package body Ch9 is Is_Overriding := True; end if; - if (Is_Overriding or else Not_Overriding) then + if Is_Overriding or else Not_Overriding then if Ada_Version < Ada_05 then Error_Msg_SP ("overriding indicator is an Ada 2005 extension"); Error_Msg_SP ("\unit must be compiled with -gnat05 switch"); diff --git a/gcc/ada/par-labl.adb b/gcc/ada/par-labl.adb index 6609a07576e..8520292ecd2 100644 --- a/gcc/ada/par-labl.adb +++ b/gcc/ada/par-labl.adb @@ -378,12 +378,10 @@ procedure Labl is -- If the label and the goto are both in the same statement -- list, then we've found a loop. Note that labels and goto - -- statements are always part of some list, so - -- List_Containing always makes sense. + -- statements are always part of some list, so In_Same_List + -- always makes sense. - if List_Containing (Node (N)) = - List_Containing (Node (S1)) - then + if In_Same_List (Node (N), Node (S1)) then Source := S1; Found := True; diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb index 9aa08423805..e30ffc02a02 100644 --- a/gcc/ada/par-load.adb +++ b/gcc/ada/par-load.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -266,11 +266,12 @@ begin Required => False, Subunit => False, Error_Node => Curunit, - Corr_Body => Cur_Unum); + Corr_Body => Cur_Unum, + PMES => (Cur_Unum = Main_Unit)); - -- If we successfully load the unit, then set the spec/body - -- pointers. Once again note that if the loaded unit has a fatal error, - -- Load will have set our Fatal_Error flag to propagate this condition. + -- If we successfully load the unit, then set the spec/body pointers. + -- Once again note that if the loaded unit has a fatal error, Load will + -- have set our Fatal_Error flag to propagate this condition. if Unum /= No_Unit then Set_Library_Unit (Curunit, Cunit (Unum)); @@ -347,7 +348,7 @@ begin Load_Unit (Load_Name => Body_Name, Required => True, - Subunit => True, + Subunit => False, Error_Node => Name (Unit (Curunit))); if Unum /= No_Unit then diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index a421592ad84..f0259168476 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1156,10 +1156,11 @@ begin Pragma_Memory_Size | Pragma_No_Body | Pragma_No_Return | - Pragma_Obsolescent | Pragma_No_Run_Time | Pragma_No_Strict_Aliasing | Pragma_Normalize_Scalars | + Pragma_Obsolescent | + Pragma_Ordered | Pragma_Optimize | Pragma_Optimize_Alignment | Pragma_Pack | @@ -1191,6 +1192,7 @@ begin Pragma_Shared | Pragma_Shared_Passive | Pragma_Short_Circuit_And_Or | + Pragma_Short_Descriptors | Pragma_Storage_Size | Pragma_Storage_Unit | Pragma_Static_Elaboration_Desired | diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index bf3dc1e6b51..28c2ca789ee 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -709,6 +709,9 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ------------- package Ch5 is + function P_Condition return Node_Id; + -- Scan out and return a condition + function P_Statement_Name (Name_Node : Node_Id) return Node_Id; -- Given a node representing a name (which is a call), converts it -- to the syntactically corresponding procedure call statement. @@ -1255,6 +1258,7 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- Start of processing for Par begin + Compiler_State := Parsing; -- Deal with configuration pragmas case first @@ -1266,10 +1270,12 @@ begin begin loop if Token = Tok_EOF then + Compiler_State := Analyzing; return Pragmas; elsif Token /= Tok_Pragma then Error_Msg_SC ("only pragmas allowed in configuration file"); + Compiler_State := Analyzing; return Error_List; else @@ -1479,6 +1485,7 @@ begin Restore_Opt_Config_Switches (Save_Config_Switches); Set_Comes_From_Source_Default (False); + Compiler_State := Analyzing; return Empty_List; end if; end Par; diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 2e9255c47d2..ef9a96d5710 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -99,6 +99,7 @@ package body Prj.Attr is "SVlibrary_version#" & "LVlibrary_interface#" & "SVlibrary_auto_init#" & + "LVleading_library_options#" & "LVlibrary_options#" & "SVlibrary_src_dir#" & "SVlibrary_ali_dir#" & @@ -246,6 +247,7 @@ package body Prj.Attr is "Plinker#" & "LVrequired_switches#" & "Ladefault_switches#" & + "LcOleading_switches#" & "LcOswitches#" & "LVlinker_options#" & "SVmap_file_option#" & diff --git a/gcc/ada/prj-attr.ads b/gcc/ada/prj-attr.ads index 6fad3f0a0dc..a16e6f3d181 100644 --- a/gcc/ada/prj-attr.ads +++ b/gcc/ada/prj-attr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -44,8 +44,8 @@ package Prj.Attr is -- packages and their attribute. This procedure should be called by -- Prj.Initialize. - type Attribute_Kind is - (Unknown, + type Attribute_Kind is ( + Unknown, -- The attribute does not exist Single, @@ -61,9 +61,10 @@ package Prj.Attr is Case_Insensitive_Associative_Array, -- Associative array attribute with a case insensitive index - Optional_Index_Case_Insensitive_Associative_Array); + Optional_Index_Case_Insensitive_Associative_Array -- Associative array attribute with a case insensitive index and an -- optional source index. + ); -- Characteristics of an attribute. Optional_Index indicates that there -- may be an optional index in the index of the associative array, as in -- for Switches ("files.ada" at 2) use ... @@ -73,6 +74,11 @@ package Prj.Attr is -- Subset of Attribute_Kinds that may be used for the attributes that is -- used when defining a new package. + subtype All_Case_Insensitive_Associative_Array is Attribute_Kind range + Case_Insensitive_Associative_Array .. + Optional_Index_Case_Insensitive_Associative_Array; + -- Subtype including both cases of Case_Insensitive_Associative_Array + Max_Attribute_Name_Length : constant := 64; -- The maximum length of attribute names diff --git a/gcc/ada/prj-conf.adb b/gcc/ada/prj-conf.adb index 7ffa8d52b94..23869e023f8 100644 --- a/gcc/ada/prj-conf.adb +++ b/gcc/ada/prj-conf.adb @@ -685,7 +685,7 @@ package body Prj.Conf is -- First, find the object directory of the user's project if Obj_Dir = Nil_Variable_Value or else Obj_Dir.Default then - Get_Name_String (Project.Directory.Name); + Get_Name_String (Project.Directory.Display_Name); else if Is_Absolute_Path (Get_Name_String (Obj_Dir.Value)) then @@ -694,7 +694,7 @@ package body Prj.Conf is else Name_Len := 0; Add_Str_To_Name_Buffer - (Get_Name_String (Project.Directory.Name)); + (Get_Name_String (Project.Directory.Display_Name)); Add_Str_To_Name_Buffer (Get_Name_String (Obj_Dir.Value)); end if; end if; diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb index 5795061eacb..51332d89dae 100644 --- a/gcc/ada/prj-dect.adb +++ b/gcc/ada/prj-dect.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -247,8 +247,7 @@ package body Prj.Dect is end if; if Attribute_Kind_Of (Current_Attribute) in - Case_Insensitive_Associative_Array .. - Optional_Index_Case_Insensitive_Associative_Array + All_Case_Insensitive_Associative_Array then Set_Case_Insensitive (Attribute, In_Tree, To => True); end if; @@ -1028,8 +1027,9 @@ package body Prj.Dect is First_Attribute : Attribute_Node_Id := Empty_Attribute; Current_Package : Package_Node_Id := Empty_Package; First_Declarative_Item : Project_Node_Id := Empty_Node; - Package_Location : constant Source_Ptr := Token_Ptr; + Renaming : Boolean := False; + Extending : Boolean := False; begin Package_Declaration := @@ -1150,13 +1150,20 @@ package body Prj.Dect is end if; if Token = Tok_Renames then + Renaming := True; + elsif Token = Tok_Extends then + Extending := True; + end if; + + if Renaming or else Extending then if Is_Config_File then Error_Msg (Flags, - "no package renames in configuration projects", Token_Ptr); + "no package rename or extension in configuration projects", + Token_Ptr); end if; - -- Scan past "renames" + -- Scan past "renames" or "extends" Scan (In_Tree); @@ -1250,7 +1257,9 @@ package body Prj.Dect is end if; end if; end if; + end if; + if Renaming then Expect (Tok_Semicolon, "`;`"); Set_End_Of_Line (Package_Declaration); Set_Previous_Line_Node (Package_Declaration); @@ -1306,7 +1315,7 @@ package body Prj.Dect is Remove_Next_End_Node; else - Error_Msg (Flags, "expected IS or RENAMES", Token_Ptr); + Error_Msg (Flags, "expected IS", Token_Ptr); end if; end Parse_Package_Declaration; diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 39bda01987e..07b173a67fe 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -728,7 +728,7 @@ package body Prj.Env is Fmap.Add_To_File_Map (Unit_Name => Unit_Name_Type (Data.Unit.Name), File_Name => Data.File, - Path_Name => File_Name_Type (Data.Path.Name)); + Path_Name => File_Name_Type (Data.Path.Display_Name)); end if; end if; @@ -831,14 +831,14 @@ package body Prj.Env is Put_Name_Buffer; end if; - Get_Name_String (Source.File); + Get_Name_String (Source.Display_File); Put_Name_Buffer; if Source.Locally_Removed then Name_Len := 1; Name_Buffer (1) := '/'; else - Get_Name_String (Source.Path.Name); + Get_Name_String (Source.Path.Display_Name); end if; Put_Name_Buffer; diff --git a/gcc/ada/prj-err.adb b/gcc/ada/prj-err.adb index 3728c9e44b0..f0e10f891f7 100644 --- a/gcc/ada/prj-err.adb +++ b/gcc/ada/prj-err.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -29,16 +29,6 @@ with Stringt; use Stringt; package body Prj.Err is - ----------------------- - -- Obsolescent_Check -- - ----------------------- - - procedure Obsolescent_Check (S : Source_Ptr) is - pragma Warnings (Off, S); - begin - null; - end Obsolescent_Check; - --------------- -- Post_Scan -- --------------- diff --git a/gcc/ada/prj-err.ads b/gcc/ada/prj-err.ads index d07285ecb2d..3f6b684130c 100644 --- a/gcc/ada/prj-err.ads +++ b/gcc/ada/prj-err.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2010, 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- -- @@ -82,20 +82,16 @@ package Prj.Err is -- Scanner -- ------------- - procedure Obsolescent_Check (S : Source_Ptr); - -- Dummy null procedure for Scng instantiation - procedure Post_Scan; -- Convert an Ada operator symbol into a standard string package Scanner is new Scng - (Post_Scan => Post_Scan, - Error_Msg => Errutil.Error_Msg, - Error_Msg_S => Errutil.Error_Msg_S, - Error_Msg_SC => Errutil.Error_Msg_SC, - Error_Msg_SP => Errutil.Error_Msg_SP, - Obsolescent_Check => Obsolescent_Check, - Style => Errutil.Style); + (Post_Scan => Post_Scan, + Error_Msg => Errutil.Error_Msg, + Error_Msg_S => Errutil.Error_Msg_S, + Error_Msg_SC => Errutil.Error_Msg_SC, + Error_Msg_SP => Errutil.Error_Msg_SP, + Style => Errutil.Style); -- Instantiation of the generic scanner end Prj.Err; diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb index 51da2a3e82c..40816cf24de 100644 --- a/gcc/ada/prj-ext.adb +++ b/gcc/ada/prj-ext.adb @@ -60,7 +60,7 @@ package body Prj.Ext is The_Value := Name_Find; Name_Len := External_Name'Length; Name_Buffer (1 .. Name_Len) := External_Name; - Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); + Canonical_Case_Env_Var_Name (Name_Buffer (1 .. Name_Len)); The_Key := Name_Find; Name_To_Name_HTable.Set (Tree.External_References, The_Key, The_Value); end Add; @@ -250,13 +250,21 @@ package body Prj.Ext is Prefix := new String'(Executable_Prefix_Path); if Prefix.all /= "" then + if Tree.Target_Name /= null + and then Tree.Target_Name.all /= "" + then + Add_Str_To_Name_Buffer + (Path_Separator & Prefix.all & + "lib" & Directory_Separator & "gpr" & + Directory_Separator & Tree.Target_Name.all); + end if; + Add_Str_To_Name_Buffer (Path_Separator & Prefix.all & "share" & Directory_Separator & "gpr"); Add_Str_To_Name_Buffer (Path_Separator & Prefix.all & - Directory_Separator & "lib" & - Directory_Separator & "gnat"); + "lib" & Directory_Separator & "gnat"); end if; else @@ -327,7 +335,7 @@ package body Prj.Ext is Name : String := Get_Name_String (External_Name); begin - Canonical_Case_File_Name (Name); + Canonical_Case_Env_Var_Name (Name); Name_Len := Name'Length; Name_Buffer (1 .. Name_Len) := Name; The_Value := diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb index 50cd0703d67..0368237d5fe 100644 --- a/gcc/ada/prj-makr.adb +++ b/gcc/ada/prj-makr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -792,7 +792,6 @@ package body Prj.Makr is -- Do some needed initializations Csets.Initialize; - Namet.Initialize; Snames.Initialize; Prj.Initialize (No_Project_Tree); Prj.Tree.Initialize (Tree); diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 456db448408..af9a62227b7 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -685,6 +685,7 @@ package body Prj.Nmsc is end if; elsif Prev_Unit /= No_Unit_Index + and then Prev_Unit.File_Names (Kind) /= null and then not Source.Locally_Removed then -- Path is set if this is a source we found on the disk, in which @@ -722,6 +723,7 @@ package body Prj.Nmsc is elsif not Source.Locally_Removed and then not Data.Flags.Allow_Duplicate_Basenames and then Lang_Id.Config.Kind = Unit_Based + and then Source.Language.Config.Kind = Unit_Based then Error_Msg_File_1 := File_Name; Error_Msg_File_2 := File_Name_Type (Source.Project.Name); @@ -3310,7 +3312,7 @@ package body Prj.Nmsc is -- Get the naming exceptions for all languages - for Kind in Spec .. Impl loop + for Kind in Spec_Or_Body loop Lang_Id := Project.Languages; while Lang_Id /= No_Language_Index loop case Lang_Id.Config.Kind is @@ -5206,6 +5208,7 @@ package body Prj.Nmsc is Resolve_Links => Opt.Follow_Links_For_Dirs, Case_Sensitive => True); + Has_Error : Boolean := False; begin if Root_Dir'Length = 0 then @@ -5213,8 +5216,11 @@ package body Prj.Nmsc is Error_Or_Warning (Data.Flags, Data.Flags.Missing_Source_Files, "{ is not a valid directory.", Location, Project); + Has_Error := Data.Flags.Missing_Source_Files = Error; + end if; + + if not Has_Error then - else -- We have an existing directory, we register it and all of -- its subdirectories. @@ -5238,6 +5244,7 @@ package body Prj.Nmsc is declare Path_Name : Path_Information; Dir_Exists : Boolean; + Has_Error : Boolean := False; begin Locate_Directory @@ -5253,10 +5260,14 @@ package body Prj.Nmsc is Error_Or_Warning (Data.Flags, Data.Flags.Missing_Source_Files, "{ is not a valid directory", Location, Project); + Has_Error := Data.Flags.Missing_Source_Files = Error; + end if; + + if not Has_Error then + + -- Links have been resolved if necessary, and Path_Name + -- always ends with a directory separator. - else - -- links have been resolved if necessary, and Path_Name - -- always ends with a directory separator Add_To_Or_Remove_From_Source_Dirs (Path_Id => Path_Name.Name, Display_Path_Id => Path_Name.Display_Name, @@ -5505,7 +5516,7 @@ package body Prj.Nmsc is Element := Data.Tree.String_Elements.Table (Current); if Element.Value /= No_Name then Element.Value := - Name_Id (Canonical_Case_File_Name (Name_Id (Element.Value))); + Name_Id (Canonical_Case_File_Name (Element.Value)); Data.Tree.String_Elements.Table (Current) := Element; end if; @@ -6519,7 +6530,7 @@ package body Prj.Nmsc is if not Found then Error_Msg_Name_1 := Name_Id (Source.Display_File); - Error_Msg_Name_2 := Name_Id (Source.Unit.Name); + Error_Msg_Name_2 := Source.Unit.Name; Error_Or_Warning (Data.Flags, Data.Flags.Missing_Source_Files, "source file %% for unit %% not found", @@ -6877,7 +6888,7 @@ package body Prj.Nmsc is and then Name_Loc.Source.Kind = Impl then Src_Ind := Sinput.P.Load_Project_File - (Get_Name_String (Path)); + (Get_Name_String (Display_Path)); if Sinput.P.Source_File_Is_Subunit (Src_Ind) then Override_Kind (Name_Loc.Source, Sep); @@ -7380,7 +7391,7 @@ package body Prj.Nmsc is Src_Ind := Sinput.P.Load_Project_File - (Get_Name_String (Src_Id.Path.Name)); + (Get_Name_String (Src_Id.Path.Display_Name)); if Sinput.P.Source_File_Is_Subunit (Src_Ind) then Override_Kind (Src_Id, Sep); diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 65d019015c1..3cbb089ad08 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -346,7 +346,7 @@ package body Prj.Proc is Var := In_Tree.Variable_Elements.Table (V1); V1 := Var.Next; - -- Do not copy the value of attribute inker_Options if Restricted + -- Do not copy the value of attribute Linker_Options if Restricted if Restricted and then Var.Name = Snames.Name_Linker_Options then Var.Value.Values := Nil_String; @@ -1428,7 +1428,7 @@ package body Prj.Proc is if Present (Project_Of_Renamed_Package) then - -- Renamed package + -- Renamed or extending package declare Project_Name : constant Name_Id := @@ -1466,8 +1466,6 @@ package body Prj.Proc is In_Tree => In_Tree); end; - -- Standard package declaration, not renaming - else -- Set the default values of the attributes @@ -1482,19 +1480,22 @@ package body Prj.Proc is (Current_Item, From_Project_Node_Tree)), Project_Level => False); - -- And process declarative items of the new package - - Process_Declarative_Items - (Project => Project, - In_Tree => In_Tree, - Flags => Flags, - From_Project_Node => From_Project_Node, - From_Project_Node_Tree => From_Project_Node_Tree, - Pkg => New_Pkg, - Item => - First_Declarative_Item_Of - (Current_Item, From_Project_Node_Tree)); end if; + + -- Process declarative items (nothing to do when the + -- package is renaming, as the first declarative item is + -- null). + + Process_Declarative_Items + (Project => Project, + In_Tree => In_Tree, + Flags => Flags, + From_Project_Node => From_Project_Node, + From_Project_Node_Tree => From_Project_Node_Tree, + Pkg => New_Pkg, + Item => + First_Declarative_Item_Of + (Current_Item, From_Project_Node_Tree)); end; end if; diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb index 9798fb9c60a..3120e172227 100644 --- a/gcc/ada/prj-strt.adb +++ b/gcc/ada/prj-strt.adb @@ -216,8 +216,7 @@ package body Prj.Strt is Set_Case_Insensitive (Reference, In_Tree, To => Attribute_Kind_Of (Current_Attribute) in - Case_Insensitive_Associative_Array .. - Optional_Index_Case_Insensitive_Associative_Array); + All_Case_Insensitive_Associative_Array); -- Scan past the attribute name diff --git a/gcc/ada/prj-tree.ads b/gcc/ada/prj-tree.ads index fa8c132e565..e4c9583e734 100644 --- a/gcc/ada/prj-tree.ads +++ b/gcc/ada/prj-tree.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -1470,7 +1470,11 @@ package Prj.Tree is -- project-tree specific so that one can load the same tree twice but -- have two views of it, for instance. - Project_Path : String_Access; + Target_Name : String_Access := null; + -- The target name, if any, specified with the gprbuild or gprclean + -- switch --target=. + + Project_Path : String_Access := null; -- The project path, manipulated through subprograms in prj-ext.ads. -- As a special case, if the first character is '#:" or this variable is -- unset, this means that the PATH has not been fully initialized yet diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb index 159ee83597c..d714cdbbf52 100644 --- a/gcc/ada/prj-util.adb +++ b/gcc/ada/prj-util.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -110,7 +110,8 @@ package body Prj.Util is Main : File_Name_Type; Index : Int; Ada_Main : Boolean := True; - Language : String := "") return File_Name_Type + Language : String := ""; + Include_Suffix : Boolean := True) return File_Name_Type is pragma Assert (Project /= No_Project); @@ -130,8 +131,6 @@ package body Prj.Util is In_Package => Builder_Package, In_Tree => In_Tree); - Executable_Suffix_Name : Name_Id := No_Name; - Lang : Language_Ptr; Spec_Suffix : Name_Id := No_Name; @@ -145,6 +144,10 @@ package body Prj.Util is S_Suffix : File_Name_Type); -- Get the non empty suffixes in variables Spec_Suffix and Body_Suffix + function Add_Suffix (File : File_Name_Type) return File_Name_Type; + -- Return the name of the executable, based on File, and adding the + -- executable suffix if needed + ------------------ -- Get_Suffixes -- ------------------ @@ -165,6 +168,52 @@ package body Prj.Util is end if; end Get_Suffixes; + ---------------- + -- Add_Suffix -- + ---------------- + + function Add_Suffix (File : File_Name_Type) return File_Name_Type is + Saved_EEOT : constant Name_Id := Executable_Extension_On_Target; + Result : File_Name_Type; + Suffix_From_Project : Variable_Value; + begin + if Include_Suffix then + if Project.Config.Executable_Suffix /= No_Name then + Executable_Extension_On_Target := + Project.Config.Executable_Suffix; + end if; + + Result := Executable_Name (File); + Executable_Extension_On_Target := Saved_EEOT; + return Result; + + elsif Builder_Package /= No_Package then + + -- If the suffix is specified in the project itself, as opposed to + -- the config file, it needs to be taken into account. However, + -- when the project was processed, in both cases the suffix was + -- stored in Project.Config, so get it from the project again. + + Suffix_From_Project := + Prj.Util.Value_Of + (Variable_Name => Name_Executable_Suffix, + In_Variables => + In_Tree.Packages.Table (Builder_Package).Decl.Attributes, + In_Tree => In_Tree); + + if Suffix_From_Project /= Nil_Variable_Value + and then Suffix_From_Project.Value /= No_Name + then + Executable_Extension_On_Target := Suffix_From_Project.Value; + Result := Executable_Name (File); + Executable_Extension_On_Target := Saved_EEOT; + return Result; + end if; + end if; + + return File; + end Add_Suffix; + -- Start of processing for Executable_Of begin @@ -181,8 +230,6 @@ package body Prj.Util is end if; if Builder_Package /= No_Package then - Executable_Suffix_Name := Project.Config.Executable_Suffix; - if Executable = Nil_Variable_Value and then Ada_Main then Get_Name_String (Main); @@ -237,22 +284,7 @@ package body Prj.Util is and then Executable.Value /= No_Name and then Length_Of_Name (Executable.Value) /= 0 then - -- Get the executable name. If Executable_Suffix is defined, - -- make sure that it will be the extension of the executable. - - declare - Saved_EEOT : constant Name_Id := Executable_Extension_On_Target; - Result : File_Name_Type; - - begin - if Executable_Suffix_Name /= No_Name then - Executable_Extension_On_Target := Executable_Suffix_Name; - end if; - - Result := Executable_Name (File_Name_Type (Executable.Value)); - Executable_Extension_On_Target := Saved_EEOT; - return Result; - end; + return Add_Suffix (File_Name_Type (Executable.Value)); end if; end if; @@ -287,24 +319,7 @@ package body Prj.Util is Get_Name_String (Strip_Suffix (Main)); end if; - -- Get the executable name. If Executable_Suffix is defined in the - -- configuration, make sure that it will be the extension of the - -- executable. - - declare - Saved_EEOT : constant Name_Id := Executable_Extension_On_Target; - Result : File_Name_Type; - - begin - if Project.Config.Executable_Suffix /= No_Name then - Executable_Extension_On_Target := - Project.Config.Executable_Suffix; - end if; - - Result := Executable_Name (Name_Find); - Executable_Extension_On_Target := Saved_EEOT; - return Result; - end; + return Add_Suffix (Name_Find); end Executable_Of; -------------- diff --git a/gcc/ada/prj-util.ads b/gcc/ada/prj-util.ads index 0efdfbb5b03..3c1ac0a741d 100644 --- a/gcc/ada/prj-util.ads +++ b/gcc/ada/prj-util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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,20 +27,27 @@ package Prj.Util is - -- ??? throughout this spec, parameters are not well enough documented - function Executable_Of - (Project : Project_Id; - In_Tree : Project_Tree_Ref; - Main : File_Name_Type; - Index : Int; - Ada_Main : Boolean := True; - Language : String := "") return File_Name_Type; + (Project : Project_Id; + In_Tree : Project_Tree_Ref; + Main : File_Name_Type; + Index : Int; + Ada_Main : Boolean := True; + Language : String := ""; + Include_Suffix : Boolean := True) return File_Name_Type; -- Return the value of the attribute Builder'Executable for file Main in -- the project Project, if it exists. If there is no attribute Executable -- for Main, remove the suffix from Main; then, if the attribute -- Executable_Suffix is specified, add this suffix, otherwise add the -- standard executable suffix for the platform. + -- + -- If Include_Suffix is true, then the ".exe" suffix (or any suffix defined + -- in the config) will be added. The suffix defined by the user in his own + -- project file is always taken into account. Otherwise, such a suffix is + -- not added. In particular, the prefix should not be added if you are + -- potentially testing for cross-platforms, since the suffix might not be + -- known (its default value comes from the ...-gnatmake prefix). + -- -- What is Ada_Main??? -- What is Language??? @@ -60,8 +67,8 @@ package Prj.Util is function Value_Of (Variable : Variable_Value; Default : String) return String; - -- Get the value of a single string variable. If Variable is - -- Nil_Variable_Value, is a string list or is defaulted, return Default. + -- Get the value of a single string variable. If Variable is a string list, + -- is Nil_Variable_Value,or is defaulted, return Default. function Value_Of (Index : Name_Id; diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index d6e9bd8abb9..4ec2349edaf 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -48,8 +48,6 @@ package body Prj is The_Empty_String : Name_Id := No_Name; - subtype Known_Casing is Casing_Type range All_Upper_Case .. Mixed_Case; - type Cst_String_Access is access constant String; All_Lower_Case_Image : aliased constant String := "lowercase"; @@ -249,16 +247,10 @@ package body Prj is return No_File; when Makefile => - return - File_Name_Type - (Extend_Name - (Source_File_Name, Makefile_Dependency_Suffix)); + return Extend_Name (Source_File_Name, Makefile_Dependency_Suffix); when ALI_File => - return - File_Name_Type - (Extend_Name - (Source_File_Name, ALI_Dependency_Suffix)); + return Extend_Name (Source_File_Name, ALI_Dependency_Suffix); end case; end Dependency_Name; @@ -1023,11 +1015,11 @@ package body Prj is if Project.Library then if Project.Object_Directory = No_Path_Information - or else Contains_ALI_Files (Project.Library_ALI_Dir.Name) + or else Contains_ALI_Files (Project.Library_ALI_Dir.Display_Name) then - return Project.Library_ALI_Dir.Name; + return Project.Library_ALI_Dir.Display_Name; else - return Project.Object_Directory.Name; + return Project.Object_Directory.Display_Name; end if; -- For a non-library project, add object directory if it is not a @@ -1053,7 +1045,7 @@ package body Prj is end loop; if Add_Object_Dir then - return Project.Object_Directory.Name; + return Project.Object_Directory.Display_Name; end if; end; end if; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 146d5302240..c353cca6f36 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -820,6 +820,7 @@ package Prj is Equal => "="); type Verbosity is (Default, Medium, High); + pragma Ordered (Verbosity); -- Verbosity when parsing GNAT Project Files -- Default is default (very quiet, if no errors). -- Medium is more verbose. diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi index 20fb19c8ee1..849ca40fb79 100644 --- a/gcc/ada/projects.texi +++ b/gcc/ada/projects.texi @@ -575,13 +575,13 @@ packages would be involved in the build process. @b{end} Builder; @b{package} Compiler @b{is} --<<< for the compiler - @b{end} Builder; + @b{end} Compiler; @b{package} Binder @b{is} --<<< for the binder - @b{end} Builder; + @b{end} Binder; @b{package} Linker @b{is} --<<< for the linker - @b{end} Builder; + @b{end} Linker; @end smallexample @noindent @@ -1582,6 +1582,17 @@ Other library-related attributes can be used to change the defaults: accomplishes specific actions before calling gcc (which itself is calling the linker to build the library image). +@item @b{Library_Options}: +@cindex @code{Library_Options} + This attribute may be used to specified additional switches (last switches) + when linking a shared library. + +@item @b{Leading_Library_Options}: +@cindex @code{Leading_Library_Options} + This attribute, that is taken into account only by @command{gprbuild}, may be + used to specified leading options (first switches) when linking a shared + library. + @cindex @code{Linker_Options} @item @b{Linker.Linker_Options}: This attribute specifies additional switches to be given to the linker when @@ -1759,11 +1770,6 @@ included in the library. the attribute @b{Binder.Default_Switches ("Ada")} are used in the call to @command{gnatbind}. -@item @b{Library_Options}: -@cindex @code{Library_Options} - This attribute may be used to specified additional switches to @command{gcc} - when linking the library. - @item @b{Library_Src_Dir}: @cindex @code{Library_Src_Dir} This attribute defines the location (absolute or relative to the project @@ -2382,9 +2388,8 @@ must be the same as the name of the renaming package. The project must contain a package declaration with this name, and the project must appear in the context clause of the current project, or be its parent project. It is not possible to add or override attributes to the renaming -project. If you need to do so, you should declare a standard package, and -assign the value of the attributes one by one (@code{for Switches ("Ada") -use Other_Project.Compiler'Switches ("Ada")}). +project. If you need to do so, you should use an @b{extending declaration} +(see below). Packages that are renamed in other project files often come from project files that have no sources: they are just used as templates. Any modification in the @@ -2392,14 +2397,22 @@ template will be reflected automatically in all the project files that rename a package from the template. This is a very common way to share settings between projects. +Finally, a package can also be defined by an @b{extending declaration}. This is +similar to a @b{renaming declaration}, except that it is possible to add or +override attributes. + @smallexample -package_declaration ::= package_spec | package_renaming +package_declaration ::= package_spec | package_renaming | package_extension package_spec ::= @i{package} @i{}simple_name @i{is} @{simple_declarative_item@} @i{end} package_identifier ; package_renaming ::== @i{package} @i{}simple_name @i{renames} @i{}simple_name.package_identifier ; +package_extension ::== + @i{package} @i{}simple_name @i{extends} @i{}simple_name.package_identifier @i{is} + @{simple_declarative_item@} + @i{end} package_identifier ; @end smallexample @c --------------------------------------------- @@ -2764,6 +2777,7 @@ system (file). The text is between brackets ([]) if the index is optional. @item Library_Interface @tab string @tab - @tab - @item Library_Auto_Init @tab string @tab - @tab - @item Library_Options @tab list @tab - @tab - +@item Leading_Library_Options @tab list @tab - @tab - @item Library_Src_Dir @tab string @tab - @tab - @item Library_ALI_Dir @tab string @tab - @tab - @item Library_GCC @tab string @tab - @tab - @@ -2862,6 +2876,7 @@ system (file). The text is between brackets ([]) if the index is optional. @item Objects_Path @tab string @tab Binder @tab insensitive (language) @item Objects_Path_File @tab string @tab Binder @tab insensitive (language) @item Linker_Options @tab list @tab Linker @tab - +@item Leading_Switches @tab list @tab Linker @tab - @item Map_File_Options @tab string @tab Linker @tab - @item Executable_Switches @tab list @tab Linker @tab - @item Lib_Dir_Switch @tab string @tab Linker @tab - diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index 362d1d8cead..3f3f488e1c7 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -1054,6 +1054,39 @@ package body Repinfo is Write_Str ("'Alignment use "); Write_Val (Alignment (Ent)); Write_Line (";"); + + -- Special stuff for fixed-point + + if Is_Fixed_Point_Type (Ent) then + + -- Write small (always a static constant) + + Write_Str ("for "); + List_Name (Ent); + Write_Str ("'Small use "); + UR_Write (Small_Value (Ent)); + Write_Line (";"); + + -- Write range if static + + declare + R : constant Node_Id := Scalar_Range (Ent); + + begin + if Nkind (Low_Bound (R)) = N_Real_Literal + and then + Nkind (High_Bound (R)) = N_Real_Literal + then + Write_Str ("for "); + List_Name (Ent); + Write_Str ("'Range use "); + UR_Write (Realval (Low_Bound (R))); + Write_Str (" .. "); + UR_Write (Realval (High_Bound (R))); + Write_Line (";"); + end if; + end; + end if; end List_Type_Info; ---------------------- @@ -1087,8 +1120,8 @@ package body Repinfo is -- Internal recursive routine to evaluate tree function W (Val : Uint) return Word; - -- Convert Val to Word, assuming Val is always in the Int range. This is - -- a helper function for the evaluation of bitwise expressions like + -- Convert Val to Word, assuming Val is always in the Int range. This + -- is a helper function for the evaluation of bitwise expressions like -- Bit_And_Expr, for which there is no direct support in uintp. Uint -- values out of the Int range are expected to be seen in such -- expressions only with overflowing byte sizes around, introducing diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 2beae888c6e..c08130a7f61 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -25,6 +25,7 @@ with Atree; use Atree; with Casing; use Casing; +with Einfo; use Einfo; with Errout; use Errout; with Debug; use Debug; with Fname; use Fname; @@ -143,8 +144,8 @@ package body Restrict is -- Start of processing for Check_Obsolescent_2005_Entity begin - if Ada_Version >= Ada_2005 - and then Restriction_Active (No_Obsolescent_Features) + if Restriction_Check_Required (No_Obsolescent_Features) + and then Ada_Version >= Ada_2005 and then Chars_Is (Scope (E), "handling") and then Chars_Is (Scope (Scope (E)), "characters") and then Chars_Is (Scope (Scope (Scope (E))), "ada") @@ -297,8 +298,8 @@ package body Restrict is -- Start of processing for Check_Restriction begin - -- In CodePeer mode, we do not want to check for any restriction, or - -- set additional restrictions than those already set in gnat1drv.adb + -- In CodePeer mode, we do not want to check for any restriction, or set + -- additional restrictions other than those already set in gnat1drv.adb -- so that we have consistency between each compilation. if CodePeer_Mode then @@ -396,6 +397,29 @@ package body Restrict is end loop; end Check_Restriction_No_Dependence; + -------------------------------------- + -- Check_Wide_Character_Restriction -- + -------------------------------------- + + procedure Check_Wide_Character_Restriction (E : Entity_Id; N : Node_Id) is + begin + if Restriction_Check_Required (No_Wide_Characters) + and then Comes_From_Source (N) + then + declare + T : constant Entity_Id := Root_Type (E); + begin + if T = Standard_Wide_Character or else + T = Standard_Wide_String or else + T = Standard_Wide_Wide_Character or else + T = Standard_Wide_Wide_String + then + Check_Restriction (No_Wide_Characters, N); + end if; + end; + end if; + end Check_Wide_Character_Restriction; + ---------------------------------------- -- Cunit_Boolean_Restrictions_Restore -- ---------------------------------------- @@ -562,6 +586,15 @@ package body Restrict is return Restrictions.Set (R) and then not Restriction_Warnings (R); end Restriction_Active; + -------------------------------- + -- Restriction_Check_Required -- + -------------------------------- + + function Restriction_Check_Required (R : All_Restrictions) return Boolean is + begin + return Restrictions.Set (R); + end Restriction_Check_Required; + --------------------- -- Restriction_Msg -- --------------------- diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads index a0c5df0b0f9..50d5427895c 100644 --- a/gcc/ada/restrict.ads +++ b/gcc/ada/restrict.ads @@ -239,6 +239,12 @@ package Restrict is -- mechanism (e.g. a special pragma) to handle this case, but there are -- only six cases, and it is not worth the effort to do something general. + procedure Check_Wide_Character_Restriction (E : Entity_Id; N : Node_Id); + -- This procedure checks if the No_Wide_Character restriction is active, + -- and if so, if N Comes_From_Source, and the root type of E is one of + -- [Wide_]Wide_Character or [Wide_]Wide_String, then the restriction + -- violation is recorded, and an appropriate message given. + function Cunit_Boolean_Restrictions_Save return Save_Cunit_Boolean_Restrictions; -- This function saves the compilation unit restriction settings, and @@ -286,7 +292,19 @@ package Restrict is -- used where the compiled code depends on whether the restriction is -- active. Always use Check_Restriction to record a violation. Note that -- this returns False if we only have a Restriction_Warnings set, since - -- restriction warnings should never affect generated code. + -- restriction warnings should never affect generated code. If you want + -- to know if a call to Check_Restriction is needed then use the function + -- Restriction_Check_Required instead. + + function Restriction_Check_Required (R : All_Restrictions) return Boolean; + pragma Inline (Restriction_Check_Required); + -- Determines if either a Restriction_Warnings or Restrictions pragma has + -- been given for the specified restriction. If true, then a subsequent + -- call to Check_Restriction is required if the restriction is violated. + -- This must not be used to guard code generation that depends on whether + -- a restriction is active (see Restriction_Active above). Typically it + -- is used to avoid complex code to determine if a restriction is violated, + -- executing this code only if needed. function Restricted_Profile return Boolean; -- Tests if set of restrictions corresponding to Profile (Restricted) is diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index 2276e80d7ab..c0744c41cbb 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -1396,6 +1396,11 @@ package Rtsfind is RE_Conditional_Call, -- System.Tasking RE_Asynchronous_Call, -- System.Tasking + RE_Foreign_Task_Level, -- System.Tasking + RE_Environment_Task_Level, -- System.Tasking + RE_Independent_Task_Level, -- System.Tasking + RE_Library_Task_Level, -- System.Tasking + RE_Ada_Task_Control_Block, -- System.Tasking RE_Task_List, -- System.Tasking @@ -2561,6 +2566,11 @@ package Rtsfind is RE_Conditional_Call => System_Tasking, RE_Asynchronous_Call => System_Tasking, + RE_Foreign_Task_Level => System_Tasking, + RE_Environment_Task_Level => System_Tasking, + RE_Independent_Task_Level => System_Tasking, + RE_Library_Task_Level => System_Tasking, + RE_Ada_Task_Control_Block => System_Tasking, RE_Task_List => System_Tasking, diff --git a/gcc/ada/s-bitops.adb b/gcc/ada/s-bitops.adb index c49b829763d..dbf30ddd54e 100644 --- a/gcc/ada/s-bitops.adb +++ b/gcc/ada/s-bitops.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,6 +34,7 @@ pragma Compiler_Unit; with System; use System; with System.Unsigned_Types; use System.Unsigned_Types; +with Ada.Exceptions; use Ada.Exceptions; with Ada.Unchecked_Conversion; package body System.Bit_Ops is @@ -72,6 +73,7 @@ package body System.Bit_Ops is ----------------------- procedure Raise_Error; + pragma No_Return (Raise_Error); -- Raise Constraint_Error, complaining about unequal lengths ------------- @@ -211,7 +213,8 @@ package body System.Bit_Ops is procedure Raise_Error is begin - raise Constraint_Error; + Raise_Exception + (Constraint_Error'Identity, "operand lengths are unequal"); end Raise_Error; end System.Bit_Ops; diff --git a/gcc/ada/s-direio.adb b/gcc/ada/s-direio.adb index dee00cd3609..ef4c3ea9cf1 100644 --- a/gcc/ada/s-direio.adb +++ b/gcc/ada/s-direio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -127,7 +127,7 @@ package body System.Direct_IO is function End_Of_File (File : File_Type) return Boolean is begin FIO.Check_Read_Status (AP (File)); - return Count (File.Index) > Size (File); + return File.Index > Size (File); end End_Of_File; ----------- @@ -137,7 +137,7 @@ package body System.Direct_IO is function Index (File : File_Type) return Positive_Count is begin FIO.Check_File_Open (AP (File)); - return Count (File.Index); + return File.Index; end Index; ---------- diff --git a/gcc/ada/s-fatgen.adb b/gcc/ada/s-fatgen.adb index cf7e4254b66..1288904278d 100644 --- a/gcc/ada/s-fatgen.adb +++ b/gcc/ada/s-fatgen.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -162,13 +162,12 @@ package body System.Fat_Gen is begin if X = 0.0 then + + -- The normalized exponent of zero is zero, see RM A.5.2(15) + Frac := X; Expo := 0; - -- More useful would be defining Expo to be T'Machine_Emin - 1 or - -- T'Machine_Emin - T'Machine_Mantissa, which would preserve - -- monotonicity of the exponent function ??? - -- Check for infinities, transfinites, whatnot elsif X > T'Safe_Last then @@ -205,6 +204,7 @@ package body System.Fat_Gen is end if; -- Ax < R_Power (N) + end loop; -- 1 <= Ax < Rad @@ -229,6 +229,7 @@ package body System.Fat_Gen is end if; -- R_Neg_Power (N) <= Ax < 1 + end loop; end if; @@ -553,8 +554,8 @@ package body System.Fat_Gen is -- Scaling -- ------------- - -- Return x * rad ** adjustment quickly, - -- or quietly underflow to zero, or overflow naturally. + -- Return x * rad ** adjustment quickly, or quietly underflow to zero, + -- or overflow naturally. function Scaling (X : T; Adjustment : UI) return T is begin @@ -586,6 +587,7 @@ package body System.Fat_Gen is end if; -- -Log_Power (N) < Ex <= 0 + end loop; -- Ex = 0 @@ -611,6 +613,7 @@ package body System.Fat_Gen is end loop; -- Ex = 0 + end if; return Y; @@ -648,13 +651,13 @@ package body System.Fat_Gen is else Decompose (X, X_Frac, X_Exp); - -- A special case, if the number we had was a negative power of - -- two, then we want to add half of what we would otherwise add, - -- since the exponent is going to be reduced. + -- A special case, if the number we had was a negative power of two, + -- then we want to add half of what we would otherwise add, since the + -- exponent is going to be reduced. -- Note that X_Frac has the same sign as X, so if X_Frac is -0.5, - -- then we know that we have a negative number (and hence a - -- negative power of 2). + -- then we know that we have a negative number (and hence a negative + -- power of 2). if X_Frac = -0.5 then return X + Gradual_Scaling (X_Exp - T'Machine_Mantissa - 1); @@ -779,8 +782,8 @@ package body System.Fat_Gen is -- one read, but small enough so that all floating point object sizes -- are a multiple of the Float_Word'Size. - -- The following conditions must be met for all possible - -- instantiations of the attributes package: + -- The following conditions must be met for all possible instantiations + -- of the attributes package: -- - T'Size is an integral multiple of Float_Word'Size @@ -795,9 +798,11 @@ package body System.Fat_Gen is type Rep_Index is range 0 .. 7; Rep_Words : constant Positive := - (T'Size + Float_Word'Size - 1) / Float_Word'Size; - Rep_Last : constant Rep_Index := Rep_Index'Min - (Rep_Index (Rep_Words - 1), (T'Mantissa + 16) / Float_Word'Size); + (T'Size + Float_Word'Size - 1) / Float_Word'Size; + Rep_Last : constant Rep_Index := + Rep_Index'Min + (Rep_Index (Rep_Words - 1), + (T'Mantissa + 16) / Float_Word'Size); -- Determine the number of Float_Words needed for representing the -- entire floating-point value. Do not take into account excessive -- padding, as occurs on IA-64 where 80 bits floats get padded to 128 diff --git a/gcc/ada/s-ficobl.ads b/gcc/ada/s-ficobl.ads index f58ae6cb040..c8f6bc66207 100644 --- a/gcc/ada/s-ficobl.ads +++ b/gcc/ada/s-ficobl.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -60,6 +60,7 @@ package System.File_Control_Block is -- Used to hold name and form strings type File_Mode is (In_File, Inout_File, Out_File, Append_File); + subtype Read_File_Mode is File_Mode range In_File .. Inout_File; -- File mode (union of file modes permitted by individual packages, -- the types File_Mode in the individual packages are declared to -- allow easy conversion to and from this general type. diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index 185fc52cff9..a11d83311e5 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.adb @@ -205,7 +205,7 @@ package body System.File_IO is begin if File = null then raise Status_Error with "file not open"; - elsif File.Mode > Inout_File then + elsif File.Mode not in Read_File_Mode then raise Mode_Error with "file not readable"; end if; end Check_Read_Status; @@ -385,7 +385,7 @@ package body System.File_IO is end Errno_Message; function Errno_Message - (Name : String; + (Name : String; Errno : Integer := OS_Lib.Errno) return String is begin @@ -1183,7 +1183,7 @@ package body System.File_IO is -- reopen. if Mode = File.Mode - and then Mode <= Inout_File + and then Mode in Read_File_Mode then rewind (File.Stream); diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads index 341a27953ab..a6418debfab 100755 --- a/gcc/ada/s-os_lib.ads +++ b/gcc/ada/s-os_lib.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1995-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2010, 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- -- @@ -203,8 +203,9 @@ package System.OS_Lib is (Name : String; Fmode : Mode) return File_Descriptor; -- Creates new file with given name for writing, returning file descriptor - -- for subsequent use in Write calls. File descriptor returned is - -- Invalid_FD if file cannot be successfully created. + -- for subsequent use in Write calls. If the file already exists, it is + -- overwritten. File descriptor returned is Invalid_FD if file cannot be + -- successfully created. function Create_Output_Text_File (Name : String) return File_Descriptor; -- Creates new text file with given name suitable to redirect standard @@ -687,9 +688,8 @@ package System.OS_Lib is -- (notably Unix systems) a simple file name may also work (if the -- executable can be located in the path). -- - -- "Spawn" should be avoided in tasking applications, since there are - -- subtle interactions between creating a process and signals/locks - -- that can cause troubles. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. -- -- Note: Arguments in Args that contain spaces and/or quotes such as -- "--GCC=gcc -v" or "--GCC=""gcc -v""" are not portable across all @@ -716,7 +716,8 @@ package System.OS_Lib is -- by the operating system, or -1 under VxWorks and any other similar -- operating systems which have no notion of separately spawnable programs. -- - -- "Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. procedure Spawn (Program_Name : String; @@ -729,7 +730,8 @@ package System.OS_Lib is -- Standard Error output is also redirected. -- Return_Code is set to the status code returned by the operating system -- - -- "Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. procedure Spawn (Program_Name : String; @@ -746,7 +748,8 @@ package System.OS_Lib is -- will be set to the status code returned by the operating system. -- Otherwise, Return_Code is undefined. -- - -- "Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. type Process_Id is private; -- A private type used to identify a process activated by the following @@ -767,7 +770,8 @@ package System.OS_Lib is -- returned. Parameters are to be used as in Spawn. If Invalid_Pid is -- returned the program could not be spawned. -- - -- "Non_Blocking_Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. @@ -782,7 +786,8 @@ package System.OS_Lib is -- Standard Error output is also redirected. Invalid_Pid is returned -- if the program could not be spawned successfully. -- - -- "Non_Blocking_Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. @@ -800,7 +805,8 @@ package System.OS_Lib is -- file could not be created or if the program could not be spawned -- successfully. -- - -- "Non_Blocking_Spawn" should not be used in tasking applications. + -- Spawning processes from tasking programs is not recommended. See + -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. @@ -826,6 +832,70 @@ package System.OS_Lib is -- be freed by the programmer (when it is no longer needed) to avoid -- memory leaks. + ------------------------------------- + -- NOTE: Spawn in Tasking Programs -- + ------------------------------------- + + -- Spawning processes in tasking programs using the above Spawn and + -- Non_Blocking_Spawn subprograms is not recommended, because there are + -- subtle interactions between creating a process and signals/locks that + -- can cause trouble. These issues are not specific to Ada; they depend + -- primarily on the operating system. + + -- If you need to spawn processes in a tasking program, you will need to + -- understand the semantics of your operating system, and you are likely to + -- write non-portable code, because operating systems differ in this area. + + -- The Spawn and Non_Blocking_Spawn subprograms call the following + -- operating system functions: + + -- On Windows: spawnvp (blocking) or CreateProcess (non-blocking) + + -- On Solaris: fork1, followed in the child process by execv + + -- On other Unix-like systems, and on VMS: fork, followed in the child + -- process by execv. + + -- On vxworks, nucleus, and RTX, spawning of processes is not supported + + -- For details, look at the functions __gnat_portable_spawn and + -- __gnat_portable_no_block_spawn in adaint.c. + + -- You should read the operating-system-specific documentation for the + -- above functions, paying special attention to subtle interactions with + -- threading, signals, locks, and file descriptors. Most of the issues are + -- related to the fact that on Unix, there is a window of time between fork + -- and execv; Windows does not have this problem, because spawning is done + -- in a single operation. + + -- On Posix-compliant systems, such as Linux, fork duplicates just the + -- calling thread. (On Solaris, fork1 is the Posix-compliant version of + -- fork.) + + -- You should avoid using signals while spawning. This includes signals + -- used internally by the Ada run-time system, such as timer signals used + -- to implement delay statements. + + -- It is best to spawn any subprocesses very early, before the parent + -- process creates tasks, locks, or installs signal handlers. Certainly + -- avoid doing simultaneous spawns from multiple threads of the same + -- process. + + -- There is no problem spawning a subprocess that uses tasking: the + -- problems are caused only by tasking in the parent. + + -- If the parent is using tasking, and needs to spawn subprocesses at + -- arbitrary times, one technique is for the parent to spawn (very early) + -- a particular spawn-manager subprocess whose job is to spawn other + -- processes. The spawn-manager avoids tasking. The parent sends messages + -- to the spawn-manager requesting it to spawn processes, using whatever + -- inter-process communication mechanism you like, such as sockets. + + -- In short, mixing spawning of subprocesses with tasking is a tricky + -- business, and should be avoided if possible, but if it is necessary, + -- the above guidelines should be followed, and you should beware of + -- portability problems. + ------------------- -- Miscellaneous -- ------------------- diff --git a/gcc/ada/s-pooglo.ads b/gcc/ada/s-pooglo.ads index 3ab05f009bf..ae2e1af86fc 100644 --- a/gcc/ada/s-pooglo.ads +++ b/gcc/ada/s-pooglo.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -57,13 +57,13 @@ package System.Pool_Global is (Pool : Unbounded_No_Reclaim_Pool) return System.Storage_Elements.Storage_Count; - procedure Allocate + overriding procedure Allocate (Pool : in out Unbounded_No_Reclaim_Pool; Address : out System.Address; Storage_Size : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count); - procedure Deallocate + overriding procedure Deallocate (Pool : in out Unbounded_No_Reclaim_Pool; Address : System.Address; Storage_Size : System.Storage_Elements.Storage_Count; diff --git a/gcc/ada/s-stratt-xdr.adb b/gcc/ada/s-stratt-xdr.adb new file mode 100644 index 00000000000..86e190a98b5 --- /dev/null +++ b/gcc/ada/s-stratt-xdr.adb @@ -0,0 +1,1891 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . S T R E A M _ A T T R I B U T E S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 1996-2010, Free Software Foundation, Inc. -- +-- -- +-- GARLIC is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- 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 -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This file is an alternate version of s-stratt.adb based on the XDR +-- standard. It is especially useful for exchanging streams between two +-- different systems with different basic type representations and endianness. + +with Ada.IO_Exceptions; +with Ada.Streams; use Ada.Streams; +with Ada.Unchecked_Conversion; + +package body System.Stream_Attributes is + + pragma Suppress (Range_Check); + pragma Suppress (Overflow_Check); + + use UST; + + Data_Error : exception renames Ada.IO_Exceptions.End_Error; + -- Exception raised if insufficient data read (End_Error is mandated by + -- AI95-00132). + + SU : constant := System.Storage_Unit; + -- The code in this body assumes that SU = 8 + + BB : constant := 2 ** SU; -- Byte base + BL : constant := 2 ** SU - 1; -- Byte last + BS : constant := 2 ** (SU - 1); -- Byte sign + + US : constant := Unsigned'Size; -- Unsigned size + UB : constant := (US - 1) / SU + 1; -- Unsigned byte + UL : constant := 2 ** US - 1; -- Unsigned last + + subtype SE is Ada.Streams.Stream_Element; + subtype SEA is Ada.Streams.Stream_Element_Array; + subtype SEO is Ada.Streams.Stream_Element_Offset; + + generic function UC renames Ada.Unchecked_Conversion; + + type Field_Type is + record + E_Size : Integer; -- Exponent bit size + E_Bias : Integer; -- Exponent bias + F_Size : Integer; -- Fraction bit size + E_Last : Integer; -- Max exponent value + F_Mask : SE; -- Mask to apply on first fraction byte + E_Bytes : SEO; -- N. of exponent bytes completely used + F_Bytes : SEO; -- N. of fraction bytes completely used + F_Bits : Integer; -- N. of bits used on first fraction word + end record; + + type Precision is (Single, Double, Quadruple); + + Fields : constant array (Precision) of Field_Type := ( + + -- Single precision + + (E_Size => 8, + E_Bias => 127, + F_Size => 23, + E_Last => 2 ** 8 - 1, + F_Mask => 16#7F#, -- 2 ** 7 - 1, + E_Bytes => 2, + F_Bytes => 3, + F_Bits => 23 mod US), + + -- Double precision + + (E_Size => 11, + E_Bias => 1023, + F_Size => 52, + E_Last => 2 ** 11 - 1, + F_Mask => 16#0F#, -- 2 ** 4 - 1, + E_Bytes => 2, + F_Bytes => 7, + F_Bits => 52 mod US), + + -- Quadruple precision + + (E_Size => 15, + E_Bias => 16383, + F_Size => 112, + E_Last => 2 ** 8 - 1, + F_Mask => 16#FF#, -- 2 ** 8 - 1, + E_Bytes => 2, + F_Bytes => 14, + F_Bits => 112 mod US)); + + -- The representation of all items requires a multiple of four bytes + -- (or 32 bits) of data. The bytes are numbered 0 through n-1. The bytes + -- are read or written to some byte stream such that byte m always + -- precedes byte m+1. If the n bytes needed to contain the data are not + -- a multiple of four, then the n bytes are followed by enough (0 to 3) + -- residual zero bytes, r, to make the total byte count a multiple of 4. + + -- An XDR signed integer is a 32-bit datum that encodes an integer + -- in the range [-2147483648,2147483647]. The integer is represented + -- in two's complement notation. The most and least significant bytes + -- are 0 and 3, respectively. Integers are declared as follows: + + -- (MSB) (LSB) + -- +-------+-------+-------+-------+ + -- |byte 0 |byte 1 |byte 2 |byte 3 | + -- +-------+-------+-------+-------+ + -- <------------32 bits------------> + + SSI_L : constant := 1; + SI_L : constant := 2; + I_L : constant := 4; + LI_L : constant := 8; + LLI_L : constant := 8; + + subtype XDR_S_SSI is SEA (1 .. SSI_L); + subtype XDR_S_SI is SEA (1 .. SI_L); + subtype XDR_S_I is SEA (1 .. I_L); + subtype XDR_S_LI is SEA (1 .. LI_L); + subtype XDR_S_LLI is SEA (1 .. LLI_L); + + function Short_Short_Integer_To_XDR_S_SSI is + new Ada.Unchecked_Conversion (Short_Short_Integer, XDR_S_SSI); + function XDR_S_SSI_To_Short_Short_Integer is + new Ada.Unchecked_Conversion (XDR_S_SSI, Short_Short_Integer); + + function Short_Integer_To_XDR_S_SI is + new Ada.Unchecked_Conversion (Short_Integer, XDR_S_SI); + function XDR_S_SI_To_Short_Integer is + new Ada.Unchecked_Conversion (XDR_S_SI, Short_Integer); + + function Integer_To_XDR_S_I is + new Ada.Unchecked_Conversion (Integer, XDR_S_I); + function XDR_S_I_To_Integer is + new Ada.Unchecked_Conversion (XDR_S_I, Integer); + + function Long_Long_Integer_To_XDR_S_LI is + new Ada.Unchecked_Conversion (Long_Long_Integer, XDR_S_LI); + function XDR_S_LI_To_Long_Long_Integer is + new Ada.Unchecked_Conversion (XDR_S_LI, Long_Long_Integer); + + function Long_Long_Integer_To_XDR_S_LLI is + new Ada.Unchecked_Conversion (Long_Long_Integer, XDR_S_LLI); + function XDR_S_LLI_To_Long_Long_Integer is + new Ada.Unchecked_Conversion (XDR_S_LLI, Long_Long_Integer); + + -- An XDR unsigned integer is a 32-bit datum that encodes a nonnegative + -- integer in the range [0,4294967295]. It is represented by an unsigned + -- binary number whose most and least significant bytes are 0 and 3, + -- respectively. An unsigned integer is declared as follows: + + -- (MSB) (LSB) + -- +-------+-------+-------+-------+ + -- |byte 0 |byte 1 |byte 2 |byte 3 | + -- +-------+-------+-------+-------+ + -- <------------32 bits------------> + + SSU_L : constant := 1; + SU_L : constant := 2; + U_L : constant := 4; + LU_L : constant := 8; + LLU_L : constant := 8; + + subtype XDR_S_SSU is SEA (1 .. SSU_L); + subtype XDR_S_SU is SEA (1 .. SU_L); + subtype XDR_S_U is SEA (1 .. U_L); + subtype XDR_S_LU is SEA (1 .. LU_L); + subtype XDR_S_LLU is SEA (1 .. LLU_L); + + type XDR_SSU is mod BB ** SSU_L; + type XDR_SU is mod BB ** SU_L; + type XDR_U is mod BB ** U_L; + + function Short_Unsigned_To_XDR_S_SU is + new Ada.Unchecked_Conversion (Short_Unsigned, XDR_S_SU); + function XDR_S_SU_To_Short_Unsigned is + new Ada.Unchecked_Conversion (XDR_S_SU, Short_Unsigned); + + function Unsigned_To_XDR_S_U is + new Ada.Unchecked_Conversion (Unsigned, XDR_S_U); + function XDR_S_U_To_Unsigned is + new Ada.Unchecked_Conversion (XDR_S_U, Unsigned); + + function Long_Long_Unsigned_To_XDR_S_LU is + new Ada.Unchecked_Conversion (Long_Long_Unsigned, XDR_S_LU); + function XDR_S_LU_To_Long_Long_Unsigned is + new Ada.Unchecked_Conversion (XDR_S_LU, Long_Long_Unsigned); + + function Long_Long_Unsigned_To_XDR_S_LLU is + new Ada.Unchecked_Conversion (Long_Long_Unsigned, XDR_S_LLU); + function XDR_S_LLU_To_Long_Long_Unsigned is + new Ada.Unchecked_Conversion (XDR_S_LLU, Long_Long_Unsigned); + + -- The standard defines the floating-point data type "float" (32 bits + -- or 4 bytes). The encoding used is the IEEE standard for normalized + -- single-precision floating-point numbers. + + -- The standard defines the encoding used for the double-precision + -- floating-point data type "double" (64 bits or 8 bytes). The encoding + -- used is the IEEE standard for normalized double-precision floating-point + -- numbers. + + SF_L : constant := 4; -- Single precision + F_L : constant := 4; -- Single precision + LF_L : constant := 8; -- Double precision + LLF_L : constant := 16; -- Quadruple precision + + TM_L : constant := 8; + subtype XDR_S_TM is SEA (1 .. TM_L); + type XDR_TM is mod BB ** TM_L; + + type XDR_SA is mod 2 ** Standard'Address_Size; + function To_XDR_SA is new UC (System.Address, XDR_SA); + function To_XDR_SA is new UC (XDR_SA, System.Address); + + -- Enumerations have the same representation as signed integers. + -- Enumerations are handy for describing subsets of the integers. + + -- Booleans are important enough and occur frequently enough to warrant + -- their own explicit type in the standard. Booleans are declared as + -- an enumeration, with FALSE = 0 and TRUE = 1. + + -- The standard defines a string of n (numbered 0 through n-1) ASCII + -- bytes to be the number n encoded as an unsigned integer (as described + -- above), and followed by the n bytes of the string. Byte m of the string + -- always precedes byte m+1 of the string, and byte 0 of the string always + -- follows the string's length. If n is not a multiple of four, then the + -- n bytes are followed by enough (0 to 3) residual zero bytes, r, to make + -- the total byte count a multiple of four. + + -- To fit with XDR string, do not consider character as an enumeration + -- type. + + C_L : constant := 1; + subtype XDR_S_C is SEA (1 .. C_L); + + -- Consider Wide_Character as an enumeration type + + WC_L : constant := 4; + subtype XDR_S_WC is SEA (1 .. WC_L); + type XDR_WC is mod BB ** WC_L; + + -- Consider Wide_Wide_Character as an enumeration type + + WWC_L : constant := 8; + subtype XDR_S_WWC is SEA (1 .. WWC_L); + type XDR_WWC is mod BB ** WWC_L; + + -- Optimization: if we already have the correct Bit_Order, then some + -- computations can be avoided since the source and the target will be + -- identical anyway. They will be replaced by direct unchecked + -- conversions. + + Optimize_Integers : constant Boolean := + Default_Bit_Order = High_Order_First; + + ----------------- + -- Block_IO_OK -- + ----------------- + + function Block_IO_OK return Boolean is + begin + return False; + end Block_IO_OK; + + ---------- + -- I_AD -- + ---------- + + function I_AD (Stream : not null access RST) return Fat_Pointer is + FP : Fat_Pointer; + + begin + FP.P1 := I_AS (Stream).P1; + FP.P2 := I_AS (Stream).P1; + + return FP; + end I_AD; + + ---------- + -- I_AS -- + ---------- + + function I_AS (Stream : not null access RST) return Thin_Pointer is + S : XDR_S_TM; + L : SEO; + U : XDR_TM := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + else + for N in S'Range loop + U := U * BB + XDR_TM (S (N)); + end loop; + + return (P1 => To_XDR_SA (XDR_SA (U))); + end if; + end I_AS; + + --------- + -- I_B -- + --------- + + function I_B (Stream : not null access RST) return Boolean is + begin + case I_SSU (Stream) is + when 0 => return False; + when 1 => return True; + when others => raise Data_Error; + end case; + end I_B; + + --------- + -- I_C -- + --------- + + function I_C (Stream : not null access RST) return Character is + S : XDR_S_C; + L : SEO; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + else + -- Use Ada requirements on Character representation clause + + return Character'Val (S (1)); + end if; + end I_C; + + --------- + -- I_F -- + --------- + + function I_F (Stream : not null access RST) return Float is + I : constant Precision := Single; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Last : Integer renames Fields (I).E_Last; + F_Mask : SE renames Fields (I).F_Mask; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + + Positive : Boolean; + Exponent : Long_Unsigned; + Fraction : Long_Unsigned; + Result : Float; + S : SEA (1 .. F_L); + L : SEO; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + end if; + + -- Extract Fraction, Sign and Exponent + + Fraction := Long_Unsigned (S (F_L + 1 - F_Bytes) and F_Mask); + for N in F_L + 2 - F_Bytes .. F_L loop + Fraction := Fraction * BB + Long_Unsigned (S (N)); + end loop; + Result := Float'Scaling (Float (Fraction), -F_Size); + + if BS <= S (1) then + Positive := False; + Exponent := Long_Unsigned (S (1) - BS); + else + Positive := True; + Exponent := Long_Unsigned (S (1)); + end if; + + for N in 2 .. E_Bytes loop + Exponent := Exponent * BB + Long_Unsigned (S (N)); + end loop; + Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + + -- NaN or Infinities + + if Integer (Exponent) = E_Last then + raise Constraint_Error; + + elsif Exponent = 0 then + + -- Signed zeros + + if Fraction = 0 then + null; + + -- Denormalized float + + else + Result := Float'Scaling (Result, 1 - E_Bias); + end if; + + -- Normalized float + + else + Result := Float'Scaling + (1.0 + Result, Integer (Exponent) - E_Bias); + end if; + + if not Positive then + Result := -Result; + end if; + + return Result; + end I_F; + + --------- + -- I_I -- + --------- + + function I_I (Stream : not null access RST) return Integer is + S : XDR_S_I; + L : SEO; + U : XDR_U := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_I_To_Integer (S); + + else + for N in S'Range loop + U := U * BB + XDR_U (S (N)); + end loop; + + -- Test sign and apply two complement notation + + if S (1) < BL then + return Integer (U); + + else + return Integer (-((XDR_U'Last xor U) + 1)); + end if; + end if; + end I_I; + + ---------- + -- I_LF -- + ---------- + + function I_LF (Stream : not null access RST) return Long_Float is + I : constant Precision := Double; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Last : Integer renames Fields (I).E_Last; + F_Mask : SE renames Fields (I).F_Mask; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + + Positive : Boolean; + Exponent : Long_Unsigned; + Fraction : Long_Long_Unsigned; + Result : Long_Float; + S : SEA (1 .. LF_L); + L : SEO; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + end if; + + -- Extract Fraction, Sign and Exponent + + Fraction := Long_Long_Unsigned (S (LF_L + 1 - F_Bytes) and F_Mask); + for N in LF_L + 2 - F_Bytes .. LF_L loop + Fraction := Fraction * BB + Long_Long_Unsigned (S (N)); + end loop; + + Result := Long_Float'Scaling (Long_Float (Fraction), -F_Size); + + if BS <= S (1) then + Positive := False; + Exponent := Long_Unsigned (S (1) - BS); + else + Positive := True; + Exponent := Long_Unsigned (S (1)); + end if; + + for N in 2 .. E_Bytes loop + Exponent := Exponent * BB + Long_Unsigned (S (N)); + end loop; + + Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + + -- NaN or Infinities + + if Integer (Exponent) = E_Last then + raise Constraint_Error; + + elsif Exponent = 0 then + + -- Signed zeros + + if Fraction = 0 then + null; + + -- Denormalized float + + else + Result := Long_Float'Scaling (Result, 1 - E_Bias); + end if; + + -- Normalized float + + else + Result := Long_Float'Scaling + (1.0 + Result, Integer (Exponent) - E_Bias); + end if; + + if not Positive then + Result := -Result; + end if; + + return Result; + end I_LF; + + ---------- + -- I_LI -- + ---------- + + function I_LI (Stream : not null access RST) return Long_Integer is + S : XDR_S_LI; + L : SEO; + U : Unsigned := 0; + X : Long_Unsigned := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return Long_Integer (XDR_S_LI_To_Long_Long_Integer (S)); + + else + + -- Compute using machine unsigned + -- rather than long_long_unsigned + + for N in S'Range loop + U := U * BB + Unsigned (S (N)); + + -- We have filled an unsigned + + if N mod UB = 0 then + X := Shift_Left (X, US) + Long_Unsigned (U); + U := 0; + end if; + end loop; + + -- Test sign and apply two complement notation + + if S (1) < BL then + return Long_Integer (X); + else + return Long_Integer (-((Long_Unsigned'Last xor X) + 1)); + end if; + + end if; + end I_LI; + + ----------- + -- I_LLF -- + ----------- + + function I_LLF (Stream : not null access RST) return Long_Long_Float is + I : constant Precision := Quadruple; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Last : Integer renames Fields (I).E_Last; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + + Positive : Boolean; + Exponent : Long_Unsigned; + Fraction_1 : Long_Long_Unsigned := 0; + Fraction_2 : Long_Long_Unsigned := 0; + Result : Long_Long_Float; + HF : constant Natural := F_Size / 2; + S : SEA (1 .. LLF_L); + L : SEO; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + end if; + + -- Extract Fraction, Sign and Exponent + + for I in LLF_L - F_Bytes + 1 .. LLF_L - 7 loop + Fraction_1 := Fraction_1 * BB + Long_Long_Unsigned (S (I)); + end loop; + + for I in SEO (LLF_L - 6) .. SEO (LLF_L) loop + Fraction_2 := Fraction_2 * BB + Long_Long_Unsigned (S (I)); + end loop; + + Result := Long_Long_Float'Scaling (Long_Long_Float (Fraction_2), -HF); + Result := Long_Long_Float (Fraction_1) + Result; + Result := Long_Long_Float'Scaling (Result, HF - F_Size); + + if BS <= S (1) then + Positive := False; + Exponent := Long_Unsigned (S (1) - BS); + else + Positive := True; + Exponent := Long_Unsigned (S (1)); + end if; + + for N in 2 .. E_Bytes loop + Exponent := Exponent * BB + Long_Unsigned (S (N)); + end loop; + + Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + + -- NaN or Infinities + + if Integer (Exponent) = E_Last then + raise Constraint_Error; + + elsif Exponent = 0 then + + -- Signed zeros + + if Fraction_1 = 0 and then Fraction_2 = 0 then + null; + + -- Denormalized float + + else + Result := Long_Long_Float'Scaling (Result, 1 - E_Bias); + end if; + + -- Normalized float + + else + Result := Long_Long_Float'Scaling + (1.0 + Result, Integer (Exponent) - E_Bias); + end if; + + if not Positive then + Result := -Result; + end if; + + return Result; + end I_LLF; + + ----------- + -- I_LLI -- + ----------- + + function I_LLI (Stream : not null access RST) return Long_Long_Integer is + S : XDR_S_LLI; + L : SEO; + U : Unsigned := 0; + X : Long_Long_Unsigned := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_LLI_To_Long_Long_Integer (S); + + else + -- Compute using machine unsigned for computing + -- rather than long_long_unsigned. + + for N in S'Range loop + U := U * BB + Unsigned (S (N)); + + -- We have filled an unsigned + + if N mod UB = 0 then + X := Shift_Left (X, US) + Long_Long_Unsigned (U); + U := 0; + end if; + end loop; + + -- Test sign and apply two complement notation + + if S (1) < BL then + return Long_Long_Integer (X); + else + return Long_Long_Integer (-((Long_Long_Unsigned'Last xor X) + 1)); + end if; + end if; + end I_LLI; + + ----------- + -- I_LLU -- + ----------- + + function I_LLU (Stream : not null access RST) return Long_Long_Unsigned is + S : XDR_S_LLU; + L : SEO; + U : Unsigned := 0; + X : Long_Long_Unsigned := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_LLU_To_Long_Long_Unsigned (S); + + else + -- Compute using machine unsigned + -- rather than long_long_unsigned. + + for N in S'Range loop + U := U * BB + Unsigned (S (N)); + + -- We have filled an unsigned + + if N mod UB = 0 then + X := Shift_Left (X, US) + Long_Long_Unsigned (U); + U := 0; + end if; + end loop; + + return X; + end if; + end I_LLU; + + ---------- + -- I_LU -- + ---------- + + function I_LU (Stream : not null access RST) return Long_Unsigned is + S : XDR_S_LU; + L : SEO; + U : Unsigned := 0; + X : Long_Unsigned := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return Long_Unsigned (XDR_S_LU_To_Long_Long_Unsigned (S)); + + else + -- Compute using machine unsigned + -- rather than long_unsigned. + + for N in S'Range loop + U := U * BB + Unsigned (S (N)); + + -- We have filled an unsigned + + if N mod UB = 0 then + X := Shift_Left (X, US) + Long_Unsigned (U); + U := 0; + end if; + end loop; + + return X; + end if; + end I_LU; + + ---------- + -- I_SF -- + ---------- + + function I_SF (Stream : not null access RST) return Short_Float is + I : constant Precision := Single; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Last : Integer renames Fields (I).E_Last; + F_Mask : SE renames Fields (I).F_Mask; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + + Exponent : Long_Unsigned; + Fraction : Long_Unsigned; + Positive : Boolean; + Result : Short_Float; + S : SEA (1 .. SF_L); + L : SEO; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + end if; + + -- Extract Fraction, Sign and Exponent + + Fraction := Long_Unsigned (S (SF_L + 1 - F_Bytes) and F_Mask); + for N in SF_L + 2 - F_Bytes .. SF_L loop + Fraction := Fraction * BB + Long_Unsigned (S (N)); + end loop; + Result := Short_Float'Scaling (Short_Float (Fraction), -F_Size); + + if BS <= S (1) then + Positive := False; + Exponent := Long_Unsigned (S (1) - BS); + else + Positive := True; + Exponent := Long_Unsigned (S (1)); + end if; + + for N in 2 .. E_Bytes loop + Exponent := Exponent * BB + Long_Unsigned (S (N)); + end loop; + Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + + -- NaN or Infinities + + if Integer (Exponent) = E_Last then + raise Constraint_Error; + + elsif Exponent = 0 then + + -- Signed zeros + + if Fraction = 0 then + null; + + -- Denormalized float + + else + Result := Short_Float'Scaling (Result, 1 - E_Bias); + end if; + + -- Normalized float + + else + Result := Short_Float'Scaling + (1.0 + Result, Integer (Exponent) - E_Bias); + end if; + + if not Positive then + Result := -Result; + end if; + + return Result; + end I_SF; + + ---------- + -- I_SI -- + ---------- + + function I_SI (Stream : not null access RST) return Short_Integer is + S : XDR_S_SI; + L : SEO; + U : XDR_SU := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_SI_To_Short_Integer (S); + + else + for N in S'Range loop + U := U * BB + XDR_SU (S (N)); + end loop; + + -- Test sign and apply two complement notation + + if S (1) < BL then + return Short_Integer (U); + else + return Short_Integer (-((XDR_SU'Last xor U) + 1)); + end if; + end if; + end I_SI; + + ----------- + -- I_SSI -- + ----------- + + function I_SSI (Stream : not null access RST) return Short_Short_Integer is + S : XDR_S_SSI; + L : SEO; + U : XDR_SSU; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_SSI_To_Short_Short_Integer (S); + + else + U := XDR_SSU (S (1)); + + -- Test sign and apply two complement notation + + if S (1) < BL then + return Short_Short_Integer (U); + else + return Short_Short_Integer (-((XDR_SSU'Last xor U) + 1)); + end if; + end if; + end I_SSI; + + ----------- + -- I_SSU -- + ----------- + + function I_SSU (Stream : not null access RST) return Short_Short_Unsigned is + S : XDR_S_SSU; + L : SEO; + U : XDR_SSU := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + else + U := XDR_SSU (S (1)); + return Short_Short_Unsigned (U); + end if; + end I_SSU; + + ---------- + -- I_SU -- + ---------- + + function I_SU (Stream : not null access RST) return Short_Unsigned is + S : XDR_S_SU; + L : SEO; + U : XDR_SU := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_SU_To_Short_Unsigned (S); + + else + for N in S'Range loop + U := U * BB + XDR_SU (S (N)); + end loop; + + return Short_Unsigned (U); + end if; + end I_SU; + + --------- + -- I_U -- + --------- + + function I_U (Stream : not null access RST) return Unsigned is + S : XDR_S_U; + L : SEO; + U : XDR_U := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + elsif Optimize_Integers then + return XDR_S_U_To_Unsigned (S); + + else + for N in S'Range loop + U := U * BB + XDR_U (S (N)); + end loop; + + return Unsigned (U); + end if; + end I_U; + + ---------- + -- I_WC -- + ---------- + + function I_WC (Stream : not null access RST) return Wide_Character is + S : XDR_S_WC; + L : SEO; + U : XDR_WC := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + else + for N in S'Range loop + U := U * BB + XDR_WC (S (N)); + end loop; + + -- Use Ada requirements on Wide_Character representation clause + + return Wide_Character'Val (U); + end if; + end I_WC; + + ----------- + -- I_WWC -- + ----------- + + function I_WWC (Stream : not null access RST) return Wide_Wide_Character is + S : XDR_S_WWC; + L : SEO; + U : XDR_WWC := 0; + + begin + Ada.Streams.Read (Stream.all, S, L); + + if L /= S'Last then + raise Data_Error; + + else + for N in S'Range loop + U := U * BB + XDR_WWC (S (N)); + end loop; + + -- Use Ada requirements on Wide_Wide_Character representation clause + + return Wide_Wide_Character'Val (U); + end if; + end I_WWC; + + ---------- + -- W_AD -- + ---------- + + procedure W_AD (Stream : not null access RST; Item : Fat_Pointer) is + S : XDR_S_TM; + U : XDR_TM; + + begin + U := XDR_TM (To_XDR_SA (Item.P1)); + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + Ada.Streams.Write (Stream.all, S); + + U := XDR_TM (To_XDR_SA (Item.P2)); + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + Ada.Streams.Write (Stream.all, S); + + if U /= 0 then + raise Data_Error; + end if; + end W_AD; + + ---------- + -- W_AS -- + ---------- + + procedure W_AS (Stream : not null access RST; Item : Thin_Pointer) is + S : XDR_S_TM; + U : XDR_TM := XDR_TM (To_XDR_SA (Item.P1)); + + begin + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + Ada.Streams.Write (Stream.all, S); + + if U /= 0 then + raise Data_Error; + end if; + end W_AS; + + --------- + -- W_B -- + --------- + + procedure W_B (Stream : not null access RST; Item : Boolean) is + begin + if Item then + W_SSU (Stream, 1); + else + W_SSU (Stream, 0); + end if; + end W_B; + + --------- + -- W_C -- + --------- + + procedure W_C (Stream : not null access RST; Item : Character) is + S : XDR_S_C; + + pragma Assert (C_L = 1); + + begin + -- Use Ada requirements on Character representation clause + + S (1) := SE (Character'Pos (Item)); + + Ada.Streams.Write (Stream.all, S); + end W_C; + + --------- + -- W_F -- + --------- + + procedure W_F (Stream : not null access RST; Item : Float) is + I : constant Precision := Single; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + F_Mask : SE renames Fields (I).F_Mask; + + Exponent : Long_Unsigned; + Fraction : Long_Unsigned; + Positive : Boolean; + E : Integer; + F : Float; + S : SEA (1 .. F_L) := (others => 0); + + begin + if not Item'Valid then + raise Constraint_Error; + end if; + + -- Compute Sign + + Positive := (0.0 <= Item); + F := abs (Item); + + -- Signed zero + + if F = 0.0 then + Exponent := 0; + Fraction := 0; + + else + E := Float'Exponent (F) - 1; + + -- Denormalized float + + if E <= -E_Bias then + F := Float'Scaling (F, F_Size + E_Bias - 1); + E := -E_Bias; + else + F := Float'Scaling (Float'Fraction (F), F_Size + 1); + end if; + + -- Compute Exponent and Fraction + + Exponent := Long_Unsigned (E + E_Bias); + Fraction := Long_Unsigned (F * 2.0) / 2; + end if; + + -- Store Fraction + + for I in reverse F_L - F_Bytes + 1 .. F_L loop + S (I) := SE (Fraction mod BB); + Fraction := Fraction / BB; + end loop; + + -- Remove implicit bit + + S (F_L - F_Bytes + 1) := S (F_L - F_Bytes + 1) and F_Mask; + + -- Store Exponent (not always at the beginning of a byte) + + Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + for N in reverse 1 .. E_Bytes loop + S (N) := SE (Exponent mod BB) + S (N); + Exponent := Exponent / BB; + end loop; + + -- Store Sign + + if not Positive then + S (1) := S (1) + BS; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_F; + + --------- + -- W_I -- + --------- + + procedure W_I (Stream : not null access RST; Item : Integer) is + S : XDR_S_I; + U : XDR_U; + + begin + if Optimize_Integers then + S := Integer_To_XDR_S_I (Item); + + else + -- Test sign and apply two complement notation + + U := (if Item < 0 + then XDR_U'Last xor XDR_U (-(Item + 1)) + else XDR_U (Item)); + + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_I; + + ---------- + -- W_LF -- + ---------- + + procedure W_LF (Stream : not null access RST; Item : Long_Float) is + I : constant Precision := Double; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + F_Mask : SE renames Fields (I).F_Mask; + + Exponent : Long_Unsigned; + Fraction : Long_Long_Unsigned; + Positive : Boolean; + E : Integer; + F : Long_Float; + S : SEA (1 .. LF_L) := (others => 0); + + begin + if not Item'Valid then + raise Constraint_Error; + end if; + + -- Compute Sign + + Positive := (0.0 <= Item); + F := abs (Item); + + -- Signed zero + + if F = 0.0 then + Exponent := 0; + Fraction := 0; + + else + E := Long_Float'Exponent (F) - 1; + + -- Denormalized float + + if E <= -E_Bias then + E := -E_Bias; + F := Long_Float'Scaling (F, F_Size + E_Bias - 1); + else + F := Long_Float'Scaling (F, F_Size - E); + end if; + + -- Compute Exponent and Fraction + + Exponent := Long_Unsigned (E + E_Bias); + Fraction := Long_Long_Unsigned (F * 2.0) / 2; + end if; + + -- Store Fraction + + for I in reverse LF_L - F_Bytes + 1 .. LF_L loop + S (I) := SE (Fraction mod BB); + Fraction := Fraction / BB; + end loop; + + -- Remove implicit bit + + S (LF_L - F_Bytes + 1) := S (LF_L - F_Bytes + 1) and F_Mask; + + -- Store Exponent (not always at the beginning of a byte) + + Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + for N in reverse 1 .. E_Bytes loop + S (N) := SE (Exponent mod BB) + S (N); + Exponent := Exponent / BB; + end loop; + + -- Store Sign + + if not Positive then + S (1) := S (1) + BS; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LF; + + ---------- + -- W_LI -- + ---------- + + procedure W_LI (Stream : not null access RST; Item : Long_Integer) is + S : XDR_S_LI; + U : Unsigned; + X : Long_Unsigned; + + begin + if Optimize_Integers then + S := Long_Long_Integer_To_XDR_S_LI (Long_Long_Integer (Item)); + + else + -- Test sign and apply two complement notation + + if Item < 0 then + X := Long_Unsigned'Last xor Long_Unsigned (-(Item + 1)); + else + X := Long_Unsigned (Item); + end if; + + -- Compute using machine unsigned rather than long_unsigned + + for N in reverse S'Range loop + + -- We have filled an unsigned + + if (LU_L - N) mod UB = 0 then + U := Unsigned (X and UL); + X := Shift_Right (X, US); + end if; + + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LI; + + ----------- + -- W_LLF -- + ----------- + + procedure W_LLF (Stream : not null access RST; Item : Long_Long_Float) is + I : constant Precision := Quadruple; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + + HFS : constant Integer := F_Size / 2; + + Exponent : Long_Unsigned; + Fraction_1 : Long_Long_Unsigned; + Fraction_2 : Long_Long_Unsigned; + Positive : Boolean; + E : Integer; + F : Long_Long_Float := Item; + S : SEA (1 .. LLF_L) := (others => 0); + + begin + if not Item'Valid then + raise Constraint_Error; + end if; + + -- Compute Sign + + Positive := (0.0 <= Item); + if F < 0.0 then + F := -Item; + end if; + + -- Signed zero + + if F = 0.0 then + Exponent := 0; + Fraction_1 := 0; + Fraction_2 := 0; + + else + E := Long_Long_Float'Exponent (F) - 1; + + -- Denormalized float + + if E <= -E_Bias then + F := Long_Long_Float'Scaling (F, E_Bias - 1); + E := -E_Bias; + else + F := Long_Long_Float'Scaling + (Long_Long_Float'Fraction (F), 1); + end if; + + -- Compute Exponent and Fraction + + Exponent := Long_Unsigned (E + E_Bias); + F := Long_Long_Float'Scaling (F, F_Size - HFS); + Fraction_1 := Long_Long_Unsigned (Long_Long_Float'Floor (F)); + F := F - Long_Long_Float (Fraction_1); + F := Long_Long_Float'Scaling (F, HFS); + Fraction_2 := Long_Long_Unsigned (Long_Long_Float'Floor (F)); + end if; + + -- Store Fraction_1 + + for I in reverse LLF_L - F_Bytes + 1 .. LLF_L - 7 loop + S (I) := SE (Fraction_1 mod BB); + Fraction_1 := Fraction_1 / BB; + end loop; + + -- Store Fraction_2 + + for I in reverse LLF_L - 6 .. LLF_L loop + S (SEO (I)) := SE (Fraction_2 mod BB); + Fraction_2 := Fraction_2 / BB; + end loop; + + -- Store Exponent (not always at the beginning of a byte) + + Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + for N in reverse 1 .. E_Bytes loop + S (N) := SE (Exponent mod BB) + S (N); + Exponent := Exponent / BB; + end loop; + + -- Store Sign + + if not Positive then + S (1) := S (1) + BS; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LLF; + + ----------- + -- W_LLI -- + ----------- + + procedure W_LLI + (Stream : not null access RST; + Item : Long_Long_Integer) + is + S : XDR_S_LLI; + U : Unsigned; + X : Long_Long_Unsigned; + + begin + if Optimize_Integers then + S := Long_Long_Integer_To_XDR_S_LLI (Item); + + else + -- Test sign and apply two complement notation + + if Item < 0 then + X := Long_Long_Unsigned'Last xor Long_Long_Unsigned (-(Item + 1)); + else + X := Long_Long_Unsigned (Item); + end if; + + -- Compute using machine unsigned rather than long_long_unsigned + + for N in reverse S'Range loop + + -- We have filled an unsigned + + if (LLU_L - N) mod UB = 0 then + U := Unsigned (X and UL); + X := Shift_Right (X, US); + end if; + + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LLI; + + ----------- + -- W_LLU -- + ----------- + + procedure W_LLU + (Stream : not null access RST; + Item : Long_Long_Unsigned) + is + S : XDR_S_LLU; + U : Unsigned; + X : Long_Long_Unsigned := Item; + + begin + if Optimize_Integers then + S := Long_Long_Unsigned_To_XDR_S_LLU (Item); + + else + -- Compute using machine unsigned rather than long_long_unsigned + + for N in reverse S'Range loop + + -- We have filled an unsigned + + if (LLU_L - N) mod UB = 0 then + U := Unsigned (X and UL); + X := Shift_Right (X, US); + end if; + + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LLU; + + ---------- + -- W_LU -- + ---------- + + procedure W_LU (Stream : not null access RST; Item : Long_Unsigned) is + S : XDR_S_LU; + U : Unsigned; + X : Long_Unsigned := Item; + + begin + if Optimize_Integers then + S := Long_Long_Unsigned_To_XDR_S_LU (Long_Long_Unsigned (Item)); + + else + -- Compute using machine unsigned rather than long_unsigned + + for N in reverse S'Range loop + + -- We have filled an unsigned + + if (LU_L - N) mod UB = 0 then + U := Unsigned (X and UL); + X := Shift_Right (X, US); + end if; + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_LU; + + ---------- + -- W_SF -- + ---------- + + procedure W_SF (Stream : not null access RST; Item : Short_Float) is + I : constant Precision := Single; + E_Size : Integer renames Fields (I).E_Size; + E_Bias : Integer renames Fields (I).E_Bias; + E_Bytes : SEO renames Fields (I).E_Bytes; + F_Bytes : SEO renames Fields (I).F_Bytes; + F_Size : Integer renames Fields (I).F_Size; + F_Mask : SE renames Fields (I).F_Mask; + + Exponent : Long_Unsigned; + Fraction : Long_Unsigned; + Positive : Boolean; + E : Integer; + F : Short_Float; + S : SEA (1 .. SF_L) := (others => 0); + + begin + if not Item'Valid then + raise Constraint_Error; + end if; + + -- Compute Sign + + Positive := (0.0 <= Item); + F := abs (Item); + + -- Signed zero + + if F = 0.0 then + Exponent := 0; + Fraction := 0; + + else + E := Short_Float'Exponent (F) - 1; + + -- Denormalized float + + if E <= -E_Bias then + E := -E_Bias; + F := Short_Float'Scaling (F, F_Size + E_Bias - 1); + else + F := Short_Float'Scaling (F, F_Size - E); + end if; + + -- Compute Exponent and Fraction + + Exponent := Long_Unsigned (E + E_Bias); + Fraction := Long_Unsigned (F * 2.0) / 2; + end if; + + -- Store Fraction + + for I in reverse SF_L - F_Bytes + 1 .. SF_L loop + S (I) := SE (Fraction mod BB); + Fraction := Fraction / BB; + end loop; + + -- Remove implicit bit + + S (SF_L - F_Bytes + 1) := S (SF_L - F_Bytes + 1) and F_Mask; + + -- Store Exponent (not always at the beginning of a byte) + + Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); + for N in reverse 1 .. E_Bytes loop + S (N) := SE (Exponent mod BB) + S (N); + Exponent := Exponent / BB; + end loop; + + -- Store Sign + + if not Positive then + S (1) := S (1) + BS; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_SF; + + ---------- + -- W_SI -- + ---------- + + procedure W_SI (Stream : not null access RST; Item : Short_Integer) is + S : XDR_S_SI; + U : XDR_SU; + + begin + if Optimize_Integers then + S := Short_Integer_To_XDR_S_SI (Item); + + else + -- Test sign and apply two complement's notation + + U := (if Item < 0 + then XDR_SU'Last xor XDR_SU (-(Item + 1)) + else XDR_SU (Item)); + + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_SI; + + ----------- + -- W_SSI -- + ----------- + + procedure W_SSI + (Stream : not null access RST; + Item : Short_Short_Integer) + is + S : XDR_S_SSI; + U : XDR_SSU; + + begin + if Optimize_Integers then + S := Short_Short_Integer_To_XDR_S_SSI (Item); + + else + -- Test sign and apply two complement's notation + + U := (if Item < 0 + then XDR_SSU'Last xor XDR_SSU (-(Item + 1)) + else XDR_SSU (Item)); + + S (1) := SE (U); + end if; + + Ada.Streams.Write (Stream.all, S); + end W_SSI; + + ----------- + -- W_SSU -- + ----------- + + procedure W_SSU + (Stream : not null access RST; + Item : Short_Short_Unsigned) + is + U : constant XDR_SSU := XDR_SSU (Item); + S : XDR_S_SSU; + + begin + S (1) := SE (U); + Ada.Streams.Write (Stream.all, S); + end W_SSU; + + ---------- + -- W_SU -- + ---------- + + procedure W_SU (Stream : not null access RST; Item : Short_Unsigned) is + S : XDR_S_SU; + U : XDR_SU := XDR_SU (Item); + + begin + if Optimize_Integers then + S := Short_Unsigned_To_XDR_S_SU (Item); + + else + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_SU; + + --------- + -- W_U -- + --------- + + procedure W_U (Stream : not null access RST; Item : Unsigned) is + S : XDR_S_U; + U : XDR_U := XDR_U (Item); + + begin + if Optimize_Integers then + S := Unsigned_To_XDR_S_U (Item); + + else + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + if U /= 0 then + raise Data_Error; + end if; + end if; + + Ada.Streams.Write (Stream.all, S); + end W_U; + + ---------- + -- W_WC -- + ---------- + + procedure W_WC (Stream : not null access RST; Item : Wide_Character) is + S : XDR_S_WC; + U : XDR_WC; + + begin + -- Use Ada requirements on Wide_Character representation clause + + U := XDR_WC (Wide_Character'Pos (Item)); + + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + Ada.Streams.Write (Stream.all, S); + + if U /= 0 then + raise Data_Error; + end if; + end W_WC; + + ----------- + -- W_WWC -- + ----------- + + procedure W_WWC + (Stream : not null access RST; Item : Wide_Wide_Character) + is + S : XDR_S_WWC; + U : XDR_WWC; + + begin + -- Use Ada requirements on Wide_Wide_Character representation clause + + U := XDR_WWC (Wide_Wide_Character'Pos (Item)); + + for N in reverse S'Range loop + S (N) := SE (U mod BB); + U := U / BB; + end loop; + + Ada.Streams.Write (Stream.all, S); + + if U /= 0 then + raise Data_Error; + end if; + end W_WWC; + +end System.Stream_Attributes; diff --git a/gcc/ada/s-stratt.ads b/gcc/ada/s-stratt.ads index ee5da8d8d11..498700e06b5 100644 --- a/gcc/ada/s-stratt.ads +++ b/gcc/ada/s-stratt.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -157,10 +157,10 @@ package System.Stream_Attributes is function Block_IO_OK return Boolean; -- Package System.Stream_Attributes has several bodies - the default one - -- distributed with GNAT, s-strxdr.adb which is based on the XDR standard - -- and s-stratt.adb for Garlic. All three bodies share the same spec. The - -- role of this function is to determine whether the current version of - -- System.Stream_Attributes is able to support block IO. + -- distributed with GNAT, and s-stratt-xdr.adb, which is based on the XDR + -- standard. Both bodies share the same spec. The role of this function is + -- to indicate whether the current version of System.Stream_Attributes + -- supports block IO. private pragma Inline (I_AD); diff --git a/gcc/ada/s-strxdr.adb b/gcc/ada/s-strxdr.adb deleted file mode 100644 index 4fca719e25d..00000000000 --- a/gcc/ada/s-strxdr.adb +++ /dev/null @@ -1,1891 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME COMPONENTS -- --- -- --- S Y S T E M . S T R E A M _ A T T R I B U T E S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1996-2009, Free Software Foundation, Inc. -- --- -- --- GARLIC is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- 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 -- --- . -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This file is an alternate version of s-stratt.adb based on the XDR --- standard. It is especially useful for exchanging streams between two --- different systems with different basic type representations and endianness. - -with Ada.IO_Exceptions; -with Ada.Streams; use Ada.Streams; -with Ada.Unchecked_Conversion; - -package body System.Stream_Attributes is - - pragma Suppress (Range_Check); - pragma Suppress (Overflow_Check); - - use UST; - - Data_Error : exception renames Ada.IO_Exceptions.End_Error; - -- Exception raised if insufficient data read (End_Error is mandated by - -- AI95-00132). - - SU : constant := System.Storage_Unit; - -- The code in this body assumes that SU = 8 - - BB : constant := 2 ** SU; -- Byte base - BL : constant := 2 ** SU - 1; -- Byte last - BS : constant := 2 ** (SU - 1); -- Byte sign - - US : constant := Unsigned'Size; -- Unsigned size - UB : constant := (US - 1) / SU + 1; -- Unsigned byte - UL : constant := 2 ** US - 1; -- Unsigned last - - subtype SE is Ada.Streams.Stream_Element; - subtype SEA is Ada.Streams.Stream_Element_Array; - subtype SEO is Ada.Streams.Stream_Element_Offset; - - generic function UC renames Ada.Unchecked_Conversion; - - type Field_Type is - record - E_Size : Integer; -- Exponent bit size - E_Bias : Integer; -- Exponent bias - F_Size : Integer; -- Fraction bit size - E_Last : Integer; -- Max exponent value - F_Mask : SE; -- Mask to apply on first fraction byte - E_Bytes : SEO; -- N. of exponent bytes completely used - F_Bytes : SEO; -- N. of fraction bytes completely used - F_Bits : Integer; -- N. of bits used on first fraction word - end record; - - type Precision is (Single, Double, Quadruple); - - Fields : constant array (Precision) of Field_Type := ( - - -- Single precision - - (E_Size => 8, - E_Bias => 127, - F_Size => 23, - E_Last => 2 ** 8 - 1, - F_Mask => 16#7F#, -- 2 ** 7 - 1, - E_Bytes => 2, - F_Bytes => 3, - F_Bits => 23 mod US), - - -- Double precision - - (E_Size => 11, - E_Bias => 1023, - F_Size => 52, - E_Last => 2 ** 11 - 1, - F_Mask => 16#0F#, -- 2 ** 4 - 1, - E_Bytes => 2, - F_Bytes => 7, - F_Bits => 52 mod US), - - -- Quadruple precision - - (E_Size => 15, - E_Bias => 16383, - F_Size => 112, - E_Last => 2 ** 8 - 1, - F_Mask => 16#FF#, -- 2 ** 8 - 1, - E_Bytes => 2, - F_Bytes => 14, - F_Bits => 112 mod US)); - - -- The representation of all items requires a multiple of four bytes - -- (or 32 bits) of data. The bytes are numbered 0 through n-1. The bytes - -- are read or written to some byte stream such that byte m always - -- precedes byte m+1. If the n bytes needed to contain the data are not - -- a multiple of four, then the n bytes are followed by enough (0 to 3) - -- residual zero bytes, r, to make the total byte count a multiple of 4. - - -- An XDR signed integer is a 32-bit datum that encodes an integer - -- in the range [-2147483648,2147483647]. The integer is represented - -- in two's complement notation. The most and least significant bytes - -- are 0 and 3, respectively. Integers are declared as follows: - - -- (MSB) (LSB) - -- +-------+-------+-------+-------+ - -- |byte 0 |byte 1 |byte 2 |byte 3 | - -- +-------+-------+-------+-------+ - -- <------------32 bits------------> - - SSI_L : constant := 1; - SI_L : constant := 2; - I_L : constant := 4; - LI_L : constant := 8; - LLI_L : constant := 8; - - subtype XDR_S_SSI is SEA (1 .. SSI_L); - subtype XDR_S_SI is SEA (1 .. SI_L); - subtype XDR_S_I is SEA (1 .. I_L); - subtype XDR_S_LI is SEA (1 .. LI_L); - subtype XDR_S_LLI is SEA (1 .. LLI_L); - - function Short_Short_Integer_To_XDR_S_SSI is - new Ada.Unchecked_Conversion (Short_Short_Integer, XDR_S_SSI); - function XDR_S_SSI_To_Short_Short_Integer is - new Ada.Unchecked_Conversion (XDR_S_SSI, Short_Short_Integer); - - function Short_Integer_To_XDR_S_SI is - new Ada.Unchecked_Conversion (Short_Integer, XDR_S_SI); - function XDR_S_SI_To_Short_Integer is - new Ada.Unchecked_Conversion (XDR_S_SI, Short_Integer); - - function Integer_To_XDR_S_I is - new Ada.Unchecked_Conversion (Integer, XDR_S_I); - function XDR_S_I_To_Integer is - new Ada.Unchecked_Conversion (XDR_S_I, Integer); - - function Long_Long_Integer_To_XDR_S_LI is - new Ada.Unchecked_Conversion (Long_Long_Integer, XDR_S_LI); - function XDR_S_LI_To_Long_Long_Integer is - new Ada.Unchecked_Conversion (XDR_S_LI, Long_Long_Integer); - - function Long_Long_Integer_To_XDR_S_LLI is - new Ada.Unchecked_Conversion (Long_Long_Integer, XDR_S_LLI); - function XDR_S_LLI_To_Long_Long_Integer is - new Ada.Unchecked_Conversion (XDR_S_LLI, Long_Long_Integer); - - -- An XDR unsigned integer is a 32-bit datum that encodes a nonnegative - -- integer in the range [0,4294967295]. It is represented by an unsigned - -- binary number whose most and least significant bytes are 0 and 3, - -- respectively. An unsigned integer is declared as follows: - - -- (MSB) (LSB) - -- +-------+-------+-------+-------+ - -- |byte 0 |byte 1 |byte 2 |byte 3 | - -- +-------+-------+-------+-------+ - -- <------------32 bits------------> - - SSU_L : constant := 1; - SU_L : constant := 2; - U_L : constant := 4; - LU_L : constant := 8; - LLU_L : constant := 8; - - subtype XDR_S_SSU is SEA (1 .. SSU_L); - subtype XDR_S_SU is SEA (1 .. SU_L); - subtype XDR_S_U is SEA (1 .. U_L); - subtype XDR_S_LU is SEA (1 .. LU_L); - subtype XDR_S_LLU is SEA (1 .. LLU_L); - - type XDR_SSU is mod BB ** SSU_L; - type XDR_SU is mod BB ** SU_L; - type XDR_U is mod BB ** U_L; - - function Short_Unsigned_To_XDR_S_SU is - new Ada.Unchecked_Conversion (Short_Unsigned, XDR_S_SU); - function XDR_S_SU_To_Short_Unsigned is - new Ada.Unchecked_Conversion (XDR_S_SU, Short_Unsigned); - - function Unsigned_To_XDR_S_U is - new Ada.Unchecked_Conversion (Unsigned, XDR_S_U); - function XDR_S_U_To_Unsigned is - new Ada.Unchecked_Conversion (XDR_S_U, Unsigned); - - function Long_Long_Unsigned_To_XDR_S_LU is - new Ada.Unchecked_Conversion (Long_Long_Unsigned, XDR_S_LU); - function XDR_S_LU_To_Long_Long_Unsigned is - new Ada.Unchecked_Conversion (XDR_S_LU, Long_Long_Unsigned); - - function Long_Long_Unsigned_To_XDR_S_LLU is - new Ada.Unchecked_Conversion (Long_Long_Unsigned, XDR_S_LLU); - function XDR_S_LLU_To_Long_Long_Unsigned is - new Ada.Unchecked_Conversion (XDR_S_LLU, Long_Long_Unsigned); - - -- The standard defines the floating-point data type "float" (32 bits - -- or 4 bytes). The encoding used is the IEEE standard for normalized - -- single-precision floating-point numbers. - - -- The standard defines the encoding used for the double-precision - -- floating-point data type "double" (64 bits or 8 bytes). The encoding - -- used is the IEEE standard for normalized double-precision floating-point - -- numbers. - - SF_L : constant := 4; -- Single precision - F_L : constant := 4; -- Single precision - LF_L : constant := 8; -- Double precision - LLF_L : constant := 16; -- Quadruple precision - - TM_L : constant := 8; - subtype XDR_S_TM is SEA (1 .. TM_L); - type XDR_TM is mod BB ** TM_L; - - type XDR_SA is mod 2 ** Standard'Address_Size; - function To_XDR_SA is new UC (System.Address, XDR_SA); - function To_XDR_SA is new UC (XDR_SA, System.Address); - - -- Enumerations have the same representation as signed integers. - -- Enumerations are handy for describing subsets of the integers. - - -- Booleans are important enough and occur frequently enough to warrant - -- their own explicit type in the standard. Booleans are declared as - -- an enumeration, with FALSE = 0 and TRUE = 1. - - -- The standard defines a string of n (numbered 0 through n-1) ASCII - -- bytes to be the number n encoded as an unsigned integer (as described - -- above), and followed by the n bytes of the string. Byte m of the string - -- always precedes byte m+1 of the string, and byte 0 of the string always - -- follows the string's length. If n is not a multiple of four, then the - -- n bytes are followed by enough (0 to 3) residual zero bytes, r, to make - -- the total byte count a multiple of four. - - -- To fit with XDR string, do not consider character as an enumeration - -- type. - - C_L : constant := 1; - subtype XDR_S_C is SEA (1 .. C_L); - - -- Consider Wide_Character as an enumeration type - - WC_L : constant := 4; - subtype XDR_S_WC is SEA (1 .. WC_L); - type XDR_WC is mod BB ** WC_L; - - -- Consider Wide_Wide_Character as an enumeration type - - WWC_L : constant := 8; - subtype XDR_S_WWC is SEA (1 .. WWC_L); - type XDR_WWC is mod BB ** WWC_L; - - -- Optimization: if we already have the correct Bit_Order, then some - -- computations can be avoided since the source and the target will be - -- identical anyway. They will be replaced by direct unchecked - -- conversions. - - Optimize_Integers : constant Boolean := - Default_Bit_Order = High_Order_First; - - ----------------- - -- Block_IO_OK -- - ----------------- - - function Block_IO_OK return Boolean is - begin - return False; - end Block_IO_OK; - - ---------- - -- I_AD -- - ---------- - - function I_AD (Stream : not null access RST) return Fat_Pointer is - FP : Fat_Pointer; - - begin - FP.P1 := I_AS (Stream).P1; - FP.P2 := I_AS (Stream).P1; - - return FP; - end I_AD; - - ---------- - -- I_AS -- - ---------- - - function I_AS (Stream : not null access RST) return Thin_Pointer is - S : XDR_S_TM; - L : SEO; - U : XDR_TM := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - else - for N in S'Range loop - U := U * BB + XDR_TM (S (N)); - end loop; - - return (P1 => To_XDR_SA (XDR_SA (U))); - end if; - end I_AS; - - --------- - -- I_B -- - --------- - - function I_B (Stream : not null access RST) return Boolean is - begin - case I_SSU (Stream) is - when 0 => return False; - when 1 => return True; - when others => raise Data_Error; - end case; - end I_B; - - --------- - -- I_C -- - --------- - - function I_C (Stream : not null access RST) return Character is - S : XDR_S_C; - L : SEO; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - else - -- Use Ada requirements on Character representation clause - - return Character'Val (S (1)); - end if; - end I_C; - - --------- - -- I_F -- - --------- - - function I_F (Stream : not null access RST) return Float is - I : constant Precision := Single; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Last : Integer renames Fields (I).E_Last; - F_Mask : SE renames Fields (I).F_Mask; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - - Positive : Boolean; - Exponent : Long_Unsigned; - Fraction : Long_Unsigned; - Result : Float; - S : SEA (1 .. F_L); - L : SEO; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - end if; - - -- Extract Fraction, Sign and Exponent - - Fraction := Long_Unsigned (S (F_L + 1 - F_Bytes) and F_Mask); - for N in F_L + 2 - F_Bytes .. F_L loop - Fraction := Fraction * BB + Long_Unsigned (S (N)); - end loop; - Result := Float'Scaling (Float (Fraction), -F_Size); - - if BS <= S (1) then - Positive := False; - Exponent := Long_Unsigned (S (1) - BS); - else - Positive := True; - Exponent := Long_Unsigned (S (1)); - end if; - - for N in 2 .. E_Bytes loop - Exponent := Exponent * BB + Long_Unsigned (S (N)); - end loop; - Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - - -- NaN or Infinities - - if Integer (Exponent) = E_Last then - raise Constraint_Error; - - elsif Exponent = 0 then - - -- Signed zeros - - if Fraction = 0 then - null; - - -- Denormalized float - - else - Result := Float'Scaling (Result, 1 - E_Bias); - end if; - - -- Normalized float - - else - Result := Float'Scaling - (1.0 + Result, Integer (Exponent) - E_Bias); - end if; - - if not Positive then - Result := -Result; - end if; - - return Result; - end I_F; - - --------- - -- I_I -- - --------- - - function I_I (Stream : not null access RST) return Integer is - S : XDR_S_I; - L : SEO; - U : XDR_U := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_I_To_Integer (S); - - else - for N in S'Range loop - U := U * BB + XDR_U (S (N)); - end loop; - - -- Test sign and apply two complement notation - - if S (1) < BL then - return Integer (U); - - else - return Integer (-((XDR_U'Last xor U) + 1)); - end if; - end if; - end I_I; - - ---------- - -- I_LF -- - ---------- - - function I_LF (Stream : not null access RST) return Long_Float is - I : constant Precision := Double; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Last : Integer renames Fields (I).E_Last; - F_Mask : SE renames Fields (I).F_Mask; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - - Positive : Boolean; - Exponent : Long_Unsigned; - Fraction : Long_Long_Unsigned; - Result : Long_Float; - S : SEA (1 .. LF_L); - L : SEO; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - end if; - - -- Extract Fraction, Sign and Exponent - - Fraction := Long_Long_Unsigned (S (LF_L + 1 - F_Bytes) and F_Mask); - for N in LF_L + 2 - F_Bytes .. LF_L loop - Fraction := Fraction * BB + Long_Long_Unsigned (S (N)); - end loop; - - Result := Long_Float'Scaling (Long_Float (Fraction), -F_Size); - - if BS <= S (1) then - Positive := False; - Exponent := Long_Unsigned (S (1) - BS); - else - Positive := True; - Exponent := Long_Unsigned (S (1)); - end if; - - for N in 2 .. E_Bytes loop - Exponent := Exponent * BB + Long_Unsigned (S (N)); - end loop; - - Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - - -- NaN or Infinities - - if Integer (Exponent) = E_Last then - raise Constraint_Error; - - elsif Exponent = 0 then - - -- Signed zeros - - if Fraction = 0 then - null; - - -- Denormalized float - - else - Result := Long_Float'Scaling (Result, 1 - E_Bias); - end if; - - -- Normalized float - - else - Result := Long_Float'Scaling - (1.0 + Result, Integer (Exponent) - E_Bias); - end if; - - if not Positive then - Result := -Result; - end if; - - return Result; - end I_LF; - - ---------- - -- I_LI -- - ---------- - - function I_LI (Stream : not null access RST) return Long_Integer is - S : XDR_S_LI; - L : SEO; - U : Unsigned := 0; - X : Long_Unsigned := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return Long_Integer (XDR_S_LI_To_Long_Long_Integer (S)); - - else - - -- Compute using machine unsigned - -- rather than long_long_unsigned - - for N in S'Range loop - U := U * BB + Unsigned (S (N)); - - -- We have filled an unsigned - - if N mod UB = 0 then - X := Shift_Left (X, US) + Long_Unsigned (U); - U := 0; - end if; - end loop; - - -- Test sign and apply two complement notation - - if S (1) < BL then - return Long_Integer (X); - else - return Long_Integer (-((Long_Unsigned'Last xor X) + 1)); - end if; - - end if; - end I_LI; - - ----------- - -- I_LLF -- - ----------- - - function I_LLF (Stream : not null access RST) return Long_Long_Float is - I : constant Precision := Quadruple; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Last : Integer renames Fields (I).E_Last; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - - Positive : Boolean; - Exponent : Long_Unsigned; - Fraction_1 : Long_Long_Unsigned := 0; - Fraction_2 : Long_Long_Unsigned := 0; - Result : Long_Long_Float; - HF : constant Natural := F_Size / 2; - S : SEA (1 .. LLF_L); - L : SEO; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - end if; - - -- Extract Fraction, Sign and Exponent - - for I in LLF_L - F_Bytes + 1 .. LLF_L - 7 loop - Fraction_1 := Fraction_1 * BB + Long_Long_Unsigned (S (I)); - end loop; - - for I in SEO (LLF_L - 6) .. SEO (LLF_L) loop - Fraction_2 := Fraction_2 * BB + Long_Long_Unsigned (S (I)); - end loop; - - Result := Long_Long_Float'Scaling (Long_Long_Float (Fraction_2), -HF); - Result := Long_Long_Float (Fraction_1) + Result; - Result := Long_Long_Float'Scaling (Result, HF - F_Size); - - if BS <= S (1) then - Positive := False; - Exponent := Long_Unsigned (S (1) - BS); - else - Positive := True; - Exponent := Long_Unsigned (S (1)); - end if; - - for N in 2 .. E_Bytes loop - Exponent := Exponent * BB + Long_Unsigned (S (N)); - end loop; - - Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - - -- NaN or Infinities - - if Integer (Exponent) = E_Last then - raise Constraint_Error; - - elsif Exponent = 0 then - - -- Signed zeros - - if Fraction_1 = 0 and then Fraction_2 = 0 then - null; - - -- Denormalized float - - else - Result := Long_Long_Float'Scaling (Result, 1 - E_Bias); - end if; - - -- Normalized float - - else - Result := Long_Long_Float'Scaling - (1.0 + Result, Integer (Exponent) - E_Bias); - end if; - - if not Positive then - Result := -Result; - end if; - - return Result; - end I_LLF; - - ----------- - -- I_LLI -- - ----------- - - function I_LLI (Stream : not null access RST) return Long_Long_Integer is - S : XDR_S_LLI; - L : SEO; - U : Unsigned := 0; - X : Long_Long_Unsigned := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_LLI_To_Long_Long_Integer (S); - - else - -- Compute using machine unsigned for computing - -- rather than long_long_unsigned. - - for N in S'Range loop - U := U * BB + Unsigned (S (N)); - - -- We have filled an unsigned - - if N mod UB = 0 then - X := Shift_Left (X, US) + Long_Long_Unsigned (U); - U := 0; - end if; - end loop; - - -- Test sign and apply two complement notation - - if S (1) < BL then - return Long_Long_Integer (X); - else - return Long_Long_Integer (-((Long_Long_Unsigned'Last xor X) + 1)); - end if; - end if; - end I_LLI; - - ----------- - -- I_LLU -- - ----------- - - function I_LLU (Stream : not null access RST) return Long_Long_Unsigned is - S : XDR_S_LLU; - L : SEO; - U : Unsigned := 0; - X : Long_Long_Unsigned := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_LLU_To_Long_Long_Unsigned (S); - - else - -- Compute using machine unsigned - -- rather than long_long_unsigned. - - for N in S'Range loop - U := U * BB + Unsigned (S (N)); - - -- We have filled an unsigned - - if N mod UB = 0 then - X := Shift_Left (X, US) + Long_Long_Unsigned (U); - U := 0; - end if; - end loop; - - return X; - end if; - end I_LLU; - - ---------- - -- I_LU -- - ---------- - - function I_LU (Stream : not null access RST) return Long_Unsigned is - S : XDR_S_LU; - L : SEO; - U : Unsigned := 0; - X : Long_Unsigned := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return Long_Unsigned (XDR_S_LU_To_Long_Long_Unsigned (S)); - - else - -- Compute using machine unsigned - -- rather than long_unsigned. - - for N in S'Range loop - U := U * BB + Unsigned (S (N)); - - -- We have filled an unsigned - - if N mod UB = 0 then - X := Shift_Left (X, US) + Long_Unsigned (U); - U := 0; - end if; - end loop; - - return X; - end if; - end I_LU; - - ---------- - -- I_SF -- - ---------- - - function I_SF (Stream : not null access RST) return Short_Float is - I : constant Precision := Single; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Last : Integer renames Fields (I).E_Last; - F_Mask : SE renames Fields (I).F_Mask; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - - Exponent : Long_Unsigned; - Fraction : Long_Unsigned; - Positive : Boolean; - Result : Short_Float; - S : SEA (1 .. SF_L); - L : SEO; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - end if; - - -- Extract Fraction, Sign and Exponent - - Fraction := Long_Unsigned (S (SF_L + 1 - F_Bytes) and F_Mask); - for N in SF_L + 2 - F_Bytes .. SF_L loop - Fraction := Fraction * BB + Long_Unsigned (S (N)); - end loop; - Result := Short_Float'Scaling (Short_Float (Fraction), -F_Size); - - if BS <= S (1) then - Positive := False; - Exponent := Long_Unsigned (S (1) - BS); - else - Positive := True; - Exponent := Long_Unsigned (S (1)); - end if; - - for N in 2 .. E_Bytes loop - Exponent := Exponent * BB + Long_Unsigned (S (N)); - end loop; - Exponent := Shift_Right (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - - -- NaN or Infinities - - if Integer (Exponent) = E_Last then - raise Constraint_Error; - - elsif Exponent = 0 then - - -- Signed zeros - - if Fraction = 0 then - null; - - -- Denormalized float - - else - Result := Short_Float'Scaling (Result, 1 - E_Bias); - end if; - - -- Normalized float - - else - Result := Short_Float'Scaling - (1.0 + Result, Integer (Exponent) - E_Bias); - end if; - - if not Positive then - Result := -Result; - end if; - - return Result; - end I_SF; - - ---------- - -- I_SI -- - ---------- - - function I_SI (Stream : not null access RST) return Short_Integer is - S : XDR_S_SI; - L : SEO; - U : XDR_SU := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_SI_To_Short_Integer (S); - - else - for N in S'Range loop - U := U * BB + XDR_SU (S (N)); - end loop; - - -- Test sign and apply two complement notation - - if S (1) < BL then - return Short_Integer (U); - else - return Short_Integer (-((XDR_SU'Last xor U) + 1)); - end if; - end if; - end I_SI; - - ----------- - -- I_SSI -- - ----------- - - function I_SSI (Stream : not null access RST) return Short_Short_Integer is - S : XDR_S_SSI; - L : SEO; - U : XDR_SSU; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_SSI_To_Short_Short_Integer (S); - - else - U := XDR_SSU (S (1)); - - -- Test sign and apply two complement notation - - if S (1) < BL then - return Short_Short_Integer (U); - else - return Short_Short_Integer (-((XDR_SSU'Last xor U) + 1)); - end if; - end if; - end I_SSI; - - ----------- - -- I_SSU -- - ----------- - - function I_SSU (Stream : not null access RST) return Short_Short_Unsigned is - S : XDR_S_SSU; - L : SEO; - U : XDR_SSU := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - else - U := XDR_SSU (S (1)); - return Short_Short_Unsigned (U); - end if; - end I_SSU; - - ---------- - -- I_SU -- - ---------- - - function I_SU (Stream : not null access RST) return Short_Unsigned is - S : XDR_S_SU; - L : SEO; - U : XDR_SU := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_SU_To_Short_Unsigned (S); - - else - for N in S'Range loop - U := U * BB + XDR_SU (S (N)); - end loop; - - return Short_Unsigned (U); - end if; - end I_SU; - - --------- - -- I_U -- - --------- - - function I_U (Stream : not null access RST) return Unsigned is - S : XDR_S_U; - L : SEO; - U : XDR_U := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - elsif Optimize_Integers then - return XDR_S_U_To_Unsigned (S); - - else - for N in S'Range loop - U := U * BB + XDR_U (S (N)); - end loop; - - return Unsigned (U); - end if; - end I_U; - - ---------- - -- I_WC -- - ---------- - - function I_WC (Stream : not null access RST) return Wide_Character is - S : XDR_S_WC; - L : SEO; - U : XDR_WC := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - else - for N in S'Range loop - U := U * BB + XDR_WC (S (N)); - end loop; - - -- Use Ada requirements on Wide_Character representation clause - - return Wide_Character'Val (U); - end if; - end I_WC; - - ----------- - -- I_WWC -- - ----------- - - function I_WWC (Stream : not null access RST) return Wide_Wide_Character is - S : XDR_S_WWC; - L : SEO; - U : XDR_WWC := 0; - - begin - Ada.Streams.Read (Stream.all, S, L); - - if L /= S'Last then - raise Data_Error; - - else - for N in S'Range loop - U := U * BB + XDR_WWC (S (N)); - end loop; - - -- Use Ada requirements on Wide_Wide_Character representation clause - - return Wide_Wide_Character'Val (U); - end if; - end I_WWC; - - ---------- - -- W_AD -- - ---------- - - procedure W_AD (Stream : not null access RST; Item : Fat_Pointer) is - S : XDR_S_TM; - U : XDR_TM; - - begin - U := XDR_TM (To_XDR_SA (Item.P1)); - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - Ada.Streams.Write (Stream.all, S); - - U := XDR_TM (To_XDR_SA (Item.P2)); - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - Ada.Streams.Write (Stream.all, S); - - if U /= 0 then - raise Data_Error; - end if; - end W_AD; - - ---------- - -- W_AS -- - ---------- - - procedure W_AS (Stream : not null access RST; Item : Thin_Pointer) is - S : XDR_S_TM; - U : XDR_TM := XDR_TM (To_XDR_SA (Item.P1)); - - begin - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - Ada.Streams.Write (Stream.all, S); - - if U /= 0 then - raise Data_Error; - end if; - end W_AS; - - --------- - -- W_B -- - --------- - - procedure W_B (Stream : not null access RST; Item : Boolean) is - begin - if Item then - W_SSU (Stream, 1); - else - W_SSU (Stream, 0); - end if; - end W_B; - - --------- - -- W_C -- - --------- - - procedure W_C (Stream : not null access RST; Item : Character) is - S : XDR_S_C; - - pragma Assert (C_L = 1); - - begin - -- Use Ada requirements on Character representation clause - - S (1) := SE (Character'Pos (Item)); - - Ada.Streams.Write (Stream.all, S); - end W_C; - - --------- - -- W_F -- - --------- - - procedure W_F (Stream : not null access RST; Item : Float) is - I : constant Precision := Single; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - F_Mask : SE renames Fields (I).F_Mask; - - Exponent : Long_Unsigned; - Fraction : Long_Unsigned; - Positive : Boolean; - E : Integer; - F : Float; - S : SEA (1 .. F_L) := (others => 0); - - begin - if not Item'Valid then - raise Constraint_Error; - end if; - - -- Compute Sign - - Positive := (0.0 <= Item); - F := abs (Item); - - -- Signed zero - - if F = 0.0 then - Exponent := 0; - Fraction := 0; - - else - E := Float'Exponent (F) - 1; - - -- Denormalized float - - if E <= -E_Bias then - F := Float'Scaling (F, F_Size + E_Bias - 1); - E := -E_Bias; - else - F := Float'Scaling (Float'Fraction (F), F_Size + 1); - end if; - - -- Compute Exponent and Fraction - - Exponent := Long_Unsigned (E + E_Bias); - Fraction := Long_Unsigned (F * 2.0) / 2; - end if; - - -- Store Fraction - - for I in reverse F_L - F_Bytes + 1 .. F_L loop - S (I) := SE (Fraction mod BB); - Fraction := Fraction / BB; - end loop; - - -- Remove implicit bit - - S (F_L - F_Bytes + 1) := S (F_L - F_Bytes + 1) and F_Mask; - - -- Store Exponent (not always at the beginning of a byte) - - Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - for N in reverse 1 .. E_Bytes loop - S (N) := SE (Exponent mod BB) + S (N); - Exponent := Exponent / BB; - end loop; - - -- Store Sign - - if not Positive then - S (1) := S (1) + BS; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_F; - - --------- - -- W_I -- - --------- - - procedure W_I (Stream : not null access RST; Item : Integer) is - S : XDR_S_I; - U : XDR_U; - - begin - if Optimize_Integers then - S := Integer_To_XDR_S_I (Item); - - else - -- Test sign and apply two complement notation - - U := (if Item < 0 - then XDR_U'Last xor XDR_U (-(Item + 1)) - else XDR_U (Item)); - - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_I; - - ---------- - -- W_LF -- - ---------- - - procedure W_LF (Stream : not null access RST; Item : Long_Float) is - I : constant Precision := Double; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - F_Mask : SE renames Fields (I).F_Mask; - - Exponent : Long_Unsigned; - Fraction : Long_Long_Unsigned; - Positive : Boolean; - E : Integer; - F : Long_Float; - S : SEA (1 .. LF_L) := (others => 0); - - begin - if not Item'Valid then - raise Constraint_Error; - end if; - - -- Compute Sign - - Positive := (0.0 <= Item); - F := abs (Item); - - -- Signed zero - - if F = 0.0 then - Exponent := 0; - Fraction := 0; - - else - E := Long_Float'Exponent (F) - 1; - - -- Denormalized float - - if E <= -E_Bias then - E := -E_Bias; - F := Long_Float'Scaling (F, F_Size + E_Bias - 1); - else - F := Long_Float'Scaling (F, F_Size - E); - end if; - - -- Compute Exponent and Fraction - - Exponent := Long_Unsigned (E + E_Bias); - Fraction := Long_Long_Unsigned (F * 2.0) / 2; - end if; - - -- Store Fraction - - for I in reverse LF_L - F_Bytes + 1 .. LF_L loop - S (I) := SE (Fraction mod BB); - Fraction := Fraction / BB; - end loop; - - -- Remove implicit bit - - S (LF_L - F_Bytes + 1) := S (LF_L - F_Bytes + 1) and F_Mask; - - -- Store Exponent (not always at the beginning of a byte) - - Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - for N in reverse 1 .. E_Bytes loop - S (N) := SE (Exponent mod BB) + S (N); - Exponent := Exponent / BB; - end loop; - - -- Store Sign - - if not Positive then - S (1) := S (1) + BS; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LF; - - ---------- - -- W_LI -- - ---------- - - procedure W_LI (Stream : not null access RST; Item : Long_Integer) is - S : XDR_S_LI; - U : Unsigned; - X : Long_Unsigned; - - begin - if Optimize_Integers then - S := Long_Long_Integer_To_XDR_S_LI (Long_Long_Integer (Item)); - - else - -- Test sign and apply two complement notation - - if Item < 0 then - X := Long_Unsigned'Last xor Long_Unsigned (-(Item + 1)); - else - X := Long_Unsigned (Item); - end if; - - -- Compute using machine unsigned rather than long_unsigned - - for N in reverse S'Range loop - - -- We have filled an unsigned - - if (LU_L - N) mod UB = 0 then - U := Unsigned (X and UL); - X := Shift_Right (X, US); - end if; - - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LI; - - ----------- - -- W_LLF -- - ----------- - - procedure W_LLF (Stream : not null access RST; Item : Long_Long_Float) is - I : constant Precision := Quadruple; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - - HFS : constant Integer := F_Size / 2; - - Exponent : Long_Unsigned; - Fraction_1 : Long_Long_Unsigned; - Fraction_2 : Long_Long_Unsigned; - Positive : Boolean; - E : Integer; - F : Long_Long_Float := Item; - S : SEA (1 .. LLF_L) := (others => 0); - - begin - if not Item'Valid then - raise Constraint_Error; - end if; - - -- Compute Sign - - Positive := (0.0 <= Item); - if F < 0.0 then - F := -Item; - end if; - - -- Signed zero - - if F = 0.0 then - Exponent := 0; - Fraction_1 := 0; - Fraction_2 := 0; - - else - E := Long_Long_Float'Exponent (F) - 1; - - -- Denormalized float - - if E <= -E_Bias then - F := Long_Long_Float'Scaling (F, E_Bias - 1); - E := -E_Bias; - else - F := Long_Long_Float'Scaling - (Long_Long_Float'Fraction (F), 1); - end if; - - -- Compute Exponent and Fraction - - Exponent := Long_Unsigned (E + E_Bias); - F := Long_Long_Float'Scaling (F, F_Size - HFS); - Fraction_1 := Long_Long_Unsigned (Long_Long_Float'Floor (F)); - F := Long_Long_Float (F - Long_Long_Float (Fraction_1)); - F := Long_Long_Float'Scaling (F, HFS); - Fraction_2 := Long_Long_Unsigned (Long_Long_Float'Floor (F)); - end if; - - -- Store Fraction_1 - - for I in reverse LLF_L - F_Bytes + 1 .. LLF_L - 7 loop - S (I) := SE (Fraction_1 mod BB); - Fraction_1 := Fraction_1 / BB; - end loop; - - -- Store Fraction_2 - - for I in reverse LLF_L - 6 .. LLF_L loop - S (SEO (I)) := SE (Fraction_2 mod BB); - Fraction_2 := Fraction_2 / BB; - end loop; - - -- Store Exponent (not always at the beginning of a byte) - - Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - for N in reverse 1 .. E_Bytes loop - S (N) := SE (Exponent mod BB) + S (N); - Exponent := Exponent / BB; - end loop; - - -- Store Sign - - if not Positive then - S (1) := S (1) + BS; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LLF; - - ----------- - -- W_LLI -- - ----------- - - procedure W_LLI - (Stream : not null access RST; - Item : Long_Long_Integer) - is - S : XDR_S_LLI; - U : Unsigned; - X : Long_Long_Unsigned; - - begin - if Optimize_Integers then - S := Long_Long_Integer_To_XDR_S_LLI (Item); - - else - -- Test sign and apply two complement notation - - if Item < 0 then - X := Long_Long_Unsigned'Last xor Long_Long_Unsigned (-(Item + 1)); - else - X := Long_Long_Unsigned (Item); - end if; - - -- Compute using machine unsigned rather than long_long_unsigned - - for N in reverse S'Range loop - - -- We have filled an unsigned - - if (LLU_L - N) mod UB = 0 then - U := Unsigned (X and UL); - X := Shift_Right (X, US); - end if; - - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LLI; - - ----------- - -- W_LLU -- - ----------- - - procedure W_LLU - (Stream : not null access RST; - Item : Long_Long_Unsigned) - is - S : XDR_S_LLU; - U : Unsigned; - X : Long_Long_Unsigned := Item; - - begin - if Optimize_Integers then - S := Long_Long_Unsigned_To_XDR_S_LLU (Item); - - else - -- Compute using machine unsigned rather than long_long_unsigned - - for N in reverse S'Range loop - - -- We have filled an unsigned - - if (LLU_L - N) mod UB = 0 then - U := Unsigned (X and UL); - X := Shift_Right (X, US); - end if; - - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LLU; - - ---------- - -- W_LU -- - ---------- - - procedure W_LU (Stream : not null access RST; Item : Long_Unsigned) is - S : XDR_S_LU; - U : Unsigned; - X : Long_Unsigned := Item; - - begin - if Optimize_Integers then - S := Long_Long_Unsigned_To_XDR_S_LU (Long_Long_Unsigned (Item)); - - else - -- Compute using machine unsigned rather than long_unsigned - - for N in reverse S'Range loop - - -- We have filled an unsigned - - if (LU_L - N) mod UB = 0 then - U := Unsigned (X and UL); - X := Shift_Right (X, US); - end if; - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_LU; - - ---------- - -- W_SF -- - ---------- - - procedure W_SF (Stream : not null access RST; Item : Short_Float) is - I : constant Precision := Single; - E_Size : Integer renames Fields (I).E_Size; - E_Bias : Integer renames Fields (I).E_Bias; - E_Bytes : SEO renames Fields (I).E_Bytes; - F_Bytes : SEO renames Fields (I).F_Bytes; - F_Size : Integer renames Fields (I).F_Size; - F_Mask : SE renames Fields (I).F_Mask; - - Exponent : Long_Unsigned; - Fraction : Long_Unsigned; - Positive : Boolean; - E : Integer; - F : Short_Float; - S : SEA (1 .. SF_L) := (others => 0); - - begin - if not Item'Valid then - raise Constraint_Error; - end if; - - -- Compute Sign - - Positive := (0.0 <= Item); - F := abs (Item); - - -- Signed zero - - if F = 0.0 then - Exponent := 0; - Fraction := 0; - - else - E := Short_Float'Exponent (F) - 1; - - -- Denormalized float - - if E <= -E_Bias then - E := -E_Bias; - F := Short_Float'Scaling (F, F_Size + E_Bias - 1); - else - F := Short_Float'Scaling (F, F_Size - E); - end if; - - -- Compute Exponent and Fraction - - Exponent := Long_Unsigned (E + E_Bias); - Fraction := Long_Unsigned (F * 2.0) / 2; - end if; - - -- Store Fraction - - for I in reverse SF_L - F_Bytes + 1 .. SF_L loop - S (I) := SE (Fraction mod BB); - Fraction := Fraction / BB; - end loop; - - -- Remove implicit bit - - S (SF_L - F_Bytes + 1) := S (SF_L - F_Bytes + 1) and F_Mask; - - -- Store Exponent (not always at the beginning of a byte) - - Exponent := Shift_Left (Exponent, Integer (E_Bytes) * SU - E_Size - 1); - for N in reverse 1 .. E_Bytes loop - S (N) := SE (Exponent mod BB) + S (N); - Exponent := Exponent / BB; - end loop; - - -- Store Sign - - if not Positive then - S (1) := S (1) + BS; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_SF; - - ---------- - -- W_SI -- - ---------- - - procedure W_SI (Stream : not null access RST; Item : Short_Integer) is - S : XDR_S_SI; - U : XDR_SU; - - begin - if Optimize_Integers then - S := Short_Integer_To_XDR_S_SI (Item); - - else - -- Test sign and apply two complement's notation - - U := (if Item < 0 - then XDR_SU'Last xor XDR_SU (-(Item + 1)) - else XDR_SU (Item)); - - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_SI; - - ----------- - -- W_SSI -- - ----------- - - procedure W_SSI - (Stream : not null access RST; - Item : Short_Short_Integer) - is - S : XDR_S_SSI; - U : XDR_SSU; - - begin - if Optimize_Integers then - S := Short_Short_Integer_To_XDR_S_SSI (Item); - - else - -- Test sign and apply two complement's notation - - U := (if Item < 0 - then XDR_SSU'Last xor XDR_SSU (-(Item + 1)) - else XDR_SSU (Item)); - - S (1) := SE (U); - end if; - - Ada.Streams.Write (Stream.all, S); - end W_SSI; - - ----------- - -- W_SSU -- - ----------- - - procedure W_SSU - (Stream : not null access RST; - Item : Short_Short_Unsigned) - is - U : constant XDR_SSU := XDR_SSU (Item); - S : XDR_S_SSU; - - begin - S (1) := SE (U); - Ada.Streams.Write (Stream.all, S); - end W_SSU; - - ---------- - -- W_SU -- - ---------- - - procedure W_SU (Stream : not null access RST; Item : Short_Unsigned) is - S : XDR_S_SU; - U : XDR_SU := XDR_SU (Item); - - begin - if Optimize_Integers then - S := Short_Unsigned_To_XDR_S_SU (Item); - - else - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_SU; - - --------- - -- W_U -- - --------- - - procedure W_U (Stream : not null access RST; Item : Unsigned) is - S : XDR_S_U; - U : XDR_U := XDR_U (Item); - - begin - if Optimize_Integers then - S := Unsigned_To_XDR_S_U (Item); - - else - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - if U /= 0 then - raise Data_Error; - end if; - end if; - - Ada.Streams.Write (Stream.all, S); - end W_U; - - ---------- - -- W_WC -- - ---------- - - procedure W_WC (Stream : not null access RST; Item : Wide_Character) is - S : XDR_S_WC; - U : XDR_WC; - - begin - -- Use Ada requirements on Wide_Character representation clause - - U := XDR_WC (Wide_Character'Pos (Item)); - - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - Ada.Streams.Write (Stream.all, S); - - if U /= 0 then - raise Data_Error; - end if; - end W_WC; - - ----------- - -- W_WWC -- - ----------- - - procedure W_WWC - (Stream : not null access RST; Item : Wide_Wide_Character) - is - S : XDR_S_WWC; - U : XDR_WWC; - - begin - -- Use Ada requirements on Wide_Wide_Character representation clause - - U := XDR_WWC (Wide_Wide_Character'Pos (Item)); - - for N in reverse S'Range loop - S (N) := SE (U mod BB); - U := U / BB; - end loop; - - Ada.Streams.Write (Stream.all, S); - - if U /= 0 then - raise Data_Error; - end if; - end W_WWC; - -end System.Stream_Attributes; diff --git a/gcc/ada/s-taenca.adb b/gcc/ada/s-taenca.adb index fba7691e3a2..14812a4464d 100644 --- a/gcc/ada/s-taenca.adb +++ b/gcc/ada/s-taenca.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -590,6 +590,13 @@ package body System.Tasking.Entry_Calls is Entry_Call.Cancellation_Attempted := True; + -- Reset Entry_Call.State so that the call is marked as cancelled + -- by Check_Pending_Actions_For_Entry_Call below. + + if Entry_Call.State < Was_Abortable then + Entry_Call.State := Now_Abortable; + end if; + if Self_Id.Pending_ATC_Level >= Entry_Call.Level then Self_Id.Pending_ATC_Level := Entry_Call.Level - 1; end if; diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb index 5680fa22c76..38b4cf6f53b 100644 --- a/gcc/ada/s-taprop-linux.adb +++ b/gcc/ada/s-taprop-linux.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -717,7 +717,9 @@ package body System.Task_Primitives.Operations is Specific.Set (Self_ID); - if Use_Alternate_Stack then + if Use_Alternate_Stack + and then Self_ID.Common.Task_Alternate_Stack /= Null_Address + then declare Stack : aliased stack_t; Result : Interfaces.C.int; diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads index 0cc43f38680..104a3a68c24 100644 --- a/gcc/ada/s-taskin.ads +++ b/gcc/ada/s-taskin.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -282,32 +282,31 @@ package System.Tasking is Cancelled -- the call was asynchronous, and was cancelled ); + pragma Ordered (Entry_Call_State); - -- Never_Abortable is used for calls that are made in a abort - -- deferred region (see ARM 9.8(5-11), 9.8 (20)). - -- Such a call is never abortable. + -- Never_Abortable is used for calls that are made in a abort deferred + -- region (see ARM 9.8(5-11), 9.8 (20)). Such a call is never abortable. - -- The Was_ vs. Not_Yet_ distinction is needed to decide whether it - -- is OK to advance into the abortable part of an async. select stmt. - -- That is allowed iff the mode is Now_ or Was_. + -- The Was_ vs. Not_Yet_ distinction is needed to decide whether it is OK + -- to advance into the abortable part of an async. select stmt. That is + -- allowed iff the mode is Now_ or Was_. - -- Done indicates the call has been completed, without cancellation, - -- or no call has been made yet at this ATC nesting level, - -- and so aborting the call is no longer an issue. - -- Completion of the call does not necessarily indicate "success"; - -- the call may be returning an exception if Exception_To_Raise is - -- non-null. + -- Done indicates the call has been completed, without cancellation, or no + -- call has been made yet at this ATC nesting level, and so aborting the + -- call is no longer an issue. Completion of the call does not necessarily + -- indicate "success"; the call may be returning an exception if + -- Exception_To_Raise is non-null. - -- Cancelled indicates the call was cancelled, - -- and so aborting the call is no longer an issue. + -- Cancelled indicates the call was cancelled, and so aborting the call is + -- no longer an issue. - -- The call is on an entry queue unless - -- State >= Done, in which case it may or may not be still Onqueue. + -- The call is on an entry queue unless State >= Done, in which case it may + -- or may not be still Onqueue. - -- Please do not modify the order of the values, without checking - -- all uses of this type. We rely on partial "monotonicity" of - -- Entry_Call_Record.State to avoid locking when we access this - -- value for certain tests. In particular: + -- Please do not modify the order of the values, without checking all uses + -- of this type. We rely on partial "monotonicity" of + -- Entry_Call_Record.State to avoid locking when we access this value for + -- certain tests. In particular: -- 1) Once State >= Done, we can rely that the call has been -- completed. If State >= Done, it will not diff --git a/gcc/ada/s-tasren.adb b/gcc/ada/s-tasren.adb index 35e0dd37d63..1ea6699473e 100644 --- a/gcc/ada/s-tasren.adb +++ b/gcc/ada/s-tasren.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1268,7 +1268,7 @@ package body System.Tasking.Rendezvous is if Old_State /= Entry_Call.State and then Entry_Call.State = Now_Abortable - and then Entry_Call.Mode > Simple_Call + and then Entry_Call.Mode /= Simple_Call and then Entry_Call.Self /= Self_ID -- Asynchronous_Call or Conditional_Call diff --git a/gcc/ada/s-tpobop.adb b/gcc/ada/s-tpobop.adb index 13688e6c669..0890181544d 100644 --- a/gcc/ada/s-tpobop.adb +++ b/gcc/ada/s-tpobop.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -646,26 +646,26 @@ package body System.Tasking.Protected_Objects.Operations is end if; end if; - elsif Mode < Asynchronous_Call then - - -- Simple_Call or Conditional_Call - - if Single_Lock then - STPO.Lock_RTS; - Entry_Calls.Wait_For_Completion (Entry_Call); - STPO.Unlock_RTS; + else + case Mode is + when Simple_Call | Conditional_Call => + if Single_Lock then + STPO.Lock_RTS; + Entry_Calls.Wait_For_Completion (Entry_Call); + STPO.Unlock_RTS; - else - STPO.Write_Lock (Self_ID); - Entry_Calls.Wait_For_Completion (Entry_Call); - STPO.Unlock (Self_ID); - end if; + else + STPO.Write_Lock (Self_ID); + Entry_Calls.Wait_For_Completion (Entry_Call); + STPO.Unlock (Self_ID); + end if; - Block.Cancelled := Entry_Call.State = Cancelled; + Block.Cancelled := Entry_Call.State = Cancelled; - else - pragma Assert (False); - null; + when Asynchronous_Call | Timed_Call => + pragma Assert (False); + null; + end case; end if; Initialization.Undefer_Abort_Nestable (Self_ID); @@ -958,7 +958,7 @@ package body System.Tasking.Protected_Objects.Operations is Send_Trace_Info (POT_Call, Entry_Index (E), Timeout); end if; - Initialization.Defer_Abort (Self_Id); + Initialization.Defer_Abort_Nestable (Self_Id); Lock_Entries (Object, Ceiling_Violation); if Ceiling_Violation then @@ -1009,7 +1009,7 @@ package body System.Tasking.Protected_Objects.Operations is end if; Entry_Call_Successful := Entry_Call.State = Done; - Initialization.Undefer_Abort (Self_Id); + Initialization.Undefer_Abort_Nestable (Self_Id); Entry_Calls.Check_Exception (Self_Id, Entry_Call); return; end if; @@ -1025,7 +1025,7 @@ package body System.Tasking.Protected_Objects.Operations is -- ??? Do we need to yield in case Yielded is False - Initialization.Undefer_Abort (Self_Id); + Initialization.Undefer_Abort_Nestable (Self_Id); Entry_Call_Successful := Entry_Call.State = Done; Entry_Calls.Check_Exception (Self_Id, Entry_Call); end Timed_Protected_Entry_Call; diff --git a/gcc/ada/s-tporft.adb b/gcc/ada/s-tporft.adb index f2cfd65decf..58badd6722a 100644 --- a/gcc/ada/s-tporft.adb +++ b/gcc/ada/s-tporft.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2010, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -86,16 +86,18 @@ begin Self_Id.Deferral_Level := 0; + -- We do not provide an alternate stack for foreign threads + + Self_Id.Common.Task_Alternate_Stack := Null_Address; + System.Soft_Links.Create_TSD (Self_Id.Common.Compiler_Data); -- ??? - -- The following call is commented out to avoid dependence on - -- the System.Tasking.Initialization package. - -- It seems that if we want Ada.Task_Attributes to work correctly - -- for C threads we will need to raise the visibility of this soft - -- link to System.Soft_Links. - -- We are putting that off until this new functionality is otherwise - -- stable. + -- The following call is commented out to avoid dependence on the + -- System.Tasking.Initialization package. It seems that if we want + -- Ada.Task_Attributes to work correctly for C threads we will need to + -- raise the visibility of this soft link to System.Soft_Links. We are + -- putting that off until this new functionality is otherwise stable. -- System.Tasking.Initialization.Initialize_Attributes_Link.all (T); diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads index 770d53bb59b..0532862cced 100644 --- a/gcc/ada/scans.ads +++ b/gcc/ada/scans.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -415,27 +415,34 @@ package Scans is -- We do things this way to minimize the impact on comment scanning. Character_Code : Char_Code; - -- Valid only when Token is Tok_Char_Literal + -- Valid only when Token is Tok_Char_Literal. Contains the value of the + -- scanned literal. Real_Literal_Value : Ureal; - -- Valid only when Token is Tok_Real_Literal + -- Valid only when Token is Tok_Real_Literal, contains the value of the + -- scanned literal. Int_Literal_Value : Uint; - -- Valid only when Token = Tok_Integer_Literal; + -- Valid only when Token = Tok_Integer_Literal, contains the value of the + -- scanned literal. + + Based_Literal_Uses_Colon : Boolean; + -- Valid only when Token = Tok_Integer_Literal or Tok_Real_Literal. Set + -- True only for the case of a based literal using ':' instead of '#'. String_Literal_Id : String_Id; - -- Id for currently scanned string value. -- Valid only when Token = Tok_String_Literal or Tok_Operator_Symbol. + -- Contains the Id for currently scanned string value. Wide_Character_Found : Boolean := False; - -- Set True if wide character found (i.e. a character that does not fit - -- in Character, but fits in Wide_Wide_Character). - -- Valid only when Token = Tok_String_Literal. + -- Valid only when Token = Tok_String_Literal. Set True if wide character + -- found (i.e. a character that does not fit in Character, but fits in + -- Wide_Wide_Character). Wide_Wide_Character_Found : Boolean := False; - -- Set True if wide wide character found (i.e. a character that does - -- not fit in Character or Wide_Character). - -- Valid only when Token = Tok_String_Literal. + -- Valid only when Token = Tok_String_Literal. Set True if wide wide + -- character found (i.e. a character that does not fit in Character or + -- Wide_Character). Special_Character : Character; -- Valid only when Token = Tok_Special. Returns one of the characters diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb index 98485506cba..eb6a97810d0 100644 --- a/gcc/ada/scn.adb +++ b/gcc/ada/scn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -44,10 +44,6 @@ package body Scn is use ASCII; - Obsolescent_Check_Flag : Boolean := True; - -- Obsolescent check activation. Set to False during integrated - -- preprocessing. - Used_As_Identifier : array (Token_Type) of Boolean; -- Flags set True if a given keyword is used as an identifier (used to -- make sure that we only post an error message for incorrect use of a @@ -340,28 +336,61 @@ package body Scn is end loop; end Initialize_Scanner; - ----------------------- - -- Obsolescent_Check -- - ----------------------- - - procedure Obsolescent_Check (S : Source_Ptr) is - begin - if Obsolescent_Check_Flag then - -- This is a pain in the neck case, since we normally need a node to - -- call Check_Restrictions, and all we have is a source pointer. The - -- easiest thing is to construct a dummy node. A bit kludgy, but this - -- is a marginal case. It's not worth trying to do things more - -- cleanly. - - Check_Restriction (No_Obsolescent_Features, New_Node (N_Empty, S)); - end if; - end Obsolescent_Check; - --------------- -- Post_Scan -- --------------- procedure Post_Scan is + procedure Check_Obsolescent_Features_Restriction (S : Source_Ptr); + -- This checks for Obsolescent_Features restriction being active, and + -- if so, flags the restriction as occurring at the given scan location. + + procedure Check_Obsolete_Base_Char; + -- Check for numeric literal using ':' instead of '#' for based case + + -------------------------------------------- + -- Check_Obsolescent_Features_Restriction -- + -------------------------------------------- + + procedure Check_Obsolescent_Features_Restriction (S : Source_Ptr) is + begin + -- Normally we have a node handy for posting restrictions. We don't + -- have such a node here, so construct a dummy one with the right + -- scan pointer. This is only used to get the Sloc value anyway. + + Check_Restriction (No_Obsolescent_Features, New_Node (N_Empty, S)); + end Check_Obsolescent_Features_Restriction; + + ------------------------------ + -- Check_Obsolete_Base_Char -- + ------------------------------ + + procedure Check_Obsolete_Base_Char is + S : Source_Ptr; + + begin + if Based_Literal_Uses_Colon then + + -- Find the : for the restriction or warning message + + S := Token_Ptr; + while Source (S) /= ':' loop + S := S + 1; + end loop; + + Check_Obsolescent_Features_Restriction (S); + + if Warn_On_Obsolescent_Feature then + Error_Msg + ("use of "":"" is an obsolescent feature (RM J.2(3))?", S); + Error_Msg + ("\use ""'#"" instead?", S); + end if; + end if; + end Check_Obsolete_Base_Char; + + -- Start of processing for Post_Scan + begin case Token is when Tok_Char_Literal => @@ -376,10 +405,12 @@ package body Scn is when Tok_Real_Literal => Token_Node := New_Node (N_Real_Literal, Token_Ptr); Set_Realval (Token_Node, Real_Literal_Value); + Check_Obsolete_Base_Char; when Tok_Integer_Literal => Token_Node := New_Node (N_Integer_Literal, Token_Ptr); Set_Intval (Token_Node, Int_Literal_Value); + Check_Obsolete_Base_Char; when Tok_String_Literal => Token_Node := New_Node (N_String_Literal, Token_Ptr); @@ -389,11 +420,32 @@ package body Scn is (Token_Node, Wide_Wide_Character_Found); Set_Strval (Token_Node, String_Literal_Id); + if Source (Token_Ptr) = '%' then + Check_Obsolescent_Features_Restriction (Token_Ptr); + + if Warn_On_Obsolescent_Feature then + Error_Msg_SC + ("use of ""'%"" is an obsolescent feature (RM J.2(4))?"); + Error_Msg_SC ("\use """""" instead?"); + end if; + end if; + when Tok_Operator_Symbol => Token_Node := New_Node (N_Operator_Symbol, Token_Ptr); Set_Chars (Token_Node, Token_Name); Set_Strval (Token_Node, String_Literal_Id); + when Tok_Vertical_Bar => + if Source (Token_Ptr) = '!' then + Check_Obsolescent_Features_Restriction (Token_Ptr); + + if Warn_On_Obsolescent_Feature then + Error_Msg_SC + ("use of ""'!"" is an obsolescent feature (RM J.2(2))?"); + Error_Msg_SC ("\use ""'|"" instead?"); + end if; + end if; + when others => null; end case; @@ -430,13 +482,4 @@ package body Scn is Set_Chars (Token_Node, Token_Name); end Scan_Reserved_Identifier; - --------------------------- - -- Set_Obsolescent_Check -- - --------------------------- - - procedure Set_Obsolescent_Check (Value : Boolean) is - begin - Obsolescent_Check_Flag := Value; - end Set_Obsolescent_Check; - end Scn; diff --git a/gcc/ada/scn.ads b/gcc/ada/scn.ads index eb6be5ecaa4..ea7b22be9f1 100644 --- a/gcc/ada/scn.ads +++ b/gcc/ada/scn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -47,15 +47,7 @@ package Scn is -- Determines the casing style of the current token, which is -- either a keyword or an identifier. See also package Casing. - procedure Obsolescent_Check (S : Source_Ptr); - -- Called to handle pragma restrictions check for usage of obsolescent - -- character replacements during the scan. - - procedure Set_Obsolescent_Check (Value : Boolean); - -- Activate or not obsolescent check - procedure Post_Scan; - pragma Inline (Post_Scan); -- Create nodes for tokens: Char_Literal, Identifier, Real_Literal, -- Integer_Literal, String_Literal and Operator_Symbol. @@ -75,13 +67,12 @@ package Scn is -- generic package Scng with routines appropriate to the compiler package Scanner is new Scng - (Post_Scan => Post_Scan, - Error_Msg => Error_Msg, - Error_Msg_S => Error_Msg_S, - Error_Msg_SC => Error_Msg_SC, - Error_Msg_SP => Error_Msg_SP, - Obsolescent_Check => Obsolescent_Check, - Style => Style.Style_Inst); + (Post_Scan => Post_Scan, + Error_Msg => Error_Msg, + Error_Msg_S => Error_Msg_S, + Error_Msg_SC => Error_Msg_SC, + Error_Msg_SP => Error_Msg_SP, + Style => Style.Style_Inst); procedure Scan renames Scanner.Scan; -- Scan scans out the next token, and advances the scan state accordingly diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index d4005b47989..bc34eab49ed 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -516,6 +516,7 @@ package body Scng is Base := 10; UI_Base := Uint_10; UI_Int_Value := Uint_0; + Based_Literal_Uses_Colon := False; Scale := 0; Scan_Integer; Point_Scanned := False; @@ -568,20 +569,14 @@ package body Scng is or else Source (Scan_Ptr + 1) in 'a' .. 'z')) then - if C = ':' then - Obsolescent_Check (Scan_Ptr); - - if Warn_On_Obsolescent_Feature then - Error_Msg_S - ("use of "":"" is an obsolescent feature (RM J.2(3))?"); - Error_Msg_S ("\use ""'#"" instead?"); - end if; - end if; - Accumulate_Checksum (C); Base_Char := C; UI_Base := UI_Int_Value; + if Base_Char = ':' then + Based_Literal_Uses_Colon := True; + end if; + if UI_Base < 2 or else UI_Base > 16 then Error_Msg_SC ("base not 2-16"); UI_Base := Uint_16; @@ -753,7 +748,6 @@ package body Scng is end if; Accumulate_Token_Checksum; - return; end Nlit; @@ -1579,24 +1573,9 @@ package body Scng is end if; end Minus_Case; - -- Double quote starting a string literal - - when '"' => - Slit; - Post_Scan; - return; - - -- Percent starting a string literal - - when '%' => - Obsolescent_Check (Token_Ptr); - - if Warn_On_Obsolescent_Feature then - Error_Msg_S - ("use of ""'%"" is an obsolescent feature (RM J.2(4))?"); - Error_Msg_S ("\use """""" instead?"); - end if; + -- Double quote or percent starting a string literal + when '"' | '%' => Slit; Post_Scan; return; @@ -1808,6 +1787,7 @@ package body Scng is Style.Check_Vertical_Bar; end if; + Post_Scan; return; end if; end Vertical_Bar_Case; @@ -1816,13 +1796,6 @@ package body Scng is when '!' => Exclamation_Case : begin Accumulate_Checksum ('!'); - Obsolescent_Check (Token_Ptr); - - if Warn_On_Obsolescent_Feature then - Error_Msg_S - ("use of ""'!"" is an obsolescent feature (RM J.2(2))?"); - Error_Msg_S ("\use ""'|"" instead?"); - end if; if Source (Scan_Ptr + 1) = '=' then Error_Msg_S -- CODEFIX @@ -1834,6 +1807,7 @@ package body Scng is else Scan_Ptr := Scan_Ptr + 1; Token := Tok_Vertical_Bar; + Post_Scan; return; end if; end Exclamation_Case; diff --git a/gcc/ada/scng.ads b/gcc/ada/scng.ads index 1988e26dd23..d9035119f4b 100644 --- a/gcc/ada/scng.ads +++ b/gcc/ada/scng.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,9 +33,10 @@ with Types; use Types; generic with procedure Post_Scan; - -- Procedure called by Scan for the following tokens: - -- Tok_Char_Literal, Tok_Identifier, Tok_Real_Literal, Tok_Real_Literal, - -- Tok_Integer_Literal, Tok_String_Literal, Tok_Operator_Symbol. + -- Procedure called by Scan for the following tokens: Tok_Char_Literal, + -- Tok_Identifier, Tok_Real_Literal, Tok_Real_Literal, Tok_Integer_Literal, + -- Tok_String_Literal, Tok_Operator_Symbol, and Tok_Vertical_Bar. Used to + -- build Token_Node and also check for obsolescent features. with procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr); -- Output a message at specified location @@ -49,10 +50,6 @@ generic with procedure Error_Msg_SP (Msg : String); -- Output a message at the start of the previous token - with procedure Obsolescent_Check (S : Source_Ptr); - -- Called when one of the obsolescent character replacements is - -- used with S pointing to the character in question. - with package Style is new Styleg (Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP); -- Instantiation of Styleg with the same error reporting routines diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads index 7111287c0a6..8163e62300d 100644 --- a/gcc/ada/scos.ads +++ b/gcc/ada/scos.ads @@ -159,7 +159,7 @@ package SCOs is -- Note: for I and W, condition above is in the RM syntax sense (this -- condition is a decision in SCO terminology). - -- and is omitted for all other cases. + -- and is omitted for all other cases -- Note: up to 6 entries can appear on a single CS line. If more than 6 -- entries appear in one logical statement sequence, continuation lines @@ -216,7 +216,7 @@ package SCOs is -- For each decision, a decision line is generated with the form: - -- C* sloc expression + -- C* sloc expression [chaining] -- Here * is one of the following characters: @@ -229,7 +229,7 @@ package SCOs is -- For I, E, P, W, sloc is the source location of the IF, EXIT, PRAGMA or -- WHILE token. - -- For X, sloc is omitted. + -- For X, sloc is omitted -- The expression is a prefix polish form indicating the structure of -- the decision, including logical operators and short-circuit forms. @@ -257,11 +257,11 @@ package SCOs is -- where t/f are used to mark a condition that has been recognized by -- the compiler as always being true or false. - -- & indicates AND THEN connecting two conditions. + -- & indicates AND THEN connecting two conditions - -- | indicates OR ELSE connecting two conditions. + -- | indicates OR ELSE connecting two conditions - -- ! indicates NOT applied to the expression. + -- ! indicates NOT applied to the expression -- Note that complex decisions do NOT include non-short-circuited logical -- operators (AND/XOR/OR). In the context of existing coverage tools the @@ -276,6 +276,34 @@ package SCOs is -- condition, and that is true even if the Ada 2005 set membership -- form is used, e.g. A in (2,7,11.15). + -- The expression can be followed by chaining indicators of the form + -- Tsloc-range or Fsloc-range. + + -- T* is present when the statement with the given sloc range is executed + -- if, and only if, the decision evaluates to TRUE. + + -- F* is present when the statement with the given sloc range is executed + -- if, and only if, the decision evaluates to FALSE. + + -- For an IF statement or ELSIF part, a T chaining indicator is always + -- present, with the sloc range of the first statement in the + -- corresponding sequence. + + -- For an ELSE part, the last decision in the IF statement (that of the + -- last ELSIF part, if any, or that of the IF statement if there is no + -- ELSIF part) has an F chaining indicator with the sloc range of the + -- first statement in the sequence of the ELSE part. + + -- For a WHILE loop, a T chaining indicator is always present, with the + -- sloc range of the first statement in the loop, but no F chaining + -- indicator is ever present. + + -- For an EXIT WHEN statement, an F chaining indicator is present if + -- there is an immediately following sequence in the same sequence of + -- statements. + + -- In all other cases, chaining indicators are omitted + -- Case Expressions -- For case statements, we rely on statement coverage to make sure that @@ -287,7 +315,7 @@ package SCOs is -- CC sloc-range sloc-range ... - -- where sloc-range covers the range of the case expression. + -- where sloc-range covers the range of the case expression -- Note: up to 6 entries can appear on a single CC line. If more than 6 -- entries appear in one logical statement sequence, continuation lines @@ -382,6 +410,12 @@ package SCOs is -- To = ending source location -- Last = False for all but the last entry, True for last entry + -- Element (chaining indicator) + -- C1 = 'H' (cHain) + -- C2 = 'T' or 'F' (chaining on decision true/false) + -- From = starting source location of chained statement + -- To = ending source location of chained statement + -- Note: the sequence starting with a decision, and continuing with -- operators and elements up to and including the first one labeled with -- Last = True, indicate the sequence to be output on one decision line. diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index f18e5e68785..32ad831db45 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -67,7 +67,7 @@ package body Sem is -- Controls debugging printouts for Walk_Library_Items Outer_Generic_Scope : Entity_Id := Empty; - -- Global reference to the outer scope that is generic. In a non- generic + -- Global reference to the outer scope that is generic. In a non-generic -- context, it is empty. At the moment, it is only used for avoiding -- freezing of external references in generics. @@ -1452,16 +1452,18 @@ package body Sem is end if; -- Do analysis, and then append the compilation unit onto the - -- Comp_Unit_List, if appropriate. This is done after analysis, so - -- if this unit depends on some others, they have already been - -- appended. We ignore bodies, except for the main unit itself. We - -- have also to guard against ill-formed subunits that have an - -- improper context. + -- Comp_Unit_List, if appropriate. This is done after analysis, + -- so if this unit depends on some others, they have already been + -- appended. We ignore bodies, except for the main unit itself, and + -- for subprogram bodies that act as specs. We have also to guard + -- against ill-formed subunits that have an improper context. Do_Analyze; if Present (Comp_Unit) and then Nkind (Unit (Comp_Unit)) in N_Proper_Body + and then (Nkind (Unit (Comp_Unit)) /= N_Subprogram_Body + or else not Acts_As_Spec (Comp_Unit)) and then not In_Extended_Main_Source_Unit (Comp_Unit) then null; @@ -1536,6 +1538,22 @@ package body Sem is -- This is needed because the spec of the main unit may appear in the -- context of some other unit. We do not want this to force processing -- of the main body before all other units have been processed. + -- + -- Another circularity pattern occurs when the main unit is a child unit + -- and the body of an ancestor has a with-clause of the main unit or on + -- one of its children. In both cases the body in question has a with- + -- clause on the main unit, and must be excluded from the traversal. In + -- some convoluted cases this may lead to a CodePeer error because the + -- spec of a subprogram declared in an instance within the parent will + -- not be seen in the main unit. + + function Depends_On_Main (CU : Node_Id) return Boolean; + -- The body of a unit that is withed by the spec of the main unit may in + -- turn have a with_clause on that spec. In that case do not traverse + -- the body, to prevent loops. It can also happen that the main body has + -- a with_clause on a child, which of course has an implicit with on its + -- parent. It's OK to traverse the child body if the main spec has been + -- processed, otherwise we also have a circularity to avoid. procedure Do_Action (CU : Node_Id; Item : Node_Id); -- Calls Action, with some validity checks @@ -1556,6 +1574,39 @@ package body Sem is -- is processed wherever it appears in the list of units, while the body -- is processed as the last unit in the list. + --------------------- + -- Depends_On_Main -- + --------------------- + + function Depends_On_Main (CU : Node_Id) return Boolean is + CL : Node_Id; + MCU : constant Node_Id := Unit (Main_CU); + + begin + CL := First (Context_Items (CU)); + + -- Problem does not arise with main subprograms + + if + not Nkind_In (MCU, N_Package_Body, N_Package_Declaration) + then + return False; + end if; + + while Present (CL) loop + if Nkind (CL) = N_With_Clause + and then Library_Unit (CL) = Main_CU + and then not Done (Get_Cunit_Unit_Number (Library_Unit (CL))) + then + return True; + end if; + + Next (CL); + end loop; + + return False; + end Depends_On_Main; + --------------- -- Do_Action -- --------------- @@ -1810,45 +1861,6 @@ package body Sem is procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit); - function Depends_On_Main (CU : Node_Id) return Boolean; - -- The body of a unit that is withed by the spec of the main unit - -- may in turn have a with_clause on that spec. In that case do not - -- traverse the body, to prevent loops. It can also happen that the - -- main body has a with_clause on a child, which of course has an - -- implicit with on its parent. It's OK to traverse the child body - -- if the main spec has been processed, otherwise we also have a - -- circularity to avoid. - - --------------------- - -- Depends_On_Main -- - --------------------- - - function Depends_On_Main (CU : Node_Id) return Boolean is - CL : Node_Id; - - begin - CL := First (Context_Items (CU)); - - -- Problem does not arise with main subprograms - - if Nkind (Unit (Main_CU)) /= N_Package_Body then - return False; - end if; - - while Present (CL) loop - if Nkind (CL) = N_With_Clause - and then Library_Unit (CL) = Library_Unit (Main_CU) - and then not Done (Get_Cunit_Unit_Number (Library_Unit (CL))) - then - return True; - end if; - - Next (CL); - end loop; - - return False; - end Depends_On_Main; - -- Start of processing for Process_Bodies_In_Context begin @@ -1929,8 +1941,9 @@ package body Sem is Cur := First_Elmt (Comp_Unit_List); while Present (Cur) loop declare - CU : constant Node_Id := Node (Cur); - N : constant Node_Id := Unit (CU); + CU : constant Node_Id := Node (Cur); + N : constant Node_Id := Unit (CU); + Par : Entity_Id; begin pragma Assert (Nkind (CU) = N_Compilation_Unit); @@ -1946,10 +1959,16 @@ package body Sem is -- a package, the original file carries the body, and the spec -- appears as a later entry in the units list. - -- Otherwise Bodies appear in the list only because of inlining - -- or instantiations, and they are processed only if relevant - -- to the main unit. The main unit itself is processed - -- separately after all other specs. + -- Otherwise bodies appear in the list only because of inlining + -- or instantiations, and they are processed only if relevant. + -- The flag Withed_Body on a context clause indicates that a + -- unit contains an instantiation that may be needed later, + -- and therefore the body that contains the generic body (and + -- its context) must be traversed immediately after the + -- corresponding spec (see Do_Unit_And_Dependents). + + -- The main unit itself is processed separately after all other + -- specs, and relevant bodies are examined in Process_Main. when N_Subprogram_Body => if Acts_As_Spec (N) then @@ -1967,10 +1986,26 @@ package body Sem is Unit (Library_Unit (Main_CU))); end if; - -- It's a spec, process it, and the units it depends on + -- It's a spec, process it, and the units it depends on, + -- unless it is a descendent of the main unit. This can + -- happen when the body of a parent depends on some other + -- descendent. when others => - Do_Unit_And_Dependents (CU, N); + Par := Scope (Defining_Entity (Unit (CU))); + + if Is_Child_Unit (Defining_Entity (Unit (CU))) then + while Present (Par) + and then Par /= Standard_Standard + and then Par /= Cunit_Entity (Main_Unit) + loop + Par := Scope (Par); + end loop; + end if; + + if Par /= Cunit_Entity (Main_Unit) then + Do_Unit_And_Dependents (CU, N); + end if; end case; end; @@ -1983,15 +2018,47 @@ package body Sem is if not Done (Main_Unit) then Do_Main := True; - declare + Process_Main : declare Parent_CU : Node_Id; Body_CU : Node_Id; Body_U : Unit_Number_Type; Child : Entity_Id; + function Is_Subunit_Of_Main (U : Node_Id) return Boolean; + -- If the main unit has subunits, their context may include + -- bodies that are needed in the body of main. We must examine + -- the context of the subunits, which are otherwise not made + -- explicit in the main unit. + + ------------------------ + -- Is_Subunit_Of_Main -- + ------------------------ + + function Is_Subunit_Of_Main (U : Node_Id) return Boolean is + Lib : Node_Id; + begin + if No (U) then + return False; + else + Lib := Library_Unit (U); + return Nkind (Unit (U)) = N_Subunit + and then + (Lib = Cunit (Main_Unit) + or else Is_Subunit_Of_Main (Lib)); + end if; + end Is_Subunit_Of_Main; + + -- Start of processing for Process_Main + begin Process_Bodies_In_Context (Main_CU); + for Unit_Num in Done'Range loop + if Is_Subunit_Of_Main (Cunit (Unit_Num)) then + Process_Bodies_In_Context (Cunit (Unit_Num)); + end if; + end loop; + -- If the main unit is a child unit, parent bodies may be present -- because they export instances or inlined subprograms. Check for -- presence of these, which are not present in context clauses. @@ -2008,6 +2075,7 @@ package body Sem is if Present (Body_CU) and then not Seen (Get_Cunit_Unit_Number (Body_CU)) + and then not Depends_On_Main (Body_CU) then Body_U := Get_Cunit_Unit_Number (Body_CU); Seen (Body_U) := True; @@ -2021,7 +2089,7 @@ package body Sem is Do_Action (Main_CU, Unit (Main_CU)); Done (Main_Unit) := True; - end; + end Process_Main; end if; if Debug_Unit_Walk then @@ -2118,6 +2186,8 @@ package body Sem is pragma Assert (Nkind (CU) = N_Compilation_Unit); Context_Item : Node_Id; + Lib_Unit : Node_Id; + Body_CU : Node_Id; begin Context_Item := First (Context_Items (CU)); @@ -2126,7 +2196,32 @@ package body Sem is and then (Include_Limited or else not Limited_Present (Context_Item)) then - Action (Library_Unit (Context_Item)); + Lib_Unit := Library_Unit (Context_Item); + Action (Lib_Unit); + + -- If the context item indicates that a package body is needed + -- because of an instantiation in CU, traverse the body now, even + -- if CU is not related to the main unit. If the generic itself + -- appears in a package body, the context item is this body, and + -- it already appears in the traversal order, so we only need to + -- examine the case of a context item being a package declaration. + + if Present (Withed_Body (Context_Item)) + and then Nkind (Unit (Lib_Unit)) = N_Package_Declaration + and then Present (Corresponding_Body (Unit (Lib_Unit))) + then + Body_CU := + Parent + (Unit_Declaration_Node + (Corresponding_Body (Unit (Lib_Unit)))); + + -- A body may have an implicit with on its own spec, in which + -- case we must ignore this context item to prevent looping. + + if Unit (CU) /= Unit (Body_CU) then + Action (Body_CU); + end if; + end if; end if; Context_Item := Next (Context_Item); diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 35f5717b3cc..50af15c7f31 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -569,7 +569,7 @@ package body Sem_Aggr is Set_Raises_Constraint_Error (N); Error_Msg_N ("sub-aggregate low bound mismatch?", N); Error_Msg_N - ("\Constraint_Error will be raised at run-time?", N); + ("\Constraint_Error will be raised at run time?", N); end if; end if; @@ -583,7 +583,7 @@ package body Sem_Aggr is Set_Raises_Constraint_Error (N); Error_Msg_N ("sub-aggregate high bound mismatch?", N); Error_Msg_N - ("\Constraint_Error will be raised at run-time?", N); + ("\Constraint_Error will be raised at run time?", N); end if; end if; end if; @@ -1255,7 +1255,7 @@ package body Sem_Aggr is if OK_BH and then OK_AH and then Val_BH < Val_AH then Set_Raises_Constraint_Error (N); Error_Msg_N ("upper bound out of range?", AH); - Error_Msg_N ("\Constraint_Error will be raised at run-time?", AH); + Error_Msg_N ("\Constraint_Error will be raised at run time?", AH); -- You need to set AH to BH or else in the case of enumerations -- indices we will not be able to resolve the aggregate bounds. @@ -1298,13 +1298,13 @@ package body Sem_Aggr is if OK_L and then Val_L > Val_AL then Set_Raises_Constraint_Error (N); Error_Msg_N ("lower bound of aggregate out of range?", N); - Error_Msg_N ("\Constraint_Error will be raised at run-time?", N); + Error_Msg_N ("\Constraint_Error will be raised at run time?", N); end if; if OK_H and then Val_H < Val_AH then Set_Raises_Constraint_Error (N); Error_Msg_N ("upper bound of aggregate out of range?", N); - Error_Msg_N ("\Constraint_Error will be raised at run-time?", N); + Error_Msg_N ("\Constraint_Error will be raised at run time?", N); end if; end Check_Bounds; @@ -1344,7 +1344,7 @@ package body Sem_Aggr is if Range_Len < Len then Set_Raises_Constraint_Error (N); Error_Msg_N ("too many elements?", N); - Error_Msg_N ("\Constraint_Error will be raised at run-time?", N); + Error_Msg_N ("\Constraint_Error will be raised at run time?", N); end if; end Check_Length; @@ -1411,6 +1411,14 @@ package body Sem_Aggr is -- Set to False if resolution of the expression failed begin + -- Defend against previous errors + + if Nkind (Expr) = N_Error + or else Error_Posted (Expr) + then + return True; + end if; + -- If the array type against which we are resolving the aggregate -- has several dimensions, the expressions nested inside the -- aggregate must be further aggregates (or strings). diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 93473732d8d..71730bead25 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2549,7 +2549,7 @@ package body Sem_Attr is -- 2005. Note that we can't test Is_Tagged_Type here on P_Type, since -- this flag gets set by Find_Type in this situation. - if Restriction_Active (No_Obsolescent_Features) + if Restriction_Check_Required (No_Obsolescent_Features) and then Ada_Version >= Ada_2005 and then Ekind (P_Type) = E_Incomplete_Type then @@ -6392,7 +6392,7 @@ package body Sem_Attr is -- Note: for the folding case, it is fine to treat Machine_Rounding -- exactly the same way as Rounding, since this is one of the allowed -- behaviors, and performance is not an issue here. It might be a bit - -- better to give the same result as it would give at run-time, even + -- better to give the same result as it would give at run time, even -- though the non-determinism is certainly permitted. when Attribute_Machine_Rounding => @@ -7949,7 +7949,14 @@ package body Sem_Attr is -- when within an instance, because any violations will have -- been caught by the compilation of the generic unit. + -- Note that we relax this check in CodePeer mode for + -- compatibility with legacy code. + + -- This seems an odd decision??? Why should codepeer mode + -- have a different notion of legality from the compiler??? + elsif Attr_Id = Attribute_Access + and then not CodePeer_Mode and then not In_Instance and then Present (Enclosing_Generic_Unit (Entity (P))) and then Present (Enclosing_Generic_Body (N)) @@ -7966,9 +7973,9 @@ package body Sem_Attr is -- The attribute type's ultimate ancestor must be -- declared within the same generic unit as the -- subprogram is declared. The error message is - -- specialized to say "ancestor" for the case where - -- the access type is not its own ancestor, since - -- saying simply "access type" would be very confusing. + -- specialized to say "ancestor" for the case where the + -- access type is not its own ancestor, since saying + -- simply "access type" would be very confusing. if Enclosing_Generic_Unit (Entity (P)) /= Enclosing_Generic_Unit (Root_Type (Btyp)) diff --git a/gcc/ada/sem_aux.ads b/gcc/ada/sem_aux.ads index 8b763e05240..490f8e3d5d4 100755 --- a/gcc/ada/sem_aux.ads +++ b/gcc/ada/sem_aux.ads @@ -172,7 +172,8 @@ package Sem_Aux is -- These are the types that are defined as return-by-reference types in Ada -- 95 (see RM95-6.5(11-16)). In Ada 2005, these are the types that require -- build-in-place for function calls. Note that build-in-place is allowed - -- for other types, too. + -- for other types, too. This is also used for idenfitying pure procedures + -- whose calls should not be eliminated (RM 10.2.1(18/2)). function Is_Limited_Type (Ent : Entity_Id) return Boolean; -- Ent is any entity. Returns true if Ent is a limited type (limited diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index b02cf1491cb..7623b8231ea 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -2325,7 +2325,7 @@ package body Sem_Ch10 is -- Note: this is not quite right if the user defines one of these units -- himself, but that's a marginal case, and fixing it is hard ??? - if Restriction_Active (No_Obsolescent_Features) then + if Restriction_Check_Required (No_Obsolescent_Features) then declare F : constant File_Name_Type := Unit_File_Name (Get_Source_Unit (U)); diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index a2009c2b66e..b325ccbe89c 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -11212,6 +11212,7 @@ package body Sem_Ch12 is -- stack contains the parent instances of the instantiation, followed by -- the original S. + Cur_P : Entity_Id; E : Entity_Id; P : Entity_Id; Hidden : Elmt_Id; @@ -11234,9 +11235,18 @@ package body Sem_Ch12 is Next_Entity (E); end loop; - if Is_Generic_Instance (Current_Scope) - and then P /= Current_Scope - then + -- If instantiation is declared in a block, it is the enclosing + -- scope that might be a parent instance. Note that only one + -- block can be involved, because the parent instances have + -- been installed within it. + + if Ekind (P) = E_Block then + Cur_P := Scope (P); + else + Cur_P := P; + end if; + + if Is_Generic_Instance (Cur_P) and then P /= Current_Scope then -- We are within an instance of some sibling. Retain -- visibility of parent, for proper subsequent cleanup, and -- reinstall private declarations as well. @@ -11246,7 +11256,7 @@ package body Sem_Ch12 is end if; -- If the ultimate parent is a top-level unit recorded in - -- Instance_Parent_Unit, then reset its visibility to what is was + -- Instance_Parent_Unit, then reset its visibility to what it was -- before instantiation. (It's not clear what the purpose is of -- testing whether Scope (P) is In_Open_Scopes, but that test was -- present before the ultimate parent test was added.???) @@ -11389,11 +11399,11 @@ package body Sem_Ch12 is while Present (M) loop Typ := Node (M); - -- Subtypes of types whose views have been exchanged, and that - -- are defined within the instance, were not on the list of - -- Private_Dependents on entry to the instance, so they have to be - -- exchanged explicitly now, in order to remain consistent with the - -- view of the parent type. + -- Subtypes of types whose views have been exchanged, and that are + -- defined within the instance, were not on the Private_Dependents + -- list on entry to the instance, so they have to be exchanged + -- explicitly now, in order to remain consistent with the view of the + -- parent type. if Ekind_In (Typ, E_Private_Type, E_Limited_Private_Type, @@ -11437,11 +11447,11 @@ package body Sem_Ch12 is -- An unusual case of aliasing: the actual may also be directly -- visible in the generic, and be private there, while it is fully -- visible in the context of the instance. The internal subtype - -- is private in the instance, but has full visibility like its + -- is private in the instance but has full visibility like its -- parent in the enclosing scope. This enforces the invariant that -- the privacy status of all private dependents of a type coincide -- with that of the parent type. This can only happen when a - -- generic child unit is instantiated within sibling. + -- generic child unit is instantiated within a sibling. if Is_Private_Type (E) and then not Is_Private_Type (Etype (E)) @@ -11457,16 +11467,14 @@ package body Sem_Ch12 is -- a formal package, make its own formals private as well. The -- actual in this case is itself the renaming of an instantiation. -- If the entity is not a package renaming, it is the entity - -- created to validate formal package actuals: ignore. + -- created to validate formal package actuals: ignore it. -- If the actual is itself a formal package for the enclosing -- generic, or the actual for such a formal package, it remains -- visible on exit from the instance, and therefore nothing needs -- to be done either, except to keep it accessible. - if Is_Package - and then Renamed_Object (E) = Pack_Id - then + if Is_Package and then Renamed_Object (E) = Pack_Id then exit; elsif Nkind (Parent (E)) /= N_Package_Renaming_Declaration then @@ -11720,15 +11728,29 @@ package body Sem_Ch12 is N2 := Get_Associated_Node (N); E := Entity (N2); + -- If the entity is an itype created as a subtype of an access type + -- with a null exclusion restore source entity for proper visibility. + -- The itype will be created anew in the instance. + if Present (E) then + if Is_Itype (E) + and then Ekind (E) = E_Access_Subtype + and then Is_Entity_Name (N) + and then Chars (Etype (E)) = Chars (N) + then + E := Etype (E); + Set_Entity (N2, E); + Set_Etype (N2, E); + end if; + if Is_Global (E) then Set_Global_Type (N, N2); elsif Nkind (N) = N_Op_Concat and then Is_Generic_Type (Etype (N2)) - and then - (Base_Type (Etype (Right_Opnd (N2))) = Etype (N2) - or else Base_Type (Etype (Left_Opnd (N2))) = Etype (N2)) + and then (Base_Type (Etype (Right_Opnd (N2))) = Etype (N2) + or else + Base_Type (Etype (Left_Opnd (N2))) = Etype (N2)) and then Is_Intrinsic_Subprogram (E) then null; @@ -11971,11 +11993,11 @@ package body Sem_Ch12 is and then Is_Generic_Unit (Scope (Gen_Id)) and then In_Open_Scopes (Scope (Gen_Id)) then - -- This is an instantiation of a child unit within a sibling, - -- so that the generic parent is in scope. An eventual instance - -- must occur within the scope of an instance of the parent. - -- Make name in instance into an expanded name, to preserve the - -- identifier of the parent, so it can be resolved subsequently. + -- This is an instantiation of a child unit within a sibling, so + -- that the generic parent is in scope. An eventual instance must + -- occur within the scope of an instance of the parent. Make name + -- in instance into an expanded name, to preserve the identifier + -- of the parent, so it can be resolved subsequently. Rewrite (Name (N2), Make_Expanded_Name (Loc, diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 67a913919e3..b3dd42cd548 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -184,415 +184,410 @@ package body Sem_Ch13 is begin -- Processing depends on version of Ada - case Ada_Version is + -- For Ada 95, we just renumber bits within a storage unit. We do the + -- same for Ada 83 mode, since we recognize pragma Bit_Order in Ada 83, + -- and are free to add this extension. - -- For Ada 95, we just renumber bits within a storage unit. We do - -- the same for Ada 83 mode, since we recognize pragma Bit_Order - -- in Ada 83, and are free to add this extension. + if Ada_Version < Ada_2005 then + Comp := First_Component_Or_Discriminant (R); + while Present (Comp) loop + CC := Component_Clause (Comp); - when Ada_83 | Ada_95 => - Comp := First_Component_Or_Discriminant (R); - while Present (Comp) loop - CC := Component_Clause (Comp); + -- If component clause is present, then deal with the non-default + -- bit order case for Ada 95 mode. - -- If component clause is present, then deal with the non- - -- default bit order case for Ada 95 mode. + -- We only do this processing for the base type, and in fact that + -- is important, since otherwise if there are record subtypes, we + -- could reverse the bits once for each subtype, which is wrong. - -- We only do this processing for the base type, and in - -- fact that's important, since otherwise if there are - -- record subtypes, we could reverse the bits once for - -- each subtype, which would be incorrect. + if Present (CC) + and then Ekind (R) = E_Record_Type + then + declare + CFB : constant Uint := Component_Bit_Offset (Comp); + CSZ : constant Uint := Esize (Comp); + CLC : constant Node_Id := Component_Clause (Comp); + Pos : constant Node_Id := Position (CLC); + FB : constant Node_Id := First_Bit (CLC); - if Present (CC) - and then Ekind (R) = E_Record_Type - then - declare - CFB : constant Uint := Component_Bit_Offset (Comp); - CSZ : constant Uint := Esize (Comp); - CLC : constant Node_Id := Component_Clause (Comp); - Pos : constant Node_Id := Position (CLC); - FB : constant Node_Id := First_Bit (CLC); + Storage_Unit_Offset : constant Uint := + CFB / System_Storage_Unit; - Storage_Unit_Offset : constant Uint := - CFB / System_Storage_Unit; + Start_Bit : constant Uint := + CFB mod System_Storage_Unit; - Start_Bit : constant Uint := - CFB mod System_Storage_Unit; + begin + -- Cases where field goes over storage unit boundary - begin - -- Cases where field goes over storage unit boundary + if Start_Bit + CSZ > System_Storage_Unit then - if Start_Bit + CSZ > System_Storage_Unit then + -- Allow multi-byte field but generate warning - -- Allow multi-byte field but generate warning + if Start_Bit mod System_Storage_Unit = 0 + and then CSZ mod System_Storage_Unit = 0 + then + Error_Msg_N + ("multi-byte field specified with non-standard" + & " Bit_Order?", CLC); - if Start_Bit mod System_Storage_Unit = 0 - and then CSZ mod System_Storage_Unit = 0 - then + if Bytes_Big_Endian then Error_Msg_N - ("multi-byte field specified with non-standard" - & " Bit_Order?", CLC); - - if Bytes_Big_Endian then - Error_Msg_N - ("bytes are not reversed " - & "(component is big-endian)?", CLC); - else - Error_Msg_N - ("bytes are not reversed " - & "(component is little-endian)?", CLC); - end if; - - -- Do not allow non-contiguous field - + ("bytes are not reversed " + & "(component is big-endian)?", CLC); else Error_Msg_N - ("attempt to specify non-contiguous field " - & "not permitted", CLC); - Error_Msg_N - ("\caused by non-standard Bit_Order " - & "specified", CLC); - Error_Msg_N - ("\consider possibility of using " - & "Ada 2005 mode here", CLC); + ("bytes are not reversed " + & "(component is little-endian)?", CLC); end if; - -- Case where field fits in one storage unit + -- Do not allow non-contiguous field else - -- Give warning if suspicious component clause + Error_Msg_N + ("attempt to specify non-contiguous field " + & "not permitted", CLC); + Error_Msg_N + ("\caused by non-standard Bit_Order " + & "specified", CLC); + Error_Msg_N + ("\consider possibility of using " + & "Ada 2005 mode here", CLC); + end if; - if Intval (FB) >= System_Storage_Unit - and then Warn_On_Reverse_Bit_Order - then - Error_Msg_N - ("?Bit_Order clause does not affect " & - "byte ordering", Pos); - Error_Msg_Uint_1 := - Intval (Pos) + Intval (FB) / - System_Storage_Unit; - Error_Msg_N - ("?position normalized to ^ before bit " & - "order interpreted", Pos); - end if; + -- Case where field fits in one storage unit - -- Here is where we fix up the Component_Bit_Offset - -- value to account for the reverse bit order. - -- Some examples of what needs to be done are: + else + -- Give warning if suspicious component clause - -- First_Bit .. Last_Bit Component_Bit_Offset - -- old new old new + if Intval (FB) >= System_Storage_Unit + and then Warn_On_Reverse_Bit_Order + then + Error_Msg_N + ("?Bit_Order clause does not affect " & + "byte ordering", Pos); + Error_Msg_Uint_1 := + Intval (Pos) + Intval (FB) / + System_Storage_Unit; + Error_Msg_N + ("?position normalized to ^ before bit " & + "order interpreted", Pos); + end if; - -- 0 .. 0 7 .. 7 0 7 - -- 0 .. 1 6 .. 7 0 6 - -- 0 .. 2 5 .. 7 0 5 - -- 0 .. 7 0 .. 7 0 4 + -- Here is where we fix up the Component_Bit_Offset value + -- to account for the reverse bit order. Some examples of + -- what needs to be done are: - -- 1 .. 1 6 .. 6 1 6 - -- 1 .. 4 3 .. 6 1 3 - -- 4 .. 7 0 .. 3 4 0 + -- First_Bit .. Last_Bit Component_Bit_Offset + -- old new old new - -- The general rule is that the first bit is - -- is obtained by subtracting the old ending bit - -- from storage_unit - 1. + -- 0 .. 0 7 .. 7 0 7 + -- 0 .. 1 6 .. 7 0 6 + -- 0 .. 2 5 .. 7 0 5 + -- 0 .. 7 0 .. 7 0 4 - Set_Component_Bit_Offset - (Comp, - (Storage_Unit_Offset * System_Storage_Unit) + - (System_Storage_Unit - 1) - - (Start_Bit + CSZ - 1)); + -- 1 .. 1 6 .. 6 1 6 + -- 1 .. 4 3 .. 6 1 3 + -- 4 .. 7 0 .. 3 4 0 - Set_Normalized_First_Bit - (Comp, - Component_Bit_Offset (Comp) mod - System_Storage_Unit); - end if; - end; - end if; + -- The rule is that the first bit is is obtained by + -- subtracting the old ending bit from storage_unit - 1. - Next_Component_Or_Discriminant (Comp); - end loop; + Set_Component_Bit_Offset + (Comp, + (Storage_Unit_Offset * System_Storage_Unit) + + (System_Storage_Unit - 1) - + (Start_Bit + CSZ - 1)); - -- For Ada 2005, we do machine scalar processing, as fully described - -- In AI-133. This involves gathering all components which start at - -- the same byte offset and processing them together + Set_Normalized_First_Bit + (Comp, + Component_Bit_Offset (Comp) mod + System_Storage_Unit); + end if; + end; + end if; - when Ada_05 .. Ada_Version_Type'Last => - declare - Max_Machine_Scalar_Size : constant Uint := - UI_From_Int - (Standard_Long_Long_Integer_Size); + Next_Component_Or_Discriminant (Comp); + end loop; + + -- For Ada 2005, we do machine scalar processing, as fully described In + -- AI-133. This involves gathering all components which start at the + -- same byte offset and processing them together. Same approach is still + -- valid in later versions including Ada 2012. + + else + declare + Max_Machine_Scalar_Size : constant Uint := + UI_From_Int + (Standard_Long_Long_Integer_Size); -- We use this as the maximum machine scalar size - Num_CC : Natural; - SSU : constant Uint := UI_From_Int (System_Storage_Unit); + Num_CC : Natural; + SSU : constant Uint := UI_From_Int (System_Storage_Unit); - begin - -- This first loop through components does two things. First it - -- deals with the case of components with component clauses - -- whose length is greater than the maximum machine scalar size - -- (either accepting them or rejecting as needed). Second, it - -- counts the number of components with component clauses whose - -- length does not exceed this maximum for later processing. + begin + -- This first loop through components does two things. First it + -- deals with the case of components with component clauses whose + -- length is greater than the maximum machine scalar size (either + -- accepting them or rejecting as needed). Second, it counts the + -- number of components with component clauses whose length does + -- not exceed this maximum for later processing. + + Num_CC := 0; + Comp := First_Component_Or_Discriminant (R); + while Present (Comp) loop + CC := Component_Clause (Comp); - Num_CC := 0; - Comp := First_Component_Or_Discriminant (R); - while Present (Comp) loop - CC := Component_Clause (Comp); + if Present (CC) then + declare + Fbit : constant Uint := + Static_Integer (First_Bit (CC)); - if Present (CC) then - declare - Fbit : constant Uint := - Static_Integer (First_Bit (CC)); + begin + -- Case of component with size > max machine scalar - begin - -- Case of component with size > max machine scalar + if Esize (Comp) > Max_Machine_Scalar_Size then - if Esize (Comp) > Max_Machine_Scalar_Size then + -- Must begin on byte boundary - -- Must begin on byte boundary + if Fbit mod SSU /= 0 then + Error_Msg_N + ("illegal first bit value for " + & "reverse bit order", + First_Bit (CC)); + Error_Msg_Uint_1 := SSU; + Error_Msg_Uint_2 := Max_Machine_Scalar_Size; - if Fbit mod SSU /= 0 then - Error_Msg_N - ("illegal first bit value for " - & "reverse bit order", - First_Bit (CC)); - Error_Msg_Uint_1 := SSU; - Error_Msg_Uint_2 := Max_Machine_Scalar_Size; + Error_Msg_N + ("\must be a multiple of ^ " + & "if size greater than ^", + First_Bit (CC)); - Error_Msg_N - ("\must be a multiple of ^ " - & "if size greater than ^", - First_Bit (CC)); + -- Must end on byte boundary - -- Must end on byte boundary + elsif Esize (Comp) mod SSU /= 0 then + Error_Msg_N + ("illegal last bit value for " + & "reverse bit order", + Last_Bit (CC)); + Error_Msg_Uint_1 := SSU; + Error_Msg_Uint_2 := Max_Machine_Scalar_Size; - elsif Esize (Comp) mod SSU /= 0 then - Error_Msg_N - ("illegal last bit value for " - & "reverse bit order", - Last_Bit (CC)); - Error_Msg_Uint_1 := SSU; - Error_Msg_Uint_2 := Max_Machine_Scalar_Size; + Error_Msg_N + ("\must be a multiple of ^ if size " + & "greater than ^", + Last_Bit (CC)); - Error_Msg_N - ("\must be a multiple of ^ if size " - & "greater than ^", - Last_Bit (CC)); + -- OK, give warning if enabled - -- OK, give warning if enabled + elsif Warn_On_Reverse_Bit_Order then + Error_Msg_N + ("multi-byte field specified with " + & " non-standard Bit_Order?", CC); - elsif Warn_On_Reverse_Bit_Order then + if Bytes_Big_Endian then Error_Msg_N - ("multi-byte field specified with " - & " non-standard Bit_Order?", CC); - - if Bytes_Big_Endian then - Error_Msg_N - ("\bytes are not reversed " - & "(component is big-endian)?", CC); - else - Error_Msg_N - ("\bytes are not reversed " - & "(component is little-endian)?", CC); - end if; + ("\bytes are not reversed " + & "(component is big-endian)?", CC); + else + Error_Msg_N + ("\bytes are not reversed " + & "(component is little-endian)?", CC); end if; + end if; - -- Case where size is not greater than max machine - -- scalar. For now, we just count these. + -- Case where size is not greater than max machine + -- scalar. For now, we just count these. - else - Num_CC := Num_CC + 1; - end if; - end; - end if; + else + Num_CC := Num_CC + 1; + end if; + end; + end if; - Next_Component_Or_Discriminant (Comp); - end loop; + Next_Component_Or_Discriminant (Comp); + end loop; - -- We need to sort the component clauses on the basis of the - -- Position values in the clause, so we can group clauses with - -- the same Position. together to determine the relevant - -- machine scalar size. + -- We need to sort the component clauses on the basis of the + -- Position values in the clause, so we can group clauses with + -- the same Position. together to determine the relevant machine + -- scalar size. - Sort_CC : declare - Comps : array (0 .. Num_CC) of Entity_Id; - -- Array to collect component and discriminant entities. The - -- data starts at index 1, the 0'th entry is for the sort - -- routine. + Sort_CC : declare + Comps : array (0 .. Num_CC) of Entity_Id; + -- Array to collect component and discriminant entities. The + -- data starts at index 1, the 0'th entry is for the sort + -- routine. - function CP_Lt (Op1, Op2 : Natural) return Boolean; - -- Compare routine for Sort + function CP_Lt (Op1, Op2 : Natural) return Boolean; + -- Compare routine for Sort - procedure CP_Move (From : Natural; To : Natural); - -- Move routine for Sort + procedure CP_Move (From : Natural; To : Natural); + -- Move routine for Sort - package Sorting is new GNAT.Heap_Sort_G (CP_Move, CP_Lt); + package Sorting is new GNAT.Heap_Sort_G (CP_Move, CP_Lt); - Start : Natural; - Stop : Natural; - -- Start and stop positions in component list of set of - -- components with the same starting position (that - -- constitute components in a single machine scalar). + Start : Natural; + Stop : Natural; + -- Start and stop positions in the component list of the set of + -- components with the same starting position (that constitute + -- components in a single machine scalar). - MaxL : Uint; - -- Maximum last bit value of any component in this set + MaxL : Uint; + -- Maximum last bit value of any component in this set - MSS : Uint; - -- Corresponding machine scalar size + MSS : Uint; + -- Corresponding machine scalar size - ----------- - -- CP_Lt -- - ----------- + ----------- + -- CP_Lt -- + ----------- - function CP_Lt (Op1, Op2 : Natural) return Boolean is - begin - return Position (Component_Clause (Comps (Op1))) < - Position (Component_Clause (Comps (Op2))); - end CP_Lt; + function CP_Lt (Op1, Op2 : Natural) return Boolean is + begin + return Position (Component_Clause (Comps (Op1))) < + Position (Component_Clause (Comps (Op2))); + end CP_Lt; - ------------- - -- CP_Move -- - ------------- + ------------- + -- CP_Move -- + ------------- - procedure CP_Move (From : Natural; To : Natural) is - begin - Comps (To) := Comps (From); - end CP_Move; + procedure CP_Move (From : Natural; To : Natural) is + begin + Comps (To) := Comps (From); + end CP_Move; -- Start of processing for Sort_CC - begin - -- Collect the component clauses + begin + -- Collect the component clauses - Num_CC := 0; - Comp := First_Component_Or_Discriminant (R); - while Present (Comp) loop - if Present (Component_Clause (Comp)) - and then Esize (Comp) <= Max_Machine_Scalar_Size - then - Num_CC := Num_CC + 1; - Comps (Num_CC) := Comp; - end if; + Num_CC := 0; + Comp := First_Component_Or_Discriminant (R); + while Present (Comp) loop + if Present (Component_Clause (Comp)) + and then Esize (Comp) <= Max_Machine_Scalar_Size + then + Num_CC := Num_CC + 1; + Comps (Num_CC) := Comp; + end if; - Next_Component_Or_Discriminant (Comp); - end loop; + Next_Component_Or_Discriminant (Comp); + end loop; - -- Sort by ascending position number + -- Sort by ascending position number - Sorting.Sort (Num_CC); + Sorting.Sort (Num_CC); - -- We now have all the components whose size does not exceed - -- the max machine scalar value, sorted by starting - -- position. In this loop we gather groups of clauses - -- starting at the same position, to process them in - -- accordance with Ada 2005 AI-133. + -- We now have all the components whose size does not exceed + -- the max machine scalar value, sorted by starting position. + -- In this loop we gather groups of clauses starting at the + -- same position, to process them in accordance with AI-133. - Stop := 0; + Stop := 0; + while Stop < Num_CC loop + Start := Stop + 1; + Stop := Start; + MaxL := + Static_Integer + (Last_Bit (Component_Clause (Comps (Start)))); while Stop < Num_CC loop - Start := Stop + 1; - Stop := Start; - MaxL := - Static_Integer - (Last_Bit (Component_Clause (Comps (Start)))); - while Stop < Num_CC loop - if Static_Integer - (Position (Component_Clause (Comps (Stop + 1)))) = - Static_Integer - (Position (Component_Clause (Comps (Stop)))) - then - Stop := Stop + 1; - MaxL := - UI_Max - (MaxL, - Static_Integer - (Last_Bit - (Component_Clause (Comps (Stop))))); - else - exit; - end if; - end loop; + if Static_Integer + (Position (Component_Clause (Comps (Stop + 1)))) = + Static_Integer + (Position (Component_Clause (Comps (Stop)))) + then + Stop := Stop + 1; + MaxL := + UI_Max + (MaxL, + Static_Integer + (Last_Bit + (Component_Clause (Comps (Stop))))); + else + exit; + end if; + end loop; - -- Now we have a group of component clauses from Start to - -- Stop whose positions are identical, and MaxL is the - -- maximum last bit value of any of these components. - - -- We need to determine the corresponding machine scalar - -- size. This loop assumes that machine scalar sizes are - -- even, and that each possible machine scalar has twice - -- as many bits as the next smaller one. - - MSS := Max_Machine_Scalar_Size; - while MSS mod 2 = 0 - and then (MSS / 2) >= SSU - and then (MSS / 2) > MaxL - loop - MSS := MSS / 2; - end loop; + -- Now we have a group of component clauses from Start to + -- Stop whose positions are identical, and MaxL is the + -- maximum last bit value of any of these components. - -- Here is where we fix up the Component_Bit_Offset value - -- to account for the reverse bit order. Some examples of - -- what needs to be done for the case of a machine scalar - -- size of 8 are: + -- We need to determine the corresponding machine scalar + -- size. This loop assumes that machine scalar sizes are + -- even, and that each possible machine scalar has twice + -- as many bits as the next smaller one. - -- First_Bit .. Last_Bit Component_Bit_Offset - -- old new old new + MSS := Max_Machine_Scalar_Size; + while MSS mod 2 = 0 + and then (MSS / 2) >= SSU + and then (MSS / 2) > MaxL + loop + MSS := MSS / 2; + end loop; - -- 0 .. 0 7 .. 7 0 7 - -- 0 .. 1 6 .. 7 0 6 - -- 0 .. 2 5 .. 7 0 5 - -- 0 .. 7 0 .. 7 0 4 + -- Here is where we fix up the Component_Bit_Offset value + -- to account for the reverse bit order. Some examples of + -- what needs to be done for the case of a machine scalar + -- size of 8 are: - -- 1 .. 1 6 .. 6 1 6 - -- 1 .. 4 3 .. 6 1 3 - -- 4 .. 7 0 .. 3 4 0 + -- First_Bit .. Last_Bit Component_Bit_Offset + -- old new old new - -- The general rule is that the first bit is obtained by - -- subtracting the old ending bit from machine scalar - -- size - 1. + -- 0 .. 0 7 .. 7 0 7 + -- 0 .. 1 6 .. 7 0 6 + -- 0 .. 2 5 .. 7 0 5 + -- 0 .. 7 0 .. 7 0 4 - for C in Start .. Stop loop - declare - Comp : constant Entity_Id := Comps (C); - CC : constant Node_Id := - Component_Clause (Comp); - LB : constant Uint := - Static_Integer (Last_Bit (CC)); - NFB : constant Uint := MSS - Uint_1 - LB; - NLB : constant Uint := NFB + Esize (Comp) - 1; - Pos : constant Uint := - Static_Integer (Position (CC)); + -- 1 .. 1 6 .. 6 1 6 + -- 1 .. 4 3 .. 6 1 3 + -- 4 .. 7 0 .. 3 4 0 - begin - if Warn_On_Reverse_Bit_Order then - Error_Msg_Uint_1 := MSS; - Error_Msg_N - ("info: reverse bit order in machine " & - "scalar of length^?", First_Bit (CC)); - Error_Msg_Uint_1 := NFB; - Error_Msg_Uint_2 := NLB; - - if Bytes_Big_Endian then - Error_Msg_NE - ("?\info: big-endian range for " - & "component & is ^ .. ^", - First_Bit (CC), Comp); - else - Error_Msg_NE - ("?\info: little-endian range " - & "for component & is ^ .. ^", - First_Bit (CC), Comp); - end if; + -- The rule is that the first bit is obtained by subtracting + -- the old ending bit from machine scalar size - 1. + + for C in Start .. Stop loop + declare + Comp : constant Entity_Id := Comps (C); + CC : constant Node_Id := + Component_Clause (Comp); + LB : constant Uint := + Static_Integer (Last_Bit (CC)); + NFB : constant Uint := MSS - Uint_1 - LB; + NLB : constant Uint := NFB + Esize (Comp) - 1; + Pos : constant Uint := + Static_Integer (Position (CC)); + + begin + if Warn_On_Reverse_Bit_Order then + Error_Msg_Uint_1 := MSS; + Error_Msg_N + ("info: reverse bit order in machine " & + "scalar of length^?", First_Bit (CC)); + Error_Msg_Uint_1 := NFB; + Error_Msg_Uint_2 := NLB; + + if Bytes_Big_Endian then + Error_Msg_NE + ("?\info: big-endian range for " + & "component & is ^ .. ^", + First_Bit (CC), Comp); + else + Error_Msg_NE + ("?\info: little-endian range " + & "for component & is ^ .. ^", + First_Bit (CC), Comp); end if; + end if; - Set_Component_Bit_Offset (Comp, Pos * SSU + NFB); - Set_Normalized_First_Bit (Comp, NFB mod SSU); - end; - end loop; + Set_Component_Bit_Offset (Comp, Pos * SSU + NFB); + Set_Normalized_First_Bit (Comp, NFB mod SSU); + end; end loop; - end Sort_CC; - end; - end case; + end loop; + end Sort_CC; + end; + end if; end Adjust_Record_For_Reverse_Bit_Order; -------------------------------------- @@ -1288,6 +1283,7 @@ package body Sem_Ch13 is when Attribute_Component_Size => Component_Size_Case : declare Csize : constant Uint := Static_Integer (Expr); + Ctyp : Entity_Id; Btype : Entity_Id; Biased : Boolean; New_Ctyp : Entity_Id; @@ -1300,13 +1296,14 @@ package body Sem_Ch13 is end if; Btype := Base_Type (U_Ent); + Ctyp := Component_Type (Btype); if Has_Component_Size_Clause (Btype) then Error_Msg_N ("component size clause for& previously given", Nam); elsif Csize /= No_Uint then - Check_Size (Expr, Component_Type (Btype), Csize, Biased); + Check_Size (Expr, Ctyp, Csize, Biased); if Has_Aliased_Components (Btype) and then Csize < 32 @@ -1372,6 +1369,17 @@ package body Sem_Ch13 is end if; end if; + -- Deal with warning on overridden size + + if Warn_On_Overridden_Size + and then Has_Size_Clause (Ctyp) + and then RM_Size (Ctyp) /= Csize + then + Error_Msg_NE + ("?component size overrides size clause for&", + N, Ctyp); + end if; + Set_Has_Component_Size_Clause (Btype, True); Set_Has_Non_Standard_Rep (Btype, True); end if; @@ -1538,6 +1546,17 @@ package body Sem_Ch13 is ("size cannot be given for unconstrained array", Nam); elsif Size /= No_Uint then + + if VM_Target /= No_VM and then not GNAT_Mode then + + -- Size clause is not handled properly on VM targets. + -- Display a warning unless we are in GNAT mode, in which + -- case this is useless. + + Error_Msg_N + ("?size clauses are ignored in this configuration", N); + end if; + if Is_Type (U_Ent) then Etyp := U_Ent; else @@ -2743,6 +2762,15 @@ package body Sem_Ch13 is Set_Normalized_First_Bit (Comp, Fbit mod SSU); Set_Normalized_Position (Comp, Fbit / SSU); + if Warn_On_Overridden_Size + and then Has_Size_Clause (Etype (Comp)) + and then RM_Size (Etype (Comp)) /= Esize (Comp) + then + Error_Msg_NE + ("?component size overrides size clause for&", + Component_Name (CC), Etype (Comp)); + end if; + -- This information is also set in the corresponding -- component of the base type, found by accessing the -- Original_Record_Component link if it is present. @@ -3251,6 +3279,9 @@ package body Sem_Ch13 is Overlap_Check_Required : Boolean; -- Used to keep track of whether or not an overlap check is required + Overlap_Detected : Boolean := False; + -- Set True if an overlap is detected + Ccount : Natural := 0; -- Number of component clauses in record rep clause @@ -3274,6 +3305,7 @@ package body Sem_Ch13 is procedure Check_Component_Overlap (C1_Ent, C2_Ent : Entity_Id) is CC1 : constant Node_Id := Component_Clause (C1_Ent); CC2 : constant Node_Id := Component_Clause (C2_Ent); + begin if Present (CC1) and then Present (CC2) then @@ -3305,6 +3337,7 @@ package body Sem_Ch13 is Error_Msg_Node_1 := Component_Name (CC1); Error_Msg_N ("component& overlaps & #", Component_Name (CC1)); + Overlap_Detected := True; end if; end; end if; @@ -3477,12 +3510,14 @@ package body Sem_Ch13 is if Present (Comp) then Ccount := Ccount + 1; + -- We need a full overlap check if record positions non-monotonic + if Fbit <= Max_Bit_So_Far then Overlap_Check_Required := True; - else - Max_Bit_So_Far := Lbit; end if; + Max_Bit_So_Far := Lbit; + -- Check bit position out of range of specified size if Has_Size_Clause (Rectype) @@ -3501,6 +3536,7 @@ package body Sem_Ch13 is Error_Msg_NE ("component overlaps tag field of&", Component_Name (CC), Rectype); + Overlap_Detected := True; end if; if Hbit < Lbit then @@ -3650,8 +3686,8 @@ package body Sem_Ch13 is -- Skip overlap check if entity has no declaration node. This -- happens with discriminants in constrained derived types. - -- Probably we are missing some checks as a result, but that - -- does not seem terribly serious ??? + -- Possibly we are missing some checks as a result, but that + -- does not seem terribly serious. if No (Declaration_Node (C1_Ent)) then goto Continue_Main_Component_Loop; @@ -3695,7 +3731,6 @@ package body Sem_Ch13 is else Citem := First (Component_Items (Clist)); - while Present (Citem) loop if Nkind (Citem) = N_Component_Declaration then C2_Ent := Defining_Identifier (Citem); @@ -3741,6 +3776,183 @@ package body Sem_Ch13 is end Overlap_Check2; end if; + -- The following circuit deals with warning on record holes (gaps). We + -- skip this check if overlap was detected, since it makes sense for the + -- programmer to fix this illegality before worrying about warnings. + + if not Overlap_Detected and Warn_On_Record_Holes then + Record_Hole_Check : declare + Decl : constant Node_Id := Declaration_Node (Base_Type (Rectype)); + -- Full declaration of record type + + procedure Check_Component_List + (CL : Node_Id; + Sbit : Uint; + DS : List_Id); + -- Check component list CL for holes. The starting bit should be + -- Sbit. which is zero for the main record component list and set + -- appropriately for recursive calls for variants. DS is set to + -- a list of discriminant specifications to be included in the + -- consideration of components. It is No_List if none to consider. + + -------------------------- + -- Check_Component_List -- + -------------------------- + + procedure Check_Component_List + (CL : Node_Id; + Sbit : Uint; + DS : List_Id) + is + Compl : Integer; + + begin + Compl := Integer (List_Length (Component_Items (CL))); + + if DS /= No_List then + Compl := Compl + Integer (List_Length (DS)); + end if; + + declare + Comps : array (Natural range 0 .. Compl) of Entity_Id; + -- Gather components (zero entry is for sort routine) + + Ncomps : Natural := 0; + -- Number of entries stored in Comps (starting at Comps (1)) + + Citem : Node_Id; + -- One component item or discriminant specification + + Nbit : Uint; + -- Starting bit for next component + + CEnt : Entity_Id; + -- Component entity + + Variant : Node_Id; + -- One variant + + function Lt (Op1, Op2 : Natural) return Boolean; + -- Compare routine for Sort + + procedure Move (From : Natural; To : Natural); + -- Move routine for Sort + + package Sorting is new GNAT.Heap_Sort_G (Move, Lt); + + -------- + -- Lt -- + -------- + + function Lt (Op1, Op2 : Natural) return Boolean is + begin + return Component_Bit_Offset (Comps (Op1)) + < + Component_Bit_Offset (Comps (Op2)); + end Lt; + + ---------- + -- Move -- + ---------- + + procedure Move (From : Natural; To : Natural) is + begin + Comps (To) := Comps (From); + end Move; + + begin + -- Gather discriminants into Comp + + if DS /= No_List then + Citem := First (DS); + while Present (Citem) loop + if Nkind (Citem) = N_Discriminant_Specification then + declare + Ent : constant Entity_Id := + Defining_Identifier (Citem); + begin + if Ekind (Ent) = E_Discriminant then + Ncomps := Ncomps + 1; + Comps (Ncomps) := Ent; + end if; + end; + end if; + + Next (Citem); + end loop; + end if; + + -- Gather component entities into Comp + + Citem := First (Component_Items (CL)); + while Present (Citem) loop + if Nkind (Citem) = N_Component_Declaration then + Ncomps := Ncomps + 1; + Comps (Ncomps) := Defining_Identifier (Citem); + end if; + + Next (Citem); + end loop; + + -- Now sort the component entities based on the first bit. + -- Note we already know there are no overlapping components. + + Sorting.Sort (Ncomps); + + -- Loop through entries checking for holes + + Nbit := Sbit; + for J in 1 .. Ncomps loop + CEnt := Comps (J); + Error_Msg_Uint_1 := Component_Bit_Offset (CEnt) - Nbit; + + if Error_Msg_Uint_1 > 0 then + Error_Msg_NE + ("?^-bit gap before component&", + Component_Name (Component_Clause (CEnt)), CEnt); + end if; + + Nbit := Component_Bit_Offset (CEnt) + Esize (CEnt); + end loop; + + -- Process variant parts recursively if present + + if Present (Variant_Part (CL)) then + Variant := First (Variants (Variant_Part (CL))); + while Present (Variant) loop + Check_Component_List + (Component_List (Variant), Nbit, No_List); + Next (Variant); + end loop; + end if; + end; + end Check_Component_List; + + -- Start of processing for Record_Hole_Check + + begin + declare + Sbit : Uint; + + begin + if Is_Tagged_Type (Rectype) then + Sbit := UI_From_Int (System_Address_Size); + else + Sbit := Uint_0; + end if; + + if Nkind (Decl) = N_Full_Type_Declaration + and then Nkind (Type_Definition (Decl)) = N_Record_Definition + then + Check_Component_List + (Component_List (Type_Definition (Decl)), + Sbit, + Discriminant_Specifications (Decl)); + end if; + end; + end Record_Hole_Check; + end if; + -- For records that have component clauses for all components, and whose -- size is less than or equal to 32, we need to know the size in the -- front end to activate possible packed array processing where the diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index d5b39f99f9d..9662357e807 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -574,14 +574,6 @@ package body Sem_Ch3 is -- copying the record declaration for the derived base. In the tagged case -- the value returned is irrelevant. - function Is_Progenitor - (Iface : Entity_Id; - Typ : Entity_Id) return Boolean; - -- Determine whether the interface Iface is implemented by Typ. It requires - -- traversing the list of abstract interfaces of the type, as well as that - -- of the ancestor types. The predicate is used to determine when a formal - -- in the signature of an inherited operation must carry the derived type. - function Is_Valid_Constraint_Kind (T_Kind : Type_Kind; Constraint_Kind : Node_Kind) return Boolean; @@ -1569,11 +1561,17 @@ package body Sem_Ch3 is if No (Prim) then + -- Skip non-overridden null interface primitives because + -- their wrappers will be generated later. + + if Is_Null_Interface_Primitive (Iface_Prim) then + goto Continue; + -- if the tagged type is defined at library level then we -- invoke Check_Abstract_Overriding to report the error -- and thus avoid generating the dispatch tables. - if Is_Library_Level_Tagged_Type (Tagged_Type) then + elsif Is_Library_Level_Tagged_Type (Tagged_Type) then Check_Abstract_Overriding (Tagged_Type); pragma Assert (Serious_Errors_Detected > 0); return; @@ -1645,6 +1643,7 @@ package body Sem_Ch3 is Set_Has_Delayed_Freeze (New_Subp); end if; + <> Next_Elmt (Elmt); end loop; @@ -2779,7 +2778,7 @@ package body Sem_Ch3 is -- Has_Stream just for efficiency reasons. There is no point in -- spending time on a Has_Stream check if the restriction is not set. - if Restrictions.Set (No_Streams) then + if Restriction_Check_Required (No_Streams) then if Has_Stream (T) then Check_Restriction (No_Streams, N); end if; @@ -2960,13 +2959,7 @@ package body Sem_Ch3 is -- Check No_Wide_Characters restriction - if T = Standard_Wide_Character - or else T = Standard_Wide_Wide_Character - or else Root_Type (T) = Standard_Wide_String - or else Root_Type (T) = Standard_Wide_Wide_String - then - Check_Restriction (No_Wide_Characters, Object_Definition (N)); - end if; + Check_Wide_Character_Restriction (T, Object_Definition (N)); -- Indicate this is not set in source. Certainly true for constants, -- and true for variables so far (will be reset for a variable if and @@ -3155,7 +3148,7 @@ package body Sem_Ch3 is -- A rather specialized test. If we see two tasks being declared -- of the same type in the same object declaration, and the task -- has an entry with an address clause, we know that program error - -- will be raised at run-time since we can't have two tasks with + -- will be raised at run time since we can't have two tasks with -- entries at the same address. if Is_Task_Type (Etype (Id)) and then More_Ids (N) then @@ -5382,9 +5375,14 @@ package body Sem_Ch3 is Set_RM_Size (Implicit_Base, RM_Size (Parent_Type)); Set_First_Rep_Item (Implicit_Base, First_Rep_Item (Parent_Type)); + -- Copy other flags from parent type + Set_Has_Non_Standard_Rep (Implicit_Base, Has_Non_Standard_Rep (Parent_Type)); + Set_Has_Pragma_Ordered + (Implicit_Base, Has_Pragma_Ordered + (Parent_Type)); Set_Has_Delayed_Freeze (Implicit_Base); -- Process the subtype indication including a validation check on the @@ -5559,8 +5557,7 @@ package body Sem_Ch3 is end if; -- If we did not have a range constraint, then set the range from the - -- parent type. Otherwise, the call to Process_Subtype has set the - -- bounds. + -- parent type. Otherwise, the Process_Subtype call has set the bounds. if No_Constraint or else not Has_Range_Constraint (Indic) @@ -5846,6 +5843,7 @@ package body Sem_Ch3 is Full_Der := New_Copy (Derived_Type); Set_Comes_From_Source (Full_Decl, False); Set_Comes_From_Source (Full_Der, False); + Set_Parent (Full_Der, Full_Decl); Insert_After (N, Full_Decl); @@ -5919,9 +5917,16 @@ package body Sem_Ch3 is Set_Defining_Identifier (Full_Decl, Full_Der); Build_Derived_Record_Type (Full_Decl, Parent_Type, Full_Der, Derive_Subps); - Set_Analyzed (Full_Decl); end if; + -- The full declaration has been introduced into the tree and + -- processed in the step above. It should not be analyzed again + -- (when encountered later in the current list of declarations) + -- to prevent spurious name conflicts. The full entity remains + -- invisible. + + Set_Analyzed (Full_Decl); + if Swapped then Uninstall_Declarations (Par_Scope); @@ -11255,6 +11260,12 @@ package body Sem_Ch3 is Rng : Node_Id; begin + -- Defend against previous errors + + if No (Scalar_Range (Derived_Type)) then + return; + end if; + Lo := Build_Scalar_Bound (Type_Low_Bound (Derived_Type), Parent_Type, Implicit_Base); @@ -12263,15 +12274,6 @@ package body Sem_Ch3 is Set_Etype (New_Id, Base_Type (Derived_Type)); end if; - -- Ada 2005 (AI-251): Handle derivations of abstract interface - -- primitives. - - elsif Is_Interface (Etype (Id)) - and then not Is_Class_Wide_Type (Etype (Id)) - and then Is_Progenitor (Etype (Id), Derived_Type) - then - Set_Etype (New_Id, Derived_Type); - else Set_Etype (New_Id, Etype (Id)); end if; @@ -12291,10 +12293,6 @@ package body Sem_Ch3 is end if; end Set_Derived_Name; - -- Local variables - - Parent_Overrides_Interface_Primitive : Boolean := False; - -- Start of processing for Derive_Subprogram begin @@ -12302,23 +12300,6 @@ package body Sem_Ch3 is New_Entity (Nkind (Parent_Subp), Sloc (Derived_Type)); Set_Ekind (New_Subp, Ekind (Parent_Subp)); - -- Check whether the parent overrides an interface primitive - - if Is_Overriding_Operation (Parent_Subp) then - declare - E : Entity_Id := Parent_Subp; - begin - while Present (Overridden_Operation (E)) loop - E := Ultimate_Alias (Overridden_Operation (E)); - end loop; - - Parent_Overrides_Interface_Primitive := - Is_Dispatching_Operation (E) - and then Present (Find_Dispatching_Type (E)) - and then Is_Interface (Find_Dispatching_Type (E)); - end; - end if; - -- Check whether the inherited subprogram is a private operation that -- should be inherited but not yet made visible. Such subprograms can -- become visible at a later point (e.g., the private part of a public @@ -12387,7 +12368,10 @@ package body Sem_Ch3 is -- overrides an interface primitive because interface primitives -- must be visible in the partial view of the parent (RM 7.3 (7.3/2)) - elsif Parent_Overrides_Interface_Primitive then + elsif Ada_Version >= Ada_05 + and then Is_Dispatching_Operation (Parent_Subp) + and then Covers_Some_Interface (Parent_Subp) + then Set_Derived_Name; -- Otherwise, the type is inheriting a private operation, so enter @@ -12992,12 +12976,19 @@ package body Sem_Ch3 is then null; - -- Case 2: Inherit entities associated with interfaces that - -- were not covered by the parent type. We exclude here null - -- interface primitives because they do not need special - -- management. + -- Case 2: Inherit entities associated with interfaces that were + -- not covered by the parent type. We exclude here null interface + -- primitives because they do not need special management. + + -- We also exclude interface operations that are renamings. If the + -- subprogram is an explicit renaming of an interface primitive, + -- it is a regular primitive operation, and the presence of its + -- alias is not relevant: it has to be derived like any other + -- primitive. elsif Present (Alias (Subp)) + and then Nkind (Unit_Declaration_Node (Subp)) /= + N_Subprogram_Renaming_Declaration and then Is_Interface (Find_Dispatching_Type (Alias_Subp)) and then not (Nkind (Parent (Alias_Subp)) = N_Procedure_Specification @@ -13550,8 +13541,18 @@ package body Sem_Ch3 is if not Is_Generic_Actual_Type (Parent_Type) or else In_Visible_Part (Scope (Parent_Type)) then - Error_Msg_N - ("type derived from tagged type must have extension", Indic); + if Is_Class_Wide_Type (Parent_Type) then + Error_Msg_N + ("parent type must not be a class-wide type", Indic); + + -- Use specific type to prevent cascaded errors. + + Parent_Type := Etype (Parent_Type); + + else + Error_Msg_N + ("type derived from tagged type must have extension", Indic); + end if; end if; end if; @@ -13677,8 +13678,20 @@ package body Sem_Ch3 is Generate_Definition (L); Set_Convention (L, Convention_Intrinsic); + -- Case of character literal + if Nkind (L) = N_Defining_Character_Literal then Set_Is_Character_Type (T, True); + + -- Check violation of No_Wide_Characters + + if Restriction_Check_Required (No_Wide_Characters) then + Get_Name_String (Chars (L)); + + if Name_Len >= 3 and then Name_Buffer (1 .. 2) = "QW" then + Check_Restriction (No_Wide_Characters, L); + end if; + end if; end if; Ev := Ev + 1; @@ -14211,13 +14224,7 @@ package body Sem_Ch3 is -- Check No_Wide_Characters restriction - if Typ = Standard_Wide_Character - or else Typ = Standard_Wide_Wide_Character - or else Typ = Standard_Wide_String - or else Typ = Standard_Wide_Wide_String - then - Check_Restriction (No_Wide_Characters, S); - end if; + Check_Wide_Character_Restriction (Typ, S); return Typ; end Find_Type_Of_Subtype_Indic; @@ -14963,19 +14970,6 @@ package body Sem_Ch3 is end if; end Is_Null_Extension; - -------------------- - -- Is_Progenitor -- - -------------------- - - function Is_Progenitor - (Iface : Entity_Id; - Typ : Entity_Id) return Boolean - is - begin - return Implements_Interface (Typ, Iface, - Exclude_Parents => True); - end Is_Progenitor; - ------------------------------ -- Is_Valid_Constraint_Kind -- ------------------------------ @@ -17275,7 +17269,7 @@ package body Sem_Ch3 is N_Subtype_Declaration); -- Create an Itype that is a duplicate of Entity (S) but with the - -- null-exclusion attribute + -- null-exclusion attribute. if May_Have_Null_Exclusion and then Is_Access_Type (Entity (S)) @@ -18314,6 +18308,12 @@ package body Sem_Ch3 is Kind : constant Entity_Kind := Ekind (Def_Id); begin + -- Defend against previous error + + if Nkind (R) = N_Error then + return; + end if; + Set_Scalar_Range (Def_Id, R); -- We need to link the range into the tree before resolving it so diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index b4663b8b4ae..4ba25d02936 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -269,7 +269,10 @@ package body Sem_Ch4 is -- the call may be overloaded with both interpretations. function Try_Object_Operation (N : Node_Id) return Boolean; - -- Ada 2005 (AI-252): Support the object.operation notation + -- Ada 2005 (AI-252): Support the object.operation notation. If node N + -- is a call in this notation, it is transformed into a normal subprogram + -- call where the prefix is a parameter, and True is returned. If node + -- N is not of this form, it is unchanged, and False is returned. procedure wpo (T : Entity_Id); pragma Warnings (Off, wpo); @@ -617,7 +620,7 @@ package body Sem_Ch4 is -- Has_Stream just for efficiency reasons. There is no point in -- spending time on a Has_Stream check if the restriction is not set. - if Restrictions.Set (No_Streams) then + if Restriction_Check_Required (No_Streams) then if Has_Stream (Designated_Type (Acc_Type)) then Check_Restriction (No_Streams, N); end if; @@ -3392,11 +3395,11 @@ package body Sem_Ch4 is if Is_Access_Type (Prefix_Type) then - -- A RACW object can never be used as prefix of a selected - -- component since that means it is dereferenced without - -- being a controlling operand of a dispatching operation - -- (RM E.2.2(16/1)). Before reporting an error, we must check - -- whether this is actually a dispatching call in prefix form. + -- A RACW object can never be used as prefix of a selected component + -- since that means it is dereferenced without being a controlling + -- operand of a dispatching operation (RM E.2.2(16/1)). Before + -- reporting an error, we must check whether this is actually a + -- dispatching call in prefix form. if Is_Remote_Access_To_Class_Wide_Type (Prefix_Type) and then Comes_From_Source (N) @@ -3586,8 +3589,8 @@ package body Sem_Ch4 is -- this case gigi generates all the checks and can find the -- necessary bounds information. - -- We also do not need an actual subtype for the case of - -- a first, last, length, or range attribute applied to a + -- We also do not need an actual subtype for the case of a + -- first, last, length, or range attribute applied to a -- non-packed array, since gigi can again get the bounds in -- these cases (gigi cannot handle the packed case, since it -- has the bounds of the packed array type, not the original @@ -3938,12 +3941,11 @@ package body Sem_Ch4 is else if Ekind (Prefix_Type) = E_Record_Subtype then - -- Check whether this is a component of the base type - -- which is absent from a statically constrained subtype. - -- This will raise constraint error at run-time, but is - -- not a compile-time error. When the selector is illegal - -- for base type as well fall through and generate a - -- compilation error anyway. + -- Check whether this is a component of the base type which + -- is absent from a statically constrained subtype. This will + -- raise constraint error at run time, but is not a compile- + -- time error. When the selector is illegal for base type as + -- well fall through and generate a compilation error anyway. Comp := First_Component (Base_Type (Prefix_Type)); while Present (Comp) loop @@ -6146,9 +6148,10 @@ package body Sem_Ch4 is N_Function_Call); Loc : constant Source_Ptr := Sloc (N); Obj : constant Node_Id := Prefix (N); - Subprog : constant Node_Id := - Make_Identifier (Sloc (Selector_Name (N)), - Chars => Chars (Selector_Name (N))); + + Subprog : constant Node_Id := + Make_Identifier (Sloc (Selector_Name (N)), + Chars => Chars (Selector_Name (N))); -- Identifier on which possible interpretations will be collected Report_Error : Boolean := False; @@ -6409,11 +6412,11 @@ package body Sem_Ch4 is else Analyze (Node_To_Replace); - -- If the operation has been rewritten into a call, which may - -- get subsequently an explicit dereference, preserve the - -- type on the original node (selected component or indexed - -- component) for subsequent legality tests, e.g. Is_Variable. - -- which examines the original node. + -- If the operation has been rewritten into a call, which may get + -- subsequently an explicit dereference, preserve the type on the + -- original node (selected component or indexed component) for + -- subsequent legality tests, e.g. Is_Variable. which examines + -- the original node. if Nkind (Node_To_Replace) = N_Function_Call then Set_Etype @@ -6530,7 +6533,6 @@ package body Sem_Ch4 is and then N = Prefix (Parent_Node) then Node_To_Replace := Parent_Node; - Actuals := Expressions (Parent_Node); Actual := First (Actuals); diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index cfd88289fb7..a379e3ae984 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -166,6 +166,13 @@ package body Sem_Ch6 is -- True otherwise. Proc is the entity for the procedure case and is used -- in posting the warning message. + procedure Check_Untagged_Equality (Eq_Op : Entity_Id); + -- In Ada 2012, a primitive equality operator on an untagged record type + -- must appear before the type is frozen, and have the same visibility as + -- that of the type. This procedure checks that this rule is met, and + -- otherwise emits an error on the subprogram declaration and a warning + -- on the earlier freeze point if it is easy to locate. + procedure Enter_Overloaded_Entity (S : Entity_Id); -- This procedure makes S, a new overloaded entity, into the first visible -- entity with that name. @@ -1638,9 +1645,7 @@ package body Sem_Ch6 is if Present (Prag) then if Present (Spec_Id) then - if List_Containing (N) = - List_Containing (Unit_Declaration_Node (Spec_Id)) - then + if In_Same_List (N, Unit_Declaration_Node (Spec_Id)) then Analyze (Prag); end if; @@ -1649,10 +1654,12 @@ package body Sem_Ch6 is declare Subp : constant Entity_Id := - Make_Defining_Identifier (Loc, Chars (Body_Id)); + Make_Defining_Identifier (Loc, Chars (Body_Id)); Decl : constant Node_Id := - Make_Subprogram_Declaration (Loc, - Specification => New_Copy_Tree (Specification (N))); + Make_Subprogram_Declaration (Loc, + Specification => + New_Copy_Tree (Specification (N))); + begin Set_Defining_Unit_Name (Specification (Decl), Subp); @@ -1714,7 +1721,7 @@ package body Sem_Ch6 is and then Present (Spec_Id) and then No_Return (Spec_Id) then - Check_Returns (HSS, 'P', Missing_Ret, Spec_Id); + Check_Returns (HSS, 'P', Missing_Ret, Spec_Id); end if; end Check_Missing_Return; @@ -4037,7 +4044,7 @@ package body Sem_Ch6 is Error_Msg_Name_2 := Get_Convention_Name (Convention (Op)); Error_Msg_Sloc := Sloc (Op); - if Comes_From_Source (Op) then + if Comes_From_Source (Op) or else No (Alias (Op)) then if not Is_Overriding_Operation (Op) then Error_Msg_N ("\\primitive % defined #", Typ); else @@ -5625,15 +5632,16 @@ package body Sem_Ch6 is begin -- In the case of functions with unconstrained result subtypes, - -- add a 3-state formal indicating whether the return object is - -- allocated by the caller (0), or should be allocated by the - -- callee on the secondary stack (1) or in the global heap (2). - -- For the moment we just use Natural for the type of this formal. - -- Note that this formal isn't usually needed in the case where - -- the result subtype is constrained, but it is needed when the - -- function has a tagged result, because generally such functions - -- can be called in a dispatching context and such calls must be - -- handled like calls to a class-wide function. + -- add a 4-state formal indicating whether the return object is + -- allocated by the caller (1), or should be allocated by the + -- callee on the secondary stack (2), in the global heap (3), or + -- in a user-defined storage pool (4). For the moment we just use + -- Natural for the type of this formal. Note that this formal + -- isn't usually needed in the case where the result subtype is + -- constrained, but it is needed when the function has a tagged + -- result, because generally such functions can be called in a + -- dispatching context and such calls must be handled like calls + -- to a class-wide function. if not Is_Constrained (Underlying_Type (Result_Subt)) or else Is_Tagged_Type (Underlying_Type (Result_Subt)) @@ -5644,19 +5652,18 @@ package body Sem_Ch6 is E, BIP_Formal_Suffix (BIP_Alloc_Form)); end if; - -- In the case of functions whose result type has controlled - -- parts, we have an extra formal of type - -- System.Finalization_Implementation.Finalizable_Ptr_Ptr. That - -- is, we are passing a pointer to a finalization list (which is - -- itself a pointer). This extra formal is then passed along to - -- Move_Final_List in case of successful completion of a return - -- statement. We cannot pass an 'in out' parameter, because we - -- need to update the finalization list during an abort-deferred - -- region, rather than using copy-back after the function - -- returns. This is true even if we are able to get away with - -- having 'in out' parameters, which are normally illegal for - -- functions. This formal is also needed when the function has - -- a tagged result. + -- For functions whose result type has controlled parts, we have + -- an extra formal of type System.Finalization_Implementation. + -- Finalizable_Ptr_Ptr. That is, we are passing a pointer to a + -- finalization list (which is itself a pointer). This extra + -- formal is then passed along to Move_Final_List in case of + -- successful completion of a return statement. We cannot pass an + -- 'in out' parameter, because we need to update the finalization + -- list during an abort-deferred region, rather than using + -- copy-back after the function returns. This is true even if we + -- are able to get away with having 'in out' parameters, which are + -- normally illegal for functions. This formal is also needed when + -- the function has a tagged result. if Needs_BIP_Final_List (E) then Discard := @@ -5790,6 +5797,51 @@ package body Sem_Ch6 is end Enter_Overloaded_Entity; ----------------------------- + -- Check_Untagged_Equality -- + ----------------------------- + + procedure Check_Untagged_Equality (Eq_Op : Entity_Id) is + Typ : constant Entity_Id := Etype (First_Formal (Eq_Op)); + Decl : constant Node_Id := Unit_Declaration_Node (Eq_Op); + Obj_Decl : Node_Id; + + begin + if Nkind (Decl) = N_Subprogram_Declaration + and then Is_Record_Type (Typ) + and then not Is_Tagged_Type (Typ) + then + if Is_Frozen (Typ) then + Error_Msg_NE + ("equality operator must be declared " + & "before type& is frozen", Eq_Op, Typ); + + Obj_Decl := Next (Parent (Typ)); + while Present (Obj_Decl) + and then Obj_Decl /= Decl + loop + if Nkind (Obj_Decl) = N_Object_Declaration + and then Etype (Defining_Identifier (Obj_Decl)) = Typ + then + Error_Msg_NE ("type& is frozen by declaration?", + Obj_Decl, Typ); + Error_Msg_N + ("\an equality operator cannot be declared after this " + & "point ('R'M 4.5.2 (9.8)) (Ada2012))?", Obj_Decl); + exit; + end if; + + Next (Obj_Decl); + end loop; + + elsif not In_Same_List (Parent (Typ), Decl) + and then not Is_Limited_Type (Typ) + then + Error_Msg_N ("equality operator appears too late", Eq_Op); + end if; + end if; + end Check_Untagged_Equality; + + ----------------------------- -- Find_Corresponding_Spec -- ----------------------------- @@ -7974,6 +8026,10 @@ package body Sem_Ch6 is and then not Is_Dispatching_Operation (S) then Make_Inequality_Operator (S); + + if Ada_Version >= Ada_12 then + Check_Untagged_Equality (S); + end if; end if; end New_Overloaded_Entity; diff --git a/gcc/ada/sem_ch6.ads b/gcc/ada/sem_ch6.ads index 5752c21c083..242d5615c55 100644 --- a/gcc/ada/sem_ch6.ads +++ b/gcc/ada/sem_ch6.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -28,9 +28,11 @@ package Sem_Ch6 is type Conformance_Type is (Type_Conformant, Mode_Conformant, Subtype_Conformant, Fully_Conformant); + pragma Ordered (Conformance_Type); -- Conformance type used in conformance checks between specs and bodies, -- and for overriding. The literals match the RM definitions of the - -- corresponding terms. + -- corresponding terms. This is an ordered type, since each conformance + -- type is stronger than the ones preceding it. procedure Analyze_Abstract_Subprogram_Declaration (N : Node_Id); procedure Analyze_Extended_Return_Statement (N : Node_Id); @@ -183,9 +185,9 @@ package Sem_Ch6 is (Tagged_Type : Entity_Id; Iface_Prim : Entity_Id; Prim : Entity_Id) return Boolean; - -- Returns true if both primitives have a matching name and they are also - -- type conformant. Special management is done for functions returning - -- interfaces. + -- Returns true if both primitives have a matching name, they are type + -- conformant, and Prim is defined in the scope of Tagged_Type. Special + -- management is done for functions returning interfaces. function Mode_Conformant (New_Id, Old_Id : Entity_Id) return Boolean; -- Determine whether two callable entities (subprograms, entries, diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 71d68133461..b61eeabc3d6 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -454,8 +454,9 @@ package body Sem_Ch8 is -- private with on E. procedure Find_Expanded_Name (N : Node_Id); - -- Selected component is known to be expanded name. Verify legality of - -- selector given the scope denoted by prefix. + -- The input is a selected component is known to be expanded name. Verify + -- legality of selector given the scope denoted by prefix, and change node + -- N into a expanded name with a properly set Entity field. function Find_Renamed_Entity (N : Node_Id; @@ -4411,6 +4412,10 @@ package body Sem_Ch8 is <> begin + -- Check violation of No_Wide_Characters restriction + + Check_Wide_Character_Restriction (E, N); + -- When distribution features are available (Get_PCS_Name /= -- Name_No_DSA), a remote access-to-subprogram type is converted -- into a record type holding whatever information is needed to @@ -4960,6 +4965,10 @@ package body Sem_Ch8 is Set_Etype (N, Get_Full_View (Etype (Id))); end if; + -- Check for violation of No_Wide_Characters + + Check_Wide_Character_Restriction (Id, N); + -- If the Ekind of the entity is Void, it means that all homonyms are -- hidden from all visibility (RM 8.3(5,14-20)). @@ -5757,9 +5766,8 @@ package body Sem_Ch8 is ("prefix of Base attribute must be scalar type", Prefix (N)); - elsif Sloc (Typ) = Standard_Location + elsif Warn_On_Redundant_Constructs and then Base_Type (Typ) = Typ - and then Warn_On_Redundant_Constructs then Error_Msg_NE -- CODEFIX ("?redundant attribute, & is its own base type", N, Typ); @@ -5768,8 +5776,8 @@ package body Sem_Ch8 is T := Base_Type (Typ); -- Rewrite attribute reference with type itself (see similar - -- processing in Analyze_Attribute, case Base). Preserve - -- prefix if present, for other legality checks. + -- processing in Analyze_Attribute, case Base). Preserve prefix + -- if present, for other legality checks. if Nkind (Prefix (N)) = N_Expanded_Name then Rewrite (N, @@ -7330,8 +7338,8 @@ package body Sem_Ch8 is and then Scope (Id) /= Scope (Prev) and then Used_As_Generic_Actual (Scope (Prev)) and then Used_As_Generic_Actual (Scope (Id)) - and then List_Containing (Current_Use_Clause (Scope (Prev))) /= - List_Containing (Current_Use_Clause (Scope (Id))) + and then not In_Same_List (Current_Use_Clause (Scope (Prev)), + Current_Use_Clause (Scope (Id))) then Set_Is_Potentially_Use_Visible (Prev, False); Append_Elmt (Prev, Hidden_By_Use_Clause (N)); diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 0cfdf38d732..792a9dad4c5 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -1182,9 +1182,9 @@ package body Sem_Ch9 is -- and the No_Local_Protected_Objects restriction applies, issue a -- warning that objects of the type will violate the restriction. - if not Is_Library_Level_Entity (T) + if Restriction_Check_Required (No_Local_Protected_Objects) + and then not Is_Library_Level_Entity (T) and then Comes_From_Source (T) - and then Restrictions.Set (No_Local_Protected_Objects) then Error_Msg_Sloc := Restrictions_Loc (No_Local_Protected_Objects); @@ -1995,9 +1995,9 @@ package body Sem_Ch9 is -- No_Task_Hierarchy restriction applies, issue a warning that objects -- of the type will violate the restriction. - if not Is_Library_Level_Entity (T) + if Restriction_Check_Required (No_Task_Hierarchy) + and then not Is_Library_Level_Entity (T) and then Comes_From_Source (T) - and then Restrictions.Set (No_Task_Hierarchy) then Error_Msg_Sloc := Restrictions_Loc (No_Task_Hierarchy); @@ -2193,18 +2193,10 @@ package body Sem_Ch9 is -- Entry family with non-static bounds else - -- If restriction is set, then this is an error + -- Record an unknown count restriction, and if the + -- restriction is active, post a message or warning. - if Restrictions.Set (R) then - Error_Msg_N - ("static subtype required by Restriction pragma", - DSD); - - -- Otherwise we record an unknown count restriction - - else - Check_Restriction (R, D); - end if; + Check_Restriction (R, D); end if; end; end if; diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index a21337bb600..69846939621 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -91,6 +91,81 @@ package body Sem_Disp is Append_Unique_Elmt (New_Op, List); end Add_Dispatching_Operation; + --------------------------- + -- Covers_Some_Interface -- + --------------------------- + + function Covers_Some_Interface (Prim : Entity_Id) return Boolean is + Tagged_Type : constant Entity_Id := Find_Dispatching_Type (Prim); + Elmt : Elmt_Id; + E : Entity_Id; + + begin + pragma Assert (Is_Dispatching_Operation (Prim)); + + -- Although this is a dispatching primitive we must check if its + -- dispatching type is available because it may be the primitive + -- of a private type not defined as tagged in its partial view. + + if Present (Tagged_Type) and then Has_Interfaces (Tagged_Type) then + + -- If the tagged type is frozen then the internal entities associated + -- with interfaces are available in the list of primitives of the + -- tagged type and can be used to speed up this search. + + if Is_Frozen (Tagged_Type) then + Elmt := First_Elmt (Primitive_Operations (Tagged_Type)); + while Present (Elmt) loop + E := Node (Elmt); + + if Present (Interface_Alias (E)) + and then Alias (E) = Prim + then + return True; + end if; + + Next_Elmt (Elmt); + end loop; + + -- Otherwise we must collect all the interface primitives and check + -- if the Prim will override some interface primitive. + + else + declare + Ifaces_List : Elist_Id; + Iface_Elmt : Elmt_Id; + Iface : Entity_Id; + Iface_Prim : Entity_Id; + + begin + Collect_Interfaces (Tagged_Type, Ifaces_List); + Iface_Elmt := First_Elmt (Ifaces_List); + while Present (Iface_Elmt) loop + Iface := Node (Iface_Elmt); + + Elmt := First_Elmt (Primitive_Operations (Iface)); + while Present (Elmt) loop + Iface_Prim := Node (Elmt); + + if Chars (E) = Chars (Prim) + and then Is_Interface_Conformant + (Tagged_Type, Iface_Prim, Prim) + then + return True; + end if; + + Next_Elmt (Elmt); + end loop; + + Next_Elmt (Iface_Elmt); + end loop; + end; + end if; + end if; + + return False; + end Covers_Some_Interface; + ------------------------------- -- Check_Controlling_Formals -- ------------------------------- @@ -794,7 +869,10 @@ package body Sem_Disp is -- type by Make_Controlling_Function_Wrappers. However, attribute -- Is_Dispatching_Operation must be set to true. - -- 2. Subprograms associated with stream attributes (built by + -- 2. Ada 2005 (AI-251): Wrapper procedures of null interface + -- primitives. + + -- 3. Subprograms associated with stream attributes (built by -- New_Stream_Subprogram) if Present (Old_Subp) @@ -805,9 +883,17 @@ package body Sem_Disp is ((Ekind (Subp) = E_Function and then Is_Dispatching_Operation (Old_Subp) and then Is_Null_Extension (Base_Type (Etype (Subp)))) + or else + (Ekind (Subp) = E_Procedure + and then Is_Dispatching_Operation (Old_Subp) + and then Present (Alias (Old_Subp)) + and then Is_Null_Interface_Primitive + (Ultimate_Alias (Old_Subp))) or else Get_TSS_Name (Subp) = TSS_Stream_Read or else Get_TSS_Name (Subp) = TSS_Stream_Write); + Check_Controlling_Formals (Tagged_Type, Subp); + Override_Dispatching_Operation (Tagged_Type, Old_Subp, Subp); Set_Is_Dispatching_Operation (Subp); end if; @@ -1602,6 +1688,19 @@ package body Sem_Disp is end if; end Is_Dynamically_Tagged; + --------------------------------- + -- Is_Null_Interface_Primitive -- + --------------------------------- + + function Is_Null_Interface_Primitive (E : Entity_Id) return Boolean is + begin + return Comes_From_Source (E) + and then Is_Dispatching_Operation (E) + and then Ekind (E) = E_Procedure + and then Null_Present (Parent (E)) + and then Is_Interface (Find_Dispatching_Type (E)); + end Is_Null_Interface_Primitive; + -------------------------- -- Is_Tag_Indeterminate -- -------------------------- diff --git a/gcc/ada/sem_disp.ads b/gcc/ada/sem_disp.ads index 3877826ca29..1888a6854ab 100644 --- a/gcc/ada/sem_disp.ads +++ b/gcc/ada/sem_disp.ads @@ -66,6 +66,11 @@ package Sem_Disp is -- of "OldSubp" is adjusted to point to the inherited procedure of the -- full view because it is always this one which has to be called. + function Covers_Some_Interface (Prim : Entity_Id) return Boolean; + -- Returns true if Prim covers some interface primitive of its associated + -- tagged type. The tagged type of Prim must be frozen when this function + -- is invoked. + function Find_Controlling_Arg (N : Node_Id) return Node_Id; -- Returns the actual controlling argument if N is dynamically tagged, -- and Empty if it is not dynamically tagged. @@ -87,6 +92,9 @@ package Sem_Disp is -- an expression of a class_Wide type, or a call to a function with -- controlling result where at least one operand is dynamically tagged. + function Is_Null_Interface_Primitive (E : Entity_Id) return Boolean; + -- Returns True if E is a null procedure that is an interface primitive + function Is_Tag_Indeterminate (N : Node_Id) return Boolean; -- An expression is tag-indeterminate if it is a call that dispatches -- on result, and all controlling operands are also indeterminate. diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 7ed76f61ee8..b4c214ddeeb 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -1676,7 +1676,7 @@ package body Sem_Elab is -- Here is where we give the warning - -- All OK if warnings suppressed on the entity + -- All OK if warnings suppressed on the entity if not Has_Warnings_Off (Ent) then Error_Msg_Sloc := Sloc (Ent); @@ -2288,7 +2288,7 @@ package body Sem_Elab is ("task will be activated before elaboration of its body?", Decl); Error_Msg_N - ("\Program_Error will be raised at run-time?", Decl); + ("\Program_Error will be raised at run time?", Decl); elsif Present (Corresponding_Body (Unit_Declaration_Node (Proc))) diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 467fafadb38..0b324b65a40 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -642,9 +642,17 @@ package body Sem_Eval is -- types, since we may have two NaN values and they should never -- compare equal. + -- If the entity is a discriminant, the two expressions may be bounds + -- of components of objects of the same discriminated type. The + -- values of the discriminants are not static, and therefore the + -- result is unknown. + + -- It would be better to comment individual branches of this test ??? + if Nkind_In (Lf, N_Identifier, N_Expanded_Name) and then Nkind_In (Rf, N_Identifier, N_Expanded_Name) and then Entity (Lf) = Entity (Rf) + and then Ekind (Entity (Lf)) /= E_Discriminant and then Present (Entity (Lf)) and then not Is_Floating_Point_Type (Etype (L)) and then not Is_Volatile_Reference (L) @@ -4672,9 +4680,9 @@ package body Sem_Eval is -- If there was an error in either range, then just assume the types -- statically match to avoid further junk errors. - if Error_Posted (Scalar_Range (T1)) - or else - Error_Posted (Scalar_Range (T2)) + if No (Scalar_Range (T1)) or else No (Scalar_Range (T2)) + or else Error_Posted (Scalar_Range (T1)) + or else Error_Posted (Scalar_Range (T2)) then return True; end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 08b0087a6cd..fa8cff8afa8 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -4907,8 +4907,8 @@ package body Sem_Prag is -- form created by the parser. procedure Set_Mechanism_Value (Ent : Entity_Id; Mech_Name : Node_Id) is - Class : Node_Id; - Param : Node_Id; + Class : Node_Id; + Param : Node_Id; Mech_Name_Id : Name_Id; procedure Bad_Class; @@ -4957,7 +4957,15 @@ package body Sem_Prag is elsif Chars (Mech_Name) = Name_Descriptor then Check_VMS (Mech_Name); - Set_Mechanism (Ent, By_Descriptor); + + -- Descriptor => Short_Descriptor if pragma was given + + if Short_Descriptors then + Set_Mechanism (Ent, By_Short_Descriptor); + else + Set_Mechanism (Ent, By_Descriptor); + end if; + return; elsif Chars (Mech_Name) = Name_Short_Descriptor then @@ -4980,7 +4988,6 @@ package body Sem_Prag is -- Note: this form is parsed as an indexed component elsif Nkind (Mech_Name) = N_Indexed_Component then - Class := First (Expressions (Mech_Name)); if Nkind (Prefix (Mech_Name)) /= N_Identifier @@ -4991,6 +4998,14 @@ package body Sem_Prag is Bad_Mechanism; else Mech_Name_Id := Chars (Prefix (Mech_Name)); + + -- Change Descriptor => Short_Descriptor if pragma was given + + if Mech_Name_Id = Name_Descriptor + and then Short_Descriptors + then + Mech_Name_Id := Name_Short_Descriptor; + end if; end if; -- MECHANISM_NAME ::= descriptor (Class => CLASS_NAME) | @@ -5000,7 +5015,6 @@ package body Sem_Prag is -- Note: this form is parsed as a function call elsif Nkind (Mech_Name) = N_Function_Call then - Param := First (Parameter_Associations (Mech_Name)); if Nkind (Name (Mech_Name)) /= N_Identifier @@ -5028,72 +5042,72 @@ package body Sem_Prag is Bad_Class; elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_UBS + and then Chars (Class) = Name_UBS then Set_Mechanism (Ent, By_Descriptor_UBS); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_UBSB + and then Chars (Class) = Name_UBSB then Set_Mechanism (Ent, By_Descriptor_UBSB); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_UBA + and then Chars (Class) = Name_UBA then Set_Mechanism (Ent, By_Descriptor_UBA); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_S + and then Chars (Class) = Name_S then Set_Mechanism (Ent, By_Descriptor_S); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_SB + and then Chars (Class) = Name_SB then Set_Mechanism (Ent, By_Descriptor_SB); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_A + and then Chars (Class) = Name_A then Set_Mechanism (Ent, By_Descriptor_A); elsif Mech_Name_Id = Name_Descriptor - and then Chars (Class) = Name_NCA + and then Chars (Class) = Name_NCA then Set_Mechanism (Ent, By_Descriptor_NCA); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_UBS + and then Chars (Class) = Name_UBS then Set_Mechanism (Ent, By_Short_Descriptor_UBS); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_UBSB + and then Chars (Class) = Name_UBSB then Set_Mechanism (Ent, By_Short_Descriptor_UBSB); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_UBA + and then Chars (Class) = Name_UBA then Set_Mechanism (Ent, By_Short_Descriptor_UBA); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_S + and then Chars (Class) = Name_S then Set_Mechanism (Ent, By_Short_Descriptor_S); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_SB + and then Chars (Class) = Name_SB then Set_Mechanism (Ent, By_Short_Descriptor_SB); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_A + and then Chars (Class) = Name_A then Set_Mechanism (Ent, By_Short_Descriptor_A); elsif Mech_Name_Id = Name_Short_Descriptor - and then Chars (Class) = Name_NCA + and then Chars (Class) = Name_NCA then Set_Mechanism (Ent, By_Short_Descriptor_NCA); @@ -7845,12 +7859,12 @@ package body Sem_Prag is else -- In VMS, the effect of IDENT is achieved by passing - -- IDENTIFICATION=name as a --for-linker switch. + -- --identification=name as a --for-linker switch. if OpenVMS_On_Target then Start_String; Store_String_Chars - ("--for-linker=IDENTIFICATION="); + ("--for-linker=--identification="); String_To_Name_Buffer (Strval (Str)); Store_String_Chars (Name_Buffer (1 .. Name_Len)); @@ -7860,7 +7874,7 @@ package body Sem_Prag is -- associated with a with'd package. Replace_Linker_Option_String - (End_String, "--for-linker=IDENTIFICATION="); + (End_String, "--for-linker=--identification="); end if; Set_Ident_String (Current_Sem_Unit, Str); @@ -8273,7 +8287,13 @@ package body Sem_Prag is when Pragma_Inline_Always => GNAT_Pragma; - Process_Inline (True); + + -- Pragma always active unless in CodePeer mode, since this causes + -- walk order issues. + + if not CodePeer_Mode then + Process_Inline (True); + end if; -------------------- -- Inline_Generic -- @@ -9707,7 +9727,7 @@ package body Sem_Prag is -- pragma Optimize_Alignment (Time | Space | Off); - when Pragma_Optimize_Alignment => + when Pragma_Optimize_Alignment => Optimize_Alignment : begin GNAT_Pragma; Check_No_Identifiers; Check_Arg_Count (1); @@ -9733,6 +9753,42 @@ package body Sem_Prag is -- switch will get reset anyway at the start of each unit. Optimize_Alignment_Local := True; + end Optimize_Alignment; + + ------------- + -- Ordered -- + ------------- + + -- pragma Ordered (first_enumeration_subtype_LOCAL_NAME); + + when Pragma_Ordered => Ordered : declare + Assoc : constant Node_Id := Arg1; + Type_Id : Node_Id; + Typ : Entity_Id; + + begin + GNAT_Pragma; + Check_No_Identifiers; + Check_Arg_Count (1); + Check_Arg_Is_Local_Name (Arg1); + + Type_Id := Expression (Assoc); + Find_Type (Type_Id); + Typ := Entity (Type_Id); + + if Typ = Any_Type then + return; + else + Typ := Underlying_Type (Typ); + end if; + + if not Is_Enumeration_Type (Typ) then + Error_Pragma ("pragma% must specify enumeration type"); + end if; + + Check_First_Subtype (Arg1); + Set_Has_Pragma_Ordered (Base_Type (Typ)); + end Ordered; ---------- -- Pack -- @@ -9821,7 +9877,7 @@ package body Sem_Prag is elsif VM_Target = No_VM then Set_Is_Packed (Base_Type (Typ)); Set_Has_Pragma_Pack (Base_Type (Typ)); - Set_Has_Non_Standard_Rep (Base_Type (Typ)); + Set_Has_Non_Standard_Rep (Base_Type (Typ)); -- If we ignore the pack, then warn about this, except -- that we suppress the warning in GNAT mode. @@ -11016,6 +11072,18 @@ package body Sem_Prag is Set_Is_Shared_Passive (Cunit_Ent); end Shared_Passive; + ----------------------- + -- Short_Descriptors -- + ----------------------- + + -- pragma Short_Descriptors; + + when Pragma_Short_Descriptors => + GNAT_Pragma; + Check_Arg_Count (0); + Check_Valid_Configuration_Pragma; + Short_Descriptors := True; + ---------------------- -- Source_File_Name -- ---------------------- @@ -12818,6 +12886,7 @@ package body Sem_Prag is Pragma_Obsolescent => 0, Pragma_Optimize => -1, Pragma_Optimize_Alignment => -1, + Pragma_Ordered => 0, Pragma_Pack => 0, Pragma_Page => -1, Pragma_Passive => -1, @@ -12850,6 +12919,7 @@ package body Sem_Prag is Pragma_Share_Generic => -1, Pragma_Shared => -1, Pragma_Shared_Passive => -1, + Pragma_Short_Descriptors => 0, Pragma_Source_File_Name => -1, Pragma_Source_File_Name_Project => -1, Pragma_Source_Reference => -1, diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 0917ccecf43..7cca8abe463 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -68,6 +68,7 @@ with Sem_Util; use Sem_Util; with Sem_Type; use Sem_Type; with Sem_Warn; use Sem_Warn; with Sinfo; use Sinfo; +with Sinfo.CN; use Sinfo.CN; with Snames; use Snames; with Stand; use Stand; with Stringt; use Stringt; @@ -91,6 +92,15 @@ package body Sem_Res is -- Note that Resolve_Attribute is separated off in Sem_Attr + function Bad_Unordered_Enumeration_Reference + (N : Node_Id; + T : Entity_Id) return Boolean; + -- Node N contains a potentially dubious reference to type T, either an + -- explicit comparison, or an explicit range. This function returns True + -- if the type T is an enumeration type for which No pragma Order has been + -- given, and the reference N is not in the same extended source unit as + -- the declaration of T. + procedure Check_Discriminant_Use (N : Node_Id); -- Enforce the restrictions on the use of discriminants when constraining -- a component of a discriminated type (record or concurrent type). @@ -400,6 +410,22 @@ package body Sem_Res is end if; end Analyze_And_Resolve; + ---------------------------------------- + -- Bad_Unordered_Enumeration_Reference -- + ---------------------------------------- + + function Bad_Unordered_Enumeration_Reference + (N : Node_Id; + T : Entity_Id) return Boolean + is + begin + return Is_Enumeration_Type (T) + and then Comes_From_Source (N) + and then Warn_On_Unordered_Enumeration_Type + and then not Has_Pragma_Ordered (T) + and then not In_Same_Extended_Unit (N, T); + end Bad_Unordered_Enumeration_Reference; + ---------------------------- -- Check_Discriminant_Use -- ---------------------------- @@ -1041,7 +1067,13 @@ package body Sem_Res is -- overloaded case) a function call. If we know for sure that the entity -- is an enumeration literal, we do not rewrite it. + -- If the entity is the name of an operator, it cannot be a call because + -- operators cannot have default parameters. In this case, this must be + -- a string whose contents coincide with an operator name. Set the kind + -- of the node appropriately and reanalyze. + if (Is_Entity_Name (N) + and then Nkind (N) /= N_Operator_Symbol and then Is_Overloadable (Entity (N)) and then (Ekind (Entity (N)) /= E_Enumeration_Literal or else Is_Overloaded (N))) @@ -1090,6 +1122,11 @@ package body Sem_Res is elsif Nkind (N) = N_Parameter_Association then Check_Parameterless_Call (Explicit_Actual_Parameter (N)); + + elsif Nkind (N) = N_Operator_Symbol then + Change_Operator_Symbol_To_String_Literal (N); + Set_Is_Overloaded (N, False); + Set_Etype (N, Any_String); end if; end Check_Parameterless_Call; @@ -4759,7 +4796,7 @@ package body Sem_Res is -- violated if either operand can be negative for mod, or for rem -- if both operands can be negative. - if Restrictions.Set (No_Implicit_Conditionals) + if Restriction_Check_Required (No_Implicit_Conditionals) and then Nkind_In (N, N_Op_Rem, N_Op_Mod) then declare @@ -5658,30 +5695,49 @@ package body Sem_Res is Set_Etype (N, Base_Type (Typ)); Generate_Reference (T, N, ' '); - if T /= Any_Type then - if T = Any_String or else - T = Any_Composite or else - T = Any_Character - then - if T = Any_Character then - Ambiguous_Character (L); - else - Error_Msg_N ("ambiguous operands for comparison", N); - end if; + -- Skip remaining processing if already set to Any_Type - Set_Etype (N, Any_Type); - return; + if T = Any_Type then + return; + end if; + + -- Deal with other error cases + if T = Any_String or else + T = Any_Composite or else + T = Any_Character + then + if T = Any_Character then + Ambiguous_Character (L); else - Resolve (L, T); - Resolve (R, T); - Check_Unset_Reference (L); - Check_Unset_Reference (R); - Generate_Operator_Reference (N, T); - Check_Low_Bound_Tested (N); - Eval_Relational_Op (N); + Error_Msg_N ("ambiguous operands for comparison", N); end if; + + Set_Etype (N, Any_Type); + return; + end if; + + -- Resolve the operands if types OK + + Resolve (L, T); + Resolve (R, T); + Check_Unset_Reference (L); + Check_Unset_Reference (R); + Generate_Operator_Reference (N, T); + Check_Low_Bound_Tested (N); + + -- Check comparison on unordered enumeration + + if Comes_From_Source (N) + and then Bad_Unordered_Enumeration_Reference (N, Etype (L)) + then + Error_Msg_N ("comparison on unordered enumeration type?", N); end if; + + -- Evaluate the relation (note we do this after the above check + -- since this Eval call may change N to True/False. + + Eval_Relational_Op (N); end Resolve_Comparison_Op; ------------------------------------ @@ -6347,12 +6403,41 @@ package body Sem_Res is R : constant Node_Id := Right_Opnd (N); T : Entity_Id := Find_Unique_Type (L, R); + procedure Check_Conditional_Expression (Cond : Node_Id); + -- The resolution rule for conditional expressions requires that each + -- such must have a unique type. This means that if several dependent + -- expressions are of a non-null anonymous access type, and the context + -- does not impose an expected type (as can be the case in an equality + -- operation) the expression must be rejected. + function Find_Unique_Access_Type return Entity_Id; -- In the case of allocators, make a last-ditch attempt to find a single -- access type with the right designated type. This is semantically -- dubious, and of no interest to any real code, but c48008a makes it -- all worthwhile. + ---------------------------------- + -- Check_Conditional_Expression -- + ---------------------------------- + + procedure Check_Conditional_Expression (Cond : Node_Id) is + Then_Expr : Node_Id; + Else_Expr : Node_Id; + + begin + if Nkind (Cond) = N_Conditional_Expression then + Then_Expr := Next (First (Expressions (Cond))); + Else_Expr := Next (Then_Expr); + + if Nkind (Then_Expr) /= N_Null + and then Nkind (Else_Expr) /= N_Null + then + Error_Msg_N + ("cannot determine type of conditional expression", Cond); + end if; + end if; + end Check_Conditional_Expression; + ----------------------------- -- Find_Unique_Access_Type -- ----------------------------- @@ -6426,6 +6511,19 @@ package body Sem_Res is Set_Etype (N, Any_Type); return; end if; + + -- Conditional expressions must have a single type, and if the + -- context does not impose one the dependent expressions cannot + -- be anonymous access types. + + elsif Ada_Version >= Ada_2012 + and then Ekind_In (Etype (L), E_Anonymous_Access_Type, + E_Anonymous_Access_Subprogram_Type) + and then Ekind_In (Etype (R), E_Anonymous_Access_Type, + E_Anonymous_Access_Subprogram_Type) + then + Check_Conditional_Expression (L); + Check_Conditional_Expression (R); end if; Resolve (L, T); @@ -7029,7 +7127,7 @@ package body Sem_Res is -- end Test; -- In this case we have nothing else to do. The membership test will be - -- done at run-time. + -- done at run time. elsif Ada_Version >= Ada_05 and then Is_Class_Wide_Type (Etype (L)) @@ -7606,11 +7704,58 @@ package body Sem_Res is L : constant Node_Id := Low_Bound (N); H : constant Node_Id := High_Bound (N); + function First_Last_Ref return Boolean; + -- Returns True if N is of the form X'First .. X'Last where X is the + -- same entity for both attributes. + + -------------------- + -- First_Last_Ref -- + -------------------- + + function First_Last_Ref return Boolean is + Lorig : constant Node_Id := Original_Node (L); + Horig : constant Node_Id := Original_Node (H); + + begin + if Nkind (Lorig) = N_Attribute_Reference + and then Nkind (Horig) = N_Attribute_Reference + and then Attribute_Name (Lorig) = Name_First + and then Attribute_Name (Horig) = Name_Last + then + declare + PL : constant Node_Id := Prefix (Lorig); + PH : constant Node_Id := Prefix (Horig); + begin + if Is_Entity_Name (PL) + and then Is_Entity_Name (PH) + and then Entity (PL) = Entity (PH) + then + return True; + end if; + end; + end if; + + return False; + end First_Last_Ref; + + -- Start of processing for Resolve_Range + begin Set_Etype (N, Typ); Resolve (L, Typ); Resolve (H, Typ); + -- Check for inappropriate range on unordered enumeration type + + if Bad_Unordered_Enumeration_Reference (N, Typ) + + -- Exclude X'First .. X'Last if X is the same entity for both + + and then not First_Last_Ref + then + Error_Msg ("subrange of unordered enumeration type?", Sloc (N)); + end if; + Check_Unset_Reference (L); Check_Unset_Reference (H); @@ -8031,7 +8176,7 @@ package body Sem_Res is -- the Sloc of the expression, not the original pragma. Error_Msg_N - ("?assertion would fail at run-time!", + ("?assertion would fail at run time!", Expression (First (Pragma_Argument_Associations (Orig)))); end if; @@ -8057,7 +8202,7 @@ package body Sem_Res is null; else Error_Msg_N - ("?check would fail at run-time!", + ("?check would fail at run time!", Expression (Last (Pragma_Argument_Associations (Orig)))); end if; @@ -8519,6 +8664,10 @@ package body Sem_Res is Orig_N : Node_Id; Orig_T : Node_Id; + Test_Redundant : Boolean := Warn_On_Redundant_Constructs; + -- Set to False to suppress cases where we want to suppress the test + -- for redundancy to avoid possible false positives on this warning. + begin if not Conv_OK and then not Valid_Conversion (N, Target_Typ, Operand) @@ -8526,7 +8675,20 @@ package body Sem_Res is return; end if; - if Etype (Operand) = Any_Fixed then + -- If the Operand Etype is Universal_Fixed, then the conversion is + -- never redundant. We need this check because by the time we have + -- finished the rather complex transformation, the conversion looks + -- redundant when it is not. + + if Operand_Typ = Universal_Fixed then + Test_Redundant := False; + + -- If the operand is marked as Any_Fixed, then special processing is + -- required. This is also a case where we suppress the test for a + -- redundant conversion, since most certainly it is not redundant. + + elsif Operand_Typ = Any_Fixed then + Test_Redundant := False; -- Mixed-mode operation involving a literal. Context must be a fixed -- type which is applied to the literal subsequently. @@ -8632,9 +8794,13 @@ package body Sem_Res is Orig_N := Original_Node (N); - if Warn_On_Redundant_Constructs - and then Comes_From_Source (Orig_N) + -- Here we test for a redundant conversion if the warning mode is + -- active (and was not locally reset), and we have a type conversion + -- from source not appearing in a generic instance. + + if Test_Redundant and then Nkind (Orig_N) = N_Type_Conversion + and then Comes_From_Source (Orig_N) and then not In_Instance then Orig_N := Original_Node (Expression (Orig_N)); @@ -8650,12 +8816,21 @@ package body Sem_Res is Orig_T := Etype (Parent (N)); end if; - if Is_Entity_Name (Orig_N) - and then - (Etype (Entity (Orig_N)) = Orig_T - or else - (Ekind (Entity (Orig_N)) = E_Loop_Parameter - and then Covers (Orig_T, Etype (Entity (Orig_N))))) + -- if we have an entity name, then give the warning if the entity + -- is the right type, or if it is a loop parameter covered by the + -- original type (that's needed because loop parameters have an + -- odd subtype coming from the bounds). + + if (Is_Entity_Name (Orig_N) + and then + (Etype (Entity (Orig_N)) = Orig_T + or else + (Ekind (Entity (Orig_N)) = E_Loop_Parameter + and then Covers (Orig_T, Etype (Entity (Orig_N)))))) + + -- If not an entity, then type of expression must match + + or else Etype (Orig_N) = Orig_T then -- One more check, do not give warning if the analyzed conversion -- has an expression with non-static bounds, and the bounds of the @@ -8668,13 +8843,34 @@ package body Sem_Res is then null; - -- Here we give the redundant conversion warning + -- Finally, the expression may be a qualified expression whose + -- own expression is a possibly overloaded function call. The + -- qualified expression is needed to be disambiguate the call, + -- but it appears in a context in which a name is needed, forcing + -- the use of a conversion. + -- In Ada2012 a qualified expression is a name, and this idiom + -- is not needed any longer. + + elsif Nkind (Orig_N) = N_Qualified_Expression + and then Nkind (Expression (Orig_N)) = N_Function_Call + then + null; + + -- Here we give the redundant conversion warning. If it is an + -- entity, give the name of the entity in the message. If not, + -- just mention the expression. else - Error_Msg_Node_2 := Orig_T; - Error_Msg_NE -- CODEFIX - ("?redundant conversion, & is of type &!", - N, Entity (Orig_N)); + if Is_Entity_Name (Orig_N) then + Error_Msg_Node_2 := Orig_T; + Error_Msg_NE -- CODEFIX + ("?redundant conversion, & is of type &!", + N, Entity (Orig_N)); + else + Error_Msg_NE + ("?redundant conversion, expression is of type&!", + N, Orig_T); + end if; end if; end if; end if; @@ -8754,7 +8950,7 @@ package body Sem_Res is -- The static analysis is not enough to know if the -- interface is implemented or not. Hence we must pass -- the work to the expander to generate code to evaluate - -- the conversion at run-time. + -- the conversion at run time. Expand_Interface_Conversion (N, Is_Static => False); @@ -8993,7 +9189,6 @@ package body Sem_Res is Resolve (Operand, Opnd_Type); Eval_Unchecked_Conversion (N); - end Resolve_Unchecked_Type_Conversion; ------------------------------ @@ -9132,8 +9327,8 @@ package body Sem_Res is Index_Subtype := Create_Itype (Subtype_Kind (Ekind (Index_Type)), N); -- Take a new copy of Drange (where bounds have been rewritten to - -- reference side-effect-vree names). Using a separate tree ensures - -- that further expansion (e.g while rewriting a slice assignment + -- reference side-effect-free names). Using a separate tree ensures + -- that further expansion (e.g. while rewriting a slice assignment -- into a FOR loop) does not attempt to remove side effects on the -- bounds again (which would cause the bounds in the index subtype -- definition to refer to temporaries before they are defined) (the diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index b1962861556..711421c579a 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -900,7 +900,7 @@ package body Sem_Type is -- An aggregate is compatible with an array or record type elsif T2 = Any_Composite - and then Ekind (T1) in E_Array_Type .. E_Record_Subtype + and then Is_Aggregate_Type (T1) then return True; @@ -1866,6 +1866,7 @@ package body Sem_Type is then declare Opnd : Node_Id; + begin if Nkind (N) = N_Function_Call then Opnd := First_Actual (N); @@ -1875,8 +1876,8 @@ package body Sem_Type is if Ekind (Etype (Opnd)) = E_Anonymous_Access_Type and then - List_Containing (Parent (Designated_Type (Etype (Opnd)))) - = List_Containing (Unit_Declaration_Node (User_Subp)) + In_Same_List (Parent (Designated_Type (Etype (Opnd))), + Unit_Declaration_Node (User_Subp)) then if It2.Nam = Predef_Subp then return It1; @@ -2606,7 +2607,22 @@ package body Sem_Type is return True; elsif Etype (Par) /= Par then - Par := Etype (Par); + + -- If this is a private type and its parent is an interface + -- then use the parent of the full view (which is a type that + -- implements such interface) + + if Is_Private_Type (Par) + and then Is_Interface (Etype (Par)) + and then Present (Full_View (Par)) + then + Par := Etype (Full_View (Par)); + else + Par := Etype (Par); + end if; + + -- For all other cases return False, not an Ancestor + else return False; end if; @@ -2653,6 +2669,18 @@ package body Sem_Type is end if; end Is_Invisible_Operator; + -------------------- + -- Is_Progenitor -- + -------------------- + + function Is_Progenitor + (Iface : Entity_Id; + Typ : Entity_Id) return Boolean + is + begin + return Implements_Interface (Typ, Iface, Exclude_Parents => True); + end Is_Progenitor; + ------------------- -- Is_Subtype_Of -- ------------------- @@ -3032,12 +3060,12 @@ package body Sem_Type is return T1; elsif T2 = Any_Composite - and then Ekind (T1) in E_Array_Type .. E_Record_Subtype + and then Is_Aggregate_Type (T1) then return T1; elsif T1 = Any_Composite - and then Ekind (T2) in E_Array_Type .. E_Record_Subtype + and then Is_Aggregate_Type (T2) then return T2; @@ -3194,7 +3222,7 @@ package body Sem_Type is Write_Str (" Index: "); Write_Int (Int (Interp_Map.Table (Map_Ptr).Index)); Write_Str (" Next: "); - Write_Int (Int (Interp_Map.Table (Map_Ptr).Next)); + Write_Int (Interp_Map.Table (Map_Ptr).Next); Write_Eol; end Write_Interp_Ref; diff --git a/gcc/ada/sem_type.ads b/gcc/ada/sem_type.ads index 307674fce14..83d4bb98e32 100644 --- a/gcc/ada/sem_type.ads +++ b/gcc/ada/sem_type.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -221,6 +221,14 @@ package Sem_Type is -- T1 is a tagged type (not class-wide). Verify that it is one of the -- ancestors of type T2 (which may or not be class-wide). + function Is_Progenitor + (Iface : Entity_Id; + Typ : Entity_Id) return Boolean; + -- Determine whether the interface Iface is implemented by Typ. It requires + -- traversing the list of abstract interfaces of the type, as well as that + -- of the ancestor types. The predicate is used to determine when a formal + -- in the signature of an inherited operation must carry the derived type. + function Is_Subtype_Of (T1 : Entity_Id; T2 : Entity_Id) return Boolean; -- Checks whether T1 is any subtype of T2 directly or indirectly. Applies -- only to scalar subtypes??? diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 72f2624fc00..83fee324fd2 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6572,7 +6572,7 @@ package body Sem_Util is -- the corresponding procedure has been created, and which therefore do -- not have an assigned scope. - if Ekind (E) in Formal_Kind then + if Is_Formal (E) then return False; end if; @@ -10532,20 +10532,24 @@ package body Sem_Util is begin -- First case, both are entities with same entity - if K1 in N_Has_Entity - and then K2 in N_Has_Entity - and then Present (Entity (N1)) - and then Present (Entity (N2)) - and then (Ekind (Entity (N1)) = E_Variable - or else - Ekind (Entity (N1)) = E_Constant) - and then Entity (N1) = Entity (N2) - then - return True; + if K1 in N_Has_Entity and then K2 in N_Has_Entity then + declare + EN1 : constant Entity_Id := Entity (N1); + EN2 : constant Entity_Id := Entity (N2); + begin + if Present (EN1) and then Present (EN2) + and then (Ekind_In (EN1, E_Variable, E_Constant) + or else Is_Formal (EN1)) + and then EN1 = EN2 + then + return True; + end if; + end; + end if; -- Second case, selected component with same selector, same record - elsif K1 = N_Selected_Component + if K1 = N_Selected_Component and then K2 = N_Selected_Component and then Chars (Selector_Name (N1)) = Chars (Selector_Name (N2)) then diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 7f18a75e71e..d4a7145683f 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -858,9 +858,11 @@ package body Sem_Warn is procedure Output_Reference_Error (M : String) is begin - -- Never issue messages for internal names + -- Never issue messages for internal names, nor for renamings - if Is_Internal_Name (Chars (E1)) then + if Is_Internal_Name (Chars (E1)) + or else Nkind (Parent (E1)) = N_Object_Renaming_Declaration + then return; end if; @@ -1422,8 +1424,7 @@ package body Sem_Warn is or else Referenced_As_Out_Parameter_Check_Spec (E1)) - -- Labels, and enumeration literals, and exceptions. The - -- warnings are also placed on local packages that cannot be + -- All other entities, including local packages that cannot be -- referenced from elsewhere, including those declared within a -- package body. @@ -1568,7 +1569,7 @@ package body Sem_Warn is if not Warnings_Off_E1 then Unreferenced_Entities.Append (E1); - -- Force warning on entity + -- Force warning on entity Set_Referenced (E1, False); end if; @@ -3084,11 +3085,14 @@ package body Sem_Warn is Warn_On_Object_Renames_Function := True; Warn_On_Obsolescent_Feature := True; Warn_On_Overlap := True; + Warn_On_Overridden_Size := True; Warn_On_Parameter_Order := True; Warn_On_Questionable_Missing_Parens := True; + Warn_On_Record_Holes := True; Warn_On_Redundant_Constructs := True; Warn_On_Reverse_Bit_Order := True; Warn_On_Unchecked_Conversion := True; + Warn_On_Unordered_Enumeration_Type := True; Warn_On_Unrecognized_Pragma := True; Warn_On_Unrepped_Components := True; Warn_On_Warnings_Off := True; @@ -3096,6 +3100,12 @@ package body Sem_Warn is when 'g' => Set_GNAT_Mode_Warnings; + when 'h' => + Warn_On_Record_Holes := True; + + when 'H' => + Warn_On_Record_Holes := False; + when 'i' => Warn_On_Overlap := True; @@ -3126,6 +3136,18 @@ package body Sem_Warn is when 'R' => Warn_On_Object_Renames_Function := False; + when 's' => + Warn_On_Overridden_Size := True; + + when 'S' => + Warn_On_Overridden_Size := False; + + when 'u' => + Warn_On_Unordered_Enumeration_Type := True; + + when 'U' => + Warn_On_Unordered_Enumeration_Type := False; + when 'v' => Warn_On_Reverse_Bit_Order := True; @@ -3187,6 +3209,7 @@ package body Sem_Warn is Warn_On_Reverse_Bit_Order := False; Warn_On_Object_Renames_Function := True; Warn_On_Unchecked_Conversion := True; + Warn_On_Unordered_Enumeration_Type := False; Warn_On_Unrecognized_Pragma := True; Warn_On_Unrepped_Components := False; Warn_On_Warnings_Off := False; @@ -3252,11 +3275,14 @@ package body Sem_Warn is Warn_On_Object_Renames_Function := False; Warn_On_Obsolescent_Feature := False; Warn_On_Overlap := False; + Warn_On_Overridden_Size := False; Warn_On_Parameter_Order := False; + Warn_On_Record_Holes := False; Warn_On_Questionable_Missing_Parens := False; Warn_On_Redundant_Constructs := False; Warn_On_Reverse_Bit_Order := False; Warn_On_Unchecked_Conversion := False; + Warn_On_Unordered_Enumeration_Type := False; Warn_On_Unrecognized_Pragma := False; Warn_On_Unrepped_Components := False; Warn_On_Warnings_Off := False; diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads index e74e144fc5b..c7e3fd2022b 100644 --- a/gcc/ada/sem_warn.ads +++ b/gcc/ada/sem_warn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1999-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,6 +33,26 @@ with Types; use Types; package Sem_Warn is + ------------------- + -- Warning Flags -- + ------------------- + + -- These flags are activated or deactivated by -gnatw switches and control + -- whether warnings of a given class will be generated or not. + + -- Note: most of these flags are still in opt, but the plan is to move them + -- here as time goes by. + + Warn_On_Record_Holes : Boolean := False; + -- Warn when explicit record component clauses leave uncovered holes (gaps) + -- in a record layout. Off by default, set by -gnatw.h (but not -gnatwa). + + Warn_On_Overridden_Size : Boolean := False; + -- Warn when explicit record component clause or array component_size + -- clause specifies a size that overrides a size for the typen which was + -- set with an explicit size clause. Off by default, set by -gnatw.sn (but + -- not -gnatwa). + ------------------------ -- Warnings Off Table -- ------------------------ diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index cb358c4d75b..707bf6480d9 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -3911,6 +3911,10 @@ package Sinfo is -- Identifier (Node1) direct name of statement identifier -- Exception_Junk (Flag8-Sem) + -- Note: Before Ada 2012, a label is always followed by a statement, + -- and this is true in the tree even in Ada 2012 mode (the parser + -- inserts a null statement marked with Comes_From_Source False). + ------------------------------- -- 5.1 Statement Identifier -- ------------------------------- @@ -4006,6 +4010,11 @@ package Sinfo is -- Alternatives (List4) -- End_Span (Uint5) (set to No_Uint if expander generated) + -- Note: Before Ada 2012, a pragma in a statement sequence is always + -- followed by a statement, and this is true in the tree even in Ada + -- 2012 mode (the parser inserts a null statement marked with the flag + -- Comes_From_Source False). + ------------------------------------- -- 5.4 Case Statement Alternative -- ------------------------------------- diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb index 5159186d9f7..d29659755ff 100644 --- a/gcc/ada/sinput-l.adb +++ b/gcc/ada/sinput-l.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -530,12 +530,9 @@ package body Sinput.L is Save_Style_Check := Opt.Style_Check; Opt.Style_Check := False; - -- Make sure that there will be no check of pragma Restrictions - -- for obsolescent features while preprocessing the source. + -- The actual preprocessing step - Scn.Set_Obsolescent_Check (False); Preprocess (Modified); - Scn.Set_Obsolescent_Check (True); -- Reset the scanner to its standard behavior, and restore the -- Style_Checks flag. diff --git a/gcc/ada/sinput-p.adb b/gcc/ada/sinput-p.adb index 2c9dc0636fc..cd513d01080 100644 --- a/gcc/ada/sinput-p.adb +++ b/gcc/ada/sinput-p.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -151,6 +151,12 @@ package body Sinput.P is function Source_File_Is_Subunit (X : Source_File_Index) return Boolean is begin + -- Nothing to do if X is no source file, so simply return False + + if X = No_Source_File then + return False; + end if; + Prj.Err.Scanner.Initialize_Scanner (X); -- No error for special characters that are used for preprocessing diff --git a/gcc/ada/sinput-p.ads b/gcc/ada/sinput-p.ads index 8f925bbc9a0..112a6f7d5da 100644 --- a/gcc/ada/sinput-p.ads +++ b/gcc/ada/sinput-p.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -54,7 +54,7 @@ package Sinput.P is -- the file cannot possibly be a legal subunit. This function does NOT do a -- complete parse of the file, or build a tree. It is used in gnatmake and -- gprbuild to decide if a body without a spec in a project file needs to - -- be compiled or not. + -- be compiled or not. Returns False if X = No_Source_File. type Saved_Project_Scan_State is limited private; -- Used to save project scan state in following two routines diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 71700388890..411e3dbd3f0 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -386,6 +386,7 @@ package Snames is Name_Restriction_Warnings : constant Name_Id := N + $; -- GNAT Name_Reviewable : constant Name_Id := N + $; Name_Short_Circuit_And_Or : constant Name_Id := N + $; -- GNAT + Name_Short_Descriptors : constant Name_Id := N + $; -- GNAT Name_Source_File_Name : constant Name_Id := N + $; -- GNAT Name_Source_File_Name_Project : constant Name_Id := N + $; -- GNAT Name_Style_Checks : constant Name_Id := N + $; -- GNAT @@ -483,6 +484,7 @@ package Snames is Name_No_Return : constant Name_Id := N + $; -- Ada 05 Name_Obsolescent : constant Name_Id := N + $; -- GNAT Name_Optimize : constant Name_Id := N + $; + Name_Ordered : constant Name_Id := N + $; -- GNAT Name_Pack : constant Name_Id := N + $; Name_Page : constant Name_Id := N + $; Name_Passive : constant Name_Id := N + $; -- GNAT @@ -1075,7 +1077,9 @@ package Snames is Name_Include_Path_File : constant Name_Id := N + $; Name_Inherit_Source_Path : constant Name_Id := N + $; Name_Languages : constant Name_Id := N + $; + Name_Leading_Library_Options : constant Name_Id := N + $; Name_Leading_Required_Switches : constant Name_Id := N + $; + Name_Leading_Switches : constant Name_Id := N + $; Name_Library : constant Name_Id := N + $; Name_Library_Ali_Dir : constant Name_Id := N + $; Name_Library_Auto_Init : constant Name_Id := N + $; @@ -1463,6 +1467,7 @@ package Snames is Pragma_Restriction_Warnings, Pragma_Reviewable, Pragma_Short_Circuit_And_Or, + Pragma_Short_Descriptors, Pragma_Source_File_Name, Pragma_Source_File_Name_Project, Pragma_Style_Checks, @@ -1545,6 +1550,7 @@ package Snames is Pragma_No_Return, Pragma_Obsolescent, Pragma_Optimize, + Pragma_Ordered, Pragma_Pack, Pragma_Page, Pragma_Passive, diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index e68f4359782..31e3e580bf1 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2003-2009, Free Software Foundation, Inc. * + * Copyright (C) 2003-2010, 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- * @@ -529,6 +529,12 @@ int __gnat_socket_ioctl (int fd, int req, int *arg) { #if defined (_WIN32) return ioctlsocket (fd, req, arg); +#elif defined (__APPLE__) + /* + * On Darwin, req is an unsigned long, and we want to convert without sign + * extension to get the proper bit pattern in the case of a 64 bit kernel. + */ + return ioctl (fd, (unsigned int) req, arg); #else return ioctl (fd, req, arg); #endif diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 44c12f0ab2d..3c780b51cd4 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -1332,7 +1332,7 @@ package body Sprint is Write_Str_With_Col_Check ("abstract "); end if; - Write_Str_With_Col_Check_Sloc ("new "); + Write_Str_With_Col_Check ("new "); -- Ada 2005 (AI-231) @@ -3467,11 +3467,13 @@ package body Sprint is end if; -- Case of selector of an expanded name where the expanded name - -- has an associated entity, output this entity. + -- has an associated entity, output this entity. Check that the + -- entity or associated node is of the right kind, see above. elsif Nkind (Parent (N)) = N_Expanded_Name and then Selector_Name (Parent (N)) = N - and then Present (Entity (Parent (N))) + and then Present (Entity_Or_Associated_Node (Parent (N))) + and then Nkind (Entity (Parent (N))) in N_Entity then Write_Id (Entity (Parent (N))); @@ -4362,12 +4364,10 @@ package body Sprint is procedure Write_Ureal_With_Col_Check_Sloc (U : Ureal) is D : constant Uint := Denominator (U); N : constant Uint := Numerator (U); - begin - Col_Check - (UI_Decimal_Digits_Hi (D) + UI_Decimal_Digits_Hi (N) + 4); + Col_Check (UI_Decimal_Digits_Hi (D) + UI_Decimal_Digits_Hi (N) + 4); Set_Debug_Sloc; - UR_Write (U); + UR_Write (U, Brackets => True); end Write_Ureal_With_Col_Check_Sloc; end Sprint; diff --git a/gcc/ada/sprint.ads b/gcc/ada/sprint.ads index 64fe81ae4c5..ffbe2088624 100644 --- a/gcc/ada/sprint.ads +++ b/gcc/ada/sprint.ads @@ -76,7 +76,7 @@ package Sprint is -- Push exception label %push_xxx_exception_label (label) -- Raise xxx error [xxx_error [when cond]] -- Raise xxx error with msg [xxx_error [when cond], "msg"] - -- Rational literal See UR_Write for details + -- Rational literal [expression] -- Rem wi Treat_Fixed_As_Integer x #rem y -- Reference expression'reference -- Shift nodes shift_name!(expr, count) diff --git a/gcc/ada/style.ads b/gcc/ada/style.ads index b61cd08bbf9..9f9f32a932d 100644 --- a/gcc/ada/style.ads +++ b/gcc/ada/style.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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/styleg.adb b/gcc/ada/styleg.adb index 1c22dbcf707..dc6b6a64892 100644 --- a/gcc/ada/styleg.adb +++ b/gcc/ada/styleg.adb @@ -202,6 +202,7 @@ package body Styleg is end OK_Boolean_Operand; -- Start of processig for Check_Boolean_Operator + begin if Style_Check_Boolean_And_Or and then Comes_From_Source (Node) diff --git a/gcc/ada/styleg.ads b/gcc/ada/styleg.ads index 91c90d2ae81..954a0335996 100644 --- a/gcc/ada/styleg.ads +++ b/gcc/ada/styleg.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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/stylesw.adb b/gcc/ada/stylesw.adb index 2f987fda28c..9a599965587 100644 --- a/gcc/ada/stylesw.adb +++ b/gcc/ada/stylesw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -59,6 +59,11 @@ package body Stylesw is "u" & -- check no unnecessary blank lines "x"; -- check extra parentheses around conditionals + -- Note: we intend GNAT_Style to also include the following, but we do + -- not yet have the whole tool suite clean with respect to this. + + -- "B" & -- check boolean operators + ------------------------------- -- Reset_Style_Check_Options -- ------------------------------- diff --git a/gcc/ada/stylesw.ads b/gcc/ada/stylesw.ads index 744706380c8..f7d45b6d60c 100644 --- a/gcc/ada/stylesw.ads +++ b/gcc/ada/stylesw.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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/switch-m.adb b/gcc/ada/switch-m.adb index 11491d3de42..39188a4ad9d 100644 --- a/gcc/ada/switch-m.adb +++ b/gcc/ada/switch-m.adb @@ -655,6 +655,9 @@ package body Switch.M is elsif Switch_Chars = Makeutl.Unchecked_Shared_Lib_Imports then Opt.Unchecked_Shared_Lib_Imports := True; + elsif Switch_Chars = Makeutl.Single_Compile_Per_Obj_Dir_Switch then + Opt.One_Compilation_Per_Obj_Dir := True; + elsif Switch_Chars (Ptr) = '-' then Bad_Switch (Switch_Chars); diff --git a/gcc/ada/symbols-processing-vms-alpha.adb b/gcc/ada/symbols-processing-vms-alpha.adb index 4cd92e2b332..c33739402c3 100644 --- a/gcc/ada/symbols-processing-vms-alpha.adb +++ b/gcc/ada/symbols-processing-vms-alpha.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2003-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,20 +31,30 @@ package body Processing is type Number is mod 2**16; -- 16 bits unsigned number for number of characters + EMH : constant Number := 8; + -- Code for the Module Header section + GSD : constant Number := 10; -- Code for the Global Symbol Definition section C_SYM : constant Number := 1; -- Code for a Symbol subsection - V_DEF_Mask : constant Number := 2**1; - V_NORM_Mask : constant Number := 2**6; + V_DEF_Mask : constant Number := 2 ** 1; + V_NORM_Mask : constant Number := 2 ** 6; + -- Comments ??? B : Byte; Number_Of_Characters : Natural := 0; -- The number of characters of each section + Native_Format : Boolean; + -- True if records are decoded by the system (like on VMS) + + Has_Pad : Boolean; + -- If true, a pad byte must be skipped before reading the next record + -- The following variables are used by procedure Process when reading an -- object file. @@ -114,25 +124,82 @@ package body Processing is Success := True; + -- Check the file format in case of cross-tool + + Get (Code); + Get (Number_Of_Characters); + Get (Dummy); + + if Code = Dummy and then Number_Of_Characters = Natural (EMH) then + + -- Looks like a cross tool + + Native_Format := False; + Number_Of_Characters := Natural (Dummy) - 4; + Has_Pad := (Number_Of_Characters mod 2) = 1; + + elsif Code = EMH then + Native_Format := True; + Number_Of_Characters := Number_Of_Characters - 6; + Has_Pad := False; + + else + Put_Line ("file """ & Object_File & """ is not an object file"); + Close (File); + Success := False; + return; + end if; + + -- Skip the EMH section + + for J in 1 .. Number_Of_Characters loop + Read (File, B); + end loop; + -- Get the different sections one by one from the object file while not End_Of_File (File) loop + if not Native_Format then + + -- Skip pad byte if present + + if Has_Pad then + Get (B); + end if; + + -- Skip record length + + Get (Dummy); + end if; + Get (Code); Get (Number_Of_Characters); + + if not Native_Format then + if Natural (Dummy) /= Number_Of_Characters then + + -- Format error + + raise Constraint_Error; + end if; + + Has_Pad := (Number_Of_Characters mod 2) = 1; + end if; + + -- The header is 4 bytes length + Number_Of_Characters := Number_Of_Characters - 4; -- If this is not a Global Symbol Definition section, skip to the -- next section. if Code /= GSD then - for J in 1 .. Number_Of_Characters loop Read (File, B); end loop; else - -- Skip over the next 4 bytes Get (Dummy); @@ -149,10 +216,10 @@ package body Processing is Number_Of_Characters := Number_Of_Characters - 8; Nchars := Nchars - 8; - -- If this is a symbol and the V_DEF flag is set, get the - -- symbol. + -- If this is a symbol and the V_DEF flag is set, get symbol if Code = C_SYM and then ((Flags and V_DEF_Mask) /= 0) then + -- First, reach the symbol length for J in 1 .. 25 loop @@ -169,6 +236,7 @@ package body Processing is for J in 1 .. Nchars loop Read (File, B); Number_Of_Characters := Number_Of_Characters - 1; + if Length > 0 then LSymb := LSymb + 1; Symbol (LSymb) := B; @@ -204,7 +272,6 @@ package body Processing is if (Flags and V_NORM_Mask) = 0 then S_Data.Kind := Data; - else S_Data.Kind := Proc; end if; @@ -225,7 +292,7 @@ package body Processing is end loop; end if; - -- Exit the GSD section when number of characters reaches 0 + -- Exit the GSD section when number of characters reaches zero exit when Number_Of_Characters = 0; end loop; diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index c978c036a35..49d2f8376af 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -959,7 +959,7 @@ __gnat_get_task_options (void) /* Force VX_FP_TASK because it is almost always required */ options |= VX_FP_TASK; -#if defined (__SPE__) +#if defined (__SPE__) && (! defined (__VXWORKSMILS__)) options |= VX_SPE_TASK; #endif diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index 5d7784dc03b..15682909ef2 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -251,13 +251,13 @@ package Types is -- Universal integers (type Uint) -- Universal reals (type Ureal) - -- In most contexts, the strongly typed interface determines which of - -- these types is present. However, there are some situations (involving - -- untyped traversals of the tree), where it is convenient to be easily - -- able to distinguish these values. The underlying representation in all - -- cases is an integer type Union_Id, and we ensure that the range of - -- the various possible values for each of the above types is disjoint - -- so that this distinction is possible. + -- In most contexts, the strongly typed interface determines which of these + -- types is present. However, there are some situations (involving untyped + -- traversals of the tree), where it is convenient to be easily able to + -- distinguish these values. The underlying representation in all cases is + -- an integer type Union_Id, and we ensure that the range of the various + -- possible values for each of the above types is disjoint so that this + -- distinction is possible. type Union_Id is new Int; -- The type in the tree for a union of possible ID values diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words index efa5356dff3..e2da62c3efc 100644 --- a/gcc/ada/ug_words +++ b/gcc/ada/ug_words @@ -24,8 +24,6 @@ gnatfind ^ GNAT FIND Gnatfind ^ GNAT FIND gnatkr ^ GNAT KRUNCH Gnatkr ^ GNAT KRUNCH -gnatlbr ^ GNAT LIBRARY -Gnatlbr ^ GNAT LIBRARY gnatlink ^ GNAT LINK Gnatlink ^ GNAT LINK gnatls ^ GNAT LIST @@ -140,6 +138,8 @@ gcc -c ^ GNAT COMPILE -gnatwG ^ /WARNINGS=NOUNRECOGNIZED_PRAGMAS -gnatwh ^ /WARNINGS=HIDING -gnatwH ^ /WARNINGS=NOHIDING +-gnatw.h ^ /WARNINGS=AVOIDGAPS +-gnatw.H ^ /WARNINGS=NOAVOIDGAPS -gnatwi ^ /WARNINGS=IMPLEMENTATION -gnatwI ^ /WARNINGS=NOIMPLEMENTATION -gnatwj ^ /WARNINGS=OBSOLESCENT @@ -161,6 +161,8 @@ gcc -c ^ GNAT COMPILE -gnatwP ^ /WARNINGS=NOINEFFECTIVE_INLINE -gnatw.p ^ /WARNINGS=PARAMETER_ORDER -gnatw.P ^ /WARNINGS=NO_PARAMETER_ORDER +-gnatw.h ^ /WARNINGS=OVERRIDING_SIZE +-gnatw.H ^ /WARNINGS=NOOVERRIDING_SIZE -gnatwq ^ /WARNINGS=MISSING_PARENS -gnatwQ ^ /WARNINGS=NOMISSING_PARENS -gnatwr ^ /WARNINGS=REDUNDANT @@ -170,6 +172,8 @@ gcc -c ^ GNAT COMPILE -gnatwT ^ /WARNINGS=NODELETED_CODE -gnatwu ^ /WARNINGS=UNUSED -gnatwU ^ /WARNINGS=NOUNUSED +-gnatw.u ^ /WARNINGS=UNORDERED_ENUMERATIONS +-gnatw.U ^ /WARNINGS=NOUNORDERED_ENUMERATIONS -gnatwv ^ /WARNINGS=VARIABLES_UNINITIALIZED -gnatwV ^ /WARNINGS=NOVARIABLES_UNINITIALIZED -gnatww ^ /WARNINGS=LOWBOUND_ASSUMED @@ -218,3 +222,5 @@ stderr ^ SYS$ERROR -O1 ^ /OPTIMIZE=SOME -O2 ^ /OPTIMIZE=ALL -O3 ^ /OPTIMIZE=INLINING +-H32 ^ /32_MALLOC +-H64 ^ /64_MALLOC diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 29ffe235aad..713e0b15dd7 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -2204,9 +2204,7 @@ package body Uintp is and then Int (Right) <= Int (Uint_Max_Simple_Mul) then - return - UI_From_Int - (Int (Direct_Val (Left)) * Int (Direct_Val (Right))); + return UI_From_Int (Direct_Val (Left) * Direct_Val (Right)); end if; -- Otherwise we have the general case (Algorithm M in Knuth) diff --git a/gcc/ada/urealp.adb b/gcc/ada/urealp.adb index 4ef21c2c220..0f2f2749da0 100644 --- a/gcc/ada/urealp.adb +++ b/gcc/ada/urealp.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1307,28 +1307,108 @@ package body Urealp is -- UR_Write -- -------------- - procedure UR_Write (Real : Ureal) is + procedure UR_Write (Real : Ureal; Brackets : Boolean := False) is Val : constant Ureal_Entry := Ureals.Table (Real); + T : Uint; begin -- If value is negative, we precede the constant by a minus sign - -- and add an extra layer of parentheses on the outside since the - -- minus sign is part of the value, not a negation operator. if Val.Negative then - Write_Str ("(-"); + Write_Char ('-'); end if; + -- Zero is zero + + if Val.Num = 0 then + Write_Str ("0.0"); + -- Constants in base 10 can be written in normal Ada literal style - if Val.Rbase = 10 then - UI_Write (Val.Num / 10); - Write_Char ('.'); - UI_Write (Val.Num mod 10); + elsif Val.Rbase = 10 then - if Val.Den /= 0 then + -- Use fixed-point format for small scaling values + + if Val.Den = 0 then + UI_Write (Val.Num, Decimal); + Write_Str (".0"); + + elsif Val.Den = 1 then + UI_Write (Val.Num / 10, Decimal); + Write_Char ('.'); + UI_Write (Val.Num mod 10, Decimal); + + elsif Val.Den = 2 then + UI_Write (Val.Num / 100, Decimal); + Write_Char ('.'); + UI_Write (Val.Num mod 100 / 10, Decimal); + UI_Write (Val.Num mod 10, Decimal); + + elsif Val.Den = -1 then + UI_Write (Val.Num, Decimal); + Write_Str ("0.0"); + + elsif Val.Den = -2 then + UI_Write (Val.Num, Decimal); + Write_Str ("00.0"); + + -- Else use exponential format + + else + UI_Write (Val.Num / 10, Decimal); + Write_Char ('.'); + UI_Write (Val.Num mod 10, Decimal); Write_Char ('E'); - UI_Write (1 - Val.Den); + UI_Write (1 - Val.Den, Decimal); + end if; + + -- If we have a constant in a base other than 10, and the denominator + -- is zero, then the value is simply the numerator value, since we are + -- dividing by base**0, which is 1. + + elsif Val.Den = 0 then + UI_Write (Val.Num, Decimal); + Write_Str (".0"); + + -- Small powers of 2 get written in decimal fixed-point format + + elsif Val.Rbase = 2 + and then Val.Den <= 3 + and then Val.Den >= -16 + then + if Val.Den = 1 then + T := Val.Num * (10/2); + UI_Write (T / 10, Decimal); + Write_Char ('.'); + UI_Write (T mod 10, Decimal); + + elsif Val.Den = 2 then + T := Val.Num * (100/4); + UI_Write (T / 100, Decimal); + Write_Char ('.'); + UI_Write (T mod 100 / 10, Decimal); + + if T mod 10 /= 0 then + UI_Write (T mod 10, Decimal); + end if; + + elsif Val.Den = 3 then + T := Val.Num * (1000 / 8); + UI_Write (T / 1000, Decimal); + Write_Char ('.'); + UI_Write (T mod 1000 / 100, Decimal); + + if T mod 100 /= 0 then + UI_Write (T mod 100 / 10, Decimal); + + if T mod 10 /= 0 then + UI_Write (T mod 10, Decimal); + end if; + end if; + + else + UI_Write (Val.Num * (Uint_2 ** (-Val.Den)), Decimal); + Write_Str (".0"); end if; -- Constants in a base other than 10 can still be easily written @@ -1343,48 +1423,60 @@ package body Urealp is -- of the following forms, depending on the sign of the number -- and the sign of the exponent (= minus denominator value) - -- (numerator.0*base**exponent) - -- (numerator.0*base**(-exponent)) + -- numerator.0*base**exponent + -- numerator.0*base**-exponent + + -- And of course an exponent of 0 can be omitted elsif Val.Rbase /= 0 then - Write_Char ('('); + if Brackets then + Write_Char ('['); + end if; + UI_Write (Val.Num, Decimal); - Write_Str (".0*"); - Write_Int (Val.Rbase); - Write_Str ("**"); + Write_Str (".0"); - if Val.Den <= 0 then - UI_Write (-Val.Den, Decimal); + if Val.Den /= 0 then + Write_Char ('*'); + Write_Int (Val.Rbase); + Write_Str ("**"); - else - Write_Str ("(-"); - UI_Write (Val.Den, Decimal); - Write_Char (')'); + if Val.Den <= 0 then + UI_Write (-Val.Den, Decimal); + else + Write_Str ("(-"); + UI_Write (Val.Den, Decimal); + Write_Char (')'); + end if; end if; - Write_Char (')'); + if Brackets then + Write_Char (']'); + end if; - -- Rational constants with a denominator of 1 can be written as - -- a real literal for the numerator integer. + -- Rationals where numerator is divisible by denominator can be output + -- as literals after we do the division. This includes the common case + -- where the denominator is 1. - elsif Val.Den = 1 then - UI_Write (Val.Num, Decimal); + elsif Val.Num mod Val.Den = 0 then + UI_Write (Val.Num / Val.Den, Decimal); Write_Str (".0"); - -- Non-based (rational) constants are written in (num/den) style + -- Other non-based (rational) constants are written in num/den style else - Write_Char ('('); + if Brackets then + Write_Char ('['); + end if; + UI_Write (Val.Num, Decimal); Write_Str (".0/"); UI_Write (Val.Den, Decimal); - Write_Str (".0)"); - end if; - - -- Add trailing paren for negative values + Write_Str (".0"); - if Val.Negative then - Write_Char (')'); + if Brackets then + Write_Char (']'); + end if; end if; end UR_Write; diff --git a/gcc/ada/urealp.ads b/gcc/ada/urealp.ads index 5b3bd2cb6cb..ca90ac4a0db 100644 --- a/gcc/ada/urealp.ads +++ b/gcc/ada/urealp.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -264,14 +264,17 @@ package Urealp is function UR_Is_Positive (Real : Ureal) return Boolean; -- Test if real value is greater than zero - procedure UR_Write (Real : Ureal); - -- Writes value of Real to standard output. Used only for debugging and - -- tree/source output. If the result is easily representable as a standard - -- Ada literal, it will be given that way, but as a result of evaluation - -- of static expressions, it is possible to generate constants (e.g. 1/13) - -- which have no such representation. In such cases (and in cases where it - -- is too much work to figure out the Ada literal), the string that is - -- output is of the form [numerator/denominator]. + procedure UR_Write (Real : Ureal; Brackets : Boolean := False); + -- Writes value of Real to standard output. Used for debugging and + -- tree/source output, and also for -gnatR representation output. If the + -- result is easily representable as a standard Ada literal, it will be + -- given that way, but as a result of evaluation of static expressions, it + -- is possible to generate constants (e.g. 1/13) which have no such + -- representation. In such cases (and in cases where it is too much work to + -- figure out the Ada literal), the string that is output is of the form + -- of some expression such as integer/integer, or integer*integer**integer. + -- In the case where an expression is output, if Brackets is set to True, + -- the expression is surrounded by square brackets. procedure pr (Real : Ureal); pragma Export (Ada, pr); diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 2121b7f20e4..6429a7d01b9 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -422,6 +422,8 @@ begin Write_Line (" G turn off warnings for unrecognized pragma"); Write_Line (" h turn on warnings for hiding variable"); Write_Line (" H* turn off warnings for hiding variable"); + Write_Line (" .h turn on warnings for holes in records"); + Write_Line (" .H* turn off warnings for holes in records"); Write_Line (" i*+ turn on warnings for implementation unit"); Write_Line (" I turn off warnings for implementation unit"); Write_Line (" .i turn on warnings for overlapping actuals"); @@ -466,10 +468,14 @@ begin Write_Line (" .r+ turn on warnings for object renaming function"); Write_Line (" .R* turn off warnings for object renaming function"); Write_Line (" s suppress all info/warnings"); + Write_Line (" .s turn on warnings for overridden size clause"); + Write_Line (" .S* turn off warnings for overridden size clause"); Write_Line (" t turn on warnings for tracking deleted code"); Write_Line (" T* turn off warnings for tracking deleted code"); Write_Line (" u+ turn on warnings for unused entity"); Write_Line (" U* turn off warnings for unused entity"); + Write_Line (" .u turn on warnings for unordered enumeration"); + Write_Line (" .U* turn off warnings for unordered enumeration"); Write_Line (" v*+ turn on warnings for unassigned variable"); Write_Line (" V turn off warnings for unassigned variable"); Write_Line (" .v*+ turn on info messages for reverse bit order"); diff --git a/gcc/ada/vms_cmds.ads b/gcc/ada/vms_cmds.ads new file mode 100644 index 00000000000..66c401506d0 --- /dev/null +++ b/gcc/ada/vms_cmds.ads @@ -0,0 +1,52 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- V M S _ C M D S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2010, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING3. If not, go to -- +-- http://www.gnu.org/licenses for a complete copy of the license. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package is part of the GNAT driver. It contains the declaration of +-- Command_Type which list all the commands supported by the gnat driver. + +package VMS_Cmds is + type Command_Type is + (Bind, + Chop, + Clean, + Compile, + Check, + Sync, + Elim, + Find, + Krunch, + Link, + List, + Make, + Metric, + Name, + Preprocess, + Pretty, + Shared, + Stack, + Stub, + Xref, + Undefined); +end VMS_Cmds; diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb index e9aba4906eb..b8060531477 100644 --- a/gcc/ada/vms_conv.adb +++ b/gcc/ada/vms_conv.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2010, 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- -- @@ -314,16 +314,16 @@ package body VMS_Conv is loop declare Dir : constant String_Access := - String_Access (Get_Next_Dir_In_Path (Object_Dir_Name)); + Get_Next_Dir_In_Path (Object_Dir_Name); begin exit when Dir = null; Object_Dirs := Object_Dirs + 1; Object_Dir (Object_Dirs) := new String'("-L" & To_Canonical_Dir_Spec - (To_Host_Dir_Spec - (Normalize_Directory_Name (Dir.all).all, - True).all, True).all); + (To_Host_Dir_Spec + (Normalize_Directory_Name (Dir.all).all, + True).all, True).all); end; end loop; diff --git a/gcc/ada/vms_conv.ads b/gcc/ada/vms_conv.ads index 965bb372d48..7e2127f10a2 100644 --- a/gcc/ada/vms_conv.ads +++ b/gcc/ada/vms_conv.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2003-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -30,6 +30,7 @@ with Table; with VMS_Data; use VMS_Data; +with VMS_Cmds; use VMS_Cmds; with GNAT.OS_Lib; use GNAT.OS_Lib; @@ -92,29 +93,6 @@ package VMS_Conv is type Parameter_Array is array (Natural range <>) of Parameter_Type; type Parameter_Ref is access all Parameter_Array; - type Command_Type is - (Bind, - Chop, - Clean, - Compile, - Check, - Sync, - Elim, - Find, - Krunch, - Link, - List, - Make, - Metric, - Name, - Preprocess, - Pretty, - Shared, - Stack, - Stub, - Xref, - Undefined); - type Alternate_Command is (Comp, Ls, Kr, Pp, Prep); -- Alternate command label for non VMS system use diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index 84571bb3bac..675e4f57f7d 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -353,6 +353,20 @@ package VMS_Data is -- -- The main program is not in Ada. + S_Bind_Alloc32 : aliased constant S := "/32_MALLOC " & + "-H32"; + -- /32_MALLOC + -- + -- Use 32-bit allocations for `__gnat_malloc' (and thus for + -- access types). + + S_Bind_Alloc64 : aliased constant S := "/64_MALLOC " & + "-H64"; + -- /64_MALLOC + -- + -- Use 64-bit allocations for `__gnat_malloc' (and thus for + -- access types). + S_Bind_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & "DEFAULT " & "-vP0 " & @@ -694,6 +708,8 @@ package VMS_Data is S_Bind_Library 'Access, S_Bind_Linker 'Access, S_Bind_Main 'Access, + S_Bind_Alloc32 'Access, + S_Bind_Alloc64 'Access, S_Bind_Mess 'Access, S_Bind_Nostinc 'Access, S_Bind_Nostlib 'Access, @@ -2259,10 +2275,12 @@ package VMS_Data is "-gnaty-A " & "BLANKS " & "-gnatyb " & - "BOOLEAN_OPERATORS " & - "-gnatyB " & "NOBLANKS " & "-gnaty-b " & + "BOOLEAN_OPERATORS " & + "-gnatyB " & + "NOBOOLEAN_OPERATORS " & + "-gnaty-B " & "COMMENTS " & "-gnatyc " & "NOCOMMENTS " & @@ -2933,6 +2951,10 @@ package VMS_Data is "-gnatwh " & "NOHIDING " & "-gnatwH " & + "AVOIDGAPS " & + "-gnatw.h " & + "NOAVOIDGAPS " & + "-gnatw.H " & "IMPLEMENTATION " & "-gnatwi " & "NOIMPLEMENTATION " & @@ -2989,6 +3011,10 @@ package VMS_Data is "-gnatw.R " & "SUPPRESS " & "-gnatws " & + "OVERRIDING_SIZE " & + "-gnatw.s " & + "NOOVERRIDING_SIZE " & + "-gnatw.S " & "DELETED_CODE " & "-gnatwt " & "NODELETED_CODE " & @@ -2999,6 +3025,10 @@ package VMS_Data is "-gnatwu " & "NOUNUSED " & "-gnatwU " & + "UNORDERED_ENUMERATIONS " & + "-gnatw.u " & + "NOUNORDERED_ENUMERATIONS " & + "-gnatw.U " & "VARIABLES_UNINITIALIZED " & "-gnatwv " & "NOVARIABLES_UNINITIALIZED " & @@ -4852,6 +4882,14 @@ package VMS_Data is -- -- Search the specified directories for both source and object files. + S_Make_Single : aliased constant S := "/SINGLE_COMPILE_PER_OBJ_DIR " & + "--single-compile-per-obj-dir"; + -- /NOSINGLE_COMPILE_PER_OBJ_DIR (D) + -- /SINGLE_COMPILE_PER_OBJ_DIR + -- + -- When project files are used, do not allow simultaneous compilations + -- for the same object directory. + S_Make_Skip : aliased constant S := "/SKIP_MISSING=*" & "-aL*"; -- /SKIP_MISSING=(directory[,...]) @@ -4971,6 +5009,7 @@ package VMS_Data is S_Make_Reason 'Access, S_Make_RTS 'Access, S_Make_Search 'Access, + S_Make_Single 'Access, S_Make_Skip 'Access, S_Make_Source 'Access, S_Make_Stand 'Access, diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb index ed213569e92..5ea51bdf369 100644 --- a/gcc/ada/xref_lib.adb +++ b/gcc/ada/xref_lib.adb @@ -518,7 +518,7 @@ package body Xref_Lib is when 'T' => return "task type"; when 'W' => return "protected type"; - when 'a' => return "array type"; + when 'a' => return Param_String & "array object"; when 'b' => return Param_String & "boolean object"; when 'c' => return Param_String & "class-wide object"; when 'd' => return Param_String & "decimal object"; diff --git a/gcc/alias.c b/gcc/alias.c index 6defc79d7a0..854ac27aa9d 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -283,6 +283,10 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) || TREE_CODE (base) == MEM_REF) && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME) return false; + if (TREE_CODE (base) == TARGET_MEM_REF + && TMR_BASE (base) + && TREE_CODE (TMR_BASE (base)) != SSA_NAME) + return false; /* If this is a reference based on a partitioned decl replace the base with an INDIRECT_REF of the pointer representative we @@ -296,6 +300,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) if (namep) ref->base = build_simple_mem_ref (*(tree *)namep); } + else if (TREE_CODE (base) == TARGET_MEM_REF + && TREE_CODE (TMR_BASE (base)) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (TMR_BASE (base), 0)) == VAR_DECL + && ! TREE_STATIC (TREE_OPERAND (TMR_BASE (base), 0)) + && cfun->gimple_df->decls_to_pointers != NULL) + { + void *namep; + namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers, + TREE_OPERAND (TMR_BASE (base), 0)); + if (namep) + ref->base = build_simple_mem_ref (*(tree *)namep); + } ref->ref_alias_set = MEM_ALIAS_SET (mem); @@ -745,6 +761,62 @@ get_alias_set (tree t) else if (TREE_CODE (t) == ARRAY_TYPE && !TYPE_NONALIASED_COMPONENT (t)) set = get_alias_set (TREE_TYPE (t)); + /* From the former common C and C++ langhook implementation: + + Unfortunately, there is no canonical form of a pointer type. + In particular, if we have `typedef int I', then `int *', and + `I *' are different types. So, we have to pick a canonical + representative. We do this below. + + Technically, this approach is actually more conservative that + it needs to be. In particular, `const int *' and `int *' + should be in different alias sets, according to the C and C++ + standard, since their types are not the same, and so, + technically, an `int **' and `const int **' cannot point at + the same thing. + + But, the standard is wrong. In particular, this code is + legal C++: + + int *ip; + int **ipp = &ip; + const int* const* cipp = ipp; + And, it doesn't make sense for that to be legal unless you + can dereference IPP and CIPP. So, we ignore cv-qualifiers on + the pointed-to types. This issue has been reported to the + C++ committee. + + In addition to the above canonicalization issue, with LTO + we should also canonicalize `T (*)[]' to `T *' avoiding + alias issues with pointer-to element types and pointer-to + array types. + + Likewise we need to deal with the situation of incomplete + pointed-to types and make `*(struct X **)&a' and + `*(struct X {} **)&a' alias. Otherwise we will have to + guarantee that all pointer-to incomplete type variants + will be replaced by pointer-to complete type variants if + they are available. + + With LTO the convenient situation of using `void *' to + access and store any pointer type will also become + more apparent (and `void *' is just another pointer-to + incomplete type). Assigning alias-set zero to `void *' + and all pointer-to incomplete types is a not appealing + solution. Assigning an effective alias-set zero only + affecting pointers might be - by recording proper subset + relationships of all pointer alias-sets. + + Pointer-to function types are another grey area which + needs caution. Globbing them all into one alias-set + or the above effective zero set would work. + + For now just assign the same alias-set to all pointers. + That's simple and avoids all the above problems. */ + else if (POINTER_TYPE_P (t) + && t != ptr_type_node) + return get_alias_set (ptr_type_node); + /* Otherwise make a new alias set for this type. */ else set = new_alias_set (); diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 692ebe65cc4..e274d6c044f 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -246,7 +246,13 @@ enum bb_flags /* Set on blocks that cannot be threaded through. Only used in cfgcleanup.c. */ - BB_NONTHREADABLE_BLOCK = 1 << 11 + BB_NONTHREADABLE_BLOCK = 1 << 11, + + /* Set on blocks that were modified in some way. This bit is set in + df_set_bb_dirty, but not cleared by df_analyze, so it can be used + to test whether a block has been modified prior to a df_analyze + call. */ + BB_MODIFIED = 1 << 12 }; /* Dummy flag for convenience in the hot/cold partitioning code. */ diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 2bf0b853165..e4996144761 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1299,7 +1299,9 @@ add_labels_and_missing_jumps (edge *crossing_edges, int n_crossing_edges) if (src && (src != ENTRY_BLOCK_PTR)) { - if (!JUMP_P (BB_END (src)) && !block_ends_with_call_p (src)) + if (!JUMP_P (BB_END (src)) + && !block_ends_with_call_p (src) + && !can_throw_internal (BB_END (src))) /* bb just falls through. */ { /* make sure there's only one successor */ @@ -1316,9 +1318,9 @@ add_labels_and_missing_jumps (edge *crossing_edges, int n_crossing_edges) src->il.rtl->footer = unlink_insn_chain (barrier, barrier); /* Mark edge as non-fallthru. */ crossing_edges[i]->flags &= ~EDGE_FALLTHRU; - } /* end: 'if (GET_CODE ... ' */ - } /* end: 'if (src && src->index...' */ - } /* end: 'if (dest && dest->index...' */ + } /* end: 'if (!JUMP_P ... ' */ + } /* end: 'if (src && src !=...' */ + } /* end: 'if (dest && dest !=...' */ } /* end: 'if (crossing_edges[i]...' */ } /* end for loop */ } @@ -1375,19 +1377,21 @@ fix_up_fall_thru_edges (void) fall_thru = succ2; cond_jump = succ1; } - else if (!fall_thru && succ1 && block_ends_with_call_p (cur_bb)) - { - edge e; - edge_iterator ei; - - /* Find EDGE_CAN_FALLTHRU edge. */ - FOR_EACH_EDGE (e, ei, cur_bb->succs) - if (e->flags & EDGE_CAN_FALLTHRU) - { - fall_thru = e; - break; - } - } + else if (succ1 + && (block_ends_with_call_p (cur_bb) + || can_throw_internal (BB_END (cur_bb)))) + { + edge e; + edge_iterator ei; + + /* Find EDGE_CAN_FALLTHRU edge. */ + FOR_EACH_EDGE (e, ei, cur_bb->succs) + if (e->flags & EDGE_CAN_FALLTHRU) + { + fall_thru = e; + break; + } + } if (fall_thru && (fall_thru->dest != EXIT_BLOCK_PTR)) { diff --git a/gcc/builtins.c b/gcc/builtins.c index e8974e1bbc2..384a81a035b 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -106,9 +106,9 @@ static void expand_errno_check (tree, rtx); static rtx expand_builtin_mathfn (tree, rtx, rtx); static rtx expand_builtin_mathfn_2 (tree, rtx, rtx); static rtx expand_builtin_mathfn_3 (tree, rtx, rtx); -static rtx expand_builtin_interclass_mathfn (tree, rtx, rtx); +static rtx expand_builtin_interclass_mathfn (tree, rtx); static rtx expand_builtin_sincos (tree); -static rtx expand_builtin_cexpi (tree, rtx, rtx); +static rtx expand_builtin_cexpi (tree, rtx); static rtx expand_builtin_int_roundingfn (tree, rtx); static rtx expand_builtin_int_roundingfn_2 (tree, rtx); static rtx expand_builtin_next_arg (void); @@ -132,7 +132,7 @@ static rtx expand_builtin_memset (tree, rtx, enum machine_mode); static rtx expand_builtin_memset_args (tree, tree, tree, rtx, enum machine_mode, tree); static rtx expand_builtin_bzero (tree); static rtx expand_builtin_strlen (tree, rtx, enum machine_mode); -static rtx expand_builtin_alloca (tree, rtx); +static rtx expand_builtin_alloca (tree, rtx, bool); static rtx expand_builtin_unop (enum machine_mode, tree, rtx, rtx, optab); static rtx expand_builtin_frame_address (tree, tree); static tree stabilize_va_list_loc (location_t, tree, int); @@ -301,11 +301,6 @@ get_object_alignment (tree exp, unsigned int max_align) align = TYPE_ALIGN (TREE_TYPE (exp)); else if (TREE_CODE (exp) == INDIRECT_REF) align = TYPE_ALIGN (TREE_TYPE (exp)); - else if (TREE_CODE (exp) == MISALIGNED_INDIRECT_REF) - { - tree op1 = TREE_OPERAND (exp, 1); - align = integer_zerop (op1) ? BITS_PER_UNIT : TREE_INT_CST_LOW (op1); - } else if (TREE_CODE (exp) == MEM_REF) { tree addr = TREE_OPERAND (exp, 0); @@ -331,9 +326,7 @@ get_object_alignment (tree exp, unsigned int max_align) max_align)); bitpos += mem_ref_offset (exp).low * BITS_PER_UNIT; } - else if (TREE_CODE (exp) == TARGET_MEM_REF - && TMR_BASE (exp) - && POINTER_TYPE_P (TREE_TYPE (TMR_BASE (exp)))) + else if (TREE_CODE (exp) == TARGET_MEM_REF) { struct ptr_info_def *pi; tree addr = TMR_BASE (exp); @@ -365,19 +358,7 @@ get_object_alignment (tree exp, unsigned int max_align) } else if (TMR_INDEX (exp)) align = BITS_PER_UNIT; - } - else if (TREE_CODE (exp) == TARGET_MEM_REF - && TMR_SYMBOL (exp)) - { - align = get_object_alignment (TMR_SYMBOL (exp), max_align); - if (TMR_OFFSET (exp)) - bitpos += TREE_INT_CST_LOW (TMR_OFFSET (exp)) * BITS_PER_UNIT; - if (TMR_INDEX (exp) && TMR_STEP (exp)) - { - unsigned HOST_WIDE_INT step = TREE_INT_CST_LOW (TMR_STEP (exp)); - align = MIN (align, (step & -step) * BITS_PER_UNIT); - } - else if (TMR_INDEX (exp)) + if (TMR_INDEX2 (exp)) align = BITS_PER_UNIT; } else @@ -1588,8 +1569,10 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX); /* Allocate a block of memory onto the stack and copy the memory - arguments to the outgoing arguments address. */ - allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT); + arguments to the outgoing arguments address. We can pass TRUE + as the 4th argument because we just saved the stack pointer + and will restore it right after the call. */ + allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT, TRUE); /* Set DRAP flag to true, even though allocate_dynamic_stack_space may have already set current_function_calls_alloca to true. @@ -2355,11 +2338,10 @@ interclass_mathfn_icode (tree arg, tree fndecl) isnan, etc). Return 0 if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin - function; if convenient, the result should be placed in TARGET. - SUBTARGET may be used as the target for computing one of EXP's operands. */ + function; if convenient, the result should be placed in TARGET. */ static rtx -expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget) +expand_builtin_interclass_mathfn (tree exp, rtx target) { enum insn_code icode = CODE_FOR_nothing; rtx op0; @@ -2392,7 +2374,7 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget) side-effects more the once. */ CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg); - op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL); + op0 = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL); if (mode != GET_MODE (op0)) op0 = convert_to_mode (mode, op0, 0); @@ -2459,11 +2441,10 @@ expand_builtin_sincos (tree exp) /* Expand a call to the internal cexpi builtin to the sincos math function. EXP is the expression that is a call to the builtin function; if convenient, - the result should be placed in TARGET. SUBTARGET may be used as the target - for computing one of EXP's operands. */ + the result should be placed in TARGET. */ static rtx -expand_builtin_cexpi (tree exp, rtx target, rtx subtarget) +expand_builtin_cexpi (tree exp, rtx target) { tree fndecl = get_callee_fndecl (exp); tree arg, type; @@ -2486,7 +2467,7 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget) op1 = gen_reg_rtx (mode); op2 = gen_reg_rtx (mode); - op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL); + op0 = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL); /* Compute into op1 and op2. */ expand_twoval_unop (sincos_optab, op0, op2, op1, 0); @@ -3232,7 +3213,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) function; if convenient, the result should be placed in TARGET. */ static rtx -expand_builtin_powi (tree exp, rtx target, rtx subtarget) +expand_builtin_powi (tree exp, rtx target) { tree arg0, arg1; rtx op0, op1; @@ -3261,7 +3242,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget) || (optimize_insn_for_speed_p () && powi_cost (n) <= POWI_MAX_MULTS))) { - op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL); + op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL); op0 = force_reg (mode, op0); return expand_powi (op0, mode, n); } @@ -3275,7 +3256,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget) if (target == NULL_RTX) target = gen_reg_rtx (mode); - op0 = expand_expr (arg0, subtarget, mode, EXPAND_NORMAL); + op0 = expand_expr (arg0, NULL_RTX, mode, EXPAND_NORMAL); if (GET_MODE (op0) != mode) op0 = convert_to_mode (mode, op0, 0); op1 = expand_expr (arg1, NULL_RTX, mode2, EXPAND_NORMAL); @@ -4739,7 +4720,7 @@ static tree dummy_object (tree type) { tree t = build_int_cst (build_pointer_type (type), 0); - return build1 (INDIRECT_REF, type, t); + return build2 (MEM_REF, type, t, t); } /* Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a @@ -4949,12 +4930,13 @@ expand_builtin_frame_address (tree fndecl, tree exp) } } -/* Expand EXP, a call to the alloca builtin. Return NULL_RTX if - we failed and the caller should emit a normal call, otherwise try to get - the result in TARGET, if convenient. */ +/* Expand EXP, a call to the alloca builtin. Return NULL_RTX if we + failed and the caller should emit a normal call, otherwise try to + get the result in TARGET, if convenient. CANNOT_ACCUMULATE is the + same as for allocate_dynamic_stack_space. */ static rtx -expand_builtin_alloca (tree exp, rtx target) +expand_builtin_alloca (tree exp, rtx target, bool cannot_accumulate) { rtx op0; rtx result; @@ -4970,7 +4952,8 @@ expand_builtin_alloca (tree exp, rtx target) op0 = expand_normal (CALL_EXPR_ARG (exp, 0)); /* Allocate the desired space. */ - result = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT); + result = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT, + cannot_accumulate); result = convert_memory_address (ptr_mode, result); return result; @@ -5015,7 +4998,10 @@ expand_builtin_unop (enum machine_mode target_mode, tree exp, rtx target, return NULL_RTX; /* Compute the argument. */ - op0 = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget, + op0 = expand_expr (CALL_EXPR_ARG (exp, 0), + (subtarget + && (TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 0))) + == GET_MODE (subtarget))) ? subtarget : NULL_RTX, VOIDmode, EXPAND_NORMAL); /* Compute op, into TARGET if possible. Set TARGET to wherever the result comes back. */ @@ -5748,6 +5734,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, tree fndecl = get_callee_fndecl (exp); enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); enum machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp)); + int flags; if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) return targetm.expand_builtin (exp, target, subtarget, mode, ignore); @@ -5770,8 +5757,8 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, none of its arguments are volatile, we can avoid expanding the built-in call and just evaluate the arguments for side-effects. */ if (target == const0_rtx - && (DECL_PURE_P (fndecl) || TREE_READONLY (fndecl)) - && !DECL_LOOPING_CONST_OR_PURE_P (fndecl)) + && ((flags = flags_from_decl_or_type (fndecl)) & (ECF_CONST | ECF_PURE)) + && !(flags & ECF_LOOPING_CONST_OR_PURE)) { bool volatilep = false; tree arg; @@ -5849,7 +5836,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, CASE_FLT_FN (BUILT_IN_FINITE): case BUILT_IN_ISFINITE: case BUILT_IN_ISNORMAL: - target = expand_builtin_interclass_mathfn (exp, target, subtarget); + target = expand_builtin_interclass_mathfn (exp, target); if (target) return target; break; @@ -5879,7 +5866,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; CASE_FLT_FN (BUILT_IN_POWI): - target = expand_builtin_powi (exp, target, subtarget); + target = expand_builtin_powi (exp, target); if (target) return target; break; @@ -5901,7 +5888,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; CASE_FLT_FN (BUILT_IN_CEXPI): - target = expand_builtin_cexpi (exp, target, subtarget); + target = expand_builtin_cexpi (exp, target); gcc_assert (target); return target; @@ -6008,7 +5995,9 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return XEXP (DECL_RTL (DECL_RESULT (current_function_decl)), 0); case BUILT_IN_ALLOCA: - target = expand_builtin_alloca (exp, target); + /* If the allocation stems from the declaration of a variable-sized + object, it cannot accumulate. */ + target = expand_builtin_alloca (exp, target, ALLOCA_FOR_VAR_P (exp)); if (target) return target; break; @@ -8466,6 +8455,27 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, return NULL_TREE; return build_call_expr_loc (loc, fn, 3, dest, src, len); } + + /* If the destination and source do not alias optimize into + memcpy as well. */ + if ((is_gimple_min_invariant (dest) + || TREE_CODE (dest) == SSA_NAME) + && (is_gimple_min_invariant (src) + || TREE_CODE (src) == SSA_NAME)) + { + ao_ref destr, srcr; + ao_ref_init_from_ptr_and_size (&destr, dest, len); + ao_ref_init_from_ptr_and_size (&srcr, src, len); + if (!refs_may_alias_p_1 (&destr, &srcr, false)) + { + tree fn; + fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; + if (!fn) + return NULL_TREE; + return build_call_expr_loc (loc, fn, 3, dest, src, len); + } + } + return NULL_TREE; } @@ -8545,12 +8555,21 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, STRIP_NOPS (srcvar); if (TREE_CODE (srcvar) == ADDR_EXPR && var_decl_component_p (TREE_OPERAND (srcvar, 0)) - && tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len) - && (!STRICT_ALIGNMENT - || !destvar - || src_align >= TYPE_ALIGN (desttype))) - srcvar = fold_build2 (MEM_REF, destvar ? desttype : srctype, - srcvar, off0); + && tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len)) + { + if (!destvar + || src_align >= TYPE_ALIGN (desttype)) + srcvar = fold_build2 (MEM_REF, destvar ? desttype : srctype, + srcvar, off0); + else if (!STRICT_ALIGNMENT) + { + srctype = build_aligned_type (TYPE_MAIN_VARIANT (desttype), + src_align); + srcvar = fold_build2 (MEM_REF, srctype, srcvar, off0); + } + else + srcvar = NULL_TREE; + } else srcvar = NULL_TREE; @@ -8559,19 +8578,31 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, if (srcvar == NULL_TREE) { - if (STRICT_ALIGNMENT - && src_align < TYPE_ALIGN (desttype)) - return NULL_TREE; STRIP_NOPS (src); - srcvar = fold_build2 (MEM_REF, desttype, src, off0); + if (src_align >= TYPE_ALIGN (desttype)) + srcvar = fold_build2 (MEM_REF, desttype, src, off0); + else + { + if (STRICT_ALIGNMENT) + return NULL_TREE; + srctype = build_aligned_type (TYPE_MAIN_VARIANT (desttype), + src_align); + srcvar = fold_build2 (MEM_REF, srctype, src, off0); + } } else if (destvar == NULL_TREE) { - if (STRICT_ALIGNMENT - && dest_align < TYPE_ALIGN (srctype)) - return NULL_TREE; STRIP_NOPS (dest); - destvar = fold_build2 (MEM_REF, srctype, dest, off0); + if (dest_align >= TYPE_ALIGN (srctype)) + destvar = fold_build2 (MEM_REF, srctype, dest, off0); + else + { + if (STRICT_ALIGNMENT) + return NULL_TREE; + desttype = build_aligned_type (TYPE_MAIN_VARIANT (srctype), + dest_align); + destvar = fold_build2 (MEM_REF, desttype, dest, off0); + } } expr = build2 (MODIFY_EXPR, TREE_TYPE (destvar), destvar, srcvar); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 10600c80074..f8be06b479f 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -118,12 +118,6 @@ static GTY(()) struct stmt_tree_s c_stmt_tree; tree c_break_label; tree c_cont_label; -/* Linked list of TRANSLATION_UNIT_DECLS for the translation units - included in this invocation. Note that the current translation - unit is not included in this list. */ - -static GTY(()) tree all_translation_units; - /* A list of decls to be made automatically visible in each file scope. */ static GTY(()) tree visible_builtins; @@ -1072,10 +1066,7 @@ pop_scope (void) context = current_function_decl; else if (scope == file_scope) { - tree file_decl = build_decl (UNKNOWN_LOCATION, - TRANSLATION_UNIT_DECL, 0, 0); - DECL_CHAIN (file_decl) = all_translation_units; - all_translation_units = file_decl; + tree file_decl = build_translation_unit_decl (NULL_TREE); context = file_decl; } else @@ -5458,6 +5449,7 @@ grokdeclarator (const struct c_declarator *declarator, if (size && integer_zerop (size)) { gcc_assert (itype); + type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); TYPE_SIZE (type) = bitsize_zero_node; TYPE_SIZE_UNIT (type) = size_zero_node; SET_TYPE_STRUCTURAL_EQUALITY (type); @@ -5466,6 +5458,7 @@ grokdeclarator (const struct c_declarator *declarator, { gcc_assert (itype); /* The type is complete. C99 6.7.5.2p4 */ + type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); TYPE_SIZE (type) = bitsize_zero_node; TYPE_SIZE_UNIT (type) = size_zero_node; SET_TYPE_STRUCTURAL_EQUALITY (type); @@ -6725,6 +6718,17 @@ detect_field_duplicates (tree fieldlist) tree x, y; int timeout = 10; + /* If the struct is the list of instance variables of an Objective-C + class, then we need to add all the instance variables of + superclasses before checking for duplicates (since you can't have + an instance variable in a subclass with the same name as an + instance variable in a superclass). objc_get_interface_ivars() + leaves fieldlist unchanged if we are not in this case, so in that + case nothing changes compared to C. + */ + if (c_dialect_objc ()) + fieldlist = objc_get_interface_ivars (fieldlist); + /* First, see if there are more than "a few" fields. This is trivially true if there are zero or one fields. */ if (!fieldlist) @@ -7343,12 +7347,13 @@ finish_enum (tree enumtype, tree values, tree attributes) /* Build and install a CONST_DECL for one value of the current enumeration type (one that was begun with start_enum). - LOC is the location of the enumerator. + DECL_LOC is the location of the enumerator. + LOC is the location of the '=' operator if any, DECL_LOC otherwise. Return a tree-list containing the CONST_DECL and its value. Assignment of sequential values by default is handled here. */ tree -build_enumerator (location_t loc, +build_enumerator (location_t decl_loc, location_t loc, struct c_enum_contents *the_enum, tree name, tree value) { tree decl, type; @@ -7436,7 +7441,7 @@ build_enumerator (location_t loc, >= TYPE_PRECISION (integer_type_node) && TYPE_UNSIGNED (type))); - decl = build_decl (loc, CONST_DECL, name, type); + decl = build_decl (decl_loc, CONST_DECL, name, type); DECL_INITIAL (decl) = convert (type, value); pushdecl (decl); @@ -9661,8 +9666,9 @@ static void collect_all_refs (const char *source_file) { tree t; + unsigned i; - for (t = all_translation_units; t; t = TREE_CHAIN (t)) + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) collect_ada_nodes (BLOCK_VARS (DECL_INITIAL (t)), source_file); } @@ -9674,8 +9680,9 @@ for_each_global_decl (void (*callback) (tree decl)) tree t; tree decls; tree decl; + unsigned i; - for (t = all_translation_units; t; t = TREE_CHAIN (t)) + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) { decls = DECL_INITIAL (t); for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl)) @@ -9690,6 +9697,7 @@ void c_write_global_declarations (void) { tree t; + unsigned i; /* We don't want to do this if generating a PCH. */ if (pch_file) @@ -9726,7 +9734,7 @@ c_write_global_declarations (void) /* Process all file scopes in this compilation, and the external_scope, through wrapup_global_declarations and check_global_declarations. */ - for (t = all_translation_units; t; t = DECL_CHAIN (t)) + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t))); c_write_global_declarations_1 (BLOCK_VARS (ext_block)); @@ -9739,7 +9747,7 @@ c_write_global_declarations (void) if (!seen_error ()) { timevar_push (TV_SYMOUT); - for (t = all_translation_units; t; t = DECL_CHAIN (t)) + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t))); c_write_global_declarations_2 (BLOCK_VARS (ext_block)); timevar_pop (TV_SYMOUT); diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 072aad4d4ca..d708edbb39c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,89 @@ +2010-09-22 Joseph Myers + + * c.opt (-all-warnings, -ansi, -assert, -assert=, -comments, + -comments-in-macros, -define-macro, -define-macro=, -dependencies, + -dump, -dump=, -imacros, -imacros=, -include, -include=, + -include-barrier, -include-directory, -include-directory=, + -include-directory-after, -include-directory-after=, + -include-prefix, -include-prefix=, -include-with-prefix, + -include-with-prefix=, -include-with-prefix-after, + -include-with-prefix-after=, -include-with-prefix-before, + -include-with-prefix-before=, -no-integrated-cpp, + -no-line-commands, -no-standard-includes, -no-warnings, -output, + -output=, -pedantic, -pedantic-errors, -preprocess, + -print-missing-file-dependencies, -trace-includes, -traditional, + -traditional-cpp, -trigraphs, -undefine-macro, -undefine-macro=, + -user-dependencies, -verbose, -write-dependencies, + -write-user-dependencies, no-integrated-cpp, traditional): New. + +2010-09-21 Nicola Pero + + PR objc/23710 + * c-common.h (objc_start_method_definition): Return bool instead + of void. + * stub-objc.c (objc_start_method_definition): Return bool instead + of void. + +2010-09-21 Nicola Pero + + PR objc/25965 + * c-common.h (objc_get_interface_ivars): New declaration. + * stub-objc.c (objc_get_interface_ivars): New stub. + +2010-09-15 Ian Lance Taylor + + * c-common.c (parse_optimize_options): Do not capitalize warning + messages. Remove period at end of warning message. + +2010-09-09 Nathan Sidwell + + * c-common.c (handle_alias_ifunc_attribute): New, broken out of ... + (handle_alias_attribute): ... here. + (handle_ifunc_attribute): New. + +2010-09-06 Mark Mitchell + + * c-common.h (do_warn_double_promotion): Declare. + * c-common.c (do_warn_double_promotion): Define. + +2010-09-05 Mark Mitchell + + * c.opt (Wdouble-promotion): New. + +2010-09-02 Joseph Myers + + * c.opt (falt-external-templates, fhuge-objects, fvtable-gc, + fvtable-thunks, fxref): Mark no longer supported in help text. + +2010-09-02 Joseph Myers + + * c.opt (Wimport, fall-virtual, falt-external-templates, + fdefault-inline, fenum-int-equiv, fexternal-templates, + fguiding-decls, fhonor-std, fhuge-objects, flabels-ok, + fname-mangling-version-, fnew-abi, fnonnull-objects, + foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable, + fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as + applicable. + (fhandle-exceptions): Mark with Alias and Warn. + * c-opts.c (c_common_handle_option): Don't handle options marked + as ignored. + +2010-09-02 Joseph Myers + + * c.opt (Wcomments, Werror-implicit-function-declaration, + ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x, + std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as + aliases. + * c-common.c (option_codes): Use OPT_Wcomment instead of + OPT_Wcomments. + * c-opts.c (warning_as_error_callback, c_common_handle_option): + Don't handle options marked as aliases. + +2010-08-25 Richard Guenther + + * c-common.c (c_common_get_alias_set): Remove special + handling for pointers. + 2010-08-20 Nathan Froyd * c-common.c: Use FOR_EACH_VEC_ELT. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index e2c5d28d08e..cf2fe17ee66 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -327,6 +327,8 @@ static tree handle_mode_attribute (tree *, tree, tree, int, bool *); static tree handle_section_attribute (tree *, tree, tree, int, bool *); static tree handle_aligned_attribute (tree *, tree, tree, int, bool *); static tree handle_weak_attribute (tree *, tree, tree, int, bool *) ; +static tree handle_alias_ifunc_attribute (bool, tree *, tree, tree, bool *); +static tree handle_ifunc_attribute (tree *, tree, tree, int, bool *); static tree handle_alias_attribute (tree *, tree, tree, int, bool *); static tree handle_weakref_attribute (tree *, tree, tree, int, bool *) ; static tree handle_visibility_attribute (tree *, tree, tree, int, @@ -599,6 +601,8 @@ const struct attribute_spec c_common_attribute_table[] = handle_aligned_attribute }, { "weak", 0, 0, true, false, false, handle_weak_attribute }, + { "ifunc", 1, 1, true, false, false, + handle_ifunc_attribute }, { "alias", 1, 1, true, false, false, handle_alias_attribute }, { "weakref", 0, 1, true, false, false, @@ -4087,37 +4091,6 @@ c_common_get_alias_set (tree t) if (t1 != t) return get_alias_set (t1); } - else if (POINTER_TYPE_P (t)) - { - tree t1; - - /* Unfortunately, there is no canonical form of a pointer type. - In particular, if we have `typedef int I', then `int *', and - `I *' are different types. So, we have to pick a canonical - representative. We do this below. - - Technically, this approach is actually more conservative that - it needs to be. In particular, `const int *' and `int *' - should be in different alias sets, according to the C and C++ - standard, since their types are not the same, and so, - technically, an `int **' and `const int **' cannot point at - the same thing. - - But, the standard is wrong. In particular, this code is - legal C++: - - int *ip; - int **ipp = &ip; - const int* const* cipp = ipp; - - And, it doesn't make sense for that to be legal unless you - can dereference IPP and CIPP. So, we ignore cv-qualifiers on - the pointed-to types. This issue has been reported to the - C++ committee. */ - t1 = build_type_no_quals (t); - if (t1 != t) - return get_alias_set (t1); - } /* Handle the case of multiple type nodes referring to "the same" type, which occurs with IMA. These share an alias set. FIXME: Currently only @@ -6626,6 +6599,12 @@ handle_weak_attribute (tree *node, tree name, error ("inline function %q+D cannot be declared weak", *node); *no_add_attrs = true; } + else if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (*node))) + { + error ("indirect function %q+D cannot be declared weak", *node); + *no_add_attrs = true; + return NULL_TREE; + } else if (TREE_CODE (*node) == FUNCTION_DECL || TREE_CODE (*node) == VAR_DECL) declare_weak (*node); @@ -6635,16 +6614,18 @@ handle_weak_attribute (tree *node, tree name, return NULL_TREE; } -/* Handle an "alias" attribute; arguments as in - struct attribute_spec.handler. */ +/* Handle an "alias" or "ifunc" attribute; arguments as in + struct attribute_spec.handler, except that IS_ALIAS tells us + whether this is an alias as opposed to ifunc attribute. */ static tree -handle_alias_attribute (tree *node, tree name, tree args, - int ARG_UNUSED (flags), bool *no_add_attrs) +handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name, tree args, + bool *no_add_attrs) { tree decl = *node; - if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) + if (TREE_CODE (decl) != FUNCTION_DECL + && (!is_alias || TREE_CODE (decl) != VAR_DECL)) { warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; @@ -6657,9 +6638,18 @@ handle_alias_attribute (tree *node, tree name, tree args, || (TREE_CODE (decl) != FUNCTION_DECL && ! TREE_PUBLIC (decl) && DECL_INITIAL (decl))) { - error ("%q+D defined both normally and as an alias", decl); + error ("%q+D defined both normally and as %qE attribute", decl, name); *no_add_attrs = true; + return NULL_TREE; } + else if (!is_alias + && (lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) + || lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))) + { + error ("weak %q+D cannot be defined %qE", decl, name); + *no_add_attrs = true; + return NULL_TREE; + } /* Note that the very first time we process a nested declaration, decl_function_context will not be set. Indeed, *would* never @@ -6673,7 +6663,7 @@ handle_alias_attribute (tree *node, tree name, tree args, id = TREE_VALUE (args); if (TREE_CODE (id) != STRING_CST) { - error ("alias argument not a string"); + error ("attribute %qE argument not a string", name); *no_add_attrs = true; return NULL_TREE; } @@ -6691,6 +6681,11 @@ handle_alias_attribute (tree *node, tree name, tree args, DECL_EXTERNAL (decl) = 0; TREE_STATIC (decl) = 1; } + + if (!is_alias) + /* ifuncs are also aliases, so set that attribute too. */ + DECL_ATTRIBUTES (decl) + = tree_cons (get_identifier ("alias"), args, DECL_ATTRIBUTES (decl)); } else { @@ -6701,6 +6696,26 @@ handle_alias_attribute (tree *node, tree name, tree args, return NULL_TREE; } +/* Handle an "alias" or "ifunc" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_ifunc_attribute (tree *node, tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + return handle_alias_ifunc_attribute (false, node, name, args, no_add_attrs); +} + +/* Handle an "alias" or "ifunc" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_alias_attribute (tree *node, tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + return handle_alias_ifunc_attribute (true, node, name, args, no_add_attrs); +} + /* Handle a "weakref" attribute; arguments as in struct attribute_spec.handler. */ @@ -6722,6 +6737,13 @@ handle_weakref_attribute (tree *node, tree ARG_UNUSED (name), tree args, return NULL_TREE; } + if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (*node))) + { + error ("indirect function %q+D cannot be declared weakref", *node); + *no_add_attrs = true; + return NULL_TREE; + } + /* The idea here is that `weakref("name")' mutates into `weakref, alias("name")', and weakref without arguments, in turn, implicitly adds weak. */ @@ -7708,10 +7730,10 @@ parse_optimize_options (tree args, bool attr_p) ret = false; if (attr_p) warning (OPT_Wattributes, - "Bad option %s to optimize attribute.", p); + "bad option %s to optimize attribute", p); else warning (OPT_Wpragmas, - "Bad option %s to pragma attribute", p); + "bad option %s to pragma attribute", p); continue; } @@ -8181,7 +8203,7 @@ struct reason_option_codes_t static const struct reason_option_codes_t option_codes[] = { {CPP_W_DEPRECATED, OPT_Wdeprecated}, - {CPP_W_COMMENTS, OPT_Wcomments}, + {CPP_W_COMMENTS, OPT_Wcomment}, {CPP_W_TRIGRAPHS, OPT_Wtrigraphs}, {CPP_W_MULTICHAR, OPT_Wmultichar}, {CPP_W_TRADITIONAL, OPT_Wtraditional}, @@ -9159,6 +9181,40 @@ warn_for_sign_compare (location_t location, } } +/* RESULT_TYPE is the result of converting TYPE1 and TYPE2 to a common + type via c_common_type. If -Wdouble-promotion is in use, and the + conditions for warning have been met, issue a warning. GMSGID is + the warning message. It must have two %T specifiers for the type + that was converted (generally "float") and the type to which it was + converted (generally "double), respectively. LOC is the location + to which the awrning should refer. */ + +void +do_warn_double_promotion (tree result_type, tree type1, tree type2, + const char *gmsgid, location_t loc) +{ + tree source_type; + + if (!warn_double_promotion) + return; + /* If the conversion will not occur at run-time, there is no need to + warn about it. */ + if (c_inhibit_evaluation_warnings) + return; + if (TYPE_MAIN_VARIANT (result_type) != double_type_node + && TYPE_MAIN_VARIANT (result_type) != complex_double_type_node) + return; + if (TYPE_MAIN_VARIANT (type1) == float_type_node + || TYPE_MAIN_VARIANT (type1) == complex_float_type_node) + source_type = type1; + else if (TYPE_MAIN_VARIANT (type2) == float_type_node + || TYPE_MAIN_VARIANT (type2) == complex_float_type_node) + source_type = type2; + else + return; + warning_at (loc, OPT_Wdouble_promotion, gmsgid, source_type, result_type); +} + /* Setup a TYPE_DECL node as a typedef representation. X is a TYPE_DECL for a typedef statement. Create a brand new diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 3f22485b6ac..de72c192edf 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -561,7 +561,7 @@ extern int flag_hosted; extern int print_struct_values; -/* ???. Undocumented. */ +/* Tells the compiler what is the constant string class for ObjC. */ extern const char *constant_string_class_name; @@ -900,6 +900,8 @@ extern void warn_for_sign_compare (location_t, tree op0, tree op1, tree result_type, enum tree_code resultcode); +extern void do_warn_double_promotion (tree, tree, tree, const char *, + location_t); extern void set_underlying_type (tree x); extern VEC(tree,gc) *make_tree_vector (void); extern void release_tree_vector (VEC(tree,gc) *); @@ -960,6 +962,7 @@ extern tree objc_build_string_object (tree); extern tree objc_get_protocol_qualified_type (tree, tree); extern tree objc_get_class_reference (tree); extern tree objc_get_class_ivars (tree); +extern tree objc_get_interface_ivars (tree); extern void objc_start_class_interface (tree, tree, tree); extern void objc_start_category_interface (tree, tree, tree); extern void objc_start_protocol (tree, tree); @@ -973,7 +976,7 @@ extern void objc_set_visibility (int); extern void objc_set_method_type (enum tree_code); extern tree objc_build_method_signature (tree, tree, tree, bool); extern void objc_add_method_declaration (tree); -extern void objc_start_method_definition (tree); +extern bool objc_start_method_definition (tree); extern void objc_finish_method_definition (tree); extern void objc_add_instance_variable (tree); extern tree objc_build_keyword_decl (tree, tree, tree); diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index b46b0a04908..e641ad029cb 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -161,7 +161,6 @@ warning_as_error_callback (int option_index) break; case OPT_Wcomment: - case OPT_Wcomments: cpp_opts->warn_comments = 1; break; @@ -493,7 +492,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wcomment: - case OPT_Wcomments: cpp_opts->warn_comments = value; break; @@ -521,13 +519,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, global_dc->warning_as_error_requested = value; break; - case OPT_Werror_implicit_function_declaration: - /* For backward compatibility, this is the same as - -Werror=implicit-function-declaration. */ - enable_warning_as_error ("implicit-function-declaration", value, - CL_C | CL_ObjC, handlers); - break; - case OPT_Wformat: set_Wformat (value); break; @@ -546,10 +537,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, value, c_family_lang_mask, kind, handlers); break; - case OPT_Wimport: - /* Silently ignore for now. */ - break; - case OPT_Winvalid_pch: cpp_opts->warn_invalid_pch = value; break; @@ -632,25 +619,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, flag_cond_mismatch = value; break; } - /* Fall through. */ - - case OPT_fall_virtual: - case OPT_falt_external_templates: - case OPT_fenum_int_equiv: - case OPT_fexternal_templates: - case OPT_fguiding_decls: - case OPT_fhonor_std: - case OPT_fhuge_objects: - case OPT_flabels_ok: - case OPT_fname_mangling_version_: - case OPT_fnew_abi: - case OPT_fnonnull_objects: - case OPT_fsquangle: - case OPT_fstrict_prototype: - case OPT_fthis_is_variable: - case OPT_fvtable_thunks: - case OPT_fxref: - case OPT_fvtable_gc: warning (0, "switch %qs is no longer supported", option->opt_text); break; @@ -681,10 +649,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, constant_string_class_name = arg; break; - case OPT_fdefault_inline: - /* Ignore. */ - break; - case OPT_fextended_identifiers: cpp_opts->extended_identifiers = value; break; @@ -693,11 +657,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, flag_next_runtime = !value; break; - case OPT_fhandle_exceptions: - warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"); - flag_exceptions = value; - break; - case OPT_fnext_runtime: flag_next_runtime = value; break; @@ -706,10 +665,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, cpp_opts->operator_names = value; break; - case OPT_foptional_diags: - /* Ignore. */ - break; - case OPT_fpch_deps: cpp_opts->restore_pch_deps = value; break; @@ -752,8 +707,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, break; case OPT_ftemplate_depth_: - /* Kept for backwards compatibility. */ - case OPT_ftemplate_depth_eq: max_tinst_depth = value; break; @@ -865,30 +818,23 @@ c_common_handle_option (size_t scode, const char *arg, int value, set_std_cxx0x (code == OPT_std_c__0x /* ISO */); break; - case OPT_std_c89: case OPT_std_c90: - case OPT_std_iso9899_1990: case OPT_std_iso9899_199409: if (!preprocessing_asm_p) set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */); break; - case OPT_std_gnu89: case OPT_std_gnu90: if (!preprocessing_asm_p) set_std_c89 (false /* c94 */, false /* ISO */); break; case OPT_std_c99: - case OPT_std_c9x: - case OPT_std_iso9899_1999: - case OPT_std_iso9899_199x: if (!preprocessing_asm_p) set_std_c99 (true /* ISO */); break; case OPT_std_gnu99: - case OPT_std_gnu9x: if (!preprocessing_asm_p) set_std_c99 (false /* ISO */); break; diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 05fedd66f02..f91eeef5a31 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -34,9 +34,153 @@ C++ Language ObjC++ +-all-warnings +C ObjC C++ ObjC++ Warning Alias(Wall) + +-ansi +C ObjC C++ ObjC++ Alias(ansi) + +-assert +C ObjC C++ ObjC++ Separate Alias(A) MissingArgError(assertion missing after %qs) + +-assert= +C ObjC C++ ObjC++ Joined Alias(A) MissingArgError(assertion missing after %qs) + +-comments +C ObjC C++ ObjC++ Alias(C) + +-comments-in-macros +C ObjC C++ ObjC++ Alias(CC) + +-define-macro +C ObjC C++ ObjC++ Separate Alias(D) MissingArgError(macro name missing after %qs) + +-define-macro= +C ObjC C++ ObjC++ Joined Alias(D) MissingArgError(macro name missing after %qs) + +-dependencies +C ObjC C++ ObjC++ Alias(M) + +-dump +C ObjC C++ ObjC++ Separate Alias(d) + +-dump= +C ObjC C++ ObjC++ Joined Alias(d) + +-imacros +C ObjC C++ ObjC++ Separate Alias(imacros) MissingArgError(missing filename after %qs) + +-imacros= +C ObjC C++ ObjC++ Joined Alias(imacros) MissingArgError(missing filename after %qs) + +-include +C ObjC C++ ObjC++ Separate Alias(include) MissingArgError(missing filename after %qs) + +-include= +C ObjC C++ ObjC++ Joined Alias(include) MissingArgError(missing filename after %qs) + +-include-barrier +C ObjC C++ ObjC++ Alias(I, -) + +-include-directory +C ObjC C++ ObjC++ Separate Alias(I) MissingArgError(missing path after %qs) + +-include-directory= +C ObjC C++ ObjC++ Joined Alias(I) MissingArgError(missing path after %qs) + +-include-directory-after +C ObjC C++ ObjC++ Separate Alias(idirafter) MissingArgError(missing path after %qs) + +-include-directory-after= +C ObjC C++ ObjC++ Joined Alias(idirafter) MissingArgError(missing path after %qs) + +-include-prefix +C ObjC C++ ObjC++ Separate Alias(iprefix) + +-include-prefix= +C ObjC C++ ObjC++ JoinedOrMissing Alias(iprefix) + +-include-with-prefix +C ObjC C++ ObjC++ Separate Alias(iwithprefix) + +-include-with-prefix= +C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefix) + +-include-with-prefix-after +C ObjC C++ ObjC++ Separate Alias(iwithprefix) + +-include-with-prefix-after= +C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefix) + +-include-with-prefix-before +C ObjC C++ ObjC++ Separate Alias(iwithprefixbefore) + +-include-with-prefix-before= +C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefixbefore) + +-no-integrated-cpp +Driver Alias(no-integrated-cpp) + +-no-line-commands +C ObjC C++ ObjC++ Alias(P) + +-no-standard-includes +C ObjC C++ ObjC++ Alias(nostdinc) + +-no-warnings +C ObjC C++ ObjC++ Alias(w) + +-output +C ObjC C++ ObjC++ Separate Alias(o) + +-output= +C ObjC C++ ObjC++ Joined Alias(o) + -output-pch= C ObjC C++ ObjC++ Joined Separate +-pedantic +C ObjC C++ ObjC++ Alias(pedantic) + +-pedantic-errors +C ObjC C++ ObjC++ Alias(pedantic-errors) + +-preprocess +C ObjC C++ ObjC++ Undocumented Alias(E) + +-print-missing-file-dependencies +C ObjC C++ ObjC++ Alias(MG) + +-trace-includes +C ObjC C++ ObjC++ Alias(H) + +-traditional +Driver Alias(traditional) + +-traditional-cpp +C ObjC C++ ObjC++ Alias(traditional-cpp) + +-trigraphs +C ObjC C++ ObjC++ Alias(trigraphs) + +-undefine-macro +C ObjC C++ ObjC++ Separate Alias(U) MissingArgError(macro name missing after %qs) + +-undefine-macro= +C ObjC C++ ObjC++ Joined Alias(U) MissingArgError(macro name missing after %qs) + +-user-dependencies +C ObjC C++ ObjC++ Alias(MM) + +-verbose +Common C ObjC C++ ObjC++ Alias(v) + +-write-dependencies +C ObjC C++ ObjC++ NoDriverArg Separate Alias(MD) MissingArgError(missing filename after %qs) + +-write-user-dependencies +C ObjC C++ ObjC++ NoDriverArg Separate Alias(MMD) MissingArgError(missing filename after %qs) + A C ObjC C++ ObjC++ Joined Separate MissingArgError(assertion missing after %qs) -A= Assert the to . Putting '-' before disables the to @@ -164,7 +308,7 @@ C ObjC C++ ObjC++ Warning Warn about possibly nested block comments, and C++ comments spanning more than one physical line Wcomments -C ObjC C++ ObjC++ Warning +C ObjC C++ ObjC++ Warning Alias(Wcomment) Synonym for -Wcomment Wconversion @@ -216,7 +360,7 @@ C ObjC C++ ObjC++ ; Documented in common.opt Werror-implicit-function-declaration -C ObjC RejectNegative Warning +C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration) This switch is deprecated; use -Werror=implicit-function-declaration instead Wfloat-equal @@ -266,6 +410,10 @@ Wimplicit C ObjC Var(warn_implicit) Init(-1) Warning Warn about implicit declarations +Wdouble-promotion +C ObjC C++ ObjC++ Var(warn_double_promotion) Warning +Warn about implicit conversions from \"float\" to \"double\" + Wimplicit-function-declaration C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning Warn about implicit function declarations @@ -275,7 +423,7 @@ C ObjC Var(warn_implicit_int) Init(-1) Warning Warn when a declaration does not specify a type Wimport -C ObjC C++ ObjC++ Undocumented +C ObjC C++ ObjC++ Undocumented Ignore Wint-to-pointer-cast C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning @@ -534,11 +682,11 @@ C++ ObjC++ Var(flag_access_control) Init(1) Enforce class member access control semantics fall-virtual -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) falt-external-templates -C++ ObjC++ -Change when template instances are emitted +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +No longer supported fasm C ObjC C++ ObjC++ Var(flag_no_asm, 0) @@ -572,7 +720,7 @@ C++ ObjC++ Var(flag_deduce_init_list) Init(1) -fno-deduce-init-list disable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list fdefault-inline -C++ ObjC++ +C++ ObjC++ Ignore Does nothing. Preserved for backward compatibility. fdirectives-only @@ -591,7 +739,7 @@ C++ ObjC++ Var(flag_enforce_eh_specs) Init(1) Generate code to check exception specifications fenum-int-equiv -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fexec-charset= C ObjC C++ ObjC++ Joined RejectNegative @@ -607,7 +755,7 @@ C ObjC C++ ObjC++ Joined RejectNegative fexternal-templates -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) ffor-scope C++ ObjC++ Var(flag_new_for_scope) Init(1) @@ -630,21 +778,21 @@ C ObjC Var(flag_gnu89_inline) Init(-1) Use traditional GNU semantics for inline functions fguiding-decls -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fhandle-exceptions -C++ ObjC++ Optimization +C++ ObjC++ Optimization Alias(fexceptions) Warn({-fhandle-exceptions has been renamed -fexceptions (and is now on by default)}) fhonor-std -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fhosted C ObjC Assume normal C execution environment fhuge-objects -C++ ObjC++ -Enable support for huge objects +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +No longer supported fimplement-inlines C++ ObjC++ Var(flag_implement_inlines) Init(1) @@ -663,7 +811,7 @@ C++ ObjC++ Var(flag_friend_injection) Inject friend functions into enclosing namespace flabels-ok -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) flax-vector-conversions C ObjC C++ ObjC++ Var(flag_lax_vector_conversions) @@ -674,10 +822,10 @@ C ObjC C++ ObjC++ Var(flag_ms_extensions) Don't warn about uses of Microsoft extensions fname-mangling-version- -C++ ObjC++ Joined +C++ ObjC++ Joined Ignore Warn(switch %qs is no longer supported) fnew-abi -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fnext-runtime ObjC ObjC++ @@ -691,7 +839,7 @@ fnonansi-builtins C++ ObjC++ Var(flag_no_nonansi_builtin, 0) fnonnull-objects -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fnothrow-opt C++ ObjC++ Optimization Var(flag_nothrow_opt) @@ -731,7 +879,7 @@ C++ ObjC++ Recognize C++ keywords like \"compl\" and \"xor\" foptional-diags -C++ ObjC++ +C++ ObjC++ Ignore Does nothing. Preserved for backward compatibility. fpch-deps @@ -786,7 +934,7 @@ C ObjC C++ ObjC++ LTO Var(flag_signed_char) Make \"char\" signed by default fsquangle -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fstats C++ ObjC++ Var(flag_detailed_statistics) @@ -797,21 +945,21 @@ C++ ObjC++ Optimization Var(flag_strict_enums) Assume that values of enumeration type are always within the minimum range of that type fstrict-prototype -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) ftabstop= C ObjC C++ ObjC++ Joined RejectNegative UInteger -ftabstop= Distance between tab stops for column reporting ftemplate-depth- -C++ ObjC++ Joined RejectNegative UInteger Undocumented +C++ ObjC++ Joined RejectNegative Undocumented Alias(ftemplate-depth=) ftemplate-depth= C++ ObjC++ Joined RejectNegative UInteger -ftemplate-depth= Specify maximum template instantiation depth fthis-is-variable -C++ ObjC++ +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fthreadsafe-statics C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1) @@ -842,12 +990,12 @@ C++ ObjC++ Var(flag_visibility_ms_compat) Changes visibility to match Microsoft Visual Studio by default fvtable-gc -C++ ObjC++ -Discard unused virtual functions +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +No longer supported fvtable-thunks -C++ ObjC++ -Implement vtables using thunks +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +No longer supported fweak C++ ObjC++ Var(flag_weak) Init(1) @@ -862,8 +1010,8 @@ C ObjC C++ ObjC++ Var(flag_working_directory) Init(-1) Generate a #line directive pointing at the current working directory fxref -C++ ObjC++ -Emit cross referencing information +C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +No longer supported fzero-link ObjC ObjC++ Var(flag_zero_link) @@ -928,6 +1076,9 @@ C ObjC C++ ObjC++ Joined Separate lang-asm C Undocumented RejectDriver +no-integrated-cpp +Driver + nostdinc C ObjC C++ ObjC++ Do not search standard system include directories (those specified with -isystem will still be used) @@ -972,7 +1123,7 @@ C ObjC Conform to the ISO 201X C standard draft (experimental and incomplete support) std=c89 -C ObjC +C ObjC Alias(std=c90) Conform to the ISO 1990 C standard std=c90 @@ -984,7 +1135,7 @@ C ObjC Conform to the ISO 1999 C standard std=c9x -C ObjC +C ObjC Alias(std=c99) Deprecated in favor of -std=c99 std=gnu++98 @@ -1003,7 +1154,7 @@ C ObjC Conform to the ISO 201X C standard draft with GNU extensions (experimental and incomplete support) std=gnu89 -C ObjC +C ObjC Alias(std=gnu90) Conform to the ISO 1990 C standard with GNU extensions std=gnu90 @@ -1015,11 +1166,11 @@ C ObjC Conform to the ISO 1999 C standard with GNU extensions std=gnu9x -C ObjC +C ObjC Alias(std=gnu99) Deprecated in favor of -std=gnu99 std=iso9899:1990 -C ObjC +C ObjC Alias(std=c90) Conform to the ISO 1990 C standard std=iso9899:199409 @@ -1027,13 +1178,16 @@ C ObjC Conform to the ISO 1990 C standard as amended in 1994 std=iso9899:1999 -C ObjC +C ObjC Alias(std=c99) Conform to the ISO 1999 C standard std=iso9899:199x -C ObjC +C ObjC Alias(std=c99) Deprecated in favor of -std=iso9899:1999 +traditional +Driver + traditional-cpp C ObjC C++ ObjC++ Enable traditional preprocessing diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c index b7748f79c6e..0ce1feffb41 100644 --- a/gcc/c-family/stub-objc.c +++ b/gcc/c-family/stub-objc.c @@ -184,9 +184,10 @@ objc_add_method_declaration (tree ARG_UNUSED (signature)) { } -void +bool objc_start_method_definition (tree ARG_UNUSED (signature)) { + return true; } void @@ -248,6 +249,12 @@ objc_get_class_reference (tree ARG_UNUSED (name)) } tree +objc_get_interface_ivars (tree ARG_UNUSED (fieldlist)) +{ + return 0; +} + +tree objc_get_protocol_qualified_type (tree ARG_UNUSED (name), tree ARG_UNUSED (protos)) { diff --git a/gcc/c-lang.h b/gcc/c-lang.h index c0bdc7cb9e5..4fe1835e5d2 100644 --- a/gcc/c-lang.h +++ b/gcc/c-lang.h @@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-common.h" #include "ggc.h" -struct GTY(()) lang_type { +struct GTY((variable_size)) lang_type { /* In a RECORD_TYPE, a sorted array of the fields of the type. */ struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s; /* In an ENUMERAL_TYPE, the min and max values. */ diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 031c6887cad..b1e6eb2ee08 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -1833,7 +1833,7 @@ c_parser_enum_specifier (c_parser *parser) bool seen_comma; c_token *token; location_t comma_loc = UNKNOWN_LOCATION; /* Quiet warning. */ - location_t value_loc; + location_t decl_loc, value_loc; if (c_parser_next_token_is_not (parser, CPP_NAME)) { c_parser_error (parser, "expected identifier"); @@ -1845,7 +1845,7 @@ c_parser_enum_specifier (c_parser *parser) enum_id = token->value; /* Set the location in case we create a decl now. */ c_parser_set_source_position_from_token (token); - value_loc = token->location; + decl_loc = value_loc = token->location; c_parser_consume_token (parser); if (c_parser_next_token_is (parser, CPP_EQ)) { @@ -1855,7 +1855,7 @@ c_parser_enum_specifier (c_parser *parser) } else enum_value = NULL_TREE; - enum_decl = build_enumerator (value_loc, + enum_decl = build_enumerator (decl_loc, value_loc, &the_enum, enum_id, enum_value); TREE_CHAIN (enum_decl) = values; values = enum_decl; @@ -6597,9 +6597,19 @@ c_parser_objc_method_definition (c_parser *parser) return; } parser->objc_pq_context = false; - objc_start_method_definition (decl); - add_stmt (c_parser_compound_statement (parser)); - objc_finish_method_definition (current_function_decl); + if (objc_start_method_definition (decl)) + { + add_stmt (c_parser_compound_statement (parser)); + objc_finish_method_definition (current_function_decl); + } + else + { + /* This code is executed when we find a method definition + outside of an @implementation context. Parse the method (to + keep going) but do not emit any code. + */ + c_parser_compound_statement (parser); + } } /* Parse an objc-methodprotolist. @@ -8004,6 +8014,42 @@ c_parser_omp_atomic (location_t loc, c_parser *parser) rhs = integer_one_node; break; + case COMPOUND_EXPR: + if (TREE_CODE (TREE_OPERAND (lhs, 0)) == SAVE_EXPR + && TREE_CODE (TREE_OPERAND (lhs, 1)) == COMPOUND_EXPR + && TREE_CODE (TREE_OPERAND (TREE_OPERAND (lhs, 1), 0)) == MODIFY_EXPR + && TREE_OPERAND (TREE_OPERAND (lhs, 1), 1) == TREE_OPERAND (lhs, 0) + && TREE_CODE (TREE_TYPE (TREE_OPERAND (TREE_OPERAND + (TREE_OPERAND (lhs, 1), 0), 0))) + == BOOLEAN_TYPE) + /* Undo effects of boolean_increment for post {in,de}crement. */ + lhs = TREE_OPERAND (TREE_OPERAND (lhs, 1), 0); + /* FALLTHRU */ + case MODIFY_EXPR: + if (TREE_CODE (lhs) == MODIFY_EXPR + && TREE_CODE (TREE_TYPE (TREE_OPERAND (lhs, 0))) == BOOLEAN_TYPE) + { + /* Undo effects of boolean_increment. */ + if (integer_onep (TREE_OPERAND (lhs, 1))) + { + /* This is pre or post increment. */ + rhs = TREE_OPERAND (lhs, 1); + lhs = TREE_OPERAND (lhs, 0); + code = NOP_EXPR; + break; + } + if (TREE_CODE (TREE_OPERAND (lhs, 1)) == TRUTH_NOT_EXPR + && TREE_OPERAND (lhs, 0) + == TREE_OPERAND (TREE_OPERAND (lhs, 1), 0)) + { + /* This is pre or post decrement. */ + rhs = TREE_OPERAND (lhs, 1); + lhs = TREE_OPERAND (lhs, 0); + code = NOP_EXPR; + break; + } + } + /* FALLTHRU */ default: switch (c_parser_peek_token (parser)->type) { diff --git a/gcc/c-tree.h b/gcc/c-tree.h index a04d45c8eb1..ff349e3723a 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -427,7 +427,8 @@ extern int quals_from_declspecs (const struct c_declspecs *); extern struct c_declarator *build_array_declarator (location_t, tree, struct c_declspecs *, bool, bool); -extern tree build_enumerator (location_t, struct c_enum_contents *, tree, tree); +extern tree build_enumerator (location_t, location_t, struct c_enum_contents *, + tree, tree); extern tree check_for_loop_decls (location_t); extern void mark_forward_parm_decls (void); extern void declare_parm_level (void); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 164cda8d54e..065e9b802c7 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1038,17 +1038,6 @@ comptypes_internal (const_tree type1, const_tree type2, bool *enum_and_int_p, || TREE_CODE (t1) == ERROR_MARK || TREE_CODE (t2) == ERROR_MARK) return 1; - /* If either type is the internal version of sizetype, return the - language version. */ - if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1) - && TYPE_ORIG_SIZE_TYPE (t1)) - t1 = TYPE_ORIG_SIZE_TYPE (t1); - - if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2) - && TYPE_ORIG_SIZE_TYPE (t2)) - t2 = TYPE_ORIG_SIZE_TYPE (t2); - - /* Enumerated types are compatible with integer types, but this is not transitive: two enumerated types in the same translation unit are compatible with each other only if they are the same type. */ @@ -2908,8 +2897,13 @@ convert_arguments (tree typelist, VEC(tree,gc) *values, if (type == void_type_node) { - error_at (input_location, - "too many arguments to function %qE", function); + if (selector) + error_at (input_location, + "too many arguments to method %qE", selector); + else + error_at (input_location, + "too many arguments to function %qE", function); + if (fundecl && !DECL_BUILT_IN (fundecl)) inform (DECL_SOURCE_LOCATION (fundecl), "declared here"); return parmnum; @@ -3106,8 +3100,15 @@ convert_arguments (tree typelist, VEC(tree,gc) *values, if (type_generic) parmval = val; else - /* Convert `float' to `double'. */ - parmval = convert (double_type_node, val); + { + /* Convert `float' to `double'. */ + if (warn_double_promotion && !c_inhibit_evaluation_warnings) + warning (OPT_Wdouble_promotion, + "implicit conversion from %qT to %qT when passing " + "argument to function", + valtype, double_type_node); + parmval = convert (double_type_node, val); + } } else if (excess_precision && !type_generic) /* A "double" argument with excess precision being passed @@ -4140,6 +4141,10 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp, || code2 == COMPLEX_TYPE)) { result_type = c_common_type (type1, type2); + do_warn_double_promotion (result_type, type1, type2, + "implicit conversion from %qT to %qT to " + "match other result of conditional", + colon_loc); /* If -Wsign-compare, warn here if type1 and type2 have different signedness. We'll promote the signed to unsigned @@ -9822,6 +9827,11 @@ build_binary_op (location_t location, enum tree_code code, if (shorten || common || short_compare) { result_type = c_common_type (type0, type1); + do_warn_double_promotion (result_type, type0, type1, + "implicit conversion from %qT to %qT " + "to match other operand of binary " + "expression", + location); if (result_type == error_mark_node) return error_mark_node; } diff --git a/gcc/calls.c b/gcc/calls.c index cd0d9c593f3..b3109cee8d2 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -601,7 +601,7 @@ flags_from_decl_or_type (const_tree exp) flags |= ECF_RETURNS_TWICE; /* Process the pure and const attributes. */ - if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) + if (TREE_READONLY (exp)) flags |= ECF_CONST; if (DECL_PURE_P (exp)) flags |= ECF_PURE; @@ -616,11 +616,15 @@ flags_from_decl_or_type (const_tree exp) flags = special_function_p (exp, flags); } - else if (TYPE_P (exp) && TYPE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) + else if (TYPE_P (exp) && TYPE_READONLY (exp)) flags |= ECF_CONST; if (TREE_THIS_VOLATILE (exp)) - flags |= ECF_NORETURN; + { + flags |= ECF_NORETURN; + if (flags & (ECF_CONST|ECF_PURE)) + flags |= ECF_LOOPING_CONST_OR_PURE; + } return flags; } @@ -1091,9 +1095,13 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, pending_stack_adjust = 0; } + /* We can pass TRUE as the 4th argument because we just + saved the stack pointer and will restore it right after + the call. */ copy = gen_rtx_MEM (BLKmode, allocate_dynamic_stack_space - (size_rtx, NULL_RTX, TYPE_ALIGN (type))); + (size_rtx, NULL_RTX, + TYPE_ALIGN (type), TRUE)); set_mem_attributes (copy, type, 1); } else @@ -1892,7 +1900,7 @@ avoid_likely_spilled_reg (rtx x) if (REG_P (x) && HARD_REGISTER_P (x) - && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (x)))) + && targetm.class_likely_spilled_p (REGNO_REG_CLASS (REGNO (x)))) { /* Make sure that we generate a REG rather than a CONCAT. Moves into CONCATs can need nontrivial instructions, @@ -2377,6 +2385,19 @@ expand_call (tree exp, rtx target, int ignore) preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT; + if (SUPPORTS_STACK_ALIGNMENT) + { + /* All variable sized adjustments must be multiple of preferred + stack boundary. Stack alignment may change preferred stack + boundary after variable sized adjustments have been made. We + need to compensate it here. */ + unsigned HOST_WIDE_INT delta + = ((stack_pointer_delta - pending_stack_adjust) + % preferred_unit_stack_boundary); + if (delta) + anti_adjust_stack (GEN_INT (preferred_unit_stack_boundary - delta)); + } + /* We want to make two insn chains; one for a sibling call, the other for a normal call. We will select one of the two chains after initial RTL generation is complete. */ @@ -2488,6 +2509,8 @@ expand_call (tree exp, rtx target, int ignore) stack_arg_under_construction = 0; } argblock = push_block (ARGS_SIZE_RTX (adjusted_args_size), 0, 0); + if (flag_stack_usage) + current_function_has_unbounded_dynamic_stack_size = 1; } else { @@ -2649,8 +2672,11 @@ expand_call (tree exp, rtx target, int ignore) stack_usage_map = stack_usage_map_buf; highest_outgoing_arg_in_use = 0; } + /* We can pass TRUE as the 4th argument because we just + saved the stack pointer and will restore it right after + the call. */ allocate_dynamic_stack_space (push_size, NULL_RTX, - BITS_PER_UNIT); + BITS_PER_UNIT, TRUE); } /* If argument evaluation might modify the stack pointer, @@ -2690,6 +2716,19 @@ expand_call (tree exp, rtx target, int ignore) be deferred during the evaluation of the arguments. */ NO_DEFER_POP; + /* Record the maximum pushed stack space size. We need to delay + doing it this far to take into account the optimization done + by combine_pending_stack_adjustment_and_call. */ + if (flag_stack_usage + && !ACCUMULATE_OUTGOING_ARGS + && pass + && adjusted_args_size.var == 0) + { + int pushed = adjusted_args_size.constant + pending_stack_adjust; + if (pushed > current_function_pushed_stack_size) + current_function_pushed_stack_size = pushed; + } + funexp = rtx_for_function_call (fndecl, addr); /* Figure out the register where the value, if any, will come back. */ @@ -3547,6 +3586,13 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if (args_size.constant > crtl->outgoing_args_size) crtl->outgoing_args_size = args_size.constant; + if (flag_stack_usage && !ACCUMULATE_OUTGOING_ARGS) + { + int pushed = args_size.constant + pending_stack_adjust; + if (pushed > current_function_pushed_stack_size) + current_function_pushed_stack_size = pushed; + } + if (ACCUMULATE_OUTGOING_ARGS) { /* Since the stack pointer will never be pushed, it is possible for diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 9ded1e6215b..6b128ebe549 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -66,6 +66,10 @@ static bool first_pass; /* Set to true if crossjumps occured in the latest run of try_optimize_cfg. */ static bool crossjumps_occured; +/* Set to true if we couldn't run an optimization due to stale liveness + information; we should run df_analyze to enable more opportunities. */ +static bool block_was_dirty; + static bool try_crossjump_to_edge (int, edge, edge); static bool try_crossjump_bb (int, basic_block); static bool outgoing_edges_match (int, basic_block, basic_block); @@ -432,7 +436,7 @@ try_forward_edges (int mode, basic_block b) int counter, goto_locus; bool threaded = false; int nthreaded_edges = 0; - bool may_thread = first_pass | df_get_bb_dirty (b); + bool may_thread = first_pass || (b->flags & BB_MODIFIED) != 0; /* Skip complex edges because we don't know how to update them. @@ -467,7 +471,7 @@ try_forward_edges (int mode, basic_block b) { basic_block new_target = NULL; bool new_target_threaded = false; - may_thread |= df_get_bb_dirty (target); + may_thread |= (target->flags & BB_MODIFIED) != 0; if (FORWARDER_BLOCK_P (target) && !(single_succ_edge (target)->flags & EDGE_CROSSING) @@ -1857,8 +1861,8 @@ try_crossjump_bb (int mode, basic_block bb) /* If nothing changed since the last attempt, there is nothing we can do. */ if (!first_pass - && (!(df_get_bb_dirty (e->src)) - && !(df_get_bb_dirty (fallthru->src)))) + && !((e->src->flags & BB_MODIFIED) + || (fallthru->src->flags & BB_MODIFIED))) continue; if (try_crossjump_to_edge (mode, e, fallthru)) @@ -1907,8 +1911,8 @@ try_crossjump_bb (int mode, basic_block bb) /* If nothing changed since the last attempt, there is nothing we can do. */ if (!first_pass - && (!(df_get_bb_dirty (e->src)) - && !(df_get_bb_dirty (e2->src)))) + && !((e->src->flags & BB_MODIFIED) + || (e2->src->flags & BB_MODIFIED))) continue; if (try_crossjump_to_edge (mode, e, e2)) @@ -1927,6 +1931,265 @@ try_crossjump_bb (int mode, basic_block bb) return changed; } +/* Search the successors of BB for common insn sequences. When found, + share code between them by moving it across the basic block + boundary. Return true if any changes made. */ + +static bool +try_head_merge_bb (basic_block bb) +{ + basic_block final_dest_bb = NULL; + int max_match = INT_MAX; + edge e0; + rtx *headptr, *currptr; + bool changed, moveall; + unsigned ix; + rtx e0_last_head, cond, move_before; + unsigned nedges = EDGE_COUNT (bb->succs); + rtx jump = BB_END (bb); + regset live, live_union; + + /* Nothing to do if there is not at least two outgoing edges. */ + if (nedges < 2) + return false; + + /* Don't crossjump if this block ends in a computed jump, + unless we are optimizing for size. */ + if (optimize_bb_for_size_p (bb) + && bb != EXIT_BLOCK_PTR + && computed_jump_p (BB_END (bb))) + return false; + + cond = get_condition (jump, &move_before, true, false); + if (cond == NULL_RTX) + move_before = jump; + + for (ix = 0; ix < nedges; ix++) + if (EDGE_SUCC (bb, ix)->dest == EXIT_BLOCK_PTR) + return false; + + for (ix = 0; ix < nedges; ix++) + { + edge e = EDGE_SUCC (bb, ix); + basic_block other_bb = e->dest; + + if (df_get_bb_dirty (other_bb)) + { + block_was_dirty = true; + return false; + } + + if (e->flags & EDGE_ABNORMAL) + return false; + + /* Normally, all destination blocks must only be reachable from this + block, i.e. they must have one incoming edge. + + There is one special case we can handle, that of multiple consecutive + jumps where the first jumps to one of the targets of the second jump. + This happens frequently in switch statements for default labels. + The structure is as follows: + FINAL_DEST_BB + .... + if (cond) jump A; + fall through + BB + jump with targets A, B, C, D... + A + has two incoming edges, from FINAL_DEST_BB and BB + + In this case, we can try to move the insns through BB and into + FINAL_DEST_BB. */ + if (EDGE_COUNT (other_bb->preds) != 1) + { + edge incoming_edge, incoming_bb_other_edge; + edge_iterator ei; + + if (final_dest_bb != NULL + || EDGE_COUNT (other_bb->preds) != 2) + return false; + + /* We must be able to move the insns across the whole block. */ + move_before = BB_HEAD (bb); + while (!NONDEBUG_INSN_P (move_before)) + move_before = NEXT_INSN (move_before); + + if (EDGE_COUNT (bb->preds) != 1) + return false; + incoming_edge = EDGE_PRED (bb, 0); + final_dest_bb = incoming_edge->src; + if (EDGE_COUNT (final_dest_bb->succs) != 2) + return false; + FOR_EACH_EDGE (incoming_bb_other_edge, ei, final_dest_bb->succs) + if (incoming_bb_other_edge != incoming_edge) + break; + if (incoming_bb_other_edge->dest != other_bb) + return false; + } + } + + e0 = EDGE_SUCC (bb, 0); + e0_last_head = NULL_RTX; + changed = false; + + for (ix = 1; ix < nedges; ix++) + { + edge e = EDGE_SUCC (bb, ix); + rtx e0_last, e_last; + int nmatch; + + nmatch = flow_find_head_matching_sequence (e0->dest, e->dest, + &e0_last, &e_last, 0); + if (nmatch == 0) + return false; + + if (nmatch < max_match) + { + max_match = nmatch; + e0_last_head = e0_last; + } + } + + /* If we matched an entire block, we probably have to avoid moving the + last insn. */ + if (max_match > 0 + && e0_last_head == BB_END (e0->dest) + && (find_reg_note (e0_last_head, REG_EH_REGION, 0) + || control_flow_insn_p (e0_last_head))) + { + max_match--; + if (max_match == 0) + return false; + do + e0_last_head = prev_real_insn (e0_last_head); + while (DEBUG_INSN_P (e0_last_head)); + } + + if (max_match == 0) + return false; + + /* We must find a union of the live registers at each of the end points. */ + live = BITMAP_ALLOC (NULL); + live_union = BITMAP_ALLOC (NULL); + + currptr = XNEWVEC (rtx, nedges); + headptr = XNEWVEC (rtx, nedges); + + for (ix = 0; ix < nedges; ix++) + { + int j; + basic_block merge_bb = EDGE_SUCC (bb, ix)->dest; + rtx head = BB_HEAD (merge_bb); + + while (!NONDEBUG_INSN_P (head)) + head = NEXT_INSN (head); + headptr[ix] = head; + currptr[ix] = head; + + /* Compute the end point and live information */ + for (j = 1; j < max_match; j++) + do + head = NEXT_INSN (head); + while (!NONDEBUG_INSN_P (head)); + simulate_backwards_to_point (merge_bb, live, head); + IOR_REG_SET (live_union, live); + } + + /* If we're moving across two blocks, verify the validity of the + first move, then adjust the target and let the loop below deal + with the final move. */ + if (final_dest_bb != NULL) + { + rtx move_upto; + + moveall = can_move_insns_across (currptr[0], e0_last_head, move_before, + jump, e0->dest, live_union, + NULL, &move_upto); + if (!moveall) + e0_last_head = move_upto; + if (e0_last_head == NULL_RTX) + goto out; + + jump = BB_END (final_dest_bb); + cond = get_condition (jump, &move_before, true, false); + if (cond == NULL_RTX) + move_before = jump; + } + + do + { + rtx move_upto; + moveall = can_move_insns_across (currptr[0], e0_last_head, + move_before, jump, e0->dest, live_union, + NULL, &move_upto); + if (!moveall && move_upto == NULL_RTX) + { + if (jump == move_before) + break; + + /* Try again, using a different insertion point. */ + move_before = jump; + continue; + } + + if (final_dest_bb && !moveall) + /* We haven't checked whether a partial move would be OK for the first + move, so we have to fail this case. */ + break; + + changed = true; + for (;;) + { + if (currptr[0] == move_upto) + break; + for (ix = 0; ix < nedges; ix++) + { + rtx curr = currptr[ix]; + do + curr = NEXT_INSN (curr); + while (!NONDEBUG_INSN_P (curr)); + currptr[ix] = curr; + } + } + + reorder_insns (headptr[0], currptr[0], PREV_INSN (move_before)); + df_set_bb_dirty (EDGE_SUCC (bb, 0)->dest); + if (final_dest_bb != NULL) + df_set_bb_dirty (final_dest_bb); + df_set_bb_dirty (bb); + for (ix = 1; ix < nedges; ix++) + { + df_set_bb_dirty (EDGE_SUCC (bb, ix)->dest); + delete_insn_chain (headptr[ix], currptr[ix], false); + } + if (!moveall) + { + if (jump == move_before) + break; + + /* Try again, using a different insertion point. */ + move_before = jump; + for (ix = 0; ix < nedges; ix++) + { + rtx curr = currptr[ix]; + do + curr = NEXT_INSN (curr); + while (!NONDEBUG_INSN_P (curr)); + currptr[ix] = headptr[ix] = curr; + } + } + } + while (!moveall); + + out: + free (currptr); + free (headptr); + + crossjumps_occured |= changed; + + return changed; +} + /* Return true if BB contains just bb note, or bb note followed by only DEBUG_INSNs. */ @@ -1972,6 +2235,7 @@ try_optimize_cfg (int mode) one predecessor, they may be combined. */ do { + block_was_dirty = false; changed = false; iterations++; @@ -2170,6 +2434,13 @@ try_optimize_cfg (int mode) && try_crossjump_bb (mode, b)) changed_here = true; + if ((mode & CLEANUP_CROSSJUMP) + /* This can lengthen register lifetimes. Do it only after + reload. */ + && reload_completed + && try_head_merge_bb (b)) + changed_here = true; + /* Don't get confused by the index shift caused by deleting blocks. */ if (!changed_here) @@ -2182,6 +2453,13 @@ try_optimize_cfg (int mode) && try_crossjump_bb (mode, EXIT_BLOCK_PTR)) changed = true; + if (block_was_dirty) + { + /* This should only be set by head-merging. */ + gcc_assert (mode & CLEANUP_CROSSJUMP); + df_analyze (); + } + #ifdef ENABLE_CHECKING if (changed) verify_flow_info (); @@ -2366,8 +2644,7 @@ cleanup_cfg (int mode) if ((mode & CLEANUP_EXPENSIVE) && !reload_completed && !delete_trivially_dead_insns (get_insns (), max_reg_num ())) break; - else if ((mode & CLEANUP_CROSSJUMP) - && crossjumps_occured) + if ((mode & CLEANUP_CROSSJUMP) && crossjumps_occured) run_fast_dce (); } else diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index bf1149f9560..f9d3fa6087e 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -205,19 +205,11 @@ static bool has_protected_decls; smaller than our cutoff threshold. Used for -Wstack-protector. */ static bool has_short_buffer; -/* Discover the byte alignment to use for DECL. Ignore alignment - we can't do with expected alignment of the stack boundary. */ +/* Update stack alignment requirement. */ -static unsigned int -get_decl_align_unit (tree decl) +static void +update_stack_alignment (unsigned int align) { - unsigned int align; - - align = LOCAL_DECL_ALIGNMENT (decl); - - if (align > MAX_SUPPORTED_STACK_ALIGNMENT) - align = MAX_SUPPORTED_STACK_ALIGNMENT; - if (SUPPORTS_STACK_ALIGNMENT) { if (crtl->stack_alignment_estimated < align) @@ -233,6 +225,22 @@ get_decl_align_unit (tree decl) crtl->stack_alignment_needed = align; if (crtl->max_used_stack_slot_alignment < align) crtl->max_used_stack_slot_alignment = align; +} + +/* Discover the byte alignment to use for DECL. Ignore alignment + we can't do with expected alignment of the stack boundary. */ + +static unsigned int +get_decl_align_unit (tree decl) +{ + unsigned int align; + + align = LOCAL_DECL_ALIGNMENT (decl); + + if (align > MAX_SUPPORTED_STACK_ALIGNMENT) + align = MAX_SUPPORTED_STACK_ALIGNMENT; + + update_stack_alignment (align); return align / BITS_PER_UNIT; } @@ -730,8 +738,7 @@ expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset) offset -= frame_phase; align = offset & -offset; align *= BITS_PER_UNIT; - max_align = MAX (crtl->max_used_stack_slot_alignment, - PREFERRED_STACK_BOUNDARY); + max_align = crtl->max_used_stack_slot_alignment; if (align == 0 || align > max_align) align = max_align; @@ -2450,7 +2457,6 @@ expand_debug_expr (tree exp) return NULL; /* Fallthru. */ case INDIRECT_REF: - case MISALIGNED_INDIRECT_REF: op0 = expand_debug_expr (TREE_OPERAND (exp, 0)); if (!op0) return NULL; @@ -2468,7 +2474,8 @@ expand_debug_expr (tree exp) return op0; case TARGET_MEM_REF: - if (TMR_SYMBOL (exp) && !DECL_RTL_SET_P (TMR_SYMBOL (exp))) + if (TREE_CODE (TMR_BASE (exp)) == ADDR_EXPR + && !DECL_RTL_SET_P (TREE_OPERAND (TMR_BASE (exp), 0))) return NULL; op0 = expand_debug_expr @@ -2911,7 +2918,32 @@ expand_debug_expr (tree exp) case ADDR_EXPR: op0 = expand_debug_expr (TREE_OPERAND (exp, 0)); if (!op0 || !MEM_P (op0)) - return NULL; + { + if ((TREE_CODE (TREE_OPERAND (exp, 0)) == VAR_DECL + || TREE_CODE (TREE_OPERAND (exp, 0)) == PARM_DECL + || TREE_CODE (TREE_OPERAND (exp, 0)) == RESULT_DECL) + && !TREE_ADDRESSABLE (TREE_OPERAND (exp, 0))) + return gen_rtx_DEBUG_IMPLICIT_PTR (mode, TREE_OPERAND (exp, 0)); + + if (handled_component_p (TREE_OPERAND (exp, 0))) + { + HOST_WIDE_INT bitoffset, bitsize, maxsize; + tree decl + = get_ref_base_and_extent (TREE_OPERAND (exp, 0), + &bitoffset, &bitsize, &maxsize); + if ((TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL + || TREE_CODE (decl) == RESULT_DECL) + && !TREE_ADDRESSABLE (decl) + && (bitoffset % BITS_PER_UNIT) == 0 + && bitsize > 0 + && bitsize == maxsize) + return plus_constant (gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl), + bitoffset / BITS_PER_UNIT); + } + + return NULL; + } op0 = convert_debug_memory_address (mode, XEXP (op0, 0)); diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 58c04787423..e93e4077088 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -955,7 +955,7 @@ fixup_reorder_chain (void) insn = BB_END (e->src); end = PREV_INSN (BB_HEAD (e->src)); while (insn != end - && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0)) + && (!NONDEBUG_INSN_P (insn) || INSN_LOCATOR (insn) == 0)) insn = PREV_INSN (insn); if (insn != end && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus)) @@ -970,7 +970,7 @@ fixup_reorder_chain (void) { insn = BB_HEAD (e->dest); end = NEXT_INSN (BB_END (e->dest)); - while (insn != end && !INSN_P (insn)) + while (insn != end && !NONDEBUG_INSN_P (insn)) insn = NEXT_INSN (insn); if (insn != end && INSN_LOCATOR (insn) && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus)) diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 722aa337c28..bf2614e136f 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -276,7 +276,7 @@ gcov_type expected_loop_iterations_unbounded (const struct loop *); extern unsigned expected_loop_iterations (const struct loop *); extern rtx doloop_condition_get (rtx); -void estimate_numbers_of_iterations_loop (struct loop *); +void estimate_numbers_of_iterations_loop (struct loop *, bool); HOST_WIDE_INT estimated_loop_iterations_int (struct loop *, bool); bool estimated_loop_iterations (struct loop *, bool, double_int *); diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 3138281b589..f7ce55841b7 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -421,7 +421,10 @@ rest_of_pass_free_cfg (void) /* The resource.c machinery uses DF but the CFG isn't guaranteed to be valid at that point so it would be too late to call df_analyze. */ if (optimize > 0 && flag_delayed_branch) - df_analyze (); + { + df_note_add_problem (); + df_analyze (); + } #endif free_bb_for_insn (); diff --git a/gcc/cgraph.h b/gcc/cgraph.h index f77a280d12f..ec90894317e 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -503,6 +503,8 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) varpool_node { During WPA output it is used to mark nodes that are present in multiple partitions. */ unsigned in_other_partition : 1; + /* True when variable is constant and its value is known. */ + unsigned int const_value_known : 1; }; /* Every top level asm statement is put into a cgraph_asm_node. */ @@ -726,6 +728,7 @@ void varpool_empty_needed_queue (void); bool varpool_extra_name_alias (tree, tree); const char * varpool_node_name (struct varpool_node *node); void varpool_reset_queue (void); +bool const_value_known_p (tree); /* Walk all reachable static variables. */ #define FOR_EACH_STATIC_VARIABLE(node) \ diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 024a3bc2eed..b51a71c2b72 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -363,7 +363,13 @@ cgraph_finalize_function (tree decl, bool nested) there. */ if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) || DECL_STATIC_CONSTRUCTOR (decl) - || DECL_STATIC_DESTRUCTOR (decl)) + || DECL_STATIC_DESTRUCTOR (decl) + /* COMDAT virtual functions may be referenced by vtable from + other compilatoin unit. Still we want to devirtualize calls + to those so we need to analyze them. + FIXME: We should introduce may edges for this purpose and update + their handling in unreachable function removal and inliner too. */ + || (DECL_VIRTUAL_P (decl) && (DECL_COMDAT (decl) || DECL_EXTERNAL (decl)))) cgraph_mark_reachable_node (node); /* If we've not yet emitted decl, tell the debug info about it. */ @@ -861,6 +867,7 @@ cgraph_analyze_functions (void) static struct varpool_node *first_analyzed_var; struct cgraph_node *node, *next; + bitmap_obstack_initialize (NULL); process_function_and_variable_attributes (first_processed, first_analyzed_var); first_processed = cgraph_nodes; @@ -971,6 +978,7 @@ cgraph_analyze_functions (void) fprintf (cgraph_dump_file, "\n\nReclaimed "); dump_cgraph (cgraph_dump_file); } + bitmap_obstack_release (NULL); first_analyzed = cgraph_nodes; ggc_collect (); } @@ -2151,6 +2159,7 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e) new_stmt = gimple_call_copy_skip_args (e->call_stmt, e->callee->clone.combined_args_to_skip); + gimple_call_set_fndecl (new_stmt, e->callee->decl); if (gimple_vdef (new_stmt) && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME) @@ -2160,10 +2169,11 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e) gsi_replace (&gsi, new_stmt, true); } else - new_stmt = e->call_stmt; - - gimple_call_set_fndecl (new_stmt, e->callee->decl); - update_stmt (new_stmt); + { + new_stmt = e->call_stmt; + gimple_call_set_fndecl (new_stmt, e->callee->decl); + update_stmt (new_stmt); + } cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt); diff --git a/gcc/cif-code.def b/gcc/cif-code.def index 4898486c315..fda104a51bd 100644 --- a/gcc/cif-code.def +++ b/gcc/cif-code.def @@ -88,3 +88,5 @@ DEFCIFCODE(ORIGINALLY_INDIRECT_CALL, /* Ths edge represents an indirect edge with a yet-undetermined callee . */ DEFCIFCODE(INDIRECT_UNKNOWN_CALL, N_("indirect function call with a yet undetermined callee")) + +DEFCIFCODE(OVERWRITABLE, N_("function body can be overwriten at linktime")) diff --git a/gcc/collect2.c b/gcc/collect2.c index b26aaf31485..a8cd232c550 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -942,12 +942,16 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, { char **lto_c_argv; const char **lto_c_ptr; - const char **p, **q, **r; - const char **lto_o_ptr; + char **p; + char **lto_o_ptr; struct lto_object *list; char *lto_wrapper = getenv ("COLLECT_LTO_WRAPPER"); struct pex_obj *pex; const char *prog = "lto-wrapper"; + int lto_ld_argv_size = 0; + char **out_lto_ld_argv; + int out_lto_ld_argv_size; + size_t num_files; if (!lto_wrapper) fatal ("COLLECT_LTO_WRAPPER must be set."); @@ -955,7 +959,11 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, num_lto_c_args++; /* There is at least one object file containing LTO info, - so we need to run the LTO back end and relink. */ + so we need to run the LTO back end and relink. + + To do so we build updated ld arguments with first + LTO object replaced by all partitions and other LTO + objects removed. */ lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args); lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv); @@ -973,7 +981,7 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, { int c; FILE *stream; - size_t i, num_files; + size_t i; char *start, *end; stream = pex_read_output (pex, 0); @@ -1007,55 +1015,50 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, do_wait (prog, pex); pex = NULL; + /* Compute memory needed for new LD arguments. At most number of original arguemtns + plus number of partitions. */ + for (lto_ld_argv_size = 0; lto_ld_argv[lto_ld_argv_size]; lto_ld_argv_size++) + ; + out_lto_ld_argv = XCNEWVEC(char *, num_files + lto_ld_argv_size + 1); + out_lto_ld_argv_size = 0; + /* After running the LTO back end, we will relink, substituting the LTO output for the object files that we submitted to the LTO. Here, we modify the linker command line for the relink. */ - p = CONST_CAST2 (const char **, char **, lto_ld_argv); - lto_o_ptr = CONST_CAST2 (const char **, char **, lto_o_files); + /* Copy all arguments until we find first LTO file. */ + p = lto_ld_argv; while (*p != NULL) { for (list = lto_objects.first; list; list = list->next) - { - if (*p == list->name) /* Note test for pointer equality! */ - { - /* Excise argument from linker command line. */ - if (*lto_o_ptr) - { - /* Replace first argument with LTO output file. */ - *p++ = *lto_o_ptr++; - } - else - { - /* Move following arguments one position earlier, - overwriting the current argument. */ - q = p; - r = p + 1; - while (*r != NULL) - *q++ = *r++; - *q = NULL; - } - - /* No need to continue searching the LTO object list. */ - break; - } - } - - /* If we didn't find a match, move on to the next argument. - Otherwise, P has been set to the correct argument position - at which to continue. */ - if (!list) ++p; + if (*p == list->name) /* Note test for pointer equality! */ + break; + if (list) + break; + out_lto_ld_argv[out_lto_ld_argv_size++] = *p++; } - /* The code above assumes we will never have more lto output files than - input files. Otherwise, we need to resize lto_ld_argv. Check this - assumption. */ - if (*lto_o_ptr) - fatal ("too many lto output files"); + /* Now insert all LTO partitions. */ + lto_o_ptr = lto_o_files; + while (*lto_o_ptr) + out_lto_ld_argv[out_lto_ld_argv_size++] = *lto_o_ptr++; + + /* ... and copy the rest. */ + while (*p != NULL) + { + for (list = lto_objects.first; list; list = list->next) + if (*p == list->name) /* Note test for pointer equality! */ + break; + if (!list) + out_lto_ld_argv[out_lto_ld_argv_size++] = *p; + p++; + } + out_lto_ld_argv[out_lto_ld_argv_size++] = 0; /* Run the linker again, this time replacing the object files optimized by the LTO with the temporary file generated by the LTO. */ - fork_execute ("ld", lto_ld_argv); + fork_execute ("ld", out_lto_ld_argv); + free (lto_ld_argv); maybe_unlink_list (lto_o_files); } diff --git a/gcc/combine.c b/gcc/combine.c index 1f8e97007ee..6131b413d1d 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2137,12 +2137,12 @@ cant_combine_insn_p (rtx insn) if (GET_CODE (dest) == SUBREG) dest = SUBREG_REG (dest); if (REG_P (src) && REG_P (dest) - && ((REGNO (src) < FIRST_PSEUDO_REGISTER - && ! fixed_regs[REGNO (src)] - && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (src)))) - || (REGNO (dest) < FIRST_PSEUDO_REGISTER - && ! fixed_regs[REGNO (dest)] - && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (dest)))))) + && ((HARD_REGISTER_P (src) + && ! TEST_HARD_REG_BIT (fixed_reg_set, REGNO (src)) + && targetm.class_likely_spilled_p (REGNO_REG_CLASS (REGNO (src)))) + || (HARD_REGISTER_P (dest) + && ! TEST_HARD_REG_BIT (fixed_reg_set, REGNO (dest)) + && targetm.class_likely_spilled_p (REGNO_REG_CLASS (REGNO (dest)))))) return 1; return 0; @@ -2223,7 +2223,7 @@ likely_spilled_retval_p (rtx insn) do { if ((mask & 1 << nregs) - && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno + nregs))) + && targetm.class_likely_spilled_p (REGNO_REG_CLASS (regno + nregs))) return 1; } while (nregs--); return 0; @@ -2862,7 +2862,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p) i1_feeds_i2_n = i1 && insn_a_feeds_b (i1, i2); i0_feeds_i1_n = i0 && insn_a_feeds_b (i0, i1); i0_feeds_i2_n = (i0 && (!i0_feeds_i1_n ? insn_a_feeds_b (i0, i2) - : (!dead_or_set_p (i1, i0dest) + : (!reg_overlap_mentioned_p (i1dest, i0dest) && reg_overlap_mentioned_p (i0dest, i2src)))); /* Ensure that I3's pattern can be the destination of combines. */ @@ -3138,7 +3138,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p) } n_occurrences = 0; - subst_low_luid = DF_INSN_LUID (i1); + subst_low_luid = DF_INSN_LUID (i0); newpat = subst (newpat, i0dest, i0src, 0, i0_feeds_i1_n && i0dest_in_i0src); substed_i0 = 1; @@ -3690,42 +3690,65 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p) && GET_CODE (XVECEXP (newpat, 0, 1)) == SET && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != ZERO_EXTRACT && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART - && ! use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)), - DF_INSN_LUID (i2)) && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 1)), XVECEXP (newpat, 0, 0)) && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 0)), XVECEXP (newpat, 0, 1)) && ! (contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 0))) - && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1)))) -#ifdef HAVE_cc0 - /* We cannot split the parallel into two sets if both sets - reference cc0. */ - && ! (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)) - && reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1))) -#endif - ) + && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1))))) { /* Normally, it doesn't matter which of the two is done first, - but it does if one references cc0. In that case, it has to + but the one that references cc0 can't be the second, and + one which uses any regs/memory set in between i2 and i3 can't be first. */ + if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)), + DF_INSN_LUID (i2)) #ifdef HAVE_cc0 - if (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))) + && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)) +#endif + ) + { + newi2pat = XVECEXP (newpat, 0, 1); + newpat = XVECEXP (newpat, 0, 0); + } + else if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 0)), + DF_INSN_LUID (i2)) +#ifdef HAVE_cc0 + && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1)) +#endif + ) { newi2pat = XVECEXP (newpat, 0, 0); newpat = XVECEXP (newpat, 0, 1); } else -#endif { - newi2pat = XVECEXP (newpat, 0, 1); - newpat = XVECEXP (newpat, 0, 0); + undo_all (); + return 0; } i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes); if (i2_code_number >= 0) - insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); + { + /* recog_for_combine might have added CLOBBERs to newi2pat. + Make sure NEWPAT does not depend on the clobbered regs. */ + if (GET_CODE (newi2pat) == PARALLEL) + { + for (i = XVECLEN (newi2pat, 0) - 1; i >= 0; i--) + if (GET_CODE (XVECEXP (newi2pat, 0, i)) == CLOBBER) + { + rtx reg = XEXP (XVECEXP (newi2pat, 0, i), 0); + if (reg_overlap_mentioned_p (reg, newpat)) + { + undo_all (); + return 0; + } + } + } + + insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); + } } /* If it still isn't recognized, fail and change things back the way they @@ -4771,6 +4794,23 @@ find_split_point (rtx *loc, rtx insn, bool set_src) case PLUS: case MINUS: + /* Canonicalization can produce (minus A (mult B C)), where C is a + constant. It may be better to try splitting (plus (mult B -C) A) + instead if this isn't a multiply by a power of two. */ + if (set_src && code == MINUS && GET_CODE (XEXP (x, 1)) == MULT + && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT + && exact_log2 (INTVAL (XEXP (XEXP (x, 1), 1))) < 0) + { + enum machine_mode mode = GET_MODE (x); + unsigned HOST_WIDE_INT this_int = INTVAL (XEXP (XEXP (x, 1), 1)); + HOST_WIDE_INT other_int = trunc_int_for_mode (-this_int, mode); + SUBST (*loc, gen_rtx_PLUS (mode, gen_rtx_MULT (mode, + XEXP (XEXP (x, 1), 0), + GEN_INT (other_int)), + XEXP (x, 0))); + return find_split_point (loc, insn, set_src); + } + /* Split at a multiply-accumulate instruction. However if this is the SET_SRC, we likely do not have such an instruction and it's worthless to try this split. */ @@ -9841,7 +9881,9 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, > GET_MODE_SIZE (GET_MODE (varop))) && (unsigned int) ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (varop))) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) - == mode_words) + == mode_words + && GET_MODE_CLASS (GET_MODE (varop)) == MODE_INT + && GET_MODE_CLASS (GET_MODE (SUBREG_REG (varop))) == MODE_INT) { varop = SUBREG_REG (varop); if (GET_MODE_SIZE (GET_MODE (varop)) > GET_MODE_SIZE (mode)) @@ -11703,13 +11745,14 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) /* If we have (compare (xshiftrt FOO N) (const_int C)) and the low order N bits of FOO are known to be zero, we can do this by comparing FOO with C shifted left N bits so long as no - overflow occurs. */ + overflow occurs. Even if the low order N bits of FOO aren't known + to be zero, if the comparison is >= or < we can use the same + optimization and for > or <= by setting all the low + order N bits in the comparison constant. */ if (CONST_INT_P (XEXP (op0, 1)) - && INTVAL (XEXP (op0, 1)) >= 0 + && INTVAL (XEXP (op0, 1)) > 0 && INTVAL (XEXP (op0, 1)) < HOST_BITS_PER_WIDE_INT && mode_width <= HOST_BITS_PER_WIDE_INT - && (nonzero_bits (XEXP (op0, 0), mode) - & (((HOST_WIDE_INT) 1 << INTVAL (XEXP (op0, 1))) - 1)) == 0 && (((unsigned HOST_WIDE_INT) const_op + (GET_CODE (op0) != LSHIFTRT ? ((GET_MODE_MASK (mode) >> INTVAL (XEXP (op0, 1)) >> 1) @@ -11717,15 +11760,27 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) : 0)) <= GET_MODE_MASK (mode) >> INTVAL (XEXP (op0, 1)))) { - /* If the shift was logical, then we must make the condition - unsigned. */ - if (GET_CODE (op0) == LSHIFTRT) - code = unsigned_condition (code); - - const_op <<= INTVAL (XEXP (op0, 1)); - op1 = GEN_INT (const_op); - op0 = XEXP (op0, 0); - continue; + unsigned HOST_WIDE_INT low_bits + = (nonzero_bits (XEXP (op0, 0), mode) + & (((unsigned HOST_WIDE_INT) 1 + << INTVAL (XEXP (op0, 1))) - 1)); + if (low_bits == 0 || !equality_comparison_p) + { + /* If the shift was logical, then we must make the condition + unsigned. */ + if (GET_CODE (op0) == LSHIFTRT) + code = unsigned_condition (code); + + const_op <<= INTVAL (XEXP (op0, 1)); + if (low_bits != 0 + && (code == GT || code == GTU + || code == LE || code == LEU)) + const_op + |= (((HOST_WIDE_INT) 1 << INTVAL (XEXP (op0, 1))) - 1); + op1 = GEN_INT (const_op); + op0 = XEXP (op0, 0); + continue; + } } /* If we are using this shift to extract just the sign bit, we diff --git a/gcc/common.opt b/gcc/common.opt index fea545c8fc5..03f465b959d 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -23,40 +23,214 @@ ; Please try to keep this file in ASCII collating order. +Variable +int target_flags + ### Driver +-assemble +Driver Alias(S) + +-compile +Driver Alias(c) + +-coverage +Driver Alias(coverage) + +-debug +Common Alias(g) + +-dump +Common Separate Alias(d) + +-dump= +Common Joined Alias(d) + +-dumpbase +Common Separate Alias(dumpbase) + +-dumpdir +Common Separate Alias(dumpdir) + +-entry +Driver Separate Alias(e) + +-entry= +Driver Joined Alias(e) + +-extra-warnings +Common Warning Alias(Wextra) + +-for-assembler +Driver Separate Alias(Xassembler) + +-for-assembler= +Driver JoinedOrMissing Alias(Xassembler) + +-for-linker +Driver Separate Alias(Xlinker) + +-for-linker= +Driver JoinedOrMissing Alias(Xlinker) + +-force-link +Driver Separate Alias(u) + +-force-link= +Driver Joined Alias(u) + -help -Common Driver +Common Driver Var(help_flag) Display this information -help= Common Driver Report Joined --help= Display descriptions of a specific class of options. is one or more of optimizers, target, warnings, undocumented, params +-language +Driver Separate Alias(x) + +-language= +Driver Joined Alias(x) + +-library-directory +Driver Separate Alias(L) + +-library-directory= +Driver Joined Alias(L) + +-no-canonical-prefixes +Driver Alias(no-canonical-prefixes) + +-no-standard-libraries +Driver Alias(nostdlib) + +-no-warnings +Common Alias(w) + +-optimize +Common Alias(O) + +-output +Common Driver Separate Alias(o) MissingArgError(missing filename after %qs) + +-output= +Common Driver Joined Alias(o) MissingArgError(missing filename after %qs) + +-pass-exit-codes +Driver Alias(pass-exit-codes) + +-pedantic +Common Alias(pedantic) + +-pedantic-errors +Common Alias(pedantic-errors) + +-pie +Common Alias(pie) + +-pipe +Driver Alias(pipe) + +-prefix +Driver Separate Alias(B) + +-prefix= +Driver JoinedOrMissing Alias(B) + +-preprocess +Driver Alias(E) + +-print-file-name +Driver Separate Alias(print-file-name=) + +-print-file-name= +Driver JoinedOrMissing Alias(print-file-name=) + +-print-libgcc-file-name +Driver Alias(print-libgcc-file-name) + +-print-multi-directory +Driver Alias(print-multi-directory) + +-print-multi-lib +Driver Alias(print-multi-lib) + +-print-multi-os-directory +Driver Alias(print-multi-os-directory) + +-print-prog-name +Driver Separate Alias(print-prog-name=) + +-print-prog-name= +Driver JoinedOrMissing Alias(print-prog-name=) + +-print-search-dirs +Driver Alias(print-search-dirs) + +-print-sysroot +Driver Alias(print-sysroot) + +-print-sysroot-headers-suffix +Driver Alias(print-sysroot-headers-suffix) + +-profile +Common Alias(p) + +-save-temps +Driver Alias(save-temps) + +-shared +Common Alias(shared) + +-specs +Driver Separate Alias(specs=) + +-specs= +Driver Joined Alias(specs=) + +-static +Driver Alias(static) + +-symbolic +Driver Alias(symbolic) + -target-help Common Driver Alias for --help=target -;; The following four entries are to work around the gcc driver -;; program's insatiable desire to turn options starting with a -;; double dash (--) into options starting with a dash f (-f). +-time +Driver Alias(time) + +-verbose +Driver Alias(v) + +;; The driver used to convert options such as --help into forms such +;; as -fhelp; the following four entries are for compatibility with +;; any direct uses of those (undocumented) -f forms fhelp -Common Driver Var(help_flag) +Common Driver Alias(-help) fhelp= -Common Driver Joined +Common Driver Joined Alias(-help=) ftarget-help -Common Driver +Common Driver Alias(-target-help) fversion -Common Driver +Common Driver Alias(-version) -param Common Separate --param = Set parameter to value. See below for a complete list of parameters +-param= +Common Joined Alias(-param) + +-sysroot +Driver Separate Alias(-sysroot=) + -sysroot= Driver JoinedOrMissing @@ -88,7 +262,7 @@ S Driver W -Common RejectNegative Var(extra_warnings) Warning +Common RejectNegative Warning Alias(Wextra) This switch is deprecated; use -Wextra instead Wa, @@ -153,7 +327,7 @@ Common Var(warn_inline) Warning Warn when an inlined function cannot be inlined Wlarger-than- -Common RejectNegative Joined UInteger Warning Undocumented +Common RejectNegative Joined Warning Undocumented Alias(Wlarger-than=) Wlarger-than= Common RejectNegative Joined UInteger Warning @@ -248,7 +422,7 @@ Common Var(warn_uninitialized) Init(-1) Warning Warn about uninitialized automatic variables Wunreachable-code -Common +Common Ignore Does nothing. Preserved for backward compatibility. Wunused @@ -301,7 +475,7 @@ Common Separate -aux-info Emit declaration information into aux-info= -Common Joined +Common Joined Alias(aux-info) auxbase Common Separate RejectDriver @@ -309,8 +483,8 @@ Common Separate RejectDriver auxbase-strip Common Separate RejectDriver -combine -Driver Var(combine_flag) +coverage +Driver c Driver @@ -336,6 +510,9 @@ Driver dumpversion Driver +e +Driver Joined Separate + ; The version of the C++ ABI in use. The following values are allowed: ; ; 0: The version of the ABI believed most conformant with the C++ ABI @@ -387,19 +564,19 @@ falign-loops= Common RejectNegative Joined UInteger fargument-alias -Common +Common Ignore Does nothing. Preserved for backward compatibility. fargument-noalias -Common +Common Ignore Does nothing. Preserved for backward compatibility. fargument-noalias-global -Common +Common Ignore Does nothing. Preserved for backward compatibility. fargument-noalias-anything -Common +Common Ignore Does nothing. Preserved for backward compatibility. fasynchronous-unwind-tables @@ -490,7 +667,7 @@ Common Report Var(flag_cse_follow_jumps) Optimization When running CSE, follow jumps to their targets fcse-skip-blocks -Common +Common Ignore Does nothing. Preserved for backward compatibility. fcx-limited-range @@ -543,6 +720,9 @@ fdump- Common Joined RejectNegative -fdump- Dump various compiler internals to a file +fdump-final-insns +Driver RejectNegative + fdump-final-insns= Common RejectNegative Joined Var(flag_dump_final_insns) -fdump-final-insns=filename Dump to filename the insns at the end of translation @@ -552,11 +732,11 @@ Common Report Var(flag_dump_noaddr) Suppress output of addresses in debugging dumps fdump-unnumbered -Common Report Var(flag_dump_unnumbered) VarExists +Common Report Var(flag_dump_unnumbered) Suppress output of instruction numbers, line number notes and addresses in debugging dumps fdump-unnumbered-links -Common Report Var(flag_dump_unnumbered_links) VarExists +Common Report Var(flag_dump_unnumbered_links) Suppress output of previous and next insn numbers in debugging dumps fdwarf2-cfi-asm @@ -619,7 +799,7 @@ Common Report Var(flag_float_store) Optimization Don't allocate floats and doubles in extended-precision registers fforce-addr -Common +Common Ignore Does nothing. Preserved for backward compatibility. fforward-propagate @@ -737,6 +917,10 @@ ftree-loop-if-convert Common Report Var(flag_tree_loop_if_convert) Init(-1) Optimization Convert conditional jumps in innermost loops to branchless equivalents +ftree-loop-if-convert-stores +Common Report Var(flag_tree_loop_if_convert_stores) Optimization +Also if-convert conditional jumps containing memory writes + ; -finhibit-size-directive inhibits output of .size for ELF. ; This is used only for compiling crtstuff.c, ; and it may be extended to other effects @@ -771,7 +955,7 @@ Common Report Var(flag_inline_functions_called_once) Init(1) Optimization Integrate functions called once into their callers finline-limit- -Common RejectNegative Joined UInteger +Common RejectNegative Joined Alias(finline-limit=) finline-limit= Common RejectNegative Joined UInteger @@ -873,7 +1057,7 @@ Common Report Var(flag_leading_underscore) Init(-1) Give external symbols a leading underscore floop-optimize -Common +Common Ignore Does nothing. Preserved for backward compatibility. flto @@ -1119,7 +1303,7 @@ Common Report Var(flag_rerun_cse_after_loop) Init(2) Optimization Add a common subexpression elimination pass after loop optimizations frerun-loop-opt -Common +Common Ignore Does nothing. Preserved for backward compatibility. frounding-math @@ -1155,7 +1339,7 @@ Common Report Var(flag_sched2_use_superblocks) Optimization If scheduling post reload, do superblock scheduling fsched2-use-traces -Common +Common Ignore Does nothing. Preserved for backward compatibility. fschedule-insns @@ -1240,7 +1424,7 @@ Common Report Var(flag_section_anchors) Optimization Access data in the same section from shared anchor points fsee -Common +Common Ignore Does nothing. Preserved for backward compatibility. fzee @@ -1280,7 +1464,7 @@ Common Report RejectNegative Joined -fstack-check=[no|generic|specific] Insert stack checking code into the program fstack-check -Common Report +Common Alias(fstack-check=, specific, no) Insert stack checking code into the program. Same as -fstack-check=specific fstack-limit @@ -1302,8 +1486,12 @@ fstack-protector-all Common Report RejectNegative Var(flag_stack_protect, 2) VarExists Use a stack protection method for every function +fstack-usage +Common RejectNegative Var(flag_stack_usage) +Output stack usage information on a per-function basis + fstrength-reduce -Common +Common Ignore Does nothing. Preserved for backward compatibility. ; Nonzero if we should do (language-dependent) alias analysis. @@ -1366,7 +1554,7 @@ Common Report Var(flag_tree_bit_ccp) Optimization Enable SSA-BIT-CCP optimization on trees ftree-store-ccp -Common +Common Ignore Does nothing. Preserved for backward compatibility. ftree-ch @@ -1382,7 +1570,7 @@ Common Report Var(flag_tree_copy_prop) Optimization Enable copy propagation on trees ftree-store-copy-prop -Common +Common Ignore Does nothing. Preserved for backward compatibility. ftree-cselim @@ -1458,7 +1646,7 @@ Common Report Var(flag_tree_reassoc) Init(1) Optimization Enable reassociation on tree level ftree-salias -Common +Common Ignore Does nothing. Preserved for backward compatibility. ftree-sink @@ -1528,16 +1716,27 @@ Just generate unwind tables for exception handling fuse-linker-plugin Common Undocumented +; Positive if we should track variables, negative if we should run +; the var-tracking pass only to discard debug annotations, zero if +; we're not to run it. When flag_var_tracking == 2 (AUTODETECT_VALUE) it +; will be set according to optimize, debug_info_level and debug_hooks +; in process_options (). fvar-tracking -Common Report Var(flag_var_tracking) VarExists Optimization +Common Report Var(flag_var_tracking) Init(2) Optimization Perform variable tracking +; Positive if we should track variables at assignments, negative if +; we should run the var-tracking pass only to discard debug +; annotations. When flag_var_tracking_assignments == +; AUTODETECT_VALUE it will be set according to flag_var_tracking. fvar-tracking-assignments -Common Report Var(flag_var_tracking_assignments) VarExists Optimization +Common Report Var(flag_var_tracking_assignments) Init(2) Optimization Perform variable tracking by annotating assignments +; Nonzero if we should toggle flag_var_tracking_assignments after +; processing options and computing its default. */ fvar-tracking-assignments-toggle -Common Report Var(flag_var_tracking_assignments_toggle) VarExists Optimization +Common Report Var(flag_var_tracking_assignments_toggle) Optimization Toggle -fvar-tracking-assignments fvar-tracking-uninit @@ -1596,8 +1795,8 @@ Common Enable partitioned link-time optimization fwhopr= -Common RejectNegative UInteger Joined Var(flag_whopr) -Enable partitioned link-time optimization with specified number of parallel jobs +Common RejectNegative Joined Var(flag_whopr) +Partitioned link-time optimization with number of parallel jobs or jobserver. ftree-builtin-call-dce Common Report Var(flag_tree_builtin_call_dce) Init(0) Optimization @@ -1747,6 +1946,9 @@ Driver Var(report_times) time= Driver JoinedOrMissing +u +Driver Joined Separate + v Driver @@ -1772,7 +1974,7 @@ shared-libgcc Driver specs -Driver Separate +Driver Separate Alias(specs=) specs= Driver Joined @@ -1790,6 +1992,9 @@ Driver static-libstdc++ Driver +symbolic +Driver + pie Common RejectNegative Negative(shared) Create a position independent executable diff --git a/gcc/config.gcc b/gcc/config.gcc index 148c99b8151..241e8788d6c 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1135,12 +1135,14 @@ i[34567]86-*-darwin*) # support. with_cpu=${with_cpu:-generic} tmake_file="${tmake_file} t-slibgcc-darwin i386/t-crtpc i386/t-crtfm" + extra_options="${extra_options} i386/darwin.opt" lto_binary_reader=lto-macho ;; x86_64-*-darwin*) with_cpu=${with_cpu:-generic} tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-darwin i386/t-crtpc i386/t-crtfm" tm_file="${tm_file} ${cpu_type}/darwin64.h" + extra_options="${extra_options} i386/darwin.opt" lto_binary_reader=lto-macho ;; i[34567]86-*-elf*) @@ -1440,7 +1442,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) else tmake_eh_file="i386/t-sjlj-eh" fi - tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming" + tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming t-dfprules" case ${target} in x86_64-w64-*) tmake_file="${tmake_file} i386/t-mingw-w64" @@ -1811,6 +1813,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" + extra_options="${extra_options} mips/sde.opt" case "${with_newlib}" in yes) # newlib / libgloss. @@ -3485,6 +3488,9 @@ case ${target} in i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*) tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp" ;; + i[34567]86-*-freebsd* | x86_64-*-freebsd*) + tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp" + ;; ia64*-*-linux*) tmake_file="${tmake_file} ia64/t-fprules-softfp soft-fp/t-softfp" ;; diff --git a/gcc/config.in b/gcc/config.in index c451c5378e0..a03b65309dc 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -968,6 +968,9 @@ /* Define if your assembler and linker support .hidden. */ #undef HAVE_GAS_HIDDEN +/* Define if your assembler supports indirect function type. */ +#undef HAVE_GAS_INDIRECT_FUNCTION + /* Define if your assembler supports .lcomm with an alignment field. */ #ifndef USED_FOR_TARGET #undef HAVE_GAS_LCOMM_WITH_ALIGNMENT diff --git a/gcc/config/alpha/alpha-modes.def b/gcc/config/alpha/alpha-modes.def index b75627edc23..9d5a042467b 100644 --- a/gcc/config/alpha/alpha-modes.def +++ b/gcc/config/alpha/alpha-modes.def @@ -1,5 +1,5 @@ /* Alpha extra machine modes. - Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* 128-bit floating point. This gets reset in alpha_override_options +/* 128-bit floating point. This gets reset in alpha_option_override if VAX float format is in use. */ FLOAT_MODE (TF, 16, ieee_quad_format); diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h index 7e9d14b5f4b..4b5e6734dc7 100644 --- a/gcc/config/alpha/alpha-protos.h +++ b/gcc/config/alpha/alpha-protos.h @@ -1,5 +1,5 @@ /* Prototypes for alpha.c functions used in the md file & elsewhere. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see extern int alpha_next_sequence_number; extern void literal_section (void); -extern void override_options (void); extern int zap_mask (HOST_WIDE_INT); extern int direct_return (void); diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 1cfca586a87..49c86fd9310 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -256,8 +256,8 @@ alpha_mangle_type (const_tree type) /* Parse target option strings. */ -void -override_options (void) +static void +alpha_option_override (void) { static const struct cpu_table { const char *const name; @@ -283,6 +283,10 @@ override_options (void) int const ct_size = ARRAY_SIZE (cpu_table); int i; +#ifdef SUBTARGET_OVERRIDE_OPTIONS + SUBTARGET_OVERRIDE_OPTIONS; +#endif + /* Unicos/Mk doesn't have shared libraries. */ if (TARGET_ABI_UNICOSMK && flag_pic) { @@ -7763,6 +7767,30 @@ emit_frame_store (unsigned int regno, rtx base_reg, emit_frame_store_1 (reg, base_reg, frame_bias, base_ofs, reg); } +/* Compute the frame size. SIZE is the size of the "naked" frame + and SA_SIZE is the size of the register save area. */ + +static HOST_WIDE_INT +compute_frame_size (HOST_WIDE_INT size, HOST_WIDE_INT sa_size) +{ + if (TARGET_ABI_OPEN_VMS) + return ALPHA_ROUND (sa_size + + (alpha_procedure_type == PT_STACK ? 8 : 0) + + size + + crtl->args.pretend_args_size); + else if (TARGET_ABI_UNICOSMK) + /* We have to allocate space for the DSIB if we generate a frame. */ + return ALPHA_ROUND (sa_size + + (alpha_procedure_type == PT_STACK ? 48 : 0)) + + ALPHA_ROUND (size + + crtl->outgoing_args_size); + else + return ALPHA_ROUND (crtl->outgoing_args_size) + + sa_size + + ALPHA_ROUND (size + + crtl->args.pretend_args_size); +} + /* Write function prologue. */ /* On vms we have two kinds of functions: @@ -7790,30 +7818,19 @@ alpha_expand_prologue (void) HOST_WIDE_INT sa_size; /* Complete stack size needed. */ HOST_WIDE_INT frame_size; + /* Probed stack size; it additionally includes the size of + the "reserve region" if any. */ + HOST_WIDE_INT probed_size; /* Offset from base reg to register save area. */ HOST_WIDE_INT reg_offset; rtx sa_reg; int i; sa_size = alpha_sa_size (); + frame_size = compute_frame_size (get_frame_size (), sa_size); - frame_size = get_frame_size (); - if (TARGET_ABI_OPEN_VMS) - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 8 : 0) - + frame_size - + crtl->args.pretend_args_size); - else if (TARGET_ABI_UNICOSMK) - /* We have to allocate space for the DSIB if we generate a frame. */ - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 48 : 0)) - + ALPHA_ROUND (frame_size - + crtl->outgoing_args_size); - else - frame_size = (ALPHA_ROUND (crtl->outgoing_args_size) - + sa_size - + ALPHA_ROUND (frame_size - + crtl->args.pretend_args_size)); + if (flag_stack_usage) + current_function_static_stack_size = frame_size; if (TARGET_ABI_OPEN_VMS) reg_offset = 8 + 8 * cfun->machine->uses_condition_handler; @@ -7849,20 +7866,26 @@ alpha_expand_prologue (void) Note that we are only allowed to adjust sp once in the prologue. */ - if (frame_size <= 32768) + probed_size = frame_size; + if (flag_stack_check) + probed_size += STACK_CHECK_PROTECT; + + if (probed_size <= 32768) { - if (frame_size > 4096) + if (probed_size > 4096) { int probed; - for (probed = 4096; probed < frame_size; probed += 8192) + for (probed = 4096; probed < probed_size; probed += 8192) emit_insn (gen_probe_stack (GEN_INT (TARGET_ABI_UNICOSMK ? -probed + 64 : -probed))); - /* We only have to do this probe if we aren't saving registers. */ - if (sa_size == 0 && frame_size > probed - 4096) - emit_insn (gen_probe_stack (GEN_INT (-frame_size))); + /* We only have to do this probe if we aren't saving registers or + if we are probing beyond the frame because of -fstack-check. */ + if ((sa_size == 0 && probed_size > probed - 4096) + || flag_stack_check) + emit_insn (gen_probe_stack (GEN_INT (-probed_size))); } if (frame_size != 0) @@ -7877,10 +7900,11 @@ alpha_expand_prologue (void) number of 8192 byte blocks to probe. We then probe each block in the loop and then set SP to the proper location. If the amount remaining is > 4096, we have to do one more probe if we - are not saving any registers. */ + are not saving any registers or if we are probing beyond the + frame because of -fstack-check. */ - HOST_WIDE_INT blocks = (frame_size + 4096) / 8192; - HOST_WIDE_INT leftover = frame_size + 4096 - blocks * 8192; + HOST_WIDE_INT blocks = (probed_size + 4096) / 8192; + HOST_WIDE_INT leftover = probed_size + 4096 - blocks * 8192; rtx ptr = gen_rtx_REG (DImode, 22); rtx count = gen_rtx_REG (DImode, 23); rtx seq; @@ -7893,20 +7917,23 @@ alpha_expand_prologue (void) late in the compilation, generate the loop as a single insn. */ emit_insn (gen_prologue_stack_probe_loop (count, ptr)); - if (leftover > 4096 && sa_size == 0) + if ((leftover > 4096 && sa_size == 0) || flag_stack_check) { rtx last = gen_rtx_MEM (DImode, plus_constant (ptr, -leftover)); MEM_VOLATILE_P (last) = 1; emit_move_insn (last, const0_rtx); } - if (TARGET_ABI_WINDOWS_NT) + if (TARGET_ABI_WINDOWS_NT || flag_stack_check) { /* For NT stack unwind (done by 'reverse execution'), it's not OK to take the result of a loop, even though the value is already in ptr, so we reload it via a single operation and subtract it to sp. + Same if -fstack-check is specified, because the probed stack + size is not equal to the frame size. + Yes, that's correct -- we have to reload the whole constant into a temporary via ldah+lda then subtract from sp. */ @@ -8135,23 +8162,7 @@ alpha_start_function (FILE *file, const char *fnname, alpha_fnname = fnname; sa_size = alpha_sa_size (); - - frame_size = get_frame_size (); - if (TARGET_ABI_OPEN_VMS) - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 8 : 0) - + frame_size - + crtl->args.pretend_args_size); - else if (TARGET_ABI_UNICOSMK) - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 48 : 0)) - + ALPHA_ROUND (frame_size - + crtl->outgoing_args_size); - else - frame_size = (ALPHA_ROUND (crtl->outgoing_args_size) - + sa_size - + ALPHA_ROUND (frame_size - + crtl->args.pretend_args_size)); + frame_size = compute_frame_size (get_frame_size (), sa_size); if (TARGET_ABI_OPEN_VMS) reg_offset = 8 + 8 * cfun->machine->uses_condition_handler; @@ -8353,23 +8364,7 @@ alpha_expand_epilogue (void) int i; sa_size = alpha_sa_size (); - - frame_size = get_frame_size (); - if (TARGET_ABI_OPEN_VMS) - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 8 : 0) - + frame_size - + crtl->args.pretend_args_size); - else if (TARGET_ABI_UNICOSMK) - frame_size = ALPHA_ROUND (sa_size - + (alpha_procedure_type == PT_STACK ? 48 : 0)) - + ALPHA_ROUND (frame_size - + crtl->outgoing_args_size); - else - frame_size = (ALPHA_ROUND (crtl->outgoing_args_size) - + sa_size - + ALPHA_ROUND (frame_size - + crtl->args.pretend_args_size)); + frame_size = compute_frame_size (get_frame_size (), sa_size); if (TARGET_ABI_OPEN_VMS) { @@ -10034,6 +10029,7 @@ alpha_use_linkage (rtx func, tree cfundecl, int lflag, int rflag) 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) @@ -11166,6 +11162,9 @@ alpha_init_libfuncs (void) #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION alpha_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE alpha_option_override + #ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING #undef TARGET_MANGLE_TYPE #define TARGET_MANGLE_TYPE alpha_mangle_type diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 806f1aa7e60..f0d8b9dba4d 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -212,17 +212,6 @@ extern enum alpha_fp_trap_mode alpha_fptm; {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" } -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - On the Alpha, it is used to translate target-option strings into - numeric values. */ - -#define OVERRIDE_OPTIONS override_options () - /* Define this macro to change register usage conditional on target flags. diff --git a/gcc/config/alpha/osf5-unwind.h b/gcc/config/alpha/osf5-unwind.h new file mode 100644 index 00000000000..c649099349e --- /dev/null +++ b/gcc/config/alpha/osf5-unwind.h @@ -0,0 +1,329 @@ +/* DWARF2 EH unwinding support for Alpha Tru64. + Copyright (C) 2010 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* This file implements the MD_FALLBACK_FRAME_STATE_FOR macro, triggered when + the GCC table based unwinding process hits a frame for which no unwind info + has been registered. This typically occurs when raising an exception from a + signal handler, because the handler is actually called from the OS kernel. + + The basic idea is to detect that we are indeed trying to unwind past a + signal handler and to fill out the GCC internal unwinding structures for + the OS kernel frame as if it had been directly called from the interrupted + context. + + This is all assuming that the code to set the handler asked the kernel to + pass a pointer to such context information. */ + +/* -------------------------------------------------------------------------- + -- Basic principles of operation: + -------------------------------------------------------------------------- + + 1/ We first need a way to detect if we are trying to unwind past a signal + handler. + + The typical method that is used on most platforms is to look at the code + around the return address we have and check if it matches the OS code + calling a handler. To determine what this code is expected to be, get a + breakpoint into a real signal handler and look at the code around the + return address. Depending on the library versions the pattern of the + signal handler is different; this is the reason why we check against more + than one pattern. + + On this target, the return address is right after the call and every + instruction is 4 bytes long. For the simple case of a null dereference in + a single-threaded app, it went like: + + # Check that we indeed have something we expect: the instruction right + # before the return address is within a __sigtramp function and is a call. + + [... run gdb and break at the signal handler entry ...] + + (gdb) x /i $ra-4 + <__sigtramp+160>: jsr ra,(a3),0x3ff800d0ed4 <_fpdata+36468> + + # Look at the code around that return address, and eventually observe a + # significantly large chunk of *constant* code right before the call: + + (gdb) x /10i $ra-44 + <__sigtramp+120>: lda gp,-27988(gp) + <__sigtramp+124>: ldq at,-18968(gp) + <__sigtramp+128>: lda t0,-1 + <__sigtramp+132>: stq t0,0(at) + <__sigtramp+136>: ldq at,-18960(gp) + <__sigtramp+140>: ldl t1,8(at) + <__sigtramp+144>: ldq at,-18960(gp) + <__sigtramp+148>: stl t1,12(at) + <__sigtramp+152>: ldq at,-18960(gp) + <__sigtramp+156>: stl t0,8(at) + + # The hexadecimal equivalent that we will have to match is: + + (gdb) x /10x $ra-44 + <__sigtramp+120>: 0x23bd92ac 0xa79db5e8 0x203fffff 0xb43c0000 + <__sigtramp+136>: 0xa79db5f0 0xa05c0008 0xa79db5f0 0xb05c000c + <__sigtramp+152>: 0xa79db5f0 0xb03c0008 + + The problem observed on this target with this approach is that although + we found a constant set of instruction patterns there were some + gp-related offsets that made the machine code to differ from one + installation to another. This problem could have been overcome by masking + these offsets, but we found that it would be simpler and more efficient to + check whether the return address was part of a signal handler, by comparing + it against some expected code offset from __sigtramp. + + # Check that we indeed have something we expect: the instruction + # right before the return address is within a __sigtramp + # function and is a call. We also need to obtain the offset + # between the return address and the start address of __sigtramp. + + [... run gdb and break at the signal handler entry ...] + + (gdb) x /2i $ra-4 + <__sigtramp+160>: jsr ra,(a3),0x3ff800d0ed4 <_fpdata+36468> + <__sigtramp+164>: ldah gp,16381(ra) + + (gdb) p (long)$ra - (long)&__sigtramp + $2 = 164 + + -------------------------------------------------------------------------- + + 2/ Once we know we are going through a signal handler, we need a way to + retrieve information about the interrupted run-time context. + + On this platform, the third handler's argument is a pointer to a structure + describing this context (struct sigcontext *). We unfortunately have no + direct way to transfer this value here, so a couple of tricks are required + to compute it. + + As documented at least in some header files (e.g. sys/machine/context.h), + the structure the handler gets a pointer to is located on the stack. As of + today, while writing this macro, we have unfortunately not been able to + find a detailed description of the full stack layout at handler entry time, + so we'll have to resort to empirism :) + + When unwinding here, we have the handler's CFA at hand, as part of the + current unwinding context which is one of our arguments. We presume that + for each call to a signal handler by the same kernel routine, the context's + structure location on the stack is always at the same offset from the + handler's CFA, and we compute that offset from bare observation: + + For the simple case of a bare null dereference in a single-threaded app, + computing the offset was done using GNAT like this: + + # Break on the first handler's instruction, before the prologue to have the + # CFA in $sp, and get there: + + (gdb) b *&__gnat_error_handler + Breakpoint 1 at 0x120016090: file init.c, line 378. + + (gdb) r + Program received signal SIGSEGV, Segmentation fault. + + (gdb) c + Breakpoint 1, __gnat_error_handler (sig=..., sip=..., context=...) + + # The displayed argument value are meaningless because we stopped before + # their final "homing". We know they are passed through $a0, $a1 and $a2 + # from the ABI, though, so ... + + # Observe that $sp and the context pointer are in the same (stack) area, + # and compute the offset: + + (gdb) p /x $sp + $2 = 0x11fffbc80 + + (gdb) p /x $a2 + $3 = 0x11fffbcf8 + + (gdb) p /x (long)$a2 - (long)$sp + $4 = 0x78 + + -------------------------------------------------------------------------- + + 3/ Once we know we are unwinding through a signal handler and have the + address of the structure describing the interrupted context at hand, we + have to fill the internal frame-state/unwind-context structures properly + to allow the unwinding process to proceed. + + Roughly, we are provided with an *unwinding* CONTEXT, describing the state + of some point P in the call chain we are unwinding through. The macro we + implement has to fill a "frame state" structure FS that describe the P's + caller state, by way of *rules* to compute its CFA, return address, and + **saved** registers *locations*. + + For the case we are going to deal with, the caller is some kernel code + calling a signal handler, and: + + o The saved registers are all in the interrupted run-time context, + + o The CFA is the stack pointer value when the kernel code is entered, that + is, the stack pointer value at the interruption point, also part of the + interrupted run-time context. + + o We want the return address to appear as the address of the active + instruction at the interruption point, so that the unwinder proceeds as + if the interruption had been a regular call. This address is also part + of the interrupted run-time context. + + -- + + Also, note that there is an important difference between the return address + we need to claim for the kernel frame and the value of the return address + register at the interruption point. + + The latter might be required to be able to unwind past the interrupted + routine, for instance if it is interrupted before saving the incoming + register value in its own frame, which may typically happen during stack + probes for stack-checking purposes. + + It is then essential that the rules stated to locate the kernel frame + return address don't clobber the rules describing where is saved the return + address register at the interruption point, so some scratch register state + entry should be used for the former. We have DWARF_ALT_FRAME_RETURN_COLUMN + at hand exactly for that purpose. + + -------------------------------------------------------------------------- + + 4/ Depending on the context (single-threaded or multi-threaded app, ...), + the code calling the handler and the handler-cfa to interrupted-context + offset might change, so we use a simple generic data structure to track + the possible variants. */ + +/* This is the structure to wrap information about each possible sighandler + caller we may have to identify. */ + +typedef struct { + /* Expected return address when being called from a sighandler. */ + void *ra_value; + + /* Offset to get to the sigcontext structure from the handler's CFA + when the pattern matches. */ + int cfa_to_context_offset; + +} sighandler_call_t; + +/* Helper macro for MD_FALLBACK_FRAME_STATE_FOR below. + + Look at RA to see if it matches within a sighandler caller. + Set SIGCTX to the corresponding sigcontext structure (computed from + CFA) if it does, or to 0 otherwise. */ + +#define COMPUTE_SIGCONTEXT_FOR(RA,CFA,SIGCTX) \ +do { \ + /* Define and register the applicable patterns. */ \ + extern void __sigtramp (void); \ + \ + sighandler_call_t sighandler_calls [] = { \ + {__sigtramp + 164, 0x78} \ + }; \ + \ + int n_patterns_to_match \ + = sizeof (sighandler_calls) / sizeof (sighandler_call_t); \ + \ + int pn; /* pattern number */ \ + \ + int match = 0; /* Did last pattern match ? */ \ + \ + /* Try to match each pattern in turn. */ \ + for (pn = 0; !match && pn < n_patterns_to_match; pn ++) \ + match = ((RA) == sighandler_calls[pn].ra_value); \ + \ + (SIGCTX) = (struct sigcontext *) \ + (match ? ((CFA) + sighandler_calls[pn - 1].cfa_to_context_offset) : 0); \ +} while (0); + +#include + +#define REG_SP 30 /* hard reg for stack pointer */ +#define REG_RA 26 /* hard reg for return address */ + +#define MD_FALLBACK_FRAME_STATE_FOR alpha_fallback_frame_state + +static _Unwind_Reason_Code +alpha_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + /* Return address and CFA of the frame we're attempting to unwind through, + possibly a signal handler. */ + void *ctx_ra = (void *)context->ra; + void *ctx_cfa = (void *)context->cfa; + + /* CFA of the intermediate abstract kernel frame between the interrupted + code and the signal handler, if we're indeed unwinding through a signal + handler. */ + void *k_cfa; + + /* Pointer to the sigcontext structure pushed by the kernel when we're + unwinding through a signal handler. */ + struct sigcontext *sigctx; + int i; + + COMPUTE_SIGCONTEXT_FOR (ctx_ra, ctx_cfa, sigctx); + + if (sigctx == 0) + return _URC_END_OF_STACK; + + /* The kernel frame's CFA is exactly the stack pointer value at the + interruption point. */ + k_cfa = (void *) sigctx->sc_regs [REG_SP]; + + /* State the rules to compute the CFA we have the value of: use the + previous CFA and offset by the difference between the two. See + uw_update_context_1 for the supporting details. */ + fs->regs.cfa_how = CFA_REG_OFFSET; + fs->regs.cfa_reg = __builtin_dwarf_sp_column (); + fs->regs.cfa_offset = k_cfa - ctx_cfa; + + /* Fill the internal frame_state structure with information stating + where each register of interest in the saved context can be found + from the CFA. */ + + /* The general registers are in sigctx->sc_regs. Leave out r31, which + is read-as-zero. It makes no sense restoring it, and we are going to + use the state entry for the kernel return address rule below. + + This loop must cover at least all the callee-saved registers, and + we just don't bother specializing the set here. */ + for (i = 0; i <= 30; i ++) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset + = (void *) &sigctx->sc_regs[i] - (void *) k_cfa; + } + + /* Ditto for the floating point registers in sigctx->sc_fpregs. */ + for (i = 0; i <= 31; i ++) + { + fs->regs.reg[32+i].how = REG_SAVED_OFFSET; + fs->regs.reg[32+i].loc.offset + = (void *) &sigctx->sc_fpregs[i] - (void *) k_cfa; + } + + /* State the rules to find the kernel's code "return address", which + is the address of the active instruction when the signal was caught, + in sigctx->sc_pc. Use DWARF_ALT_FRAME_RETURN_COLUMN since the return + address register is a general register and should be left alone. */ + fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN; + fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_OFFSET; + fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset + = (void *) &sigctx->sc_pc - (void *) k_cfa; + fs->signal_frame = 1; + + return _URC_NO_REASON; +} diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h index c44371d317a..759b4e799ec 100644 --- a/gcc/config/alpha/osf5.h +++ b/gcc/config/alpha/osf5.h @@ -274,3 +274,5 @@ __enable_execute_stack (void *addr) \ /* Handle #pragma extern_prefix. */ #define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX 1 + +#define MD_UNWIND_SUPPORT "config/alpha/osf5-unwind.h" diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index c0b20f89d61..38b2068693e 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -1,6 +1,6 @@ /* Output variables, constants and external declarations, for GNU compiler. Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2004, 2005, 2007, 2008, - 2009 + 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -337,17 +337,16 @@ typedef struct crtl_name_spec /* The VMS convention is to always provide minimal debug info for a traceback unless specifically overridden. */ -#undef OVERRIDE_OPTIONS -#define OVERRIDE_OPTIONS \ -{ \ +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS \ +do { \ if (write_symbols == NO_DEBUG \ && debug_info_level == DINFO_LEVEL_NONE) \ { \ write_symbols = VMS_DEBUG; \ debug_info_level = DINFO_LEVEL_TERSE; \ } \ - override_options (); \ -} +} while (0) /* Link with vms-dwarf2.o if -g (except -g0). This causes the VMS link to pull all the dwarf2 debug sections together. */ diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index c9fc51ad2ac..5550ebfbe2c 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, Argonaut ARC cpu. - Copyright (C) 2000, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2004, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -54,7 +54,6 @@ extern int shift_operator (rtx, enum machine_mode); extern enum arc_function_type arc_compute_function_type (tree); -extern void arc_init (void); extern unsigned int arc_compute_frame_size (int); extern void arc_save_restore (FILE *, const char *, unsigned int, unsigned int, const char *); diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 72800cac3a5..5031b99e2f7 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1,6 +1,6 @@ /* Subroutines used for code generation on the Argonaut ARC cpu. Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -95,6 +95,7 @@ static bool arc_return_in_memory (const_tree, const_tree); static bool arc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static void arc_trampoline_init (rtx, tree, rtx); +static void arc_option_override (void); /* ARC specific attributs. */ @@ -130,6 +131,9 @@ static const struct attribute_spec arc_attribute_table[] = #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION arc_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE arc_option_override + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS arc_rtx_costs #undef TARGET_ADDRESS_COST @@ -173,10 +177,11 @@ arc_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) } } -/* Called by OVERRIDE_OPTIONS to initialize various things. */ +/* Implement TARGET_OPTION_OVERRIDE. + These need to be done at start up. It's convenient to do them here. */ -void -arc_init (void) +static void +arc_option_override (void) { char *tmp; diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 9a4e360504b..f2d273dcae0 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, Argonaut ARC cpu. Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -82,24 +82,9 @@ extern int arc_cpu_type; /* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu' appropriately. The result should be nonzero if the cpu is recognized, otherwise zero. This is intended to be redefined in a cover file. - This is used by arc_init. */ + This is used by arc_handle_option. */ #define ARC_EXTENSION_CPU(cpu) 0 -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - - -#define OVERRIDE_OPTIONS \ -do { \ - /* These need to be done at start up. It's convenient to do them here. */ \ - arc_init (); \ -} while (0) /* Target machine storage layout. */ diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def index 1a02ba0522f..645f2817b93 100644 --- a/gcc/config/arm/arm-cores.def +++ b/gcc/config/arm/arm-cores.def @@ -121,6 +121,7 @@ ARM_CORE("arm1156t2f-s", arm1156t2fs, 6T2, FL_LDSCHED | FL_VFPV2, 9e) ARM_CORE("cortex-a5", cortexa5, 7A, FL_LDSCHED, 9e) ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, 9e) ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, cortex_a9) +ARM_CORE("cortex-a15", cortexa15, 7A, FL_LDSCHED, 9e) ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, 9e) ARM_CORE("cortex-r4f", cortexr4f, 7R, FL_LDSCHED, 9e) ARM_CORE("cortex-m4", cortexm4, 7EM, FL_LDSCHED, 9e) diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index cd29ef15cfa..c861bb6a361 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -1,6 +1,6 @@ /* Prototypes for exported functions defined in arm.c and pe.c Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) @@ -23,8 +23,6 @@ #ifndef GCC_ARM_PROTOS_H #define GCC_ARM_PROTOS_H -extern void arm_override_options (void); -extern void arm_optimization_options (int, int); extern int use_return_insn (int, rtx); extern enum reg_class arm_regno_class (int); extern void arm_load_pic_register (unsigned long); @@ -88,6 +86,8 @@ extern int arm_coproc_mem_operand (rtx, bool); extern int neon_vector_mem_operand (rtx, int); extern int neon_struct_mem_operand (rtx); extern int arm_no_early_store_addr_dep (rtx, rtx); +extern int arm_early_store_addr_dep (rtx, rtx); +extern int arm_early_load_addr_dep (rtx, rtx); extern int arm_no_early_alu_shift_dep (rtx, rtx); extern int arm_no_early_alu_shift_value_dep (rtx, rtx); extern int arm_no_early_mul_dep (rtx, rtx); @@ -129,6 +129,7 @@ extern const char *output_move_quad (rtx *); extern const char *output_move_vfp (rtx *operands); extern const char *output_move_neon (rtx *operands); extern int arm_attr_length_move_neon (rtx); +extern int arm_address_offset_is_imm (rtx); extern const char *output_add_immediate (rtx *); extern const char *arithmetic_instr (rtx, int); extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int); @@ -150,16 +151,11 @@ extern const char *arm_output_memory_barrier (rtx *); extern const char *arm_output_sync_insn (rtx, rtx *); extern unsigned int arm_sync_loop_insns (rtx , rtx *); -extern bool arm_output_addr_const_extra (FILE *, rtx); - #if defined TREE_CODE -extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern void arm_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, - tree, bool); extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); extern bool arm_pad_arg_upward (enum machine_mode, const_tree); extern bool arm_pad_reg_upward (enum machine_mode, tree, int); -extern bool arm_needs_doubleword_align (enum machine_mode, tree); +extern bool arm_needs_doubleword_align (enum machine_mode, const_tree); #endif extern int arm_apply_result_size (void); extern rtx aapcs_libcall_value (enum machine_mode); diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md index 4123043058b..eb1dde5c145 100644 --- a/gcc/config/arm/arm-tune.md +++ b/gcc/config/arm/arm-tune.md @@ -1,5 +1,5 @@ ;; -*- buffer-read-only: t -*- ;; Generated automatically by gentune.sh from arm-cores.def (define_attr "tune" - "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,cortexa5,cortexa8,cortexa9,cortexr4,cortexr4f,cortexm4,cortexm3,cortexm1,cortexm0" + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,cortexa5,cortexa8,cortexa9,cortexa15,cortexr4,cortexr4f,cortexm4,cortexm3,cortexm1,cortexm0" (const (symbol_ref "((enum attr_tune) arm_tune)"))) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5ed16a8a76e..782bc985a1e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -164,6 +164,10 @@ static void emit_constant_insn (rtx cond, rtx pattern); static rtx emit_set_insn (rtx, rtx); static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +static rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static void arm_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static rtx aapcs_allocate_return_reg (enum machine_mode, const_tree, const_tree); static int aapcs_select_return_coproc (const_tree, const_tree); @@ -192,6 +196,8 @@ static bool arm_return_in_memory (const_tree, const_tree); #ifdef TARGET_UNWIND_INFO static void arm_unwind_emit (FILE *, rtx); static bool arm_output_ttype (rtx); +static void arm_asm_emit_except_personality (rtx); +static void arm_asm_init_sections (void); #endif static void arm_dwarf_handle_frame_unspec (const char *, rtx, int); static rtx arm_dwarf_register_span (rtx); @@ -209,6 +215,8 @@ static void arm_init_libfuncs (void); static tree arm_build_builtin_va_list (void); static void arm_expand_builtin_va_start (tree, rtx); static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); +static void arm_option_override (void); +static void arm_option_optimization (int, int); static bool arm_handle_option (size_t, const char *, int); static void arm_target_help (void); static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); @@ -216,6 +224,7 @@ static bool arm_cannot_copy_insn_p (rtx); static bool arm_tls_symbol_p (rtx x); static int arm_issue_rate (void); static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; +static bool arm_output_addr_const_extra (FILE *, rtx); static bool arm_allocate_stack_slots_for_args (void); static const char *arm_invalid_parameter_type (const_tree t); static const char *arm_invalid_return_type (const_tree t); @@ -230,6 +239,8 @@ static rtx arm_trampoline_adjust_address (rtx); static rtx arm_pic_static_addr (rtx orig, rtx reg); static bool cortex_a9_sched_adjust_cost (rtx, rtx, rtx, int *); static bool xscale_sched_adjust_cost (rtx, rtx, rtx, int *); +static unsigned int arm_units_per_simd_word (enum machine_mode); +static bool arm_class_likely_spilled_p (reg_class_t); /* Table of machine attributes. */ @@ -299,6 +310,9 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_PRINT_OPERAND_PUNCT_VALID_P #define TARGET_PRINT_OPERAND_PUNCT_VALID_P arm_print_operand_punct_valid_p +#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA +#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA arm_output_addr_const_extra + #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE arm_output_function_prologue @@ -311,6 +325,10 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_HANDLE_OPTION arm_handle_option #undef TARGET_HELP #define TARGET_HELP arm_target_help +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE arm_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION arm_option_optimization #undef TARGET_COMP_TYPE_ATTRIBUTES #define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes @@ -357,6 +375,8 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_SHIFT_TRUNCATION_MASK arm_shift_truncation_mask #undef TARGET_VECTOR_MODE_SUPPORTED_P #define TARGET_VECTOR_MODE_SUPPORTED_P arm_vector_mode_supported_p +#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD +#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD arm_units_per_simd_word #undef TARGET_MACHINE_DEPENDENT_REORG #define TARGET_MACHINE_DEPENDENT_REORG arm_reorg @@ -377,6 +397,10 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_PASS_BY_REFERENCE arm_pass_by_reference #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES arm_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG arm_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE arm_function_arg_advance #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs @@ -447,6 +471,12 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_ARM_EABI_UNWINDER #define TARGET_ARM_EABI_UNWINDER true + +#undef TARGET_ASM_EMIT_EXCEPT_PERSONALITY +#define TARGET_ASM_EMIT_EXCEPT_PERSONALITY arm_asm_emit_except_personality + +#undef TARGET_ASM_INIT_SECTIONS +#define TARGET_ASM_INIT_SECTIONS arm_asm_init_sections #endif /* TARGET_UNWIND_INFO */ #undef TARGET_DWARF_HANDLE_FRAME_UNSPEC @@ -520,6 +550,9 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE arm_can_eliminate +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P arm_class_likely_spilled_p + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -1356,13 +1389,16 @@ arm_target_help (void) } -/* Fix up any incompatible options that the user has specified. - This has now turned into a maze. */ -void -arm_override_options (void) +/* Fix up any incompatible options that the user has specified. */ +static void +arm_option_override (void) { unsigned i; +#ifdef SUBTARGET_OVERRIDE_OPTIONS + SUBTARGET_OVERRIDE_OPTIONS; +#endif + if (arm_selected_arch) { if (arm_selected_cpu) @@ -1403,7 +1439,7 @@ arm_override_options (void) arm_selected_cpu = &all_cores[SUBTARGET_CPU_DEFAULT]; #endif /* Default to ARM6. */ - if (arm_selected_cpu->name) + if (!arm_selected_cpu->name) arm_selected_cpu = &all_cores[arm6]; } @@ -1545,7 +1581,7 @@ arm_override_options (void) /* Callee super interworking implies thumb interworking. Adding this to the flags here simplifies the logic elsewhere. */ if (TARGET_THUMB && TARGET_CALLEE_INTERWORKING) - target_flags |= MASK_INTERWORK; + target_flags |= MASK_INTERWORK; /* TARGET_BACKTRACE calls leaf_function_p, which causes a crash if done from here where no function is being compiled currently. */ @@ -1555,9 +1591,6 @@ arm_override_options (void) if (TARGET_ARM && TARGET_CALLEE_INTERWORKING) warning (0, "enabling callee interworking support is only meaningful when compiling for the Thumb"); - if (TARGET_ARM && TARGET_CALLER_INTERWORKING) - warning (0, "enabling caller interworking support is only meaningful when compiling for the Thumb"); - if (TARGET_APCS_STACK && !TARGET_APCS_FRAME) { warning (0, "-mapcs-stack-check incompatible with -mno-apcs-frame"); @@ -4181,7 +4214,7 @@ static struct static int aapcs_select_call_coproc (CUMULATIVE_ARGS *pcum, enum machine_mode mode, - tree type) + const_tree type) { int i; @@ -4293,7 +4326,7 @@ aapcs_libcall_value (enum machine_mode mode) numbers referred to here are those in the AAPCS. */ static void aapcs_layout_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode, - tree type, int named) + const_tree type, bool named) { int nregs, nregs2; int ncrn; @@ -4458,7 +4491,7 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype, /* Return true if mode/type need doubleword alignment. */ bool -arm_needs_doubleword_align (enum machine_mode mode, tree type) +arm_needs_doubleword_align (enum machine_mode mode, const_tree type) { return (GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY || (type && TYPE_ALIGN (type) > PARM_BOUNDARY)); @@ -4476,11 +4509,17 @@ arm_needs_doubleword_align (enum machine_mode mode, tree type) 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). */ + (otherwise it is an extra parameter matching an ellipsis). -rtx + On the ARM, normally the first 16 bytes are passed in registers r0-r3; all + other arguments are passed on the stack. If (NAMED == 0) (which happens + only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is + defined), say it is passed in the stack (function_prologue will + indeed make it pass in the stack if necessary). */ + +static rtx arm_function_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode, - tree type, int named) + const_tree type, bool named) { int nregs; @@ -4553,9 +4592,13 @@ arm_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode, return 0; } -void +/* Update the data in PCUM 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 arm_function_arg_advance (CUMULATIVE_ARGS *pcum, enum machine_mode mode, - tree type, bool named) + const_tree type, bool named) { if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL) { @@ -13310,6 +13353,34 @@ arm_attr_length_move_neon (rtx insn) return 4; } +/* Return nonzero if the offset in the address is an immediate. Otherwise, + return zero. */ + +int +arm_address_offset_is_imm (rtx insn) +{ + rtx mem, addr; + + extract_insn_cached (insn); + + if (REG_P (recog_data.operand[0])) + return 0; + + mem = recog_data.operand[0]; + + gcc_assert (MEM_P (mem)); + + addr = XEXP (mem, 0); + + if (GET_CODE (addr) == REG + || (GET_CODE (addr) == PLUS + && GET_CODE (XEXP (addr, 0)) == REG + && GET_CODE (XEXP (addr, 1)) == CONST_INT)) + return 1; + else + return 0; +} + /* Output an ADD r, s, #n where n may be too big for one instruction. If adding zero to one register, output nothing. */ const char * @@ -21468,6 +21539,38 @@ arm_no_early_store_addr_dep (rtx producer, rtx consumer) return !reg_overlap_mentioned_p (value, addr); } +/* Return nonzero if the CONSUMER instruction (a store) does need + PRODUCER's value to calculate the address. */ + +int +arm_early_store_addr_dep (rtx producer, rtx consumer) +{ + return !arm_no_early_store_addr_dep (producer, consumer); +} + +/* Return nonzero if the CONSUMER instruction (a load) does need + PRODUCER's value to calculate the address. */ + +int +arm_early_load_addr_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx addr = PATTERN (consumer); + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (addr) == COND_EXEC) + addr = COND_EXEC_CODE (addr); + if (GET_CODE (addr) == PARALLEL) + addr = XVECEXP (addr, 0, 0); + addr = XEXP (addr, 1); + + return reg_overlap_mentioned_p (value, addr); +} + /* Return nonzero if the CONSUMER instruction (an ALU op) does not have an early register shift value or amount dependency on the result of PRODUCER. */ @@ -21846,6 +21949,33 @@ arm_vector_mode_supported_p (enum machine_mode mode) return false; } +/* Use the option -mvectorize-with-neon-quad to override the use of doubleword + registers when autovectorizing for Neon, at least until multiple vector + widths are supported properly by the middle-end. */ + +static unsigned int +arm_units_per_simd_word (enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return (TARGET_NEON + ? (TARGET_NEON_VECTORIZE_QUAD ? 16 : 8) : UNITS_PER_WORD); +} + +/* Implement TARGET_CLASS_LIKELY_SPILLED_P. + + We need to define this for LO_REGS on thumb. Otherwise we can end up + using r0-r4 for function arguments, r7 for the stack frame and don't + have enough left over to do doubleword arithmetic. */ + +static bool +arm_class_likely_spilled_p (reg_class_t rclass) +{ + if ((TARGET_THUMB && rclass == LO_REGS) + || rclass == CC_REG) + return true; + + return false; +} + /* Implements target hook small_register_classes_for_mode_p. */ bool arm_small_register_classes_for_mode_p (enum machine_mode mode ATTRIBUTE_UNUSED) @@ -22194,6 +22324,25 @@ arm_output_ttype (rtx x) return TRUE; } + +/* Implement TARGET_ASM_EMIT_EXCEPT_PERSONALITY. */ + +static void +arm_asm_emit_except_personality (rtx personality) +{ + fputs ("\t.personality\t", asm_out_file); + output_addr_const (asm_out_file, personality); + fputc ('\n', asm_out_file); +} + +/* Implement TARGET_ASM_INITIALIZE_SECTIONS. */ + +static void +arm_asm_init_sections (void) +{ + exception_section = get_unnamed_section (0, output_section_asm_op, + "\t.handlerdata"); +} #endif /* TARGET_UNWIND_INFO */ @@ -22306,7 +22455,9 @@ arm_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs ("(tlsldo)", file); } -bool +/* Implement TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */ + +static bool arm_output_addr_const_extra (FILE *fp, rtx x) { if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) @@ -22446,6 +22597,7 @@ arm_issue_rate (void) { case cortexr4: case cortexr4f: + case cortexa5: case cortexa8: case cortexa9: return 2; @@ -22564,8 +22716,8 @@ arm_order_regs_for_local_alloc (void) } /* Set default optimization options. */ -void -arm_optimization_options (int level, int size ATTRIBUTE_UNUSED) +static void +arm_option_optimization (int level, int size ATTRIBUTE_UNUSED) { /* Enable section anchors by default at -O1 or higher. Use 2 to distinguish from an explicit -fsection-anchors diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 9730417ee3e..9bd1c69e849 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). @@ -498,11 +498,6 @@ extern int arm_arch_hwdiv; that is controlled by the APCS-FRAME option. */ #define CAN_DEBUG_WITHOUT_FP -#define OVERRIDE_OPTIONS arm_override_options () - -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ - arm_optimization_options ((LEVEL), (SIZE)) - /* Nonzero if PIC code requires explicit qualifiers to generate PLT and GOT relocs rather than the assembler doing so implicitly. Subtargets can override these if required. */ @@ -580,12 +575,6 @@ extern int arm_arch_hwdiv; #define UNITS_PER_WORD 4 -/* Use the option -mvectorize-with-neon-quad to override the use of doubleword - registers when autovectorizing for Neon, at least until multiple vector - widths are supported properly by the middle-end. */ -#define UNITS_PER_SIMD_WORD(MODE) \ - (TARGET_NEON ? (TARGET_NEON_VECTORIZE_QUAD ? 16 : 8) : UNITS_PER_WORD) - /* True if natural alignment is used for doubleword types. */ #define ARM_DOUBLEWORD_ALIGN TARGET_AAPCS_BASED @@ -1295,13 +1284,6 @@ enum reg_class || reg_classes_intersect_p (VFP_REGS, (CLASS)) \ : 0) -/* We need to define this for LO_REGS on thumb. Otherwise we can end up - using r0-r4 for function arguments, r7 for the stack frame and don't - have enough left over to do doubleword arithmetic. */ -#define CLASS_LIKELY_SPILLED_P(CLASS) \ - ((TARGET_THUMB && (CLASS) == LO_REGS) \ - || (CLASS) == CC_REG) - /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS) #define BASE_REG_CLASS (TARGET_THUMB1 ? LO_REGS : CORE_REGS) @@ -1737,27 +1719,6 @@ typedef struct MACHMODE aapcs_vfp_rmode; } CUMULATIVE_ARGS; -/* Define where to put the arguments 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 ARM, normally the first 16 bytes are passed in registers r0-r3; all - other arguments are passed on the stack. If (NAMED == 0) (which happens - only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is - defined), say it is passed in the stack (function_prologue will - indeed make it pass in the stack if necessary). */ -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED)) - #define FUNCTION_ARG_PADDING(MODE, TYPE) \ (arm_pad_arg_upward (MODE, TYPE) ? upward : downward) @@ -1776,12 +1737,6 @@ typedef struct #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \ arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL)) -/* 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.) */ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - arm_function_arg_advance (&(CUM), (MODE), (TYPE), (NAMED)) - /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, `PARM_BOUNDARY' is used for all arguments. */ @@ -2464,10 +2419,6 @@ extern int making_const_table; & ~ (unsigned HOST_WIDE_INT) 0xffffffff) \ : 0)))) -#define OUTPUT_ADDR_CONST_EXTRA(file, x, fail) \ - if (arm_output_addr_const_extra (file, x) == FALSE) \ - goto fail - /* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. */ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 1815955cb1c..defda7cc2d9 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -234,10 +234,12 @@ (const_string "yes")) ; Enable all alternatives that are both arch_enabled and insn_enabled. -(define_attr "enabled" "no,yes" - (if_then_else (eq_attr "insn_enabled" "yes") - (attr "arch_enabled") - (const_string "no"))) + (define_attr "enabled" "no,yes" + (if_then_else (eq_attr "insn_enabled" "yes") + (if_then_else (eq_attr "arch_enabled" "yes") + (const_string "yes") + (const_string "no")) + (const_string "no"))) ; POOL_RANGE is how far away from a constant pool entry that this insn ; can be placed. If the distance is zero, then this insn will never @@ -331,7 +333,7 @@ (const_string "alu"))) ; Load scheduling, set from the arm_ld_sched variable -; initialized by arm_override_options() +; initialized by arm_option_override() (define_attr "ldsched" "no,yes" (const (symbol_ref "arm_ld_sched"))) ;; Classification of NEON instructions for scheduling purposes. @@ -417,10 +419,11 @@ ; CLOB means that the condition codes are altered in an undefined manner, if ; they are altered at all ; -; UNCONDITIONAL means the instions can not be conditionally executed. +; UNCONDITIONAL means the instruction can not be conditionally executed and +; that the instruction does not use or alter the condition codes. ; -; NOCOND means that the condition codes are neither altered nor affect the -; output of this insn +; NOCOND means that the instruction does not use or alter the condition +; codes but can be converted into a conditionally exectuted instruction. (define_attr "conds" "use,set,clob,unconditional,nocond" (if_then_else @@ -494,16 +497,16 @@ ;; True if the generic scheduling description should be used. (define_attr "generic_sched" "yes,no" - (const (if_then_else - (ior (eq_attr "tune" "arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,cortexa8,cortexa9") - (eq_attr "tune_cortexr4" "yes")) + (const (if_then_else + (ior (eq_attr "tune" "arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,cortexa5,cortexa8,cortexa9,cortexm4") + (eq_attr "tune_cortexr4" "yes")) (const_string "no") (const_string "yes")))) (define_attr "generic_vfp" "yes,no" (const (if_then_else (and (eq_attr "fpu" "vfp") - (eq_attr "tune" "!arm1020e,arm1022e,cortexa8,cortexa9") + (eq_attr "tune" "!arm1020e,arm1022e,cortexa5,cortexa8,cortexa9,cortexm4") (eq_attr "tune_cortexr4" "no")) (const_string "yes") (const_string "no")))) @@ -513,10 +516,13 @@ (include "arm1020e.md") (include "arm1026ejs.md") (include "arm1136jfs.md") +(include "cortex-a5.md") (include "cortex-a8.md") (include "cortex-a9.md") (include "cortex-r4.md") (include "cortex-r4f.md") +(include "cortex-m4.md") +(include "cortex-m4-fpu.md") (include "vfp11.md") @@ -3319,7 +3325,7 @@ ) (define_insn "arm_ashldi3_1bit" - [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + [(set (match_operand:DI 0 "s_register_operand" "=r,&r") (ashift:DI (match_operand:DI 1 "s_register_operand" "0,r") (const_int 1))) (clobber (reg:CC CC_REGNUM))] @@ -3378,13 +3384,14 @@ ) (define_insn "arm_ashrdi3_1bit" - [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + [(set (match_operand:DI 0 "s_register_operand" "=r,&r") (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "0,r") (const_int 1))) (clobber (reg:CC CC_REGNUM))] "TARGET_32BIT" "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx" [(set_attr "conds" "clob") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -3434,13 +3441,14 @@ ) (define_insn "arm_lshrdi3_1bit" - [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + [(set (match_operand:DI 0 "s_register_operand" "=r,&r") (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "0,r") (const_int 1))) (clobber (reg:CC CC_REGNUM))] "TARGET_32BIT" "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx" [(set_attr "conds" "clob") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -3567,6 +3575,7 @@ "mvn%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") + (set_attr "insn" "mvn") (set_attr "arch" "32,a") (set_attr "type" "alu_shift,alu_shift_reg")]) @@ -3583,6 +3592,7 @@ "mvn%.\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") + (set_attr "insn" "mvn") (set_attr "arch" "32,a") (set_attr "type" "alu_shift,alu_shift_reg")]) @@ -3598,6 +3608,7 @@ "mvn%.\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") + (set_attr "insn" "mvn") (set_attr "arch" "32,a") (set_attr "type" "alu_shift,alu_shift_reg")]) @@ -3857,7 +3868,8 @@ (not:SI (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_32BIT" "mvn%?\\t%0, %1" - [(set_attr "predicable" "yes")] + [(set_attr "predicable" "yes") + (set_attr "insn" "mvn")] ) (define_insn "*thumb1_one_cmplsi2" @@ -3865,7 +3877,8 @@ (not:SI (match_operand:SI 1 "register_operand" "l")))] "TARGET_THUMB1" "mvn\\t%0, %1" - [(set_attr "length" "2")] + [(set_attr "length" "2") + (set_attr "insn" "mvn")] ) (define_insn "*notsi_compare0" @@ -3876,7 +3889,8 @@ (not:SI (match_dup 1)))] "TARGET_32BIT" "mvn%.\\t%0, %1" - [(set_attr "conds" "set")] + [(set_attr "conds" "set") + (set_attr "insn" "mvn")] ) (define_insn "*notsi_compare0_scratch" @@ -3886,7 +3900,8 @@ (clobber (match_scratch:SI 0 "=r"))] "TARGET_32BIT" "mvn%.\\t%0, %1" - [(set_attr "conds" "set")] + [(set_attr "conds" "set") + (set_attr "insn" "mvn")] ) ;; Fixed <--> Floating conversion insns @@ -4025,69 +4040,81 @@ ;; Zero and sign extension instructions. -(define_expand "zero_extendsidi2" - [(set (match_operand:DI 0 "s_register_operand" "") - (zero_extend:DI (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_32BIT" - "" +(define_insn "zero_extenddi2" + [(set (match_operand:DI 0 "s_register_operand" "=r") + (zero_extend:DI (match_operand:QHSI 1 "" + "")))] + "TARGET_32BIT " + "#" + [(set_attr "length" "8") + (set_attr "ce_count" "2") + (set_attr "predicable" "yes")] ) -(define_insn "*arm_zero_extendsidi2" +(define_insn "extenddi2" [(set (match_operand:DI 0 "s_register_operand" "=r") - (zero_extend:DI (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM" - "* - if (REGNO (operands[1]) - != REGNO (operands[0]) + (WORDS_BIG_ENDIAN ? 1 : 0)) - output_asm_insn (\"mov%?\\t%Q0, %1\", operands); - return \"mov%?\\t%R0, #0\"; - " + (sign_extend:DI (match_operand:QHSI 1 "" + "")))] + "TARGET_32BIT " + "#" [(set_attr "length" "8") + (set_attr "ce_count" "2") + (set_attr "shift" "1") (set_attr "predicable" "yes")] ) -(define_expand "zero_extendqidi2" - [(set (match_operand:DI 0 "s_register_operand" "") - (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "")))] +;; Splits for all extensions to DImode +(define_split + [(set (match_operand:DI 0 "s_register_operand" "") + (zero_extend:DI (match_operand 1 "nonimmediate_operand" "")))] "TARGET_32BIT" - "" -) - -(define_insn "*arm_zero_extendqidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r,r") - (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] - "TARGET_ARM" - "@ - and%?\\t%Q0, %1, #255\;mov%?\\t%R0, #0 - ldr%(b%)\\t%Q0, %1\;mov%?\\t%R0, #0" - [(set_attr "length" "8") - (set_attr "predicable" "yes") - (set_attr "type" "*,load_byte") - (set_attr "pool_range" "*,4092") - (set_attr "neg_pool_range" "*,4084")] -) + [(set (match_dup 0) (match_dup 1))] +{ + rtx lo_part = gen_lowpart (SImode, operands[0]); + enum machine_mode src_mode = GET_MODE (operands[1]); + + if (REG_P (operands[0]) + && !reg_overlap_mentioned_p (operands[0], operands[1])) + emit_clobber (operands[0]); + if (!REG_P (lo_part) || src_mode != SImode + || !rtx_equal_p (lo_part, operands[1])) + { + if (src_mode == SImode) + emit_move_insn (lo_part, operands[1]); + else + emit_insn (gen_rtx_SET (VOIDmode, lo_part, + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); + operands[1] = lo_part; + } + operands[0] = gen_highpart (SImode, operands[0]); + operands[1] = const0_rtx; +}) -(define_expand "extendsidi2" +(define_split [(set (match_operand:DI 0 "s_register_operand" "") - (sign_extend:DI (match_operand:SI 1 "s_register_operand" "")))] + (sign_extend:DI (match_operand 1 "nonimmediate_operand" "")))] "TARGET_32BIT" - "" -) + [(set (match_dup 0) (ashiftrt:SI (match_dup 1) (const_int 31)))] +{ + rtx lo_part = gen_lowpart (SImode, operands[0]); + enum machine_mode src_mode = GET_MODE (operands[1]); -(define_insn "*arm_extendsidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r") - (sign_extend:DI (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM" - "* - if (REGNO (operands[1]) - != REGNO (operands[0]) + (WORDS_BIG_ENDIAN ? 1 : 0)) - output_asm_insn (\"mov%?\\t%Q0, %1\", operands); - return \"mov%?\\t%R0, %Q0, asr #31\"; - " - [(set_attr "length" "8") - (set_attr "shift" "1") - (set_attr "predicable" "yes")] -) + if (REG_P (operands[0]) + && !reg_overlap_mentioned_p (operands[0], operands[1])) + emit_clobber (operands[0]); + + if (!REG_P (lo_part) || src_mode != SImode + || !rtx_equal_p (lo_part, operands[1])) + { + if (src_mode == SImode) + emit_move_insn (lo_part, operands[1]); + else + emit_insn (gen_rtx_SET (VOIDmode, lo_part, + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + operands[1] = lo_part; + } + operands[0] = gen_highpart (SImode, operands[0]); +}) (define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "s_register_operand" "") @@ -4123,26 +4150,22 @@ [(set (match_operand:SI 0 "register_operand" "=l,l") (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))] "TARGET_THUMB1" - "* +{ rtx mem; if (which_alternative == 0 && arm_arch6) - return \"uxth\\t%0, %1\"; + return "uxth\t%0, %1"; if (which_alternative == 0) - return \"#\"; + return "#"; mem = XEXP (operands[1], 0); if (GET_CODE (mem) == CONST) mem = XEXP (mem, 0); - if (GET_CODE (mem) == LABEL_REF) - return \"ldr\\t%0, %1\"; - if (GET_CODE (mem) == PLUS) { rtx a = XEXP (mem, 0); - rtx b = XEXP (mem, 1); /* This can happen due to bugs in reload. */ if (GET_CODE (a) == REG && REGNO (a) == SP_REGNUM) @@ -4151,24 +4174,19 @@ ops[0] = operands[0]; ops[1] = a; - output_asm_insn (\"mov %0, %1\", ops); + output_asm_insn ("mov\t%0, %1", ops); XEXP (mem, 0) = operands[0]; } - - else if ( GET_CODE (a) == LABEL_REF - && GET_CODE (b) == CONST_INT) - return \"ldr\\t%0, %1\"; } - return \"ldrh\\t%0, %1\"; - " + return "ldrh\t%0, %1"; +} [(set_attr_alternative "length" [(if_then_else (eq_attr "is_arch6" "yes") (const_int 2) (const_int 4)) (const_int 4)]) - (set_attr "type" "alu_shift,load_byte") - (set_attr "pool_range" "*,60")] + (set_attr "type" "alu_shift,load_byte")] ) (define_insn "*arm_zero_extendhisi2" @@ -4179,9 +4197,7 @@ # ldr%(h%)\\t%0, %1" [(set_attr "type" "alu_shift,load_byte") - (set_attr "predicable" "yes") - (set_attr "pool_range" "*,256") - (set_attr "neg_pool_range" "*,244")] + (set_attr "predicable" "yes")] ) (define_insn "*arm_zero_extendhisi2_v6" @@ -4192,9 +4208,7 @@ uxth%?\\t%0, %1 ldr%(h%)\\t%0, %1" [(set_attr "type" "alu_shift,load_byte") - (set_attr "predicable" "yes") - (set_attr "pool_range" "*,256") - (set_attr "neg_pool_range" "*,244")] + (set_attr "predicable" "yes")] ) (define_insn "*arm_zero_extendhisi2addsi" @@ -4263,9 +4277,8 @@ "@ uxtb\\t%0, %1 ldrb\\t%0, %1" - [(set_attr "length" "2,2") - (set_attr "type" "alu_shift,load_byte") - (set_attr "pool_range" "*,32")] + [(set_attr "length" "2") + (set_attr "type" "alu_shift,load_byte")] ) (define_insn "*arm_zero_extendqisi2" @@ -4277,9 +4290,7 @@ ldr%(b%)\\t%0, %1\\t%@ zero_extendqisi2" [(set_attr "length" "8,4") (set_attr "type" "alu_shift,load_byte") - (set_attr "predicable" "yes") - (set_attr "pool_range" "*,4096") - (set_attr "neg_pool_range" "*,4084")] + (set_attr "predicable" "yes")] ) (define_insn "*arm_zero_extendqisi2_v6" @@ -4290,9 +4301,7 @@ uxtb%(%)\\t%0, %1 ldr%(b%)\\t%0, %1\\t%@ zero_extendqisi2" [(set_attr "type" "alu_shift,load_byte") - (set_attr "predicable" "yes") - (set_attr "pool_range" "*,4096") - (set_attr "neg_pool_range" "*,4084")] + (set_attr "predicable" "yes")] ) (define_insn "*arm_zero_extendqisi2addsi" @@ -5010,6 +5019,7 @@ }" [(set_attr "length" "4,4,6,2,2,6,4,4") (set_attr "type" "*,*,*,load2,store2,load2,store2,*") + (set_attr "insn" "*,mov,*,*,*,*,*,mov") (set_attr "pool_range" "*,*,*,*,*,1020,*,*")] ) @@ -5111,7 +5121,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=r") (lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:SI 2 "general_operand" "i")))] - "TARGET_32BIT" + "arm_arch_thumb2" "movt%?\t%0, #:upper16:%c2" [(set_attr "predicable" "yes") (set_attr "length" "4")] @@ -5132,6 +5142,7 @@ ldr%?\\t%0, %1 str%?\\t%1, %0" [(set_attr "type" "*,*,*,*,load1,store1") + (set_attr "insn" "mov,mov,mvn,mov,*,*") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,*,*,4096,*") (set_attr "neg_pool_range" "*,*,*,*,4084,*")] @@ -5787,6 +5798,7 @@ ldr%(h%)\\t%0, %1\\t%@ movhi" [(set_attr "type" "*,*,store1,load1") (set_attr "predicable" "yes") + (set_attr "insn" "mov,mvn,*,*") (set_attr "pool_range" "*,*,*,256") (set_attr "neg_pool_range" "*,*,*,244")] ) @@ -5798,7 +5810,8 @@ "@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi" - [(set_attr "predicable" "yes")] + [(set_attr "predicable" "yes") + (set_attr "insn" "mov,mvn")] ) (define_expand "thumb_movhi_clobber" @@ -5934,6 +5947,7 @@ ldr%(b%)\\t%0, %1 str%(b%)\\t%1, %0" [(set_attr "type" "*,*,load1,store1") + (set_attr "insn" "mov,mvn,*,*") (set_attr "predicable" "yes")] ) @@ -5952,6 +5966,7 @@ mov\\t%0, %1" [(set_attr "length" "2") (set_attr "type" "*,load1,store1,*,*,*") + (set_attr "insn" "*,*,*,mov,mov,mov") (set_attr "pool_range" "*,32,*,*,*,*") (set_attr "conds" "clob,nocond,nocond,nocond,nocond,clob")]) @@ -6017,9 +6032,9 @@ " [(set_attr "conds" "unconditional") (set_attr "type" "load1,store1,*,*") + (set_attr "insn" "*,*,mov,mov") (set_attr "length" "4,4,4,8") - (set_attr "predicable" "yes") - ] + (set_attr "predicable" "yes")] ) (define_insn "*thumb1_movhf" @@ -6053,6 +6068,7 @@ " [(set_attr "length" "2") (set_attr "type" "*,load1,store1,*,*") + (set_attr "insn" "mov,*,*,mov,mov") (set_attr "pool_range" "*,1020,*,*,*") (set_attr "conds" "clob,nocond,nocond,nocond,nocond")]) @@ -6107,6 +6123,7 @@ str%?\\t%1, %0\\t%@ float" [(set_attr "predicable" "yes") (set_attr "type" "*,load1,store1") + (set_attr "insn" "mov,*,*") (set_attr "pool_range" "*,4096,*") (set_attr "arm_neg_pool_range" "*,4084,*") (set_attr "thumb2_neg_pool_range" "*,0,*")] @@ -6130,6 +6147,7 @@ [(set_attr "length" "2") (set_attr "type" "*,load1,store1,load1,store1,*,*") (set_attr "pool_range" "*,*,*,1020,*,*,*") + (set_attr "insn" "*,*,*,*,*,mov,mov") (set_attr "conds" "clob,nocond,nocond,nocond,nocond,nocond,nocond")] ) @@ -6259,6 +6277,7 @@ " [(set_attr "length" "4,2,2,6,4,4") (set_attr "type" "*,load2,store2,load2,store2,*") + (set_attr "insn" "*,*,*,*,*,mov") (set_attr "pool_range" "*,*,*,1020,*,*")] ) @@ -7306,6 +7325,7 @@ "TARGET_ARM" "mov%D1\\t%0, #0\;mov%d1\\t%0, #1" [(set_attr "conds" "use") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -7316,6 +7336,7 @@ "TARGET_ARM" "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0" [(set_attr "conds" "use") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -7326,6 +7347,7 @@ "TARGET_ARM" "mov%D1\\t%0, #0\;mvn%d1\\t%0, #1" [(set_attr "conds" "use") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -7689,7 +7711,8 @@ mvn%d3\\t%0, #%B1\;mov%D3\\t%0, %2 mvn%d3\\t%0, #%B1\;mvn%D3\\t%0, #%B2" [(set_attr "length" "4,4,4,4,8,8,8,8") - (set_attr "conds" "use")] + (set_attr "conds" "use") + (set_attr "insn" "mov,mvn,mov,mvn,mov,mov,mvn,mvn")] ) (define_insn "*movsfcc_soft_insn" @@ -7702,7 +7725,8 @@ "@ mov%D3\\t%0, %2 mov%d3\\t%0, %1" - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "insn" "mov")] ) @@ -8604,6 +8628,7 @@ "TARGET_ARM" "mov%D1\\t%0, #0\;and%d1\\t%0, %2, #1" [(set_attr "conds" "use") + (set_attr "insn" "mov") (set_attr "length" "8")] ) @@ -8757,6 +8782,7 @@ return \"\"; " [(set_attr "conds" "use") + (set_attr "insn" "mov") (set_attr "length" "4,4,8")] ) @@ -9473,6 +9499,7 @@ mov%d4\\t%0, %1\;mvn%D4\\t%0, %2 mvn%d4\\t%0, #%B1\;mvn%D4\\t%0, %2" [(set_attr "conds" "use") + (set_attr "insn" "mvn") (set_attr "length" "4,8,8")] ) @@ -9505,6 +9532,7 @@ mov%D4\\t%0, %1\;mvn%d4\\t%0, %2 mvn%D4\\t%0, #%B1\;mvn%d4\\t%0, %2" [(set_attr "conds" "use") + (set_attr "insn" "mvn") (set_attr "length" "4,8,8")] ) @@ -9542,6 +9570,7 @@ [(set_attr "conds" "use") (set_attr "shift" "2") (set_attr "length" "4,8,8") + (set_attr "insn" "mov") (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") (const_string "alu_shift") (const_string "alu_shift_reg")))] @@ -9581,6 +9610,7 @@ [(set_attr "conds" "use") (set_attr "shift" "2") (set_attr "length" "4,8,8") + (set_attr "insn" "mov") (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") (const_string "alu_shift") (const_string "alu_shift_reg")))] @@ -9621,6 +9651,7 @@ [(set_attr "conds" "use") (set_attr "shift" "1") (set_attr "length" "8") + (set_attr "insn" "mov") (set (attr "type") (if_then_else (and (match_operand 2 "const_int_operand" "") (match_operand 4 "const_int_operand" "")) @@ -9657,6 +9688,7 @@ "TARGET_ARM" "mvn%d5\\t%0, %1\;%I6%D5\\t%0, %2, %3" [(set_attr "conds" "use") + (set_attr "insn" "mvn") (set_attr "length" "8")] ) @@ -9689,6 +9721,7 @@ "TARGET_ARM" "mvn%D5\\t%0, %1\;%I6%d5\\t%0, %2, %3" [(set_attr "conds" "use") + (set_attr "insn" "mvn") (set_attr "length" "8")] ) @@ -10135,6 +10168,7 @@ mvn%D4\\t%0, %2 mov%d4\\t%0, %1\;mvn%D4\\t%0, %2" [(set_attr "conds" "use") + (set_attr "insn" "mvn") (set_attr "length" "4,8")] ) @@ -10547,7 +10581,7 @@ (const_int 16) (const_int 16)) (match_operand:SI 1 "const_int_operand" ""))] - "TARGET_32BIT" + "arm_arch_thumb2" "movt%?\t%0, %c1" [(set_attr "predicable" "yes") (set_attr "length" "4")] @@ -10629,34 +10663,29 @@ (define_expand "bswapsi2" [(set (match_operand:SI 0 "s_register_operand" "=r") (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))] -"TARGET_EITHER" +"TARGET_EITHER && (arm_arch6 || !optimize_size)" " - if (!arm_arch6) - { - if (!optimize_size) - { - rtx op2 = gen_reg_rtx (SImode); - rtx op3 = gen_reg_rtx (SImode); + if (!arm_arch6) + { + rtx op2 = gen_reg_rtx (SImode); + rtx op3 = gen_reg_rtx (SImode); - if (TARGET_THUMB) - { - rtx op4 = gen_reg_rtx (SImode); - rtx op5 = gen_reg_rtx (SImode); + if (TARGET_THUMB) + { + rtx op4 = gen_reg_rtx (SImode); + rtx op5 = gen_reg_rtx (SImode); - emit_insn (gen_thumb_legacy_rev (operands[0], operands[1], - op2, op3, op4, op5)); - } - else - { - emit_insn (gen_arm_legacy_rev (operands[0], operands[1], - op2, op3)); - } + emit_insn (gen_thumb_legacy_rev (operands[0], operands[1], + op2, op3, op4, op5)); + } + else + { + emit_insn (gen_arm_legacy_rev (operands[0], operands[1], + op2, op3)); + } - DONE; - } - else - FAIL; - } + DONE; + } " ) diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index 8ab934631d8..c6cdca4f0e3 100644 --- a/gcc/config/arm/bpabi.h +++ b/gcc/config/arm/bpabi.h @@ -53,7 +53,7 @@ #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}" -#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}" +#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15:%{!r:--be8}}}" /* Tell the assembler to build BPABI binaries. */ #undef SUBTARGET_EXTRA_ASM_SPEC diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md index fce8b5ea0be..41a06637975 100644 --- a/gcc/config/arm/constraints.md +++ b/gcc/config/arm/constraints.md @@ -29,7 +29,7 @@ ;; in Thumb-1 state: I, J, K, L, M, N, O ;; The following multi-letter normal constraints have been used: -;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv, Dy, Di +;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv, Dy, Di, Dz ;; in Thumb-1 state: Pa, Pb, Pc, Pd ;; in Thumb-2 state: Ps, Pt, Pu, Pv, Pw, Px @@ -199,6 +199,12 @@ (and (match_code "const_double") (match_test "TARGET_32BIT && neg_const_double_rtx_ok_for_fpa (op)"))) +(define_constraint "Dz" + "@internal + In ARM/Thumb-2 state a vector of constant zeros." + (and (match_code "const_vector") + (match_test "TARGET_NEON && op == CONST0_RTX (mode)"))) + (define_constraint "Da" "@internal In ARM/Thumb-2 state a const_int, const_double or const_vector that can diff --git a/gcc/config/arm/cortex-a5.md b/gcc/config/arm/cortex-a5.md new file mode 100644 index 00000000000..471f588022e --- /dev/null +++ b/gcc/config/arm/cortex-a5.md @@ -0,0 +1,297 @@ +;; ARM Cortex-A5 pipeline description +;; Copyright (C) 2010 Free Software Foundation, Inc. +;; Contributed by CodeSourcery. +;; +;; 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 +;; . + +(define_automaton "cortex_a5") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Functional units. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The integer (ALU) pipeline. There are five DPU pipeline +;; stages. However the decode/issue stages operate the same for all +;; instructions, so do not model them. We only need to model the +;; first execute stage because instructions always advance one stage +;; per cycle in order. Only branch instructions may dual-issue, so a +;; single unit covers all of the LS, ALU, MAC and FPU pipelines. + +(define_cpu_unit "cortex_a5_ex1" "cortex_a5") + +;; The branch pipeline. Branches can dual-issue with other instructions +;; (except when those instructions take multiple cycles to issue). + +(define_cpu_unit "cortex_a5_branch" "cortex_a5") + +;; Pseudo-unit for blocking the multiply pipeline when a double-precision +;; multiply is in progress. + +(define_cpu_unit "cortex_a5_fpmul_pipe" "cortex_a5") + +;; The floating-point add pipeline (ex1/f1 stage), used to model the usage +;; of the add pipeline by fmac instructions, etc. + +(define_cpu_unit "cortex_a5_fpadd_pipe" "cortex_a5") + +;; Floating-point div/sqrt (long latency, out-of-order completion). + +(define_cpu_unit "cortex_a5_fp_div_sqrt" "cortex_a5") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU instructions. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn_reservation "cortex_a5_alu" 2 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "alu")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_alu_shift" 2 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "alu_shift,alu_shift_reg")) + "cortex_a5_ex1") + +;; Forwarding path for unshifted operands. + +(define_bypass 1 "cortex_a5_alu,cortex_a5_alu_shift" + "cortex_a5_alu") + +(define_bypass 1 "cortex_a5_alu,cortex_a5_alu_shift" + "cortex_a5_alu_shift" + "arm_no_early_alu_shift_dep") + +;; The multiplier pipeline can forward results from wr stage only so +;; there's no need to specify bypasses). + +(define_insn_reservation "cortex_a5_mul" 2 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "mult")) + "cortex_a5_ex1") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/store instructions. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Address-generation happens in the issue stage, which is one stage behind +;; the ex1 stage (the first stage we care about for scheduling purposes). The +;; dc1 stage is parallel with ex1, dc2 with ex2 and rot with wr. + +(define_insn_reservation "cortex_a5_load1" 2 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "load_byte,load1")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_store1" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "store1")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_load2" 3 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "load2")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_store2" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "store2")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_load3" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "load3")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1+cortex_a5_branch,\ + cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_store3" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "store3")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1+cortex_a5_branch,\ + cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_load4" 5 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "load3")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1+cortex_a5_branch,\ + cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_store4" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "store3")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1+cortex_a5_branch,\ + cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branches. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Direct branches are the only instructions we can dual-issue (also IT and +;; nop, but those aren't very interesting for scheduling). (The latency here +;; is meant to represent when the branch actually takes place, but may not be +;; entirely correct.) + +(define_insn_reservation "cortex_a5_branch" 3 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "branch,call")) + "cortex_a5_branch") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Floating-point arithmetic. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn_reservation "cortex_a5_fpalu" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "ffariths, fadds, ffarithd, faddd, fcpys, fmuls, f_cvt,\ + fcmps, fcmpd")) + "cortex_a5_ex1+cortex_a5_fpadd_pipe") + +;; For fconsts and fconstd, 8-bit immediate data is passed directly from +;; f1 to f3 (which I think reduces the latency by one cycle). + +(define_insn_reservation "cortex_a5_fconst" 3 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fconsts,fconstd")) + "cortex_a5_ex1+cortex_a5_fpadd_pipe") + +;; We should try not to attempt to issue a single-precision multiplication in +;; the middle of a double-precision multiplication operation (the usage of +;; cortex_a5_fpmul_pipe). + +(define_insn_reservation "cortex_a5_fpmuls" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fmuls")) + "cortex_a5_ex1+cortex_a5_fpmul_pipe") + +;; For single-precision multiply-accumulate, the add (accumulate) is issued +;; whilst the multiply is in F4. The multiply result can then be forwarded +;; from F5 to F1. The issue unit is only used once (when we first start +;; processing the instruction), but the usage of the FP add pipeline could +;; block other instructions attempting to use it simultaneously. We try to +;; avoid that using cortex_a5_fpadd_pipe. + +(define_insn_reservation "cortex_a5_fpmacs" 8 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fmacs")) + "cortex_a5_ex1+cortex_a5_fpmul_pipe, nothing*3, cortex_a5_fpadd_pipe") + +;; Non-multiply instructions can issue in the middle two instructions of a +;; double-precision multiply. Note that it isn't entirely clear when a branch +;; can dual-issue when a multi-cycle multiplication is in progress; we ignore +;; that for now though. + +(define_insn_reservation "cortex_a5_fpmuld" 7 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fmuld")) + "cortex_a5_ex1+cortex_a5_fpmul_pipe, cortex_a5_fpmul_pipe*2,\ + cortex_a5_ex1+cortex_a5_fpmul_pipe") + +(define_insn_reservation "cortex_a5_fpmacd" 11 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fmacd")) + "cortex_a5_ex1+cortex_a5_fpmul_pipe, cortex_a5_fpmul_pipe*2,\ + cortex_a5_ex1+cortex_a5_fpmul_pipe, nothing*3, cortex_a5_fpadd_pipe") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Floating-point divide/square root instructions. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ??? Not sure if the 14 cycles taken for single-precision divide to complete +;; includes the time taken for the special instruction used to collect the +;; result to travel down the multiply pipeline, or not. Assuming so. (If +;; that's wrong, the latency should be increased by a few cycles.) + +;; fsqrt takes one cycle less, but that is not modelled, nor is the use of the +;; multiply pipeline to collect the divide/square-root result. + +(define_insn_reservation "cortex_a5_fdivs" 14 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fdivs")) + "cortex_a5_ex1, cortex_a5_fp_div_sqrt * 13") + +;; ??? Similarly for fdivd. + +(define_insn_reservation "cortex_a5_fdivd" 29 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "fdivd")) + "cortex_a5_ex1, cortex_a5_fp_div_sqrt * 28") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; VFP to/from core transfers. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; FP loads take data from wr/rot/f3. + +;; Core-to-VFP transfers use the multiply pipeline. + +(define_insn_reservation "cortex_a5_r2f" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "r_2_f")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_f2r" 2 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_2_r")) + "cortex_a5_ex1") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; VFP flag transfer. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ??? The flag forwarding from fmstat to the ex2 stage of the second +;; instruction is not modeled at present. + +(define_insn_reservation "cortex_a5_f_flags" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_flag")) + "cortex_a5_ex1") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; VFP load/store. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn_reservation "cortex_a5_f_loads" 4 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_loads")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_f_loadd" 5 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_load,f_loadd")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_f_stores" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_stores")) + "cortex_a5_ex1") + +(define_insn_reservation "cortex_a5_f_stored" 0 + (and (eq_attr "tune" "cortexa5") + (eq_attr "type" "f_store,f_stored")) + "cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1") + +;; Load-to-use for floating-point values has a penalty of one cycle, +;; i.e. a latency of two. + +(define_bypass 2 "cortex_a5_f_loads" + "cortex_a5_fpalu, cortex_a5_fpmacs, cortex_a5_fpmuld,\ + cortex_a5_fpmacd, cortex_a5_fdivs, cortex_a5_fdivd,\ + cortex_a5_f2r") + +(define_bypass 3 "cortex_a5_f_loadd" + "cortex_a5_fpalu, cortex_a5_fpmacs, cortex_a5_fpmuld,\ + cortex_a5_fpmacd, cortex_a5_fdivs, cortex_a5_fdivd,\ + cortex_a5_f2r") diff --git a/gcc/config/arm/cortex-a8-neon.md b/gcc/config/arm/cortex-a8-neon.md index 10b335c3005..5639b5836d5 100644 --- a/gcc/config/arm/cortex-a8-neon.md +++ b/gcc/config/arm/cortex-a8-neon.md @@ -182,12 +182,12 @@ ;; NEON -> core transfers. -(define_insn_reservation "neon_mrc" 20 +(define_insn_reservation "cortex_a8_neon_mrc" 20 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mrc")) "cortex_a8_neon_ls") -(define_insn_reservation "neon_mrrc" 21 +(define_insn_reservation "cortex_a8_neon_mrrc" 21 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mrrc")) "cortex_a8_neon_ls_2") @@ -196,48 +196,48 @@ ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N3. -(define_insn_reservation "neon_int_1" 3 +(define_insn_reservation "cortex_a8_neon_int_1" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_int_1")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their (D|Q)m operands at N1, ;; their (D|Q)n operands at N2, and produce a result at N3. -(define_insn_reservation "neon_int_2" 3 +(define_insn_reservation "cortex_a8_neon_int_2" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_int_2")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N3. -(define_insn_reservation "neon_int_3" 3 +(define_insn_reservation "cortex_a8_neon_int_3" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_int_3")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N4. -(define_insn_reservation "neon_int_4" 4 +(define_insn_reservation "cortex_a8_neon_int_4" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_int_4")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their (D|Q)m operands at N1, ;; their (D|Q)n operands at N2, and produce a result at N4. -(define_insn_reservation "neon_int_5" 4 +(define_insn_reservation "cortex_a8_neon_int_5" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_int_5")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N4. -(define_insn_reservation "neon_vqneg_vqabs" 4 +(define_insn_reservation "cortex_a8_neon_vqneg_vqabs" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vqneg_vqabs")) "cortex_a8_neon_dp") ;; Instructions using this reservation produce a result at N3. -(define_insn_reservation "neon_vmov" 3 +(define_insn_reservation "cortex_a8_neon_vmov" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vmov")) "cortex_a8_neon_dp") @@ -245,7 +245,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N6. -(define_insn_reservation "neon_vaba" 6 +(define_insn_reservation "cortex_a8_neon_vaba" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vaba")) "cortex_a8_neon_dp") @@ -253,35 +253,35 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N6 on cycle 2. -(define_insn_reservation "neon_vaba_qqq" 7 +(define_insn_reservation "cortex_a8_neon_vaba_qqq" 7 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vaba_qqq")) "cortex_a8_neon_dp_2") ;; Instructions using this reservation read their (D|Q)m operands at N1, ;; their (D|Q)d operands at N3, and produce a result at N6. -(define_insn_reservation "neon_vsma" 6 +(define_insn_reservation "cortex_a8_neon_vsma" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vsma")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N6. -(define_insn_reservation "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" 6 +(define_insn_reservation "cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N6 on cycle 2. -(define_insn_reservation "neon_mul_qqq_8_16_32_ddd_32" 7 +(define_insn_reservation "cortex_a8_neon_mul_qqq_8_16_32_ddd_32" 7 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mul_qqq_8_16_32_ddd_32")) "cortex_a8_neon_dp_2") ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, and produce a result at N6 on cycle 2. -(define_insn_reservation "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" 7 +(define_insn_reservation "cortex_a8_neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" 7 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar")) "cortex_a8_neon_dp_2") @@ -289,7 +289,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and ;; produce a result at N6. -(define_insn_reservation "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" 6 +(define_insn_reservation "cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long")) "cortex_a8_neon_dp") @@ -297,7 +297,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and ;; produce a result at N6 on cycle 2. -(define_insn_reservation "neon_mla_qqq_8_16" 7 +(define_insn_reservation "cortex_a8_neon_mla_qqq_8_16" 7 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mla_qqq_8_16")) "cortex_a8_neon_dp_2") @@ -305,7 +305,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N6 on cycle 2. -(define_insn_reservation "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" 7 +(define_insn_reservation "cortex_a8_neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" 7 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long")) "cortex_a8_neon_dp_2") @@ -313,21 +313,21 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N6 on cycle 4. -(define_insn_reservation "neon_mla_qqq_32_qqd_32_scalar" 9 +(define_insn_reservation "cortex_a8_neon_mla_qqq_32_qqd_32_scalar" 9 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mla_qqq_32_qqd_32_scalar")) "cortex_a8_neon_dp_4") ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, and produce a result at N6. -(define_insn_reservation "neon_mul_ddd_16_scalar_32_16_long_scalar" 6 +(define_insn_reservation "cortex_a8_neon_mul_ddd_16_scalar_32_16_long_scalar" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mul_ddd_16_scalar_32_16_long_scalar")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, and produce a result at N6 on cycle 4. -(define_insn_reservation "neon_mul_qqd_32_scalar" 9 +(define_insn_reservation "cortex_a8_neon_mul_qqd_32_scalar" 9 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mul_qqd_32_scalar")) "cortex_a8_neon_dp_4") @@ -335,84 +335,84 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N6. -(define_insn_reservation "neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" 6 +(define_insn_reservation "cortex_a8_neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mla_ddd_16_scalar_qdd_32_16_long_scalar")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N3. -(define_insn_reservation "neon_shift_1" 3 +(define_insn_reservation "cortex_a8_neon_shift_1" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_shift_1")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N4. -(define_insn_reservation "neon_shift_2" 4 +(define_insn_reservation "cortex_a8_neon_shift_2" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_shift_2")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N3 on cycle 2. -(define_insn_reservation "neon_shift_3" 4 +(define_insn_reservation "cortex_a8_neon_shift_3" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_shift_3")) "cortex_a8_neon_dp_2") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N1. -(define_insn_reservation "neon_vshl_ddd" 1 +(define_insn_reservation "cortex_a8_neon_vshl_ddd" 1 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vshl_ddd")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N4 on cycle 2. -(define_insn_reservation "neon_vqshl_vrshl_vqrshl_qqq" 5 +(define_insn_reservation "cortex_a8_neon_vqshl_vrshl_vqrshl_qqq" 5 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vqshl_vrshl_vqrshl_qqq")) "cortex_a8_neon_dp_2") ;; Instructions using this reservation read their (D|Q)m operands at N1, ;; their (D|Q)d operands at N3, and produce a result at N6. -(define_insn_reservation "neon_vsra_vrsra" 6 +(define_insn_reservation "cortex_a8_neon_vsra_vrsra" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vsra_vrsra")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N5. -(define_insn_reservation "neon_fp_vadd_ddd_vabs_dd" 5 +(define_insn_reservation "cortex_a8_neon_fp_vadd_ddd_vabs_dd" 5 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vadd_ddd_vabs_dd")) "cortex_a8_neon_fadd") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N5 on cycle 2. -(define_insn_reservation "neon_fp_vadd_qqq_vabs_qq" 6 +(define_insn_reservation "cortex_a8_neon_fp_vadd_qqq_vabs_qq" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vadd_qqq_vabs_qq")) "cortex_a8_neon_fadd_2") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N5. -(define_insn_reservation "neon_fp_vsum" 5 +(define_insn_reservation "cortex_a8_neon_fp_vsum" 5 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vsum")) "cortex_a8_neon_fadd") ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, and produce a result at N5. -(define_insn_reservation "neon_fp_vmul_ddd" 5 +(define_insn_reservation "cortex_a8_neon_fp_vmul_ddd" 5 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmul_ddd")) "cortex_a8_neon_dp") ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, and produce a result at N5 on cycle 2. -(define_insn_reservation "neon_fp_vmul_qqd" 6 +(define_insn_reservation "cortex_a8_neon_fp_vmul_qqd" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmul_qqd")) "cortex_a8_neon_dp_2") @@ -420,7 +420,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and ;; produce a result at N9. -(define_insn_reservation "neon_fp_vmla_ddd" 9 +(define_insn_reservation "cortex_a8_neon_fp_vmla_ddd" 9 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmla_ddd")) "cortex_a8_neon_fmul_then_fadd") @@ -428,7 +428,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and ;; produce a result at N9 on cycle 2. -(define_insn_reservation "neon_fp_vmla_qqq" 10 +(define_insn_reservation "cortex_a8_neon_fp_vmla_qqq" 10 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmla_qqq")) "cortex_a8_neon_fmul_then_fadd_2") @@ -436,7 +436,7 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N9. -(define_insn_reservation "neon_fp_vmla_ddd_scalar" 9 +(define_insn_reservation "cortex_a8_neon_fp_vmla_ddd_scalar" 9 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmla_ddd_scalar")) "cortex_a8_neon_fmul_then_fadd") @@ -444,869 +444,869 @@ ;; Instructions using this reservation read their (D|Q)n operands at N2, ;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and ;; produce a result at N9 on cycle 2. -(define_insn_reservation "neon_fp_vmla_qqq_scalar" 10 +(define_insn_reservation "cortex_a8_neon_fp_vmla_qqq_scalar" 10 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vmla_qqq_scalar")) "cortex_a8_neon_fmul_then_fadd_2") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N9. -(define_insn_reservation "neon_fp_vrecps_vrsqrts_ddd" 9 +(define_insn_reservation "cortex_a8_neon_fp_vrecps_vrsqrts_ddd" 9 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vrecps_vrsqrts_ddd")) "cortex_a8_neon_fmul_then_fadd") ;; Instructions using this reservation read their source operands at N2, and ;; produce a result at N9 on cycle 2. -(define_insn_reservation "neon_fp_vrecps_vrsqrts_qqq" 10 +(define_insn_reservation "cortex_a8_neon_fp_vrecps_vrsqrts_qqq" 10 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_fp_vrecps_vrsqrts_qqq")) "cortex_a8_neon_fmul_then_fadd_2") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N2. -(define_insn_reservation "neon_bp_simple" 2 +(define_insn_reservation "cortex_a8_neon_bp_simple" 2 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_bp_simple")) "cortex_a8_neon_perm") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N2 on cycle 2. -(define_insn_reservation "neon_bp_2cycle" 3 +(define_insn_reservation "cortex_a8_neon_bp_2cycle" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_bp_2cycle")) "cortex_a8_neon_perm_2") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N2 on cycle 3. -(define_insn_reservation "neon_bp_3cycle" 4 +(define_insn_reservation "cortex_a8_neon_bp_3cycle" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_bp_3cycle")) "cortex_a8_neon_perm_3") ;; Instructions using this reservation produce a result at N1. -(define_insn_reservation "neon_ldr" 1 +(define_insn_reservation "cortex_a8_neon_ldr" 1 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_ldr")) "cortex_a8_neon_ls") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_str" 0 +(define_insn_reservation "cortex_a8_neon_str" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_str")) "cortex_a8_neon_ls") ;; Instructions using this reservation produce a result at N1 on cycle 2. -(define_insn_reservation "neon_vld1_1_2_regs" 2 +(define_insn_reservation "cortex_a8_neon_vld1_1_2_regs" 2 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld1_1_2_regs")) "cortex_a8_neon_ls_2") ;; Instructions using this reservation produce a result at N1 on cycle 3. -(define_insn_reservation "neon_vld1_3_4_regs" 3 +(define_insn_reservation "cortex_a8_neon_vld1_3_4_regs" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld1_3_4_regs")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation produce a result at N2 on cycle 2. -(define_insn_reservation "neon_vld2_2_regs_vld1_vld2_all_lanes" 3 +(define_insn_reservation "cortex_a8_neon_vld2_2_regs_vld1_vld2_all_lanes" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld2_2_regs_vld1_vld2_all_lanes")) "cortex_a8_neon_ls_2") ;; Instructions using this reservation produce a result at N2 on cycle 3. -(define_insn_reservation "neon_vld2_4_regs" 4 +(define_insn_reservation "cortex_a8_neon_vld2_4_regs" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld2_4_regs")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation produce a result at N2 on cycle 4. -(define_insn_reservation "neon_vld3_vld4" 5 +(define_insn_reservation "cortex_a8_neon_vld3_vld4" 5 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld3_vld4")) "cortex_a8_neon_ls_4") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst1_1_2_regs_vst2_2_regs" 0 +(define_insn_reservation "cortex_a8_neon_vst1_1_2_regs_vst2_2_regs" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")) "cortex_a8_neon_ls_2") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst1_3_4_regs" 0 +(define_insn_reservation "cortex_a8_neon_vst1_3_4_regs" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst1_3_4_regs")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst2_4_regs_vst3_vst4" 0 +(define_insn_reservation "cortex_a8_neon_vst2_4_regs_vst3_vst4" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst2_4_regs_vst3_vst4")) "cortex_a8_neon_ls_4") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst3_vst4" 0 +(define_insn_reservation "cortex_a8_neon_vst3_vst4" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst3_vst4")) "cortex_a8_neon_ls_4") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N2 on cycle 3. -(define_insn_reservation "neon_vld1_vld2_lane" 4 +(define_insn_reservation "cortex_a8_neon_vld1_vld2_lane" 4 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld1_vld2_lane")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation read their source operands at N1, and ;; produce a result at N2 on cycle 5. -(define_insn_reservation "neon_vld3_vld4_lane" 6 +(define_insn_reservation "cortex_a8_neon_vld3_vld4_lane" 6 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld3_vld4_lane")) "cortex_a8_neon_ls_5") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst1_vst2_lane" 0 +(define_insn_reservation "cortex_a8_neon_vst1_vst2_lane" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst1_vst2_lane")) "cortex_a8_neon_ls_2") ;; Instructions using this reservation read their source operands at N1. -(define_insn_reservation "neon_vst3_vst4_lane" 0 +(define_insn_reservation "cortex_a8_neon_vst3_vst4_lane" 0 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vst3_vst4_lane")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation produce a result at N2 on cycle 2. -(define_insn_reservation "neon_vld3_vld4_all_lanes" 3 +(define_insn_reservation "cortex_a8_neon_vld3_vld4_all_lanes" 3 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_vld3_vld4_all_lanes")) "cortex_a8_neon_ls_3") ;; Instructions using this reservation produce a result at N2. -(define_insn_reservation "neon_mcr" 2 +(define_insn_reservation "cortex_a8_neon_mcr" 2 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mcr")) "cortex_a8_neon_perm") ;; Instructions using this reservation produce a result at N2. -(define_insn_reservation "neon_mcr_2_mcrr" 2 +(define_insn_reservation "cortex_a8_neon_mcr_2_mcrr" 2 (and (eq_attr "tune" "cortexa8") (eq_attr "neon_type" "neon_mcr_2_mcrr")) "cortex_a8_neon_perm_2") ;; Exceptions to the default latencies. -(define_bypass 1 "neon_mcr_2_mcrr" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 1 "neon_mcr" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_vld3_vld4_all_lanes" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_vld3_vld4_lane" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_vld1_vld2_lane" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 4 "neon_vld3_vld4" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_vld2_4_regs" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_vld2_2_regs_vld1_vld2_all_lanes" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_vld1_3_4_regs" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 1 "neon_vld1_1_2_regs" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 0 "neon_ldr" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_bp_3cycle" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_bp_2cycle" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 1 "neon_bp_simple" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 9 "neon_fp_vrecps_vrsqrts_qqq" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 8 "neon_fp_vrecps_vrsqrts_ddd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 9 "neon_fp_vmla_qqq_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 8 "neon_fp_vmla_ddd_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 9 "neon_fp_vmla_qqq" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 8 "neon_fp_vmla_ddd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_fp_vmul_qqd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 4 "neon_fp_vmul_ddd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 4 "neon_fp_vsum" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_fp_vadd_qqq_vabs_qq" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 4 "neon_fp_vadd_ddd_vabs_dd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_vsra_vrsra" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 4 "neon_vqshl_vrshl_vqrshl_qqq" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 0 "neon_vshl_ddd" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_shift_3" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_shift_2" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_shift_1" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 8 "neon_mul_qqd_32_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_mul_ddd_16_scalar_32_16_long_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 8 "neon_mla_qqq_32_qqd_32_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 6 "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 6 "neon_mla_qqq_8_16" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 6 "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 6 "neon_mul_qqq_8_16_32_ddd_32" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_vsma" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 6 "neon_vaba_qqq" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 5 "neon_vaba" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_vmov" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_vqneg_vqabs" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_int_5" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 3 "neon_int_4" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_int_3" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_int_2" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") - -(define_bypass 2 "neon_int_1" - "neon_int_1,\ - neon_int_4,\ - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mul_qqq_8_16_32_ddd_32,\ - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ - neon_mla_qqq_8_16,\ - neon_fp_vadd_ddd_vabs_dd,\ - neon_fp_vadd_qqq_vabs_qq,\ - neon_fp_vmla_ddd,\ - neon_fp_vmla_qqq,\ - neon_fp_vrecps_vrsqrts_ddd,\ - neon_fp_vrecps_vrsqrts_qqq") +(define_bypass 1 "cortex_a8_neon_mcr_2_mcrr" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a8_neon_mcr" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_vld3_vld4_all_lanes" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_vld3_vld4_lane" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_vld1_vld2_lane" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a8_neon_vld3_vld4" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_vld2_4_regs" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_vld2_2_regs_vld1_vld2_all_lanes" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_vld1_3_4_regs" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a8_neon_vld1_1_2_regs" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 0 "cortex_a8_neon_ldr" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_bp_3cycle" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_bp_2cycle" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a8_neon_bp_simple" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a8_neon_fp_vrecps_vrsqrts_qqq" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a8_neon_fp_vrecps_vrsqrts_ddd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a8_neon_fp_vmla_qqq_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a8_neon_fp_vmla_ddd_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a8_neon_fp_vmla_qqq" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a8_neon_fp_vmla_ddd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_fp_vmul_qqd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a8_neon_fp_vmul_ddd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a8_neon_fp_vsum" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_fp_vadd_qqq_vabs_qq" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a8_neon_fp_vadd_ddd_vabs_dd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_vsra_vrsra" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a8_neon_vqshl_vrshl_vqrshl_qqq" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 0 "cortex_a8_neon_vshl_ddd" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_shift_3" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_shift_2" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_shift_1" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a8_neon_mul_qqd_32_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_mul_ddd_16_scalar_32_16_long_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a8_neon_mla_qqq_32_qqd_32_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a8_neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a8_neon_mla_qqq_8_16" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a8_neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a8_neon_mul_qqq_8_16_32_ddd_32" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_vsma" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a8_neon_vaba_qqq" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a8_neon_vaba" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_vmov" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_vqneg_vqabs" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_int_5" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a8_neon_int_4" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_int_3" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_int_2" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a8_neon_int_1" + "cortex_a8_neon_int_1,\ + cortex_a8_neon_int_4,\ + cortex_a8_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a8_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a8_neon_mla_qqq_8_16,\ + cortex_a8_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a8_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a8_neon_fp_vmla_ddd,\ + cortex_a8_neon_fp_vmla_qqq,\ + cortex_a8_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a8_neon_fp_vrecps_vrsqrts_qqq") diff --git a/gcc/config/arm/cortex-a9-neon.md b/gcc/config/arm/cortex-a9-neon.md new file mode 100644 index 00000000000..2e8ec9b14c7 --- /dev/null +++ b/gcc/config/arm/cortex-a9-neon.md @@ -0,0 +1,1237 @@ +;; ARM Cortex-A9 pipeline description +;; Copyright (C) 2010 Free Software Foundation, Inc. +;; +;; Neon pipeline description contributed by ARM Ltd. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING3. If not see +;; . + + +(define_automaton "cortex_a9_neon") + +;; Only one instruction can be issued per cycle. +(define_cpu_unit "cortex_a9_neon_issue_perm" "cortex_a9_neon") + +;; Only one data-processing instruction can be issued per cycle. +(define_cpu_unit "cortex_a9_neon_issue_dp" "cortex_a9_neon") + +;; We need a special mutual exclusion (to be used in addition to +;; cortex_a9_neon_issue_dp) for the case when an instruction such as +;; vmla.f is forwarded from E5 of the floating-point multiply pipeline to +;; E2 of the floating-point add pipeline. On the cycle previous to that +;; forward we must prevent issue of any instruction to the floating-point +;; add pipeline, but still allow issue of a data-processing instruction +;; to any of the other pipelines. +(define_cpu_unit "cortex_a9_neon_issue_fadd" "cortex_a9_neon") +(define_cpu_unit "cortex_a9_neon_mcr" "cortex_a9_neon") + + +;; Patterns of reservation. +;; We model the NEON issue units as running in parallel with the core ones. +;; We assume that multi-cycle NEON instructions get decomposed into +;; micro-ops as they are issued into the NEON pipeline. + +(define_reservation "cortex_a9_neon_dp" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp") +(define_reservation "cortex_a9_neon_dp_2" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp,\ + cortex_a9_neon_issue_dp") +(define_reservation "cortex_a9_neon_dp_4" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp,\ + cortex_a9_neon_issue_dp + cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp + cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp") + +(define_reservation "cortex_a9_neon_fadd" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp + \ + cortex_a9_neon_issue_fadd") +(define_reservation "cortex_a9_neon_fadd_2" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp,\ + cortex_a9_neon_issue_fadd,\ + cortex_a9_neon_issue_dp") + +(define_reservation "cortex_a9_neon_perm" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm") +(define_reservation "cortex_a9_neon_perm_2" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm, \ + cortex_a9_neon_issue_perm") +(define_reservation "cortex_a9_neon_perm_3" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_perm") + +(define_reservation "cortex_a9_neon_ls" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm+cortex_a9_ls") +(define_reservation "cortex_a9_neon_ls_2" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_perm") +(define_reservation "cortex_a9_neon_ls_3" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_perm") +(define_reservation "cortex_a9_neon_ls_4" + "ca9_issue_vfp_neon+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_perm") +(define_reservation "cortex_a9_neon_ls_5" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_dp+cortex_a9_neon_issue_perm,\ + cortex_a9_neon_issue_perm") + +(define_reservation "cortex_a9_neon_fmul_then_fadd" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp,\ + nothing*3,\ + cortex_a9_neon_issue_fadd") +(define_reservation "cortex_a9_neon_fmul_then_fadd_2" + "ca9_issue_vfp_neon + cortex_a9_neon_issue_dp,\ + cortex_a9_neon_issue_dp,\ + nothing*2,\ + cortex_a9_neon_issue_fadd,\ + cortex_a9_neon_issue_fadd") + + +;; NEON -> core transfers. +(define_insn_reservation "ca9_neon_mrc" 1 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mrc")) + "ca9_issue_vfp_neon + cortex_a9_neon_mcr") + +(define_insn_reservation "ca9_neon_mrrc" 1 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mrrc")) + "ca9_issue_vfp_neon + cortex_a9_neon_mcr") + +;; The remainder of this file is auto-generated by neon-schedgen. + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N3. +(define_insn_reservation "cortex_a9_neon_int_1" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_int_1")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)m operands at N1, +;; their (D|Q)n operands at N2, and produce a result at N3. +(define_insn_reservation "cortex_a9_neon_int_2" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_int_2")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N3. +(define_insn_reservation "cortex_a9_neon_int_3" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_int_3")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N4. +(define_insn_reservation "cortex_a9_neon_int_4" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_int_4")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)m operands at N1, +;; their (D|Q)n operands at N2, and produce a result at N4. +(define_insn_reservation "cortex_a9_neon_int_5" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_int_5")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N4. +(define_insn_reservation "cortex_a9_neon_vqneg_vqabs" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vqneg_vqabs")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation produce a result at N3. +(define_insn_reservation "cortex_a9_neon_vmov" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vmov")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N6. +(define_insn_reservation "cortex_a9_neon_vaba" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vaba")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N6 on cycle 2. +(define_insn_reservation "cortex_a9_neon_vaba_qqq" 7 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vaba_qqq")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)m operands at N1, +;; their (D|Q)d operands at N3, and produce a result at N6. +(define_insn_reservation "cortex_a9_neon_vsma" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vsma")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N6. +(define_insn_reservation "cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N6 on cycle 2. +(define_insn_reservation "cortex_a9_neon_mul_qqq_8_16_32_ddd_32" 7 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mul_qqq_8_16_32_ddd_32")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, and produce a result at N6 on cycle 2. +(define_insn_reservation "cortex_a9_neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" 7 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and +;; produce a result at N6. +(define_insn_reservation "cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and +;; produce a result at N6 on cycle 2. +(define_insn_reservation "cortex_a9_neon_mla_qqq_8_16" 7 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mla_qqq_8_16")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N6 on cycle 2. +(define_insn_reservation "cortex_a9_neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" 7 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N6 on cycle 4. +(define_insn_reservation "cortex_a9_neon_mla_qqq_32_qqd_32_scalar" 9 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mla_qqq_32_qqd_32_scalar")) + "cortex_a9_neon_dp_4") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, and produce a result at N6. +(define_insn_reservation "cortex_a9_neon_mul_ddd_16_scalar_32_16_long_scalar" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mul_ddd_16_scalar_32_16_long_scalar")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, and produce a result at N6 on cycle 4. +(define_insn_reservation "cortex_a9_neon_mul_qqd_32_scalar" 9 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mul_qqd_32_scalar")) + "cortex_a9_neon_dp_4") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N6. +(define_insn_reservation "cortex_a9_neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mla_ddd_16_scalar_qdd_32_16_long_scalar")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N3. +(define_insn_reservation "cortex_a9_neon_shift_1" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_shift_1")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N4. +(define_insn_reservation "cortex_a9_neon_shift_2" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_shift_2")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N3 on cycle 2. +(define_insn_reservation "cortex_a9_neon_shift_3" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_shift_3")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N1. +(define_insn_reservation "cortex_a9_neon_vshl_ddd" 1 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vshl_ddd")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N4 on cycle 2. +(define_insn_reservation "cortex_a9_neon_vqshl_vrshl_vqrshl_qqq" 5 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vqshl_vrshl_vqrshl_qqq")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)m operands at N1, +;; their (D|Q)d operands at N3, and produce a result at N6. +(define_insn_reservation "cortex_a9_neon_vsra_vrsra" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vsra_vrsra")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N5. +(define_insn_reservation "cortex_a9_neon_fp_vadd_ddd_vabs_dd" 5 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vadd_ddd_vabs_dd")) + "cortex_a9_neon_fadd") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N5 on cycle 2. +(define_insn_reservation "cortex_a9_neon_fp_vadd_qqq_vabs_qq" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vadd_qqq_vabs_qq")) + "cortex_a9_neon_fadd_2") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N5. +(define_insn_reservation "cortex_a9_neon_fp_vsum" 5 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vsum")) + "cortex_a9_neon_fadd") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, and produce a result at N5. +(define_insn_reservation "cortex_a9_neon_fp_vmul_ddd" 5 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmul_ddd")) + "cortex_a9_neon_dp") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, and produce a result at N5 on cycle 2. +(define_insn_reservation "cortex_a9_neon_fp_vmul_qqd" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmul_qqd")) + "cortex_a9_neon_dp_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and +;; produce a result at N9. +(define_insn_reservation "cortex_a9_neon_fp_vmla_ddd" 9 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmla_ddd")) + "cortex_a9_neon_fmul_then_fadd") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N2, their (D|Q)d operands at N3, and +;; produce a result at N9 on cycle 2. +(define_insn_reservation "cortex_a9_neon_fp_vmla_qqq" 10 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmla_qqq")) + "cortex_a9_neon_fmul_then_fadd_2") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N9. +(define_insn_reservation "cortex_a9_neon_fp_vmla_ddd_scalar" 9 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmla_ddd_scalar")) + "cortex_a9_neon_fmul_then_fadd") + +;; Instructions using this reservation read their (D|Q)n operands at N2, +;; their (D|Q)m operands at N1, their (D|Q)d operands at N3, and +;; produce a result at N9 on cycle 2. +(define_insn_reservation "cortex_a9_neon_fp_vmla_qqq_scalar" 10 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vmla_qqq_scalar")) + "cortex_a9_neon_fmul_then_fadd_2") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N9. +(define_insn_reservation "cortex_a9_neon_fp_vrecps_vrsqrts_ddd" 9 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vrecps_vrsqrts_ddd")) + "cortex_a9_neon_fmul_then_fadd") + +;; Instructions using this reservation read their source operands at N2, and +;; produce a result at N9 on cycle 2. +(define_insn_reservation "cortex_a9_neon_fp_vrecps_vrsqrts_qqq" 10 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_fp_vrecps_vrsqrts_qqq")) + "cortex_a9_neon_fmul_then_fadd_2") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N2. +(define_insn_reservation "cortex_a9_neon_bp_simple" 2 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_bp_simple")) + "cortex_a9_neon_perm") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N2 on cycle 2. +(define_insn_reservation "cortex_a9_neon_bp_2cycle" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_bp_2cycle")) + "cortex_a9_neon_perm_2") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N2 on cycle 3. +(define_insn_reservation "cortex_a9_neon_bp_3cycle" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_bp_3cycle")) + "cortex_a9_neon_perm_3") + +;; Instructions using this reservation produce a result at N1. +(define_insn_reservation "cortex_a9_neon_ldr" 1 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_ldr")) + "cortex_a9_neon_ls") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_str" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_str")) + "cortex_a9_neon_ls") + +;; Instructions using this reservation produce a result at N1 on cycle 2. +(define_insn_reservation "cortex_a9_neon_vld1_1_2_regs" 2 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld1_1_2_regs")) + "cortex_a9_neon_ls_2") + +;; Instructions using this reservation produce a result at N1 on cycle 3. +(define_insn_reservation "cortex_a9_neon_vld1_3_4_regs" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld1_3_4_regs")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation produce a result at N2 on cycle 2. +(define_insn_reservation "cortex_a9_neon_vld2_2_regs_vld1_vld2_all_lanes" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld2_2_regs_vld1_vld2_all_lanes")) + "cortex_a9_neon_ls_2") + +;; Instructions using this reservation produce a result at N2 on cycle 3. +(define_insn_reservation "cortex_a9_neon_vld2_4_regs" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld2_4_regs")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation produce a result at N2 on cycle 4. +(define_insn_reservation "cortex_a9_neon_vld3_vld4" 5 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld3_vld4")) + "cortex_a9_neon_ls_4") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst1_1_2_regs_vst2_2_regs" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")) + "cortex_a9_neon_ls_2") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst1_3_4_regs" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst1_3_4_regs")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst2_4_regs_vst3_vst4" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst2_4_regs_vst3_vst4")) + "cortex_a9_neon_ls_4") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst3_vst4" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst3_vst4")) + "cortex_a9_neon_ls_4") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N2 on cycle 3. +(define_insn_reservation "cortex_a9_neon_vld1_vld2_lane" 4 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld1_vld2_lane")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation read their source operands at N1, and +;; produce a result at N2 on cycle 5. +(define_insn_reservation "cortex_a9_neon_vld3_vld4_lane" 6 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld3_vld4_lane")) + "cortex_a9_neon_ls_5") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst1_vst2_lane" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst1_vst2_lane")) + "cortex_a9_neon_ls_2") + +;; Instructions using this reservation read their source operands at N1. +(define_insn_reservation "cortex_a9_neon_vst3_vst4_lane" 0 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vst3_vst4_lane")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation produce a result at N2 on cycle 2. +(define_insn_reservation "cortex_a9_neon_vld3_vld4_all_lanes" 3 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_vld3_vld4_all_lanes")) + "cortex_a9_neon_ls_3") + +;; Instructions using this reservation produce a result at N2. +(define_insn_reservation "cortex_a9_neon_mcr" 2 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mcr")) + "cortex_a9_neon_perm") + +;; Instructions using this reservation produce a result at N2. +(define_insn_reservation "cortex_a9_neon_mcr_2_mcrr" 2 + (and (eq_attr "tune" "cortexa9") + (eq_attr "neon_type" "neon_mcr_2_mcrr")) + "cortex_a9_neon_perm_2") + +;; Exceptions to the default latencies. + +(define_bypass 1 "cortex_a9_neon_mcr_2_mcrr" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a9_neon_mcr" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_vld3_vld4_all_lanes" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_vld3_vld4_lane" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_vld1_vld2_lane" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a9_neon_vld3_vld4" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_vld2_4_regs" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_vld2_2_regs_vld1_vld2_all_lanes" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_vld1_3_4_regs" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a9_neon_vld1_1_2_regs" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 0 "cortex_a9_neon_ldr" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_bp_3cycle" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_bp_2cycle" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 1 "cortex_a9_neon_bp_simple" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a9_neon_fp_vrecps_vrsqrts_qqq" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a9_neon_fp_vrecps_vrsqrts_ddd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a9_neon_fp_vmla_qqq_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a9_neon_fp_vmla_ddd_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 9 "cortex_a9_neon_fp_vmla_qqq" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a9_neon_fp_vmla_ddd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_fp_vmul_qqd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a9_neon_fp_vmul_ddd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a9_neon_fp_vsum" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_fp_vadd_qqq_vabs_qq" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a9_neon_fp_vadd_ddd_vabs_dd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_vsra_vrsra" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 4 "cortex_a9_neon_vqshl_vrshl_vqrshl_qqq" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 0 "cortex_a9_neon_vshl_ddd" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_shift_3" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_shift_2" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_shift_1" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_mla_ddd_16_scalar_qdd_32_16_long_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a9_neon_mul_qqd_32_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_mul_ddd_16_scalar_32_16_long_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 8 "cortex_a9_neon_mla_qqq_32_qqd_32_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a9_neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a9_neon_mla_qqq_8_16" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a9_neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a9_neon_mul_qqq_8_16_32_ddd_32" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_vsma" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 6 "cortex_a9_neon_vaba_qqq" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 5 "cortex_a9_neon_vaba" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_vmov" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_vqneg_vqabs" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_int_5" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 3 "cortex_a9_neon_int_4" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_int_3" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_int_2" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + +(define_bypass 2 "cortex_a9_neon_int_1" + "cortex_a9_neon_int_1,\ + cortex_a9_neon_int_4,\ + cortex_a9_neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mul_qqq_8_16_32_ddd_32,\ + cortex_a9_neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\ + cortex_a9_neon_mla_qqq_8_16,\ + cortex_a9_neon_fp_vadd_ddd_vabs_dd,\ + cortex_a9_neon_fp_vadd_qqq_vabs_qq,\ + cortex_a9_neon_fp_vmla_ddd,\ + cortex_a9_neon_fp_vmla_qqq,\ + cortex_a9_neon_fp_vrecps_vrsqrts_ddd,\ + cortex_a9_neon_fp_vrecps_vrsqrts_qqq") + diff --git a/gcc/config/arm/cortex-a9.md b/gcc/config/arm/cortex-a9.md index 27ad70569e4..350562d4396 100644 --- a/gcc/config/arm/cortex-a9.md +++ b/gcc/config/arm/cortex-a9.md @@ -80,8 +80,9 @@ cortex_a9_p1_e2 + cortex_a9_p0_e1 + cortex_a9_p1_e1") (define_insn_reservation "cortex_a9_dp" 2 (and (eq_attr "tune" "cortexa9") (ior (eq_attr "type" "alu") - (and (eq_attr "type" "alu_shift_reg, alu_shift") - (eq_attr "insn" "mov")))) + (ior (and (eq_attr "type" "alu_shift_reg, alu_shift") + (eq_attr "insn" "mov")) + (eq_attr "neon_type" "none")))) "cortex_a9_p0_default|cortex_a9_p1_default") ;; An instruction using the shifter will go down E1. diff --git a/gcc/config/arm/cortex-m4-fpu.md b/gcc/config/arm/cortex-m4-fpu.md new file mode 100644 index 00000000000..7de115c5209 --- /dev/null +++ b/gcc/config/arm/cortex-m4-fpu.md @@ -0,0 +1,111 @@ +;; ARM Cortex-M4 FPU pipeline description +;; Copyright (C) 2010 Free Software Foundation, Inc. +;; Contributed by CodeSourcery. +;; +;; 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 +;; . + +;; Use an artifial unit to model FPU. +(define_cpu_unit "cortex_m4_v" "cortex_m4") + +(define_reservation "cortex_m4_ex_v" "cortex_m4_ex+cortex_m4_v") + +;; Integer instructions following VDIV or VSQRT complete out-of-order. +(define_insn_reservation "cortex_m4_fdivs" 15 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fdivs")) + "cortex_m4_ex_v,cortex_m4_v*13") + +(define_insn_reservation "cortex_m4_vmov_1" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fcpys,fconsts")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_vmov_2" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_2_r,r_2_f")) + "cortex_m4_ex_v*2") + +(define_insn_reservation "cortex_m4_fmuls" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fmuls")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_fmacs" 4 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fmacs")) + "cortex_m4_ex_v*3") + +(define_insn_reservation "cortex_m4_ffariths" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "ffariths")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_fadds" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fadds")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_fcmps" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "fcmps")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_f_flag" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_flag")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_f_cvt" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_cvt")) + "cortex_m4_ex_v") + +(define_insn_reservation "cortex_m4_f_load" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_load")) + "cortex_m4_ex_v*2") + +(define_insn_reservation "cortex_m4_f_store" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_store")) + "cortex_m4_ex_v*2") + +(define_insn_reservation "cortex_m4_f_loadd" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_loadd")) + "cortex_m4_ex_v*3") + +(define_insn_reservation "cortex_m4_f_stored" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "f_stored")) + "cortex_m4_ex_v*3") + +;; MAC instructions consume their addend one cycle later. If the result +;; of an arithmetic instruction is consumed as the addend of the following +;; MAC instruction, the latency can be decreased by one. + +(define_bypass 1 "cortex_m4_fadds,cortex_m4_fmuls,cortex_m4_f_cvt" + "cortex_m4_fmacs" + "arm_no_early_mul_dep") + +(define_bypass 3 "cortex_m4_fmacs" + "cortex_m4_fmacs" + "arm_no_early_mul_dep") + +(define_bypass 14 "cortex_m4_fdivs" + "cortex_m4_fmacs" + "arm_no_early_mul_dep") diff --git a/gcc/config/arm/cortex-m4.md b/gcc/config/arm/cortex-m4.md new file mode 100644 index 00000000000..b71037585d0 --- /dev/null +++ b/gcc/config/arm/cortex-m4.md @@ -0,0 +1,111 @@ +;; ARM Cortex-M4 pipeline description +;; Copyright (C) 2010 Free Software Foundation, Inc. +;; Contributed by CodeSourcery. +;; +;; 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 +;; . + +(define_automaton "cortex_m4") + +;; We model the pipelining of LDR instructions by using two artificial units. + +(define_cpu_unit "cortex_m4_a" "cortex_m4") + +(define_cpu_unit "cortex_m4_b" "cortex_m4") + +(define_reservation "cortex_m4_ex" "cortex_m4_a+cortex_m4_b") + +;; ALU and multiply is one cycle. +(define_insn_reservation "cortex_m4_alu" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "alu,alu_shift,alu_shift_reg,mult")) + "cortex_m4_ex") + +;; Byte, half-word and word load is two cycles. +(define_insn_reservation "cortex_m4_load1" 2 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "load_byte,load1")) + "cortex_m4_a, cortex_m4_b") + +;; str rx, [ry, #imm] is always one cycle. +(define_insn_reservation "cortex_m4_store1_1" 1 + (and (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "store1")) + (ne (symbol_ref ("arm_address_offset_is_imm (insn)")) (const_int 0))) + "cortex_m4_a") + +;; Other byte, half-word and word load is two cycles. +(define_insn_reservation "cortex_m4_store1_2" 2 + (and (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "store1")) + (eq (symbol_ref ("arm_address_offset_is_imm (insn)")) (const_int 0))) + "cortex_m4_a*2") + +(define_insn_reservation "cortex_m4_load2" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "load2")) + "cortex_m4_ex*3") + +(define_insn_reservation "cortex_m4_store2" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "store2")) + "cortex_m4_ex*3") + +(define_insn_reservation "cortex_m4_load3" 4 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "load3")) + "cortex_m4_ex*4") + +(define_insn_reservation "cortex_m4_store3" 4 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "store3")) + "cortex_m4_ex*4") + +(define_insn_reservation "cortex_m4_load4" 5 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "load4")) + "cortex_m4_ex*5") + +(define_insn_reservation "cortex_m4_store4" 5 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "store4")) + "cortex_m4_ex*5") + +;; If the address of load or store depends on the result of the preceding +;; instruction, the latency is increased by one. + +(define_bypass 2 "cortex_m4_alu" + "cortex_m4_load1" + "arm_early_load_addr_dep") + +(define_bypass 2 "cortex_m4_alu" + "cortex_m4_store1_1,cortex_m4_store1_2" + "arm_early_store_addr_dep") + +(define_insn_reservation "cortex_m4_branch" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "branch")) + "cortex_m4_ex*3") + +(define_insn_reservation "cortex_m4_call" 3 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "call")) + "cortex_m4_ex*3") + +(define_insn_reservation "cortex_m4_block" 1 + (and (eq_attr "tune" "cortexm4") + (eq_attr "type" "block")) + "cortex_m4_ex") diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index ee04aabebf2..887c962baeb 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -28,6 +28,8 @@ ;; registers. (define_mode_iterator ANY64 [DI DF V8QI V4HI V2SI V2SF]) +(define_mode_iterator ANY128 [V2DI V2DF V16QI V8HI V4SI V4SF]) + ;; A list of integer modes that are up to one word long (define_mode_iterator QHSI [QI HI SI]) @@ -136,7 +138,9 @@ ;; Modes with 32-bit elements only. (define_mode_iterator V32 [V2SI V2SF V4SI V4SF]) - +;; Modes with 8-bit, 16-bit and 32-bit elements. +(define_mode_iterator VU [V16QI V8HI V4SI]) + ;;---------------------------------------------------------------------------- ;; Code iterators ;;---------------------------------------------------------------------------- @@ -156,6 +160,8 @@ ;; without unsigned variants (for use with *SFmode pattern). (define_code_iterator vqhs_ops [plus smin smax]) +;; A list of widening operators +(define_code_iterator SE [sign_extend zero_extend]) ;;---------------------------------------------------------------------------- ;; Mode attributes @@ -223,9 +229,13 @@ ;; Narrower modes with the same number of elements. (define_mode_attr V_narrow [(V8HI "V8QI") (V4SI "V4HI") (V2DI "V2SI")]) +;; Narrower modes with double the number of elements. +(define_mode_attr V_narrow_pack [(V4SI "V8HI") (V8HI "V16QI") (V2DI "V4SI") + (V4HI "V8QI") (V2SI "V4HI") (DI "V2SI")]) + ;; Modes with half the number of equal-sized elements. (define_mode_attr V_HALF [(V16QI "V8QI") (V8HI "V4HI") - (V4SI "V2SI") (V4SF "V2SF") + (V4SI "V2SI") (V4SF "V2SF") (V2DF "DF") (V2DI "DI")]) ;; Same, but lower-case. @@ -235,7 +245,7 @@ ;; Modes with twice the number of equal-sized elements. (define_mode_attr V_DOUBLE [(V8QI "V16QI") (V4HI "V8HI") - (V2SI "V4SI") (V2SF "V4SF") + (V2SI "V4SI") (V2SF "V4SF") (DF "V2DF") (DI "V2DI")]) ;; Same, but lower-case. @@ -358,8 +368,23 @@ (V4HI "4") (V8HI "8") (V2SI "2") (V4SI "4") (V2SF "2") (V4SF "4") - (DI "1") (V2DI "2")]) + (DI "1") (V2DI "2") + (DF "1") (V2DF "2")]) +;; Same as V_widen, but lower-case. +(define_mode_attr V_widen_l [(V8QI "v8hi") (V4HI "v4si") ( V2SI "v2di")]) + +;; Widen. Result is half the number of elements, but widened to double-width. +(define_mode_attr V_unpack [(V16QI "V8HI") (V8HI "V4SI") (V4SI "V2DI")]) + +;; Conditions to be used in extenddi patterns. +(define_mode_attr qhs_zextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "")]) +(define_mode_attr qhs_sextenddi_cond [(SI "") (HI "&& arm_arch6") + (QI "&& arm_arch6")]) +(define_mode_attr qhs_extenddi_op [(SI "s_register_operand") + (HI "nonimmediate_operand") + (QI "nonimmediate_operand")]) +(define_mode_attr qhs_extenddi_cstr [(SI "r") (HI "rm") (QI "rm")]) ;;---------------------------------------------------------------------------- ;; Code attributes @@ -375,3 +400,6 @@ (define_code_attr cnb [(ltu "CC_C") (geu "CC")]) (define_code_attr optab [(ltu "ltu") (geu "geu")]) + +;; Assembler mnemonics for signedness of widening operations. +(define_code_attr US [(sign_extend "s") (zero_extend "u")]) diff --git a/gcc/config/arm/linux-atomic.c b/gcc/config/arm/linux-atomic.c index 685f16b80e9..ddedeb52985 100644 --- a/gcc/config/arm/linux-atomic.c +++ b/gcc/config/arm/linux-atomic.c @@ -155,12 +155,12 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) { actual_oldval = *ptr; - if (oldval != actual_oldval) + if (__builtin_expect (oldval != actual_oldval, 0)) return actual_oldval; fail = __kernel_cmpxchg (actual_oldval, newval, ptr); - if (!fail) + if (__builtin_expect (!fail, 1)) return oldval; } } @@ -180,7 +180,8 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) { \ actual_oldval = *wordptr; \ \ - if (((actual_oldval & mask) >> shift) != (unsigned int) oldval) \ + if (__builtin_expect (((actual_oldval & mask) >> shift) != \ + (unsigned int) oldval, 0)) \ return (actual_oldval & mask) >> shift; \ \ actual_newval = (actual_oldval & ~mask) \ @@ -189,7 +190,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) fail = __kernel_cmpxchg (actual_oldval, actual_newval, \ wordptr); \ \ - if (!fail) \ + if (__builtin_expect (!fail, 1)) \ return oldval; \ } \ } diff --git a/gcc/config/arm/neon-schedgen.ml b/gcc/config/arm/neon-schedgen.ml index bb96e427c99..3d9b04422b1 100644 --- a/gcc/config/arm/neon-schedgen.ml +++ b/gcc/config/arm/neon-schedgen.ml @@ -1,7 +1,6 @@ (* Emission of the core of the Cortex-A8 NEON scheduling description. Copyright (C) 2007, 2010 Free Software Foundation, Inc. Contributed by CodeSourcery. - This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under @@ -21,7 +20,14 @@ (* This scheduling description generator works as follows. - Each group of instructions has source and destination requirements - specified. The source requirements may be specified using + specified and a list of cores supported. This is then filtered + and per core scheduler descriptions are generated out. + The reservations generated are prefixed by the name of the + core and the check is performed on the basis of what the tuning + string is. Running this will generate Neon scheduler descriptions + for all cores supported. + + The source requirements may be specified using Source (the stage at which all source operands not otherwise described are read), Source_m (the stage at which Rm operands are read), Source_n (likewise for Rn) and Source_d (likewise for Rd). @@ -83,6 +89,17 @@ type reservation = | Ls of int | Fmul_then_fadd | Fmul_then_fadd_2 +type core = CortexA8 | CortexA9 +let allCores = [CortexA8; CortexA9] +let coreStr = function + CortexA8 -> "cortex_a8" + | CortexA9 -> "cortex_a9" + +let tuneStr = function + CortexA8 -> "cortexa8" + | CortexA9 -> "cortexa9" + + (* This table must be kept as short as possible by conflating entries with the same availability behavior. @@ -90,129 +107,136 @@ type reservation = Second components: availability requirements, in the order in which they should appear in the comments in the .md file. Third components: reservation info + Fourth components: List of supported cores. *) let availability_table = [ (* NEON integer ALU instructions. *) (* vbit vbif vbsl vorr vbic vnot vcls vclz vcnt vadd vand vorr veor vbic vorn ddd qqq *) - "neon_int_1", [Source n2; Dest n3], ALU; + "neon_int_1", [Source n2; Dest n3], ALU, allCores; (* vadd vsub qqd vsub ddd qqq *) - "neon_int_2", [Source_m n1; Source_n n2; Dest n3], ALU; + "neon_int_2", [Source_m n1; Source_n n2; Dest n3], ALU, allCores; (* vsum vneg dd qq vadd vsub qdd *) - "neon_int_3", [Source n1; Dest n3], ALU; + "neon_int_3", [Source n1; Dest n3], ALU, allCores; (* vabs vceqz vcgez vcbtz vclez vcltz vadh vradh vsbh vrsbh dqq *) (* vhadd vrhadd vqadd vtst ddd qqq *) - "neon_int_4", [Source n2; Dest n4], ALU; + "neon_int_4", [Source n2; Dest n4], ALU, allCores; (* vabd qdd vhsub vqsub vabd vceq vcge vcgt vmax vmin vfmx vfmn ddd ddd *) - "neon_int_5", [Source_m n1; Source_n n2; Dest n4], ALU; + "neon_int_5", [Source_m n1; Source_n n2; Dest n4], ALU, allCores; (* vqneg vqabs dd qq *) - "neon_vqneg_vqabs", [Source n1; Dest n4], ALU; + "neon_vqneg_vqabs", [Source n1; Dest n4], ALU, allCores; (* vmov vmvn *) - "neon_vmov", [Dest n3], ALU; + "neon_vmov", [Dest n3], ALU, allCores; (* vaba *) - "neon_vaba", [Source_n n2; Source_m n1; Source_d n3; Dest n6], ALU; + "neon_vaba", [Source_n n2; Source_m n1; Source_d n3; Dest n6], ALU, allCores; "neon_vaba_qqq", - [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (1, n6)], ALU_2cycle; + [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (1, n6)], + ALU_2cycle, allCores; (* vsma *) - "neon_vsma", [Source_m n1; Source_d n3; Dest n6], ALU; + "neon_vsma", [Source_m n1; Source_d n3; Dest n6], ALU, allCores; (* NEON integer multiply instructions. *) (* vmul, vqdmlh, vqrdmlh *) (* vmul, vqdmul, qdd 16/8 long 32/16 long *) - "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long", [Source n2; Dest n6], Mul; - "neon_mul_qqq_8_16_32_ddd_32", [Source n2; Dest_n_after (1, n6)], Mul_2cycle; + "neon_mul_ddd_8_16_qdd_16_8_long_32_16_long", [Source n2; Dest n6], + Mul, allCores; + "neon_mul_qqq_8_16_32_ddd_32", [Source n2; Dest_n_after (1, n6)], + Mul_2cycle, allCores; (* vmul, vqdmul again *) "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar", - [Source_n n2; Source_m n1; Dest_n_after (1, n6)], Mul_2cycle; + [Source_n n2; Source_m n1; Dest_n_after (1, n6)], Mul_2cycle, allCores; (* vmla, vmls *) "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long", - [Source_n n2; Source_m n2; Source_d n3; Dest n6], Mul; + [Source_n n2; Source_m n2; Source_d n3; Dest n6], Mul, allCores; "neon_mla_qqq_8_16", - [Source_n n2; Source_m n2; Source_d n3; Dest_n_after (1, n6)], Mul_2cycle; + [Source_n n2; Source_m n2; Source_d n3; Dest_n_after (1, n6)], + Mul_2cycle, allCores; "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long", - [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (1, n6)], Mul_2cycle; + [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (1, n6)], + Mul_2cycle, allCores; "neon_mla_qqq_32_qqd_32_scalar", - [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (3, n6)], Mul_4cycle; + [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (3, n6)], + Mul_4cycle, allCores; (* vmul, vqdmulh, vqrdmulh *) (* vmul, vqdmul *) "neon_mul_ddd_16_scalar_32_16_long_scalar", - [Source_n n2; Source_m n1; Dest n6], Mul; + [Source_n n2; Source_m n1; Dest n6], Mul, allCores; "neon_mul_qqd_32_scalar", - [Source_n n2; Source_m n1; Dest_n_after (3, n6)], Mul_4cycle; + [Source_n n2; Source_m n1; Dest_n_after (3, n6)], Mul_4cycle, allCores; (* vmla, vmls *) (* vmla, vmla, vqdmla, vqdmls *) "neon_mla_ddd_16_scalar_qdd_32_16_long_scalar", - [Source_n n2; Source_m n1; Source_d n3; Dest n6], Mul; + [Source_n n2; Source_m n1; Source_d n3; Dest n6], Mul, allCores; (* NEON integer shift instructions. *) (* vshr/vshl immediate, vshr_narrow, vshl_vmvh, vsli_vsri_ddd *) - "neon_shift_1", [Source n1; Dest n3], Shift; - (* vqshl, vrshr immediate; vqshr, vqmov, vrshr, vqrshr narrow; + "neon_shift_1", [Source n1; Dest n3], Shift, allCores; + (* vqshl, vrshr immediate; vqshr, vqmov, vrshr, vqrshr narrow, allCores; vqshl_vrshl_vqrshl_ddd *) - "neon_shift_2", [Source n1; Dest n4], Shift; + "neon_shift_2", [Source n1; Dest n4], Shift, allCores; (* vsli, vsri and vshl for qqq *) - "neon_shift_3", [Source n1; Dest_n_after (1, n3)], Shift_2cycle; - "neon_vshl_ddd", [Source n1; Dest n1], Shift; + "neon_shift_3", [Source n1; Dest_n_after (1, n3)], Shift_2cycle, allCores; + "neon_vshl_ddd", [Source n1; Dest n1], Shift, allCores; "neon_vqshl_vrshl_vqrshl_qqq", [Source n1; Dest_n_after (1, n4)], - Shift_2cycle; - "neon_vsra_vrsra", [Source_m n1; Source_d n3; Dest n6], Shift; + Shift_2cycle, allCores; + "neon_vsra_vrsra", [Source_m n1; Source_d n3; Dest n6], Shift, allCores; (* NEON floating-point instructions. *) (* vadd, vsub, vabd, vmul, vceq, vcge, vcgt, vcage, vcagt, vmax, vmin *) (* vabs, vneg, vceqz, vcgez, vcgtz, vclez, vcltz, vrecpe, vrsqrte, vcvt *) - "neon_fp_vadd_ddd_vabs_dd", [Source n2; Dest n5], Fadd; + "neon_fp_vadd_ddd_vabs_dd", [Source n2; Dest n5], Fadd, allCores; "neon_fp_vadd_qqq_vabs_qq", [Source n2; Dest_n_after (1, n5)], - Fadd_2cycle; + Fadd_2cycle, allCores; (* vsum, fvmx, vfmn *) - "neon_fp_vsum", [Source n1; Dest n5], Fadd; - "neon_fp_vmul_ddd", [Source_n n2; Source_m n1; Dest n5], Fmul; + "neon_fp_vsum", [Source n1; Dest n5], Fadd, allCores; + "neon_fp_vmul_ddd", [Source_n n2; Source_m n1; Dest n5], Fmul, allCores; "neon_fp_vmul_qqd", [Source_n n2; Source_m n1; Dest_n_after (1, n5)], - Fmul_2cycle; + Fmul_2cycle, allCores; (* vmla, vmls *) "neon_fp_vmla_ddd", - [Source_n n2; Source_m n2; Source_d n3; Dest n9], Fmul_then_fadd; + [Source_n n2; Source_m n2; Source_d n3; Dest n9], Fmul_then_fadd, allCores; "neon_fp_vmla_qqq", [Source_n n2; Source_m n2; Source_d n3; Dest_n_after (1, n9)], - Fmul_then_fadd_2; + Fmul_then_fadd_2, allCores; "neon_fp_vmla_ddd_scalar", - [Source_n n2; Source_m n1; Source_d n3; Dest n9], Fmul_then_fadd; + [Source_n n2; Source_m n1; Source_d n3; Dest n9], Fmul_then_fadd, allCores; "neon_fp_vmla_qqq_scalar", [Source_n n2; Source_m n1; Source_d n3; Dest_n_after (1, n9)], - Fmul_then_fadd_2; - "neon_fp_vrecps_vrsqrts_ddd", [Source n2; Dest n9], Fmul_then_fadd; + Fmul_then_fadd_2, allCores; + "neon_fp_vrecps_vrsqrts_ddd", [Source n2; Dest n9], Fmul_then_fadd, allCores; "neon_fp_vrecps_vrsqrts_qqq", [Source n2; Dest_n_after (1, n9)], - Fmul_then_fadd_2; + Fmul_then_fadd_2, allCores; (* NEON byte permute instructions. *) (* vmov; vtrn and vswp for dd; vzip for dd; vuzp for dd; vrev; vext for dd *) - "neon_bp_simple", [Source n1; Dest n2], Permute 1; - (* vswp for qq; vext for qqq; vtbl with {Dn} or {Dn, Dn1}; + "neon_bp_simple", [Source n1; Dest n2], Permute 1, allCores; + (* vswp for qq; vext for qqq; vtbl with {Dn} or {Dn, Dn1}, allCores; similarly for vtbx *) - "neon_bp_2cycle", [Source n1; Dest_n_after (1, n2)], Permute 2; + "neon_bp_2cycle", [Source n1; Dest_n_after (1, n2)], Permute 2, allCores; (* all the rest *) - "neon_bp_3cycle", [Source n1; Dest_n_after (2, n2)], Permute 3; + "neon_bp_3cycle", [Source n1; Dest_n_after (2, n2)], Permute 3, allCores; (* NEON load/store instructions. *) - "neon_ldr", [Dest n1], Ls 1; - "neon_str", [Source n1], Ls 1; - "neon_vld1_1_2_regs", [Dest_n_after (1, n1)], Ls 2; - "neon_vld1_3_4_regs", [Dest_n_after (2, n1)], Ls 3; - "neon_vld2_2_regs_vld1_vld2_all_lanes", [Dest_n_after (1, n2)], Ls 2; - "neon_vld2_4_regs", [Dest_n_after (2, n2)], Ls 3; - "neon_vld3_vld4", [Dest_n_after (3, n2)], Ls 4; - "neon_vst1_1_2_regs_vst2_2_regs", [Source n1], Ls 2; - "neon_vst1_3_4_regs", [Source n1], Ls 3; - "neon_vst2_4_regs_vst3_vst4", [Source n1], Ls 4; - "neon_vst3_vst4", [Source n1], Ls 4; - "neon_vld1_vld2_lane", [Source n1; Dest_n_after (2, n2)], Ls 3; - "neon_vld3_vld4_lane", [Source n1; Dest_n_after (4, n2)], Ls 5; - "neon_vst1_vst2_lane", [Source n1], Ls 2; - "neon_vst3_vst4_lane", [Source n1], Ls 3; - "neon_vld3_vld4_all_lanes", [Dest_n_after (1, n2)], Ls 3; + "neon_ldr", [Dest n1], Ls 1, allCores; + "neon_str", [Source n1], Ls 1, allCores; + "neon_vld1_1_2_regs", [Dest_n_after (1, n1)], Ls 2, allCores; + "neon_vld1_3_4_regs", [Dest_n_after (2, n1)], Ls 3, allCores; + "neon_vld2_2_regs_vld1_vld2_all_lanes", [Dest_n_after (1, n2)], Ls 2, allCores; + "neon_vld2_4_regs", [Dest_n_after (2, n2)], Ls 3, allCores; + "neon_vld3_vld4", [Dest_n_after (3, n2)], Ls 4, allCores; + "neon_vst1_1_2_regs_vst2_2_regs", [Source n1], Ls 2, allCores; + "neon_vst1_3_4_regs", [Source n1], Ls 3, allCores; + "neon_vst2_4_regs_vst3_vst4", [Source n1], Ls 4, allCores; + "neon_vst3_vst4", [Source n1], Ls 4, allCores; + "neon_vld1_vld2_lane", [Source n1; Dest_n_after (2, n2)], Ls 3, allCores; + "neon_vld3_vld4_lane", [Source n1; Dest_n_after (4, n2)], Ls 5, allCores; + "neon_vst1_vst2_lane", [Source n1], Ls 2, allCores; + "neon_vst3_vst4_lane", [Source n1], Ls 3, allCores; + "neon_vld3_vld4_all_lanes", [Dest_n_after (1, n2)], Ls 3, allCores; (* NEON register transfer instructions. *) - "neon_mcr", [Dest n2], Permute 1; - "neon_mcr_2_mcrr", [Dest n2], Permute 2; + "neon_mcr", [Dest n2], Permute 1, allCores; + "neon_mcr_2_mcrr", [Dest n2], Permute 2, allCores; (* MRC instructions are in the .tpl file. *) ] @@ -221,7 +245,7 @@ let availability_table = [ required. (It is also possible that an entry in the table has no source requirements.) *) let calculate_sources = - List.map (fun (name, avail, res) -> + List.map (fun (name, avail, res, cores) -> let earliest_stage = List.fold_left (fun cur -> fun info -> @@ -331,7 +355,7 @@ let pick_latency largest worst guards = of one bypass from this producer to any particular consumer listed in LATENCIES.) Use a hash table to collate bypasses with the same latency and guard. *) -let collate_bypasses (producer_name, _, _, _) largest latencies = +let collate_bypasses (producer_name, _, _, _) largest latencies core = let ht = Hashtbl.create 42 in let keys = ref [] in List.iter ( @@ -350,7 +374,7 @@ let collate_bypasses (producer_name, _, _, _) largest latencies = (if (try ignore (Hashtbl.find ht (guard, latency)); false with Not_found -> true) then keys := (guard, latency) :: !keys); - Hashtbl.add ht (guard, latency) consumer + Hashtbl.add ht (guard, latency) ((coreStr core) ^ "_" ^ consumer) end ) latencies; (* The hash table now has bypasses collated so that ones with the @@ -372,7 +396,7 @@ let collate_bypasses (producer_name, _, _, _) largest latencies = the output in such a way that all bypasses with the same producer and latency are together, and so that bypasses with the worst-case latency are ignored. *) -let worst_case_latencies_and_bypasses = +let worst_case_latencies_and_bypasses core = let rec f (worst_acc, bypasses_acc) prev xs = match xs with [] -> (worst_acc, bypasses_acc) @@ -400,7 +424,7 @@ let worst_case_latencies_and_bypasses = (* Having got the largest latency, collect all bypasses for this producer and filter out those with that larger latency. Record the others for later emission. *) - let bypasses = collate_bypasses producer largest latencies in + let bypasses = collate_bypasses producer largest latencies core in (* Go on to process remaining producers, having noted the result for this one. *) f ((producer_name, producer_avail, largest, @@ -444,14 +468,18 @@ let write_comment producer avail = in f avail 0 + (* Emit a define_insn_reservation for each producer. The latency written in will be its worst-case latency. *) -let emit_insn_reservations = - List.iter ( +let emit_insn_reservations core = + let corestring = coreStr core in + let tunestring = tuneStr core + in List.iter ( fun (producer, avail, latency, reservation) -> write_comment producer avail; - Printf.printf "(define_insn_reservation \"%s\" %d\n" producer latency; - Printf.printf " (and (eq_attr \"tune\" \"cortexa8\")\n"; + Printf.printf "(define_insn_reservation \"%s_%s\" %d\n" + corestring producer latency; + Printf.printf " (and (eq_attr \"tune\" \"%s\")\n" tunestring; Printf.printf " (eq_attr \"neon_type\" \"%s\"))\n" producer; let str = match reservation with @@ -467,7 +495,7 @@ let emit_insn_reservations = | Fmul_then_fadd -> "fmul_then_fadd" | Fmul_then_fadd_2 -> "fmul_then_fadd_2" in - Printf.printf " \"cortex_a8_neon_%s\")\n\n" str + Printf.printf " \"%s_neon_%s\")\n\n" corestring str ) (* Given a guard description, return the name of the C function to @@ -480,10 +508,12 @@ let guard_fn g = | Guard_none -> assert false (* Emit a define_bypass for each bypass. *) -let emit_bypasses = +let emit_bypasses core = List.iter ( fun (producer, consumers, latency, guard) -> - Printf.printf "(define_bypass %d \"%s\"\n" latency producer; + Printf.printf "(define_bypass %d \"%s_%s\"\n" + latency (coreStr core) producer; + if guard = Guard_none then Printf.printf " \"%s\")\n\n" consumers else @@ -493,11 +523,21 @@ let emit_bypasses = end ) -(* Program entry point. *) -let main = + +let calculate_per_core_availability_table core availability_table = let table = calculate_sources availability_table in - let worst_cases, bypasses = worst_case_latencies_and_bypasses table in - emit_insn_reservations (List.rev worst_cases); + let worst_cases, bypasses = worst_case_latencies_and_bypasses core table in + emit_insn_reservations core (List.rev worst_cases); Printf.printf ";; Exceptions to the default latencies.\n\n"; - emit_bypasses bypasses + emit_bypasses core bypasses + +let calculate_core_availability_table core availability_table = +let filter_core = List.filter (fun (_, _, _, cores) + -> List.exists ((=) core) cores) +in calculate_per_core_availability_table core (filter_core availability_table) + +(* Program entry point. *) +let main = + List.map (fun core -> calculate_core_availability_table + core availability_table) allCores diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index bdc279a92a5..3bb74a2d3ee 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -140,7 +140,9 @@ (UNSPEC_VUZP1 201) (UNSPEC_VUZP2 202) (UNSPEC_VZIP1 203) - (UNSPEC_VZIP2 204)]) + (UNSPEC_VZIP2 204) + (UNSPEC_VCLE 206) + (UNSPEC_VCLT 207)]) ;; Attribute used to permit string comparisons against in @@ -1115,12 +1117,13 @@ ; vector registers. Make an attempt at removing unnecessary moves, though ; we're really at the mercy of the register allocator. -(define_insn "move_lo_quad_v4si" - [(set (match_operand:V4SI 0 "s_register_operand" "+w") - (vec_concat:V4SI - (match_operand:V2SI 1 "s_register_operand" "w") - (vec_select:V2SI (match_dup 0) - (parallel [(const_int 2) (const_int 3)]))))] +(define_insn "neon_move_lo_quad_" + [(set (match_operand:ANY128 0 "s_register_operand" "+w") + (vec_concat:ANY128 + (match_operand: 1 "s_register_operand" "w") + (vec_select: + (match_dup 0) + (match_operand:ANY128 2 "vect_par_constant_high" ""))))] "TARGET_NEON" { int dest = REGNO (operands[0]); @@ -1134,66 +1137,61 @@ [(set_attr "neon_type" "neon_bp_simple")] ) -(define_insn "move_lo_quad_v4sf" - [(set (match_operand:V4SF 0 "s_register_operand" "+w") - (vec_concat:V4SF - (match_operand:V2SF 1 "s_register_operand" "w") - (vec_select:V2SF (match_dup 0) - (parallel [(const_int 2) (const_int 3)]))))] +(define_insn "neon_move_hi_quad_" + [(set (match_operand:ANY128 0 "s_register_operand" "+w") + (vec_concat:ANY128 + (match_operand: 1 "s_register_operand" "w") + (vec_select: + (match_dup 0) + (match_operand:ANY128 2 "vect_par_constant_low" ""))))] "TARGET_NEON" { int dest = REGNO (operands[0]); int src = REGNO (operands[1]); if (dest != src) - return "vmov\t%e0, %P1"; + return "vmov\t%f0, %P1"; else return ""; } [(set_attr "neon_type" "neon_bp_simple")] ) -(define_insn "move_lo_quad_v8hi" - [(set (match_operand:V8HI 0 "s_register_operand" "+w") - (vec_concat:V8HI - (match_operand:V4HI 1 "s_register_operand" "w") - (vec_select:V4HI (match_dup 0) - (parallel [(const_int 4) (const_int 5) - (const_int 6) (const_int 7)]))))] - "TARGET_NEON" +(define_expand "move_hi_quad_" + [(match_operand:ANY128 0 "s_register_operand" "") + (match_operand: 1 "s_register_operand" "")] + "TARGET_NEON" { - int dest = REGNO (operands[0]); - int src = REGNO (operands[1]); + rtvec v = rtvec_alloc (/2); + rtx t1; + int i; - if (dest != src) - return "vmov\t%e0, %P1"; - else - return ""; -} - [(set_attr "neon_type" "neon_bp_simple")] -) + for (i=0; i < (/2); i++) + RTVEC_ELT (v, i) = GEN_INT (i); -(define_insn "move_lo_quad_v16qi" - [(set (match_operand:V16QI 0 "s_register_operand" "+w") - (vec_concat:V16QI - (match_operand:V8QI 1 "s_register_operand" "w") - (vec_select:V8QI (match_dup 0) - (parallel [(const_int 8) (const_int 9) - (const_int 10) (const_int 11) - (const_int 12) (const_int 13) - (const_int 14) (const_int 15)]))))] - "TARGET_NEON" + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_move_hi_quad_ (operands[0], operands[1], t1)); + + DONE; +}) + +(define_expand "move_lo_quad_" + [(match_operand:ANY128 0 "s_register_operand" "") + (match_operand: 1 "s_register_operand" "")] + "TARGET_NEON" { - int dest = REGNO (operands[0]); - int src = REGNO (operands[1]); + rtvec v = rtvec_alloc (/2); + rtx t1; + int i; - if (dest != src) - return "vmov\t%e0, %P1"; - else - return ""; -} - [(set_attr "neon_type" "neon_bp_simple")] -) + for (i=0; i < (/2); i++) + RTVEC_ELT (v, i) = GEN_INT ((/2) + i); + + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_move_lo_quad_ (operands[0], operands[1], t1)); + + DONE; +}) ;; Reduction operations @@ -1452,6 +1450,169 @@ [(set_attr "neon_type" "neon_int_5")] ) +;; Conditional instructions. These are comparisons with conditional moves for +;; vectors. They perform the assignment: +;; +;; Vop0 = (Vop4 Vop5) ? Vop1 : Vop2; +;; +;; where op3 is <, <=, ==, !=, >= or >. Operations are performed +;; element-wise. + +(define_expand "vcond" + [(set (match_operand:VDQW 0 "s_register_operand" "") + (if_then_else:VDQW + (match_operator 3 "arm_comparison_operator" + [(match_operand:VDQW 4 "s_register_operand" "") + (match_operand:VDQW 5 "nonmemory_operand" "")]) + (match_operand:VDQW 1 "s_register_operand" "") + (match_operand:VDQW 2 "s_register_operand" "")))] + "TARGET_NEON && (! || flag_unsafe_math_optimizations)" +{ + rtx mask; + int inverse = 0, immediate_zero = 0; + /* See the description of "magic" bits in the 'T' case of + arm_print_operand. */ + HOST_WIDE_INT magic_word = (mode == V2SFmode || mode == V4SFmode) + ? 3 : 1; + rtx magic_rtx = GEN_INT (magic_word); + + mask = gen_reg_rtx (mode); + + if (operands[5] == CONST0_RTX (mode)) + immediate_zero = 1; + else if (!REG_P (operands[5])) + operands[5] = force_reg (mode, operands[5]); + + switch (GET_CODE (operands[3])) + { + case GE: + emit_insn (gen_neon_vcge (mask, operands[4], operands[5], + magic_rtx)); + break; + + case GT: + emit_insn (gen_neon_vcgt (mask, operands[4], operands[5], + magic_rtx)); + break; + + case EQ: + emit_insn (gen_neon_vceq (mask, operands[4], operands[5], + magic_rtx)); + break; + + case LE: + if (immediate_zero) + emit_insn (gen_neon_vcle (mask, operands[4], operands[5], + magic_rtx)); + else + emit_insn (gen_neon_vcge (mask, operands[5], operands[4], + magic_rtx)); + break; + + case LT: + if (immediate_zero) + emit_insn (gen_neon_vclt (mask, operands[4], operands[5], + magic_rtx)); + else + emit_insn (gen_neon_vcgt (mask, operands[5], operands[4], + magic_rtx)); + break; + + case NE: + emit_insn (gen_neon_vceq (mask, operands[4], operands[5], + magic_rtx)); + inverse = 1; + break; + + default: + gcc_unreachable (); + } + + if (inverse) + emit_insn (gen_neon_vbsl (operands[0], mask, operands[2], + operands[1])); + else + emit_insn (gen_neon_vbsl (operands[0], mask, operands[1], + operands[2])); + + DONE; +}) + +(define_expand "vcondu" + [(set (match_operand:VDQIW 0 "s_register_operand" "") + (if_then_else:VDQIW + (match_operator 3 "arm_comparison_operator" + [(match_operand:VDQIW 4 "s_register_operand" "") + (match_operand:VDQIW 5 "s_register_operand" "")]) + (match_operand:VDQIW 1 "s_register_operand" "") + (match_operand:VDQIW 2 "s_register_operand" "")))] + "TARGET_NEON" +{ + rtx mask; + int inverse = 0, immediate_zero = 0; + + mask = gen_reg_rtx (mode); + + if (operands[5] == CONST0_RTX (mode)) + immediate_zero = 1; + else if (!REG_P (operands[5])) + operands[5] = force_reg (mode, operands[5]); + + switch (GET_CODE (operands[3])) + { + case GEU: + emit_insn (gen_neon_vcge (mask, operands[4], operands[5], + const0_rtx)); + break; + + case GTU: + emit_insn (gen_neon_vcgt (mask, operands[4], operands[5], + const0_rtx)); + break; + + case EQ: + emit_insn (gen_neon_vceq (mask, operands[4], operands[5], + const0_rtx)); + break; + + case LEU: + if (immediate_zero) + emit_insn (gen_neon_vcle (mask, operands[4], operands[5], + const0_rtx)); + else + emit_insn (gen_neon_vcge (mask, operands[5], operands[4], + const0_rtx)); + break; + + case LTU: + if (immediate_zero) + emit_insn (gen_neon_vclt (mask, operands[4], operands[5], + const0_rtx)); + else + emit_insn (gen_neon_vcgt (mask, operands[5], operands[4], + const0_rtx)); + break; + + case NE: + emit_insn (gen_neon_vceq (mask, operands[4], operands[5], + const0_rtx)); + inverse = 1; + break; + + default: + gcc_unreachable (); + } + + if (inverse) + emit_insn (gen_neon_vbsl (operands[0], mask, operands[2], + operands[1])); + else + emit_insn (gen_neon_vbsl (operands[0], mask, operands[1], + operands[2])); + + DONE; +}) + ;; Patterns for builtins. ; good for plain vadd, vaddq. @@ -1863,13 +2024,16 @@ ) (define_insn "neon_vceq" - [(set (match_operand: 0 "s_register_operand" "=w") - (unspec: [(match_operand:VDQW 1 "s_register_operand" "w") - (match_operand:VDQW 2 "s_register_operand" "w") - (match_operand:SI 3 "immediate_operand" "i")] - UNSPEC_VCEQ))] + [(set (match_operand: 0 "s_register_operand" "=w,w") + (unspec: + [(match_operand:VDQW 1 "s_register_operand" "w,w") + (match_operand:VDQW 2 "nonmemory_operand" "w,Dz") + (match_operand:SI 3 "immediate_operand" "i,i")] + UNSPEC_VCEQ))] "TARGET_NEON" - "vceq.\t%0, %1, %2" + "@ + vceq.\t%0, %1, %2 + vceq.\t%0, %1, #0" [(set (attr "neon_type") (if_then_else (ne (symbol_ref "") (const_int 0)) (if_then_else (ne (symbol_ref "") (const_int 0)) @@ -1879,13 +2043,16 @@ ) (define_insn "neon_vcge" - [(set (match_operand: 0 "s_register_operand" "=w") - (unspec: [(match_operand:VDQW 1 "s_register_operand" "w") - (match_operand:VDQW 2 "s_register_operand" "w") - (match_operand:SI 3 "immediate_operand" "i")] - UNSPEC_VCGE))] + [(set (match_operand: 0 "s_register_operand" "=w,w") + (unspec: + [(match_operand:VDQW 1 "s_register_operand" "w,w") + (match_operand:VDQW 2 "nonmemory_operand" "w,Dz") + (match_operand:SI 3 "immediate_operand" "i,i")] + UNSPEC_VCGE))] "TARGET_NEON" - "vcge.%T3%#\t%0, %1, %2" + "@ + vcge.%T3%#\t%0, %1, %2 + vcge.%T3%#\t%0, %1, #0" [(set (attr "neon_type") (if_then_else (ne (symbol_ref "") (const_int 0)) (if_then_else (ne (symbol_ref "") (const_int 0)) @@ -1895,13 +2062,16 @@ ) (define_insn "neon_vcgt" - [(set (match_operand: 0 "s_register_operand" "=w") - (unspec: [(match_operand:VDQW 1 "s_register_operand" "w") - (match_operand:VDQW 2 "s_register_operand" "w") - (match_operand:SI 3 "immediate_operand" "i")] - UNSPEC_VCGT))] + [(set (match_operand: 0 "s_register_operand" "=w,w") + (unspec: + [(match_operand:VDQW 1 "s_register_operand" "w,w") + (match_operand:VDQW 2 "nonmemory_operand" "w,Dz") + (match_operand:SI 3 "immediate_operand" "i,i")] + UNSPEC_VCGT))] "TARGET_NEON" - "vcgt.%T3%#\t%0, %1, %2" + "@ + vcgt.%T3%#\t%0, %1, %2 + vcgt.%T3%#\t%0, %1, #0" [(set (attr "neon_type") (if_then_else (ne (symbol_ref "") (const_int 0)) (if_then_else (ne (symbol_ref "") (const_int 0)) @@ -1910,6 +2080,43 @@ (const_string "neon_int_5")))] ) +;; VCLE and VCLT only support comparisons with immediate zero (register +;; variants are VCGE and VCGT with operands reversed). + +(define_insn "neon_vcle" + [(set (match_operand: 0 "s_register_operand" "=w") + (unspec: + [(match_operand:VDQW 1 "s_register_operand" "w") + (match_operand:VDQW 2 "nonmemory_operand" "Dz") + (match_operand:SI 3 "immediate_operand" "i")] + UNSPEC_VCLE))] + "TARGET_NEON" + "vcle.%T3%#\t%0, %1, #0" + [(set (attr "neon_type") + (if_then_else (ne (symbol_ref "") (const_int 0)) + (if_then_else (ne (symbol_ref "") (const_int 0)) + (const_string "neon_fp_vadd_ddd_vabs_dd") + (const_string "neon_fp_vadd_qqq_vabs_qq")) + (const_string "neon_int_5")))] +) + +(define_insn "neon_vclt" + [(set (match_operand: 0 "s_register_operand" "=w") + (unspec: + [(match_operand:VDQW 1 "s_register_operand" "w") + (match_operand:VDQW 2 "nonmemory_operand" "Dz") + (match_operand:SI 3 "immediate_operand" "i")] + UNSPEC_VCLT))] + "TARGET_NEON" + "vclt.%T3%#\t%0, %1, #0" + [(set (attr "neon_type") + (if_then_else (ne (symbol_ref "") (const_int 0)) + (if_then_else (ne (symbol_ref "") (const_int 0)) + (const_string "neon_fp_vadd_ddd_vabs_dd") + (const_string "neon_fp_vadd_qqq_vabs_qq")) + (const_string "neon_int_5")))] +) + (define_insn "neon_vcage" [(set (match_operand: 0 "s_register_operand" "=w") (unspec: [(match_operand:VCVTF 1 "s_register_operand" "w") @@ -4977,3 +5184,240 @@ emit_insn (gen_orn3_neon (operands[0], operands[1], operands[2])); DONE; }) + +(define_insn "neon_vec_unpack_lo_" + [(set (match_operand: 0 "register_operand" "=w") + (SE: (vec_select: + (match_operand:VU 1 "register_operand" "w") + (match_operand:VU 2 "vect_par_constant_low" ""))))] + "TARGET_NEON" + "vmovl. %q0, %e1" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_insn "neon_vec_unpack_hi_" + [(set (match_operand: 0 "register_operand" "=w") + (SE: (vec_select: + (match_operand:VU 1 "register_operand" "w") + (match_operand:VU 2 "vect_par_constant_high" ""))))] + "TARGET_NEON" + "vmovl. %q0, %f1" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_unpack_hi_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VU 1 "register_operand"))] + "TARGET_NEON" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2); i++) + RTVEC_ELT (v, i) = GEN_INT ((/2) + i); + + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_vec_unpack_hi_ (operands[0], + operands[1], + t1)); + DONE; + } +) + +(define_expand "vec_unpack_lo_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VU 1 "register_operand" ""))] + "TARGET_NEON" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2) ; i++) + RTVEC_ELT (v, i) = GEN_INT (i); + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_vec_unpack_lo_ (operands[0], + operands[1], + t1)); + DONE; + } +) + +(define_insn "neon_vec_mult_lo_" + [(set (match_operand: 0 "register_operand" "=w") + (mult: (SE: (vec_select: + (match_operand:VU 1 "register_operand" "w") + (match_operand:VU 2 "vect_par_constant_low" ""))) + (SE: (vec_select: + (match_operand:VU 3 "register_operand" "w") + (match_dup 2)))))] + "TARGET_NEON" + "vmull. %q0, %e1, %e3" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_widen_mult_lo_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VU 1 "register_operand" "")) + (SE: (match_operand:VU 2 "register_operand" ""))] + "TARGET_NEON" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2) ; i++) + RTVEC_ELT (v, i) = GEN_INT (i); + t1 = gen_rtx_PARALLEL (mode, v); + + emit_insn (gen_neon_vec_mult_lo_ (operands[0], + operands[1], + t1, + operands[2])); + DONE; + } +) + +(define_insn "neon_vec_mult_hi_" + [(set (match_operand: 0 "register_operand" "=w") + (mult: (SE: (vec_select: + (match_operand:VU 1 "register_operand" "w") + (match_operand:VU 2 "vect_par_constant_high" ""))) + (SE: (vec_select: + (match_operand:VU 3 "register_operand" "w") + (match_dup 2)))))] + "TARGET_NEON" + "vmull. %q0, %f1, %f3" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_widen_mult_hi_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VU 1 "register_operand" "")) + (SE: (match_operand:VU 2 "register_operand" ""))] + "TARGET_NEON" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2) ; i++) + RTVEC_ELT (v, i) = GEN_INT (/2 + i); + t1 = gen_rtx_PARALLEL (mode, v); + + emit_insn (gen_neon_vec_mult_hi_ (operands[0], + operands[1], + t1, + operands[2])); + DONE; + + } +) + +;; Vectorize for non-neon-quad case +(define_insn "neon_unpack_" + [(set (match_operand: 0 "register_operand" "=w") + (SE: (match_operand:VDI 1 "register_operand" "")))] + "TARGET_NEON" + "vmovl. %q0, %1" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_unpack_lo_" + [(match_operand: 0 "register_operand" "") + (SE:(match_operand:VDI 1 "register_operand"))] + "TARGET_NEON" +{ + rtx tmpreg = gen_reg_rtx (mode); + emit_insn (gen_neon_unpack_ (tmpreg, operands[1])); + emit_insn (gen_neon_vget_low (operands[0], tmpreg)); + + DONE; +} +) + +(define_expand "vec_unpack_hi_" + [(match_operand: 0 "register_operand" "") + (SE:(match_operand:VDI 1 "register_operand"))] + "TARGET_NEON" +{ + rtx tmpreg = gen_reg_rtx (mode); + emit_insn (gen_neon_unpack_ (tmpreg, operands[1])); + emit_insn (gen_neon_vget_high (operands[0], tmpreg)); + + DONE; +} +) + +(define_insn "neon_vec_mult_" + [(set (match_operand: 0 "register_operand" "=w") + (mult: (SE: + (match_operand:VDI 1 "register_operand" "w")) + (SE: + (match_operand:VDI 2 "register_operand" "w"))))] + "TARGET_NEON" + "vmull. %q0, %1, %2" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_widen_mult_hi_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VDI 1 "register_operand" "")) + (SE: (match_operand:VDI 2 "register_operand" ""))] + "TARGET_NEON" + { + rtx tmpreg = gen_reg_rtx (mode); + emit_insn (gen_neon_vec_mult_ (tmpreg, operands[1], operands[2])); + emit_insn (gen_neon_vget_high (operands[0], tmpreg)); + + DONE; + + } +) + +(define_expand "vec_widen_mult_lo_" + [(match_operand: 0 "register_operand" "") + (SE: (match_operand:VDI 1 "register_operand" "")) + (SE: (match_operand:VDI 2 "register_operand" ""))] + "TARGET_NEON" + { + rtx tmpreg = gen_reg_rtx (mode); + emit_insn (gen_neon_vec_mult_ (tmpreg, operands[1], operands[2])); + emit_insn (gen_neon_vget_low (operands[0], tmpreg)); + + DONE; + + } +) + +(define_insn "vec_pack_trunc_" + [(set (match_operand: 0 "register_operand" "=&w") + (vec_concat: + (truncate: + (match_operand:VN 1 "register_operand" "w")) + (truncate: + (match_operand:VN 2 "register_operand" "w"))))] + "TARGET_NEON" + "vmovn.i\t%e0, %q1\n\tvmovn.i\t%f0, %q2" + [(set_attr "neon_type" "neon_shift_1")] +) + +;; For the non-quad case. +(define_insn "neon_vec_pack_trunc_" + [(set (match_operand: 0 "register_operand" "=w") + (truncate: (match_operand:VN 1 "register_operand" "")))] + "TARGET_NEON" + "vmovn.i\t%0, %q1" + [(set_attr "neon_type" "neon_shift_1")] +) + +(define_expand "vec_pack_trunc_" + [(match_operand: 0 "register_operand" "") + (match_operand:VSHFT 1 "register_operand" "") + (match_operand:VSHFT 2 "register_operand")] + "TARGET_NEON" +{ + rtx tempreg = gen_reg_rtx (mode); + + emit_insn (gen_move_lo_quad_ (tempreg, operands[1])); + emit_insn (gen_move_hi_quad_ (tempreg, operands[2])); + emit_insn (gen_neon_vec_pack_trunc_ (operands[0], tempreg)); + DONE; +}) diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index da3b6dcd4fd..54f4861a008 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -619,3 +619,66 @@ (and (match_test "TARGET_32BIT") (match_operand 0 "arm_di_operand")))) +;; True if the operand is memory reference suitable for a ldrex/strex. +(define_predicate "arm_sync_memory_operand" + (and (match_operand 0 "memory_operand") + (match_code "reg" "0"))) + +;; Predicates for parallel expanders based on mode. +(define_special_predicate "vect_par_constant_high" + (match_code "parallel") +{ + HOST_WIDE_INT count = XVECLEN (op, 0); + int i; + int base = GET_MODE_NUNITS (mode); + + if ((count < 1) + || (count != base/2)) + return false; + + if (!VECTOR_MODE_P (mode)) + return false; + + for (i = 0; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + int val; + + if (GET_CODE (elt) != CONST_INT) + return false; + + val = INTVAL (elt); + if (val != (base/2) + i) + return false; + } + return true; +}) + +(define_special_predicate "vect_par_constant_low" + (match_code "parallel") +{ + HOST_WIDE_INT count = XVECLEN (op, 0); + int i; + int base = GET_MODE_NUNITS (mode); + + if ((count < 1) + || (count != base/2)) + return false; + + if (!VECTOR_MODE_P (mode)) + return false; + + for (i = 0; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + int val; + + if (GET_CODE (elt) != CONST_INT) + return false; + + val = INTVAL (elt); + if (val != i) + return false; + } + return true; +}) diff --git a/gcc/config/arm/sync.md b/gcc/config/arm/sync.md index 7fd38d75484..4c4b4fa106b 100644 --- a/gcc/config/arm/sync.md +++ b/gcc/config/arm/sync.md @@ -280,7 +280,7 @@ (define_insn "arm_sync_compare_and_swapsi" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI - [(match_operand:SI 1 "memory_operand" "+m") + [(match_operand:SI 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 3 "s_register_operand" "r")] VUNSPEC_SYNC_COMPARE_AND_SWAP)) @@ -300,14 +300,14 @@ (set_attr "sync_new_value" "3") (set_attr "sync_t1" "0") (set_attr "sync_t2" "4") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_compare_and_swap" [(set (match_operand:SI 0 "s_register_operand" "=&r") (zero_extend:SI (unspec_volatile:NARROW - [(match_operand:NARROW 1 "memory_operand" "+m") + [(match_operand:NARROW 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 3 "s_register_operand" "r")] VUNSPEC_SYNC_COMPARE_AND_SWAP))) @@ -327,12 +327,12 @@ (set_attr "sync_new_value" "3") (set_attr "sync_t1" "0") (set_attr "sync_t2" "4") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_lock_test_and_setsi" [(set (match_operand:SI 0 "s_register_operand" "=&r") - (match_operand:SI 1 "memory_operand" "+m")) + (match_operand:SI 1 "arm_sync_memory_operand" "+Q")) (set (match_dup 1) (unspec_volatile:SI [(match_operand:SI 2 "s_register_operand" "r")] VUNSPEC_SYNC_LOCK)) @@ -348,12 +348,12 @@ (set_attr "sync_new_value" "2") (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_lock_test_and_set" [(set (match_operand:SI 0 "s_register_operand" "=&r") - (zero_extend:SI (match_operand:NARROW 1 "memory_operand" "+m"))) + (zero_extend:SI (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q"))) (set (match_dup 1) (unspec_volatile:NARROW [(match_operand:SI 2 "s_register_operand" "r")] VUNSPEC_SYNC_LOCK)) @@ -369,13 +369,13 @@ (set_attr "sync_new_value" "2") (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_new_si" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(syncop:SI - (match_operand:SI 1 "memory_operand" "+m") + (match_operand:SI 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r")) ] VUNSPEC_SYNC_NEW_OP)) @@ -394,13 +394,13 @@ (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") (set_attr "sync_op" "") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_new_nandsi" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(not:SI (and:SI - (match_operand:SI 1 "memory_operand" "+m") + (match_operand:SI 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r"))) ] VUNSPEC_SYNC_NEW_OP)) @@ -419,14 +419,14 @@ (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") (set_attr "sync_op" "nand") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_new_" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(syncop:SI (zero_extend:SI - (match_operand:NARROW 1 "memory_operand" "+m")) + (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")) (match_operand:SI 2 "s_register_operand" "r")) ] VUNSPEC_SYNC_NEW_OP)) @@ -445,7 +445,7 @@ (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") (set_attr "sync_op" "") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_new_nand" @@ -454,7 +454,7 @@ [(not:SI (and:SI (zero_extend:SI - (match_operand:NARROW 1 "memory_operand" "+m")) + (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")) (match_operand:SI 2 "s_register_operand" "r"))) ] VUNSPEC_SYNC_NEW_OP)) (set (match_dup 1) @@ -472,13 +472,13 @@ (set_attr "sync_t1" "0") (set_attr "sync_t2" "3") (set_attr "sync_op" "nand") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_old_si" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(syncop:SI - (match_operand:SI 1 "memory_operand" "+m") + (match_operand:SI 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r")) ] VUNSPEC_SYNC_OLD_OP)) @@ -498,13 +498,13 @@ (set_attr "sync_t1" "3") (set_attr "sync_t2" "4") (set_attr "sync_op" "") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_old_nandsi" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(not:SI (and:SI - (match_operand:SI 1 "memory_operand" "+m") + (match_operand:SI 1 "arm_sync_memory_operand" "+Q") (match_operand:SI 2 "s_register_operand" "r"))) ] VUNSPEC_SYNC_OLD_OP)) @@ -524,14 +524,14 @@ (set_attr "sync_t1" "3") (set_attr "sync_t2" "4") (set_attr "sync_op" "nand") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_old_" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(syncop:SI (zero_extend:SI - (match_operand:NARROW 1 "memory_operand" "+m")) + (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")) (match_operand:SI 2 "s_register_operand" "r")) ] VUNSPEC_SYNC_OLD_OP)) @@ -551,14 +551,14 @@ (set_attr "sync_t1" "3") (set_attr "sync_t2" "4") (set_attr "sync_op" "") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "arm_sync_old_nand" [(set (match_operand:SI 0 "s_register_operand" "=&r") (unspec_volatile:SI [(not:SI (and:SI (zero_extend:SI - (match_operand:NARROW 1 "memory_operand" "+m")) + (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")) (match_operand:SI 2 "s_register_operand" "r"))) ] VUNSPEC_SYNC_OLD_OP)) @@ -578,7 +578,7 @@ (set_attr "sync_t1" "3") (set_attr "sync_t2" "4") (set_attr "sync_op" "nand") - (set_attr "conds" "nocond") + (set_attr "conds" "clob") (set_attr "predicable" "no")]) (define_insn "*memory_barrier" diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md index f6865a7db00..9ccb4d81f45 100644 --- a/gcc/config/arm/thumb2.md +++ b/gcc/config/arm/thumb2.md @@ -557,145 +557,6 @@ ;; Zero and sign extension instructions. -(define_insn_and_split "*thumb2_zero_extendsidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r") - (zero_extend:DI (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_THUMB2" - "mov%?\\t%Q0, %1\;mov%?\\t%R0, #0" - "&& reload_completed" - [(set (match_dup 0) (match_dup 1))] - " - { - rtx lo_part = gen_lowpart (SImode, operands[0]); - if (!REG_P (lo_part) || REGNO (lo_part) != REGNO (operands[1])) - emit_move_insn (lo_part, operands[1]); - operands[0] = gen_highpart (SImode, operands[0]); - operands[1] = const0_rtx; - } - " - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "predicable" "yes")] -) - -(define_insn_and_split "*thumb2_zero_extendhidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r,r") - (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] - "TARGET_THUMB2" - "@ - uxth%?\\t%Q0, %1\;mov%?\\t%R0, #0 - ldr%(h%)\\t%Q0, %1\;mov%?\\t%R0, #0" - "&& reload_completed" - [(set (match_dup 0) (zero_extend:SI (match_dup 1))) - (set (match_dup 2) (match_dup 3))] - " - { - operands[2] = gen_highpart (SImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - operands[3] = const0_rtx; - } - " - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "predicable" "yes") - (set_attr "type" "*,load_byte") - (set_attr "pool_range" "*,4092") - (set_attr "neg_pool_range" "*,250")] -) - -(define_insn_and_split "*thumb2_zero_extendqidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r,r") - (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] - "TARGET_THUMB2" - "@ - uxtb%?\\t%Q0, %1\;mov%?\\t%R0, #0 - ldr%(b%)\\t%Q0, %1\;mov%?\\t%R0, #0" - "&& reload_completed" - [(set (match_dup 0) (zero_extend:SI (match_dup 1))) - (set (match_dup 2) (match_dup 3))] - " - { - operands[2] = gen_highpart (SImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - operands[3] = const0_rtx; - } - " - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "predicable" "yes") - (set_attr "type" "*,load_byte") - (set_attr "pool_range" "*,4092") - (set_attr "neg_pool_range" "*,250")] -) - -(define_insn_and_split "*thumb2_extendsidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r") - (sign_extend:DI (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_THUMB2" - "mov%?\\t%Q0, %1\;asr?\\t%R0, %1, #31" - "&& reload_completed" - [(set (match_dup 0) (ashiftrt:SI (match_dup 1) (const_int 31)))] - { - rtx lo_part = gen_lowpart (SImode, operands[0]); - - if (!REG_P (lo_part) || REGNO (lo_part) != REGNO (operands[1])) - emit_move_insn (lo_part, operands[1]); - operands[0] = gen_highpart (SImode, operands[0]); - } - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "shift" "1") - (set_attr "predicable" "yes")] -) - -(define_insn_and_split "*thumb2_extendhidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r,r") - (sign_extend:DI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] - "TARGET_THUMB2" - "@ - sxth%?\\t%Q0, %1\;asr%?\\t%R0, %Q0, #31 - ldrsh%?\\t%Q0, %1\;asr%?\\t%R0, %Q0, #31" - "&& reload_completed" - [(set (match_dup 0) (sign_extend:SI (match_dup 1))) - (set (match_dup 2) (ashiftrt:SI (match_dup 0) (const_int 31)))] - " - { - operands[2] = gen_highpart (SImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - } - " - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "predicable" "yes") - (set_attr "type" "*,load_byte") - (set_attr "pool_range" "*,4092") - (set_attr "neg_pool_range" "*,250")] -) - -(define_insn_and_split "*thumb2_extendqidi2" - [(set (match_operand:DI 0 "s_register_operand" "=r,r") - (sign_extend:DI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] - "TARGET_THUMB2" - "@ - sxtb%?\\t%Q0, %1\;asr%?\\t%R0, %Q0, #31 - ldrsb%?\\t%Q0, %1\;asr%?\\t%R0, %Q0, #31" - "&& reload_completed" - [(set (match_dup 0) (sign_extend:SI (match_dup 1))) - (set (match_dup 2) (ashiftrt:SI (match_dup 0) (const_int 31)))] - " - { - operands[2] = gen_highpart (SImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - } - " - [(set_attr "length" "8") - (set_attr "ce_count" "2") - (set_attr "predicable" "yes") - (set_attr "type" "*,load_byte") - (set_attr "pool_range" "*,4092") - (set_attr "neg_pool_range" "*,250")] -) - ;; All supported Thumb2 implementations are armv6, so only that case is ;; provided. (define_insn "*thumb2_extendqisi_v6" diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index 26fd11826df..4e7b8012ac0 100644 --- a/gcc/config/arm/vfp.md +++ b/gcc/config/arm/vfp.md @@ -82,6 +82,7 @@ " [(set_attr "predicable" "yes") (set_attr "type" "*,*,*,*,load1,store1,r_2_f,f_2_r,fcpys,f_loads,f_stores") + (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*") (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*") (set_attr "neg_pool_range" "*,*,*,*,4084,*,*,*,*,1008,*")] ) @@ -123,6 +124,7 @@ " [(set_attr "predicable" "yes") (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_load,f_store") + (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*,*,*") (set_attr "pool_range" "*,*,*,*,1020,4096,*,*,*,*,*,1020,*") (set_attr "neg_pool_range" "*,*,*,*, 0, 0,*,*,*,*,*,1008,*")] ) @@ -352,6 +354,7 @@ [(set_attr "predicable" "yes") (set_attr "type" "r_2_f,f_2_r,fconsts,f_loads,f_stores,load1,store1,fcpys,*") + (set_attr "insn" "*,*,*,*,*,*,*,*,mov") (set_attr "pool_range" "*,*,*,1020,*,4096,*,*,*") (set_attr "neg_pool_range" "*,*,*,1008,*,4080,*,*,*")] ) @@ -388,6 +391,7 @@ [(set_attr "predicable" "yes") (set_attr "type" "r_2_f,f_2_r,fconsts,f_load,f_store,load1,store1,fcpys,*") + (set_attr "insn" "*,*,*,*,*,*,*,*,mov") (set_attr "pool_range" "*,*,*,1020,*,4092,*,*,*") (set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")] ) @@ -1099,7 +1103,7 @@ fcmpes%?\\t%0, %1 fcmpezs%?\\t%0" [(set_attr "predicable" "yes") - (set_attr "type" "fcmpd")] + (set_attr "type" "fcmps")] ) (define_insn "*cmpdf_vfp" diff --git a/gcc/config/arm/vxworks.h b/gcc/config/arm/vxworks.h index aa7e197bc5d..3ceaed9039c 100644 --- a/gcc/config/arm/vxworks.h +++ b/gcc/config/arm/vxworks.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for ARM with targetting the VXWorks run time environment. - Copyright (C) 1999, 2000, 2003, 2004, 2007, 2008 + Copyright (C) 1999, 2000, 2003, 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by: Mike Stump @@ -44,14 +44,8 @@ along with GCC; see the file COPYING3. If not see VXWORKS_OS_CPP_BUILTINS (); \ } while (0) -#undef OVERRIDE_OPTIONS -#define OVERRIDE_OPTIONS \ - do \ - { \ - VXWORKS_OVERRIDE_OPTIONS; \ - arm_override_options (); \ - } \ - while (0) +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS /* Subsume the arm/elf.h definition, and add RTP hooks. */ #undef SUBTARGET_CPP_SPEC diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h index ea55a9bd5c3..aa0c6614c50 100644 --- a/gcc/config/avr/avr-protos.h +++ b/gcc/config/avr/avr-protos.h @@ -22,7 +22,6 @@ extern int function_arg_regno_p (int r); -extern void avr_override_options (void); extern void avr_cpu_cpp_builtins (struct cpp_reader * pfile); extern int avr_ret_register (void); extern bool class_likely_spilled_p (int c); diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index e8d6fa3bc37..cabf678d8f9 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -49,6 +49,7 @@ /* Maximal allowed offset for an address in the LD command */ #define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE)) +static void avr_option_override (void); static int avr_naked_function_p (tree); static int interrupt_function_p (tree); static int signal_function_p (tree); @@ -192,10 +193,13 @@ static const struct attribute_spec avr_attribute_table[] = #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE avr_can_eliminate +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE avr_option_override + struct gcc_target targetm = TARGET_INITIALIZER; -void -avr_override_options (void) +static void +avr_option_override (void) { const struct mcu_type_s *t; diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index fd3cd1d3a52..92c197a6ab9 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -124,8 +124,6 @@ extern GTY(()) section *progmem_section; #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)"); -#define OVERRIDE_OPTIONS avr_override_options () - #define CAN_DEBUG_WITHOUT_FP #define BITS_BIG_ENDIAN 0 diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h index 4a9b7a11768..1e18307d710 100644 --- a/gcc/config/bfin/bfin-protos.h +++ b/gcc/config/bfin/bfin-protos.h @@ -1,5 +1,5 @@ /* Prototypes for Blackfin functions used in the md file & elsewhere. - Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU CC. @@ -99,13 +99,11 @@ extern enum reg_class secondary_output_reload_class (enum reg_class, Mmode, rtx); extern char *section_asm_op_1 (SECT_ENUM_T); extern char *section_asm_op (SECT_ENUM_T); -extern void override_options (void); extern void print_operand (FILE *, rtx, char); extern void print_address_operand (FILE *, rtx); extern void split_di (rtx [], int, rtx [], rtx []); extern int split_load_immediate (rtx []); extern void emit_pic_move (rtx *, Mmode); -extern void override_options (void); extern void asm_conditional_branch (rtx, rtx *, int, int); extern rtx bfin_gen_compare (rtx, Mmode); diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index d0a13969f8d..da5a8eef237 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -358,7 +358,7 @@ output_file_start (void) /* Variable tracking should be run after all optimizations which change order of insns. It also needs a valid CFG. This can't be done in - override_options, because flag_var_tracking is finalized after + bfin_option_override, because flag_var_tracking is finalized after that. */ bfin_flag_var_tracking = flag_var_tracking; flag_var_tracking = 0; @@ -2543,6 +2543,29 @@ bfin_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i, return NO_REGS; } + +/* Implement TARGET_CLASS_LIKELY_SPILLED_P. */ + +static bool +bfin_class_likely_spilled_p (reg_class_t rclass) +{ + switch (rclass) + { + case PREGS_CLOBBERED: + case PROLOGUE_REGS: + case P0REGS: + case D0REGS: + case D1REGS: + case D2REGS: + case CCREGS: + return true; + + default: + break; + } + + return false; +} /* Implement TARGET_HANDLE_OPTION. */ @@ -2639,10 +2662,10 @@ bfin_init_machine_status (void) return ggc_alloc_cleared_machine_function (); } -/* Implement the macro OVERRIDE_OPTIONS. */ +/* Implement the TARGET_OPTION_OVERRIDE hook. */ -void -override_options (void) +static void +bfin_option_override (void) { /* If processor type is not specified, enable all workarounds. */ if (bfin_cpu_type == BFIN_CPU_UNKNOWN) @@ -6626,12 +6649,18 @@ bfin_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION bfin_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE bfin_option_override + #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD bfin_secondary_reload +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P bfin_class_likely_spilled_p + #undef TARGET_DELEGITIMIZE_ADDRESS #define TARGET_DELEGITIMIZE_ADDRESS bfin_delegitimize_address diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index e6e2aaeb7f9..30b298d76e1 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -276,17 +276,6 @@ extern int target_flags; extern const char *bfin_library_id_string; -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - -#define OVERRIDE_OPTIONS override_options () - #define FUNCTION_MODE SImode #define Pmode SImode @@ -761,15 +750,6 @@ enum reg_class registers. */ #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true -#define CLASS_LIKELY_SPILLED_P(CLASS) \ - ((CLASS) == PREGS_CLOBBERED \ - || (CLASS) == PROLOGUE_REGS \ - || (CLASS) == P0REGS \ - || (CLASS) == D0REGS \ - || (CLASS) == D1REGS \ - || (CLASS) == D2REGS \ - || (CLASS) == CCREGS) - /* Do not allow to store a value in REG_CC for any mode */ /* Do not allow to store value in pregs if mode is not SI*/ #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE)) diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h index c819c790d19..84191c0920b 100644 --- a/gcc/config/cris/cris-protos.h +++ b/gcc/config/cris/cris-protos.h @@ -1,5 +1,5 @@ /* Definitions for GCC. Part of the machine description for CRIS. - Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005, 2006, 2007 + Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Axis Communications. @@ -64,8 +64,6 @@ extern void cris_pragma_expand_mul (struct cpp_reader *); /* Need one that returns an int; usable in expressions. */ extern int cris_fatal (char *); -extern void cris_override_options (void); - extern int cris_initial_elimination_offset (int, int); extern void cris_init_expanders (void); diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index ce6b568df03..52367c2c71d 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -1,6 +1,6 @@ /* Definitions for GCC. Part of the machine description for CRIS. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009 Free Software Foundation, Inc. + 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Axis Communications. Written by Hans-Peter Nilsson. This file is part of GCC. @@ -130,6 +130,8 @@ static int cris_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, static tree cris_md_asm_clobbers (tree, tree, tree); static bool cris_handle_option (size_t, const char *, int); +static void cris_option_optimization (int, int); +static void cris_option_override (void); static bool cris_frame_pointer_required (void); @@ -208,6 +210,11 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #undef TARGET_FRAME_POINTER_REQUIRED #define TARGET_FRAME_POINTER_REQUIRED cris_frame_pointer_required +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE cris_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION cris_option_optimization + #undef TARGET_ASM_TRAMPOLINE_TEMPLATE #define TARGET_ASM_TRAMPOLINE_TEMPLATE cris_asm_trampoline_template #undef TARGET_TRAMPOLINE_INIT @@ -2336,7 +2343,7 @@ cris_asm_output_case_end (FILE *stream, int num, rtx table) /* TARGET_HANDLE_OPTION worker. We just store the values into local variables here. Checks for correct semantics are in - cris_override_options. */ + cris_option_override. */ static bool cris_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, @@ -2392,11 +2399,20 @@ cris_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, return true; } -/* The OVERRIDE_OPTIONS worker. +/* Implement TARGET_OPTION_OPTIMIZATION. */ + +static void +cris_option_optimization (int level, int size) +{ + if (level >= 2 || size) + flag_omit_frame_pointer = 1; +} + +/* The TARGET_OPTION_OVERRIDE worker. As is the norm, this also parses -mfoo=bar type parameters. */ -void -cris_override_options (void) +static void +cris_option_override (void) { if (cris_max_stackframe_str) { diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 4c685489a8c..d302c9f5540 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1,6 +1,6 @@ /* Definitions for GCC. Part of the machine description for CRIS. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. Contributed by Axis Communications. Written by Hans-Peter Nilsson. This file is part of GCC. @@ -328,17 +328,6 @@ extern int target_flags; #define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z) -#define OVERRIDE_OPTIONS cris_override_options () - -#define OPTIMIZATION_OPTIONS(OPTIMIZE, SIZE) \ - do \ - { \ - if ((OPTIMIZE) >= 2 || (SIZE)) \ - flag_omit_frame_pointer = 1; \ - } \ - while (0) - - /* Node: Storage Layout */ #define BITS_BIG_ENDIAN 0 diff --git a/gcc/config/crx/crx.c b/gcc/config/crx/crx.c index e8b750c95a3..8ae552fe5db 100644 --- a/gcc/config/crx/crx.c +++ b/gcc/config/crx/crx.c @@ -1,6 +1,6 @@ /* Output routines for GCC for CRX. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -130,6 +130,7 @@ static bool crx_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_U static int crx_address_cost (rtx, bool); static bool crx_legitimate_address_p (enum machine_mode, rtx, bool); static bool crx_can_eliminate (const int, const int); +static void crx_option_optimization (int, int); /*****************************************************************************/ /* RTL VALIDITY */ @@ -174,6 +175,10 @@ static const struct attribute_spec crx_attribute_table[] = { {NULL, 0, 0, false, false, false, NULL} }; +/* Option handling. */ + +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION crx_option_optimization /* Initialize 'targetm' variable which contains pointers to functions and data * relating to the target machine. */ @@ -1442,3 +1447,13 @@ crx_expand_epilogue (void) else emit_jump_insn (gen_pop_and_popret_return (GEN_INT (sum_regs))); } + +/* Implement TARGET_OPTION_OPTIMIZATION. */ +static void +crx_option_optimization (int level, int size) +{ + /* Put each function in its own section so that PAGE-instruction + relaxation can do its best. */ + if (level || size) + flag_function_sections = 1; +} diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h index a6260f48aa2..d4bf2743bf3 100644 --- a/gcc/config/crx/crx.h +++ b/gcc/config/crx/crx.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for CRX. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -54,14 +54,6 @@ do { \ #define TARGET_VERSION fputs (" (CRX/ELF)", stderr); -/* Put each function in its own section so that PAGE-instruction - * relaxation can do its best. */ -#define OPTIMIZATION_OPTIONS(LEVEL, SIZEFLAG) \ - do { \ - if ((LEVEL) || (SIZEFLAG)) \ - flag_function_sections = 1; \ - } while (0) - /* Show we can debug even without a frame pointer. */ #define CAN_DEBUG_WITHOUT_FP diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index b23efc50c0a..099226c25d3 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "gcc.h" +#include "opts.h" #include #include "xregex.h" @@ -32,11 +33,12 @@ along with GCC; see the file COPYING3. If not see of the system on which the compiler is running. */ void -darwin_default_min_version (int * argc_p, char *** argv_p) +darwin_default_min_version (unsigned int *decoded_options_count, + struct cl_decoded_option **decoded_options) { - const int argc = *argc_p; - char ** const argv = *argv_p; - int i; + const unsigned int argc = *decoded_options_count; + struct cl_decoded_option *const argv = *decoded_options; + unsigned int i; char osversion[32]; size_t osversion_len = sizeof (osversion) - 1; static int osversion_name[2] = { CTL_KERN, KERN_OSRELEASE }; @@ -44,34 +46,17 @@ darwin_default_min_version (int * argc_p, char *** argv_p) char * version_pend; int major_vers; char minor_vers[6]; - static char new_flag[sizeof ("-mmacosx-version-min=10.0.0") + 6]; + static char new_flag[sizeof ("10.0.0") + 6]; /* If the command-line is empty, just return. */ if (argc <= 1) return; - /* Don't do this if the user has specified -b or -V at the start - of the command-line. */ - if (argv[1][0] == '-' - && (argv[1][1] == 'V' || - ((argv[1][1] == 'b') && (NULL != strchr(argv[1] + 2,'-'))))) - return; /* Don't do this if the user specified -mmacosx-version-min= or -mno-macosx-version-min. */ for (i = 1; i < argc; i++) - if (argv[i][0] == '-') - { - const char * const p = argv[i]; - if (strncmp (p, "-mno-macosx-version-min", 23) == 0 - || strncmp (p, "-mmacosx-version-min", 20) == 0) - return; - - /* It doesn't count if it's an argument to a different switch. */ - if (p[0] == '-' - && ((SWITCH_TAKES_ARG (p[1]) > (p[2] != 0)) - || WORD_SWITCH_TAKES_ARG (p + 1))) - i++; - } + if (argv[i].opt_index == OPT_mmacosx_version_min_) + return; /* Retrieve the deployment target from the environment and insert it as a flag. */ @@ -84,12 +69,14 @@ darwin_default_min_version (int * argc_p, char *** argv_p) to ignore the environment variable, as if it was never set. */ && macosx_deployment_target[0]) { - ++*argc_p; - *argv_p = XNEWVEC (char *, *argc_p); - (*argv_p)[0] = argv[0]; - (*argv_p)[1] = concat ("-mmacosx-version-min=", - macosx_deployment_target, NULL); - memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *)); + ++*decoded_options_count; + *decoded_options = XNEWVEC (struct cl_decoded_option, + *decoded_options_count); + (*decoded_options)[0] = argv[0]; + generate_option (OPT_mmacosx_version_min_, macosx_deployment_target, + 1, CL_DRIVER, &(*decoded_options)[1]); + memcpy (*decoded_options + 2, argv + 1, + (argc - 1) * sizeof (struct cl_decoded_option *)); return; } } @@ -128,17 +115,20 @@ darwin_default_min_version (int * argc_p, char *** argv_p) if (major_vers - 4 <= 4) /* On 10.4 and earlier, the old linker is used which does not support three-component system versions. */ - sprintf (new_flag, "-mmacosx-version-min=10.%d", major_vers - 4); + sprintf (new_flag, "10.%d", major_vers - 4); else - sprintf (new_flag, "-mmacosx-version-min=10.%d.%s", major_vers - 4, + sprintf (new_flag, "10.%d.%s", major_vers - 4, minor_vers); /* Add the new flag. */ - ++*argc_p; - *argv_p = XNEWVEC (char *, *argc_p); - (*argv_p)[0] = argv[0]; - (*argv_p)[1] = new_flag; - memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *)); + ++*decoded_options_count; + *decoded_options = XNEWVEC (struct cl_decoded_option, + *decoded_options_count); + (*decoded_options)[0] = argv[0]; + generate_option (OPT_mmacosx_version_min_, new_flag, + 1, CL_DRIVER, &(*decoded_options)[1]); + memcpy (*decoded_options + 2, argv + 1, + (argc - 1) * sizeof (struct cl_decoded_option *)); return; parse_failed: diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 3314acb1912..f0ff9010b93 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -1059,9 +1059,10 @@ extern int flag_apple_kext; #define TARGET_HAS_TARGETCM 1 #ifndef CROSS_DIRECTORY_STRUCTURE -extern void darwin_default_min_version (int * argc, char *** argv); +extern void darwin_default_min_version (unsigned int *decoded_options_count, + struct cl_decoded_option **decoded_options); #define GCC_DRIVER_HOST_INITIALIZATION \ - darwin_default_min_version (&argc, &argv) + darwin_default_min_version (&decoded_options_count, &decoded_options) #endif /* CROSS_DIRECTORY_STRUCTURE */ /* The Apple assembler and linker do not support constructor priorities. */ diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index f417f91dfd2..118de0afd5b 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -844,9 +844,8 @@ fr30_move_double (rtx * operands) else if (src_code == MEM) { rtx addr = XEXP (src, 0); - int dregno = REGNO (dest); - rtx dest0 = operand_subword (dest, 0, TRUE, mode);; - rtx dest1 = operand_subword (dest, 1, TRUE, mode);; + rtx dest0 = operand_subword (dest, 0, TRUE, mode); + rtx dest1 = operand_subword (dest, 1, TRUE, mode); rtx new_mem; gcc_assert (GET_CODE (addr) == REG); diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 11612e49825..68c2a576a63 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -1,5 +1,5 @@ /* Frv prototypes. - Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Red Hat, Inc. @@ -38,8 +38,6 @@ extern frv_cpu_t frv_cpu_type; /* value of -mcpu= */ /* Define functions defined in frv.c */ extern void frv_expand_prologue (void); extern void frv_expand_epilogue (bool); -extern void frv_override_options (void); -extern void frv_optimization_options (int, int); extern void frv_conditional_register_usage (void); extern frv_stack_t *frv_stack_info (void); extern void frv_debug_stack (frv_stack_t *); @@ -102,7 +100,6 @@ extern int frv_trampoline_size (void); extern enum reg_class frv_secondary_reload_class (enum reg_class, enum machine_mode, rtx); -extern int frv_class_likely_spilled_p (enum reg_class rclass); extern int frv_hard_regno_mode_ok (int, enum machine_mode); extern int frv_hard_regno_nregs (int, enum machine_mode); extern int frv_class_max_nregs (enum reg_class rclass, @@ -112,7 +109,6 @@ extern enum machine_mode frv_select_cc_mode (enum rtx_code, rtx, rtx); #endif /* RTX_CODE */ extern int direct_return_p (void); -extern int frv_register_move_cost (enum reg_class, enum reg_class); extern int frv_issue_rate (void); extern int frv_acc_group (rtx); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 49133f764a5..0730e32d9a4 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -264,6 +264,8 @@ frv_cpu_t frv_cpu_type = CPU_TYPE; /* value of -mcpu= */ /* Forward references */ static bool frv_handle_option (size_t, const char *, int); +static void frv_option_override (void); +static void frv_option_optimization (int, int); static bool frv_legitimate_address_p (enum machine_mode, rtx, bool); static int frv_default_flags_for_cpu (void); static int frv_string_begins_with (const_tree, const char *); @@ -371,6 +373,10 @@ static void frv_setup_incoming_varargs (CUMULATIVE_ARGS *, static rtx frv_expand_builtin_saveregs (void); static void frv_expand_builtin_va_start (tree, rtx); static bool frv_rtx_costs (rtx, int, int, int*, bool); +static int frv_register_move_cost (enum machine_mode, + reg_class_t, reg_class_t); +static int frv_memory_move_cost (enum machine_mode, + reg_class_t, bool); static void frv_asm_out_constructor (rtx, int); static void frv_asm_out_destructor (rtx, int); static bool frv_function_symbol_referenced_p (rtx); @@ -391,6 +397,7 @@ static reg_class_t frv_secondary_reload (bool, rtx, reg_class_t, static bool frv_frame_pointer_required (void); static bool frv_can_eliminate (const int, const int); static void frv_trampoline_init (rtx, tree, rtx); +static bool frv_class_likely_spilled_p (reg_class_t); /* Allow us to easily change the default for -malloc-cc. */ #ifndef DEFAULT_NO_ALLOC_CC @@ -423,6 +430,10 @@ static void frv_trampoline_init (rtx, tree, rtx); | MASK_NESTED_CE) #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION frv_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE frv_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION frv_option_optimization #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS frv_init_builtins #undef TARGET_EXPAND_BUILTIN @@ -431,6 +442,10 @@ static void frv_trampoline_init (rtx, tree, rtx); #define TARGET_INIT_LIBFUNCS frv_init_libfuncs #undef TARGET_IN_SMALL_DATA_P #define TARGET_IN_SMALL_DATA_P frv_in_small_data_p +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST frv_register_move_cost +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST frv_memory_move_cost #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS frv_rtx_costs #undef TARGET_ASM_CONSTRUCTOR @@ -481,6 +496,9 @@ static void frv_trampoline_init (rtx, tree, rtx); #define TARGET_ASM_OUTPUT_DWARF_DTPREL frv_output_dwarf_dtprel #endif +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P frv_class_likely_spilled_p + #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD frv_secondary_reload @@ -657,17 +675,10 @@ frv_default_flags_for_cpu (void) } } -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ +/* Implement TARGET_OPTION_OVERRIDE. */ -void -frv_override_options (void) +static void +frv_option_override (void) { int regno; unsigned int i; @@ -842,29 +853,12 @@ frv_override_options (void) } -/* Some machines may desire to change what optimizations are performed for - various optimization levels. This macro, if defined, is executed once just - after the optimization level is determined and before the remainder of the - command options have been parsed. Values set in this macro are used as the - default values for the other command line options. - - LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if - `-O' is specified, and 0 if neither is specified. - - SIZE is nonzero if `-Os' is specified, 0 otherwise. - - You should not use this macro to change options that are not - machine-specific. These should uniformly selected by the same optimization - level on all supported machines. Use this macro to enable machine-specific - optimizations. +/* Implement TARGET_OPTION_OPTIMIZATION. - *Do not examine `write_symbols' in this macro!* The debugging options are - *not supposed to alter the generated code. */ - -/* On the FRV, possibly disable VLIW packing which is done by the 2nd + On the FRV, possibly disable VLIW packing which is done by the 2nd scheduling pass at the current time. */ -void -frv_optimization_options (int level, int size ATTRIBUTE_UNUSED) +static void +frv_option_optimization (int level, int size ATTRIBUTE_UNUSED) { if (level >= 2) { @@ -6533,23 +6527,10 @@ frv_secondary_reload (bool in_p, rtx x, reg_class_t reload_class_i, } -/* A C expression whose value is nonzero if pseudos that have been assigned to - registers of class RCLASS would likely be spilled because registers of RCLASS - are needed for spill registers. - - The default value of this macro returns 1 if RCLASS has exactly one register - and zero otherwise. On most machines, this default should be used. Only - define this macro to some other expression if pseudo allocated by - `local-alloc.c' end up in memory because their hard registers were needed - for spill registers. If this macro returns nonzero for those classes, those - pseudos will only be allocated by `global.c', which knows how to reallocate - the pseudo to another register. If there would not be another register - available for reallocation, you should not change the definition of this - macro since the only effect of such a definition would be to slow down - register allocation. */ +/* Worker function for TARGET_CLASS_LIKELY_SPILLED_P. */ -int -frv_class_likely_spilled_p (enum reg_class rclass) +static bool +frv_class_likely_spilled_p (reg_class_t rclass) { switch (rclass) { @@ -6574,10 +6555,10 @@ frv_class_likely_spilled_p (enum reg_class rclass) case EVEN_ACC_REGS: case ACC_REGS: case ACCG_REGS: - return TRUE; + return true; } - return FALSE; + return false; } @@ -6917,28 +6898,16 @@ frv_select_cc_mode (enum rtx_code code, rtx x, rtx y) } } -/* A C expression for the cost of moving data from a register in class FROM to - one in class TO. The classes are expressed using the enumeration values - such as `GENERAL_REGS'. A value of 4 is the default; other values are - interpreted relative to that. - - It is not required that the cost always equal 2 when FROM is the same as TO; - on some machines it is expensive to move between registers if they are not - general registers. - - If reload sees an insn consisting of a single `set' between two hard - registers, and if `REGISTER_MOVE_COST' applied to their classes returns a - value of 2, reload does not check to ensure that the constraints of the insn - are met. Setting a cost of other than 2 will allow reload to verify that - the constraints are met. You should do this if the `movM' pattern's - constraints do not allow such copying. */ + +/* Worker function for TARGET_REGISTER_MOVE_COST. */ #define HIGH_COST 40 #define MEDIUM_COST 3 #define LOW_COST 1 -int -frv_register_move_cost (enum reg_class from, enum reg_class to) +static int +frv_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + reg_class_t from, reg_class_t to) { switch (from) { @@ -7021,6 +6990,17 @@ frv_register_move_cost (enum reg_class from, enum reg_class to) return HIGH_COST; } + +/* Worker function for TARGET_MEMORY_MOVE_COST. */ + +static int +frv_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + reg_class_t rclass ATTRIBUTE_UNUSED, + bool in ATTRIBUTE_UNUSED) +{ + return 4; +} + /* Implementation of TARGET_ASM_INTEGER. In the FRV case we need to use ".picptr" to generate safe relocations for PIC code. We also diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 56db4e4a21e..463f6ad1ecc 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -1,5 +1,6 @@ /* Target macros for the FRV port of GCC. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. Contributed by Red Hat Inc. @@ -327,37 +328,6 @@ #endif */ #define TARGET_VERSION fprintf (stderr, _(" (frv)")) -/* Sometimes certain combinations of command options do not make sense on a - particular target machine. You can define a macro `OVERRIDE_OPTIONS' to - take account of this. This macro, if defined, is executed once just after - all the command options have been parsed. - - Don't use this macro to turn on various extra optimizations for `-O'. That - is what `OPTIMIZATION_OPTIONS' is for. */ - -#define OVERRIDE_OPTIONS frv_override_options () - -/* Some machines may desire to change what optimizations are performed for - various optimization levels. This macro, if defined, is executed once just - after the optimization level is determined and before the remainder of the - command options have been parsed. Values set in this macro are used as the - default values for the other command line options. - - LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if - `-O' is specified, and 0 if neither is specified. - - SIZE is nonzero if `-Os' is specified, 0 otherwise. - - You should not use this macro to change options that are not - machine-specific. These should uniformly selected by the same optimization - level on all supported machines. Use this macro to enable machine-specific - optimizations. - - *Do not examine `write_symbols' in this macro!* The debugging options are - *not supposed to alter the generated code. */ -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) frv_optimization_options (LEVEL, SIZE) - - /* Define this macro if debugging can be performed even without a frame pointer. If this macro is defined, GCC will turn on the `-fomit-frame-pointer' option whenever `-O' is specified. */ @@ -1257,22 +1227,6 @@ extern enum reg_class reg_class_from_letter[]; #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ frv_secondary_reload_class (CLASS, MODE, X) -/* A C expression whose value is nonzero if pseudos that have been assigned to - registers of class CLASS would likely be spilled because registers of CLASS - are needed for spill registers. - - The default value of this macro returns 1 if CLASS has exactly one register - and zero otherwise. On most machines, this default should be used. Only - define this macro to some other expression if pseudo allocated by - `local-alloc.c' end up in memory because their hard registers were needed - for spill registers. If this macro returns nonzero for those classes, those - pseudos will only be allocated by `global.c', which knows how to reallocate - the pseudo to another register. If there would not be another register - available for reallocation, you should not change the definition of this - macro since the only effect of such a definition would be to slow down - register allocation. */ -#define CLASS_LIKELY_SPILLED_P(CLASS) frv_class_likely_spilled_p (CLASS) - /* A C expression for the maximum number of consecutive registers of class CLASS needed to hold a value of mode MODE. @@ -1961,31 +1915,6 @@ __asm__("\n" \ /* Describing Relative Costs of Operations. */ -/* A C expression for the cost of moving data from a register in class FROM to - one in class TO. The classes are expressed using the enumeration values - such as `GENERAL_REGS'. A value of 4 is the default; other values are - interpreted relative to that. - - It is not required that the cost always equal 2 when FROM is the same as TO; - on some machines it is expensive to move between registers if they are not - general registers. - - If reload sees an insn consisting of a single `set' between two hard - registers, and if `REGISTER_MOVE_COST' applied to their classes returns a - value of 2, reload does not check to ensure that the constraints of the insn - are met. Setting a cost of other than 2 will allow reload to verify that - the constraints are met. You should do this if the `movM' pattern's - constraints do not allow such copying. */ -#define REGISTER_MOVE_COST(MODE, FROM, TO) frv_register_move_cost (FROM, TO) - -/* A C expression for the cost of moving data of mode M between a register and - memory. A value of 2 is the default; this cost is relative to those in - `REGISTER_MOVE_COST'. - - If moving between registers and memory is more expensive than between two - registers, you should define this macro to express the relative cost. */ -#define MEMORY_MOVE_COST(M,C,I) 4 - /* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */ #define BRANCH_COST(speed_p, predictable_p) frv_branch_cost_int diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 35023c6236d..7bf8ba367bd 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler. Renesas H8/300 version - Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). @@ -95,7 +96,6 @@ extern int h8300_eightbit_data_p (tree); extern int h8300_tiny_data_p (tree); #endif /* TREE_CODE */ -extern void h8300_init_once (void); extern int h8300_can_use_return_insn_p (void); extern void h8300_expand_prologue (void); extern void h8300_expand_epilogue (void); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index bba5e793f93..551e354b849 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -303,10 +303,22 @@ enum h8_cpu H8_S }; +/* Implement TARGET_OPTION_OPTIMIZATION. */ + +static void +h8300_option_optimization (int level ATTRIBUTE_UNUSED, + int size ATTRIBUTE_UNUSED) +{ + /* Basic block reordering is only beneficial on targets with cache + and/or variable-cycle branches where (cycle count taken != cycle + count not taken). */ + flag_reorder_blocks = 0; +} + /* Initialize various cpu specific globals at start up. */ -void -h8300_init_once (void) +static void +h8300_option_override (void) { static const char *const h8_push_ops[2] = { "push" , "push.l" }; static const char *const h8_pop_ops[2] = { "pop" , "pop.l" }; @@ -5922,4 +5934,10 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt) #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT h8300_trampoline_init +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE h8300_option_override + +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION h8300_option_optimization + struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 4e0a3b6728e..7d7437f0f2d 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler. Renesas H8/300 (generic) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). @@ -82,16 +82,6 @@ extern const char * const *h8_reg_names; #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - do \ - { \ - /* Basic block reordering is only beneficial on targets with cache \ - and/or variable-cycle branches where (cycle count taken != \ - cycle count not taken). */ \ - flag_reorder_blocks = 0; \ - } \ - while (0) - /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (Renesas H8/300)"); @@ -129,15 +119,6 @@ extern const char * const *h8_reg_names; #endif #endif /* !IN_LIBGCC2 */ -/* Do things that must be done once at start up. */ - -#define OVERRIDE_OPTIONS \ - do \ - { \ - h8300_init_once (); \ - } \ - while (0) - /* Default target_flags if no switches specified. */ #ifndef TARGET_DEFAULT diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index a6434f354fa..7fbb5d2f56d 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -296,6 +296,12 @@ do { \ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) +/* Put all *tf routines in libgcc. */ +#undef LIBGCC2_HAS_TF_MODE +#define LIBGCC2_HAS_TF_MODE 1 +#define LIBGCC2_TF_CEXT q +#define TF_SIZE 113 + /* Output function declarations at the end of the file. */ #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END i386_pe_file_end diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h index 8a637e80ae5..67308fc7dff 100644 --- a/gcc/config/i386/cygwin.h +++ b/gcc/config/i386/cygwin.h @@ -83,7 +83,7 @@ along with GCC; see the file COPYING3. If not see %{!mno-cygwin:-lcygwin} \ %{mno-cygwin:%{mthreads:-lmingwthrd} -lmingw32} \ %{mwindows:-lgdi32 -lcomdlg32} \ - -luser32 -lkernel32 -ladvapi32 -lshell32" + -ladvapi32 -lshell32 -luser32 -lkernel32" /* To implement C++ function replacement we always wrap the cxx malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */ @@ -252,12 +252,13 @@ char *cvt_to_mingw[] = #undef GEN_CVT_ARRAY #endif /*GEN_CVT_ARRAY*/ -void mingw_scan (int, const char * const *, const char **); +void mingw_scan (unsigned int, const struct cl_decoded_option *, + const char **); #if 1 #define GCC_DRIVER_HOST_INITIALIZATION \ do \ { \ - mingw_scan(argc, (const char * const *) argv, &spec_machine); \ + mingw_scan (decoded_options_count, decoded_options, &spec_machine); \ } \ while (0) #else @@ -277,7 +278,7 @@ do \ add_prefix (&startfile_prefixes,\ concat (standard_startfile_prefix, "w32api", NULL),\ "GCC", PREFIX_PRIORITY_LAST, 0, NULL);\ - mingw_scan(argc, (const char * const *) argv, &spec_machine); \ + mingw_scan (decoded_options_count, decoded_options, &spec_machine); \ } \ while (0) #endif diff --git a/gcc/config/i386/cygwin1.c b/gcc/config/i386/cygwin1.c index 7de34d24b7a..99d9d8f8243 100644 --- a/gcc/config/i386/cygwin1.c +++ b/gcc/config/i386/cygwin1.c @@ -22,32 +22,42 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" +#include "opts.h" #include void -mingw_scan (int argc ATTRIBUTE_UNUSED, - const char *const *argv, +mingw_scan (unsigned int decoded_options_count, + const struct cl_decoded_option *decoded_options, const char **spec_machine) { + unsigned int i; putenv (xstrdup ("GCC_CYGWIN_MINGW=0")); - while (*++argv) - if (strcmp (*argv, "-mno-win32") == 0) - putenv (xstrdup ("GCC_CYGWIN_WIN32=0")); - else if (strcmp (*argv, "-mwin32") == 0) - putenv (xstrdup ("GCC_CYGWIN_WIN32=1")); - else if (strcmp (*argv, "-mno-cygwin") == 0) + for (i = 1; i < decoded_options_count; i++) + switch (decoded_options[i].opt_index) { - char *p = strstr (*spec_machine, "-cygwin"); - if (p) + case OPT_mwin32: + if (decoded_options[i].value == 0) + putenv (xstrdup ("GCC_CYGWIN_WIN32=0")); + else + putenv (xstrdup ("GCC_CYGWIN_WIN32=1")); + break; + + case OPT_mcygwin: + if (decoded_options[i].value == 0) { - int len = p - *spec_machine; - char *s = XNEWVEC (char, strlen (*spec_machine) + 3); - memcpy (s, *spec_machine, len); - strcpy (s + len, "-mingw32"); - *spec_machine = s; + char *p = strstr (*spec_machine, "-cygwin"); + if (p) + { + int len = p - *spec_machine; + char *s = XNEWVEC (char, strlen (*spec_machine) + 3); + memcpy (s, *spec_machine, len); + strcpy (s + len, "-mingw32"); + *spec_machine = s; + } + putenv (xstrdup ("GCC_CYGWIN_MINGW=1")); } - putenv (xstrdup ("GCC_CYGWIN_MINGW=1")); + break; } return; } diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 7917f2fc18f..416b0238c38 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -79,7 +79,9 @@ extern int darwin_emit_branch_islands; Failure to ensure this will lead to a crash in the system libraries or dynamic loader. */ #undef STACK_BOUNDARY -#define STACK_BOUNDARY 128 +#define STACK_BOUNDARY \ + ((profile_flag || (TARGET_64BIT && ix86_abi == MS_ABI)) \ + ? 128 : BITS_PER_WORD) #undef MAIN_STACK_BOUNDARY #define MAIN_STACK_BOUNDARY 128 @@ -91,7 +93,7 @@ extern int darwin_emit_branch_islands; it's below the minimum. */ #undef PREFERRED_STACK_BOUNDARY #define PREFERRED_STACK_BOUNDARY \ - MAX (STACK_BOUNDARY, ix86_preferred_stack_boundary) + MAX (128, ix86_preferred_stack_boundary) /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ @@ -148,6 +150,12 @@ extern int darwin_emit_branch_islands; #define SHIFT_DOUBLE_OMITS_COUNT 0 +/* Put all *tf routines in libgcc. */ +#undef LIBGCC2_HAS_TF_MODE +#define LIBGCC2_HAS_TF_MODE 1 +#define LIBGCC2_TF_CEXT q +#define TF_SIZE 113 + #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END darwin_file_end diff --git a/gcc/config/i386/darwin.opt b/gcc/config/i386/darwin.opt new file mode 100644 index 00000000000..89726d8f506 --- /dev/null +++ b/gcc/config/i386/darwin.opt @@ -0,0 +1,22 @@ +; Darwin options for IA32 port. +; +; Copyright (C) 2010 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; . + +mdynamic-no-pic +Target RejectNegative Ignore diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h index c616a205d2c..1ec5ee0d27d 100644 --- a/gcc/config/i386/freebsd.h +++ b/gcc/config/i386/freebsd.h @@ -139,5 +139,16 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_96_ROUND_53_LONG_DOUBLE #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) +/* Put all *tf routines in libgcc. */ +#undef LIBGCC2_HAS_TF_MODE +#define LIBGCC2_HAS_TF_MODE 1 +#define LIBGCC2_TF_CEXT q +#define TF_SIZE 113 + /* Static stack checking is supported by means of probes. */ #define STACK_CHECK_STATIC_BUILTIN 1 + +/* Support for i386 has been removed from FreeBSD 6.0 onward. */ +#if FBSD_MAJOR >= 6 +#define SUBTARGET32_DEFAULT_CPU "i486" +#endif diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index de6b961fd7b..fd31e9917f5 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -20,12 +20,10 @@ along with GCC; see the file COPYING3. If not see . */ /* Functions in i386.c */ -extern void override_options (bool); -extern void optimization_options (int, int); extern void ix86_conditional_register_usage (void); extern bool ix86_target_stack_probe (void); -extern int ix86_can_use_return_insn_p (void); +extern bool ix86_can_use_return_insn_p (void); extern void ix86_setup_frame_addresses (void); extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int); @@ -35,13 +33,16 @@ extern void ix86_expand_epilogue (int); extern void ix86_output_addr_vec_elt (FILE *, int); extern void ix86_output_addr_diff_elt (FILE *, int, int); +extern enum calling_abi ix86_cfun_abi (void); +extern enum calling_abi ix86_function_type_abi (const_tree); + #ifdef RTX_CODE extern int standard_80387_constant_p (rtx); extern const char *standard_80387_constant_opcode (rtx); extern rtx standard_80387_constant_rtx (int); extern int standard_sse_constant_p (rtx); extern const char *standard_sse_constant_opcode (rtx, rtx); -extern int symbolic_reference_mentioned_p (rtx); +extern bool symbolic_reference_mentioned_p (rtx); extern bool extended_reg_mentioned_p (rtx); extern bool x86_extended_QIreg_mentioned_p (rtx); extern bool x86_extended_reg_mentioned_p (rtx); @@ -51,20 +52,19 @@ extern enum machine_mode ix86_cc_mode (enum rtx_code, rtx, rtx); extern int avx_vpermilp_parallel (rtx par, enum machine_mode mode); extern int avx_vperm2f128_parallel (rtx par, enum machine_mode mode); -extern int ix86_expand_movmem (rtx, rtx, rtx, rtx, rtx, rtx); -extern int ix86_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx); -extern int ix86_expand_strlen (rtx, rtx, rtx, rtx); +extern bool ix86_expand_movmem (rtx, rtx, rtx, rtx, rtx, rtx); +extern bool ix86_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx); +extern bool ix86_expand_strlen (rtx, rtx, rtx, rtx); extern bool legitimate_constant_p (rtx); extern bool constant_address_p (rtx); extern bool legitimate_pic_operand_p (rtx); -extern int legitimate_pic_address_disp_p (rtx); +extern bool legitimate_pic_address_disp_p (rtx); extern void print_reg (rtx, int, FILE*); extern void ix86_print_operand (FILE *, rtx, int); -extern void split_di (rtx[], int, rtx[], rtx[]); -extern void split_ti (rtx[], int, rtx[], rtx[]); +extern void split_double_mode (enum machine_mode, rtx[], int, rtx[], rtx[]); extern const char *output_set_got (rtx, rtx); extern const char *output_387_binary_op (rtx, rtx*); @@ -85,7 +85,7 @@ extern void ix86_fixup_binary_operands_no_copy (enum rtx_code, enum machine_mode, rtx[]); extern void ix86_expand_binary_operator (enum rtx_code, enum machine_mode, rtx[]); -extern int ix86_binary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); +extern bool ix86_binary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); extern bool ix86_lea_for_add_ok (rtx, rtx[]); extern bool ix86_vec_interleave_v2df_operator_ok (rtx operands[3], bool high); extern bool ix86_dep_by_shift_count (const_rtx set_insn, const_rtx use_insn); @@ -106,18 +106,17 @@ extern void ix86_expand_fp_absneg_operator (enum rtx_code, enum machine_mode, extern void ix86_expand_copysign (rtx []); extern void ix86_split_copysign_const (rtx []); extern void ix86_split_copysign_var (rtx []); -extern int ix86_unary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); -extern int ix86_match_ccmode (rtx, enum machine_mode); -extern int ix86_use_fcomi_compare (enum rtx_code); +extern bool ix86_unary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); +extern bool ix86_match_ccmode (rtx, enum machine_mode); extern void ix86_expand_branch (enum rtx_code, rtx, rtx, rtx); extern void ix86_expand_setcc (rtx, enum rtx_code, rtx, rtx); -extern int ix86_expand_int_movcc (rtx[]); -extern int ix86_expand_fp_movcc (rtx[]); +extern bool ix86_expand_int_movcc (rtx[]); +extern bool ix86_expand_fp_movcc (rtx[]); extern bool ix86_expand_fp_vcond (rtx[]); extern bool ix86_expand_int_vcond (rtx[]); extern void ix86_expand_sse_unpack (rtx[], bool, bool); extern void ix86_expand_sse4_unpack (rtx[], bool, bool); -extern int ix86_expand_int_addcc (rtx[]); +extern bool ix86_expand_int_addcc (rtx[]); extern void ix86_expand_call (rtx, rtx, rtx, rtx, rtx, int); extern void x86_initialize_trampoline (rtx, rtx, rtx); extern rtx ix86_zero_extend_to_Pmode (rtx); @@ -126,7 +125,8 @@ extern void ix86_split_ashl (rtx *, rtx, enum machine_mode); extern void ix86_split_ashr (rtx *, rtx, enum machine_mode); extern void ix86_split_lshr (rtx *, rtx, enum machine_mode); extern rtx ix86_find_base_term (rtx); -extern int ix86_check_movabs (rtx, int); +extern bool ix86_check_movabs (rtx, int); +extern void ix86_split_idivmod (enum machine_mode, rtx[], bool); extern rtx assign_386_stack_local (enum machine_mode, enum ix86_stack_slot); extern int ix86_attr_length_immediate_default (rtx, int); @@ -142,8 +142,6 @@ extern int ix86_function_arg_boundary (enum machine_mode, const_tree); extern bool ix86_solaris_return_in_memory (const_tree, const_tree); extern rtx ix86_force_to_memory (enum machine_mode, rtx); extern void ix86_free_from_memory (enum machine_mode); -extern enum calling_abi ix86_cfun_abi (void); -extern enum calling_abi ix86_function_type_abi (const_tree); extern void ix86_call_abi_override (const_tree); extern int ix86_reg_parm_stack_space (const_tree); @@ -151,8 +149,8 @@ extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx, rtx, rtx, rtx, rtx); extern bool ix86_hard_regno_mode_ok (int, enum machine_mode); extern bool ix86_modes_tieable_p (enum machine_mode, enum machine_mode); -extern int ix86_secondary_memory_needed (enum reg_class, enum reg_class, - enum machine_mode, int); +extern bool ix86_secondary_memory_needed (enum reg_class, enum reg_class, + enum machine_mode, int); extern bool ix86_cannot_change_mode_class (enum machine_mode, enum machine_mode, enum reg_class); extern enum reg_class ix86_preferred_reload_class (rtx, enum reg_class); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0bc1c664cdb..b2585210ded 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see #include "cselib.h" #include "debug.h" #include "dwarf2out.h" - +#include "sched-int.h" static rtx legitimize_dllimport_symbol (rtx, bool); #ifndef CHECK_STACK_LIMIT @@ -1480,21 +1480,21 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = { /* X86_TUNE_PROMOTE_HI_REGS */ m_PPRO, - /* X86_TUNE_ADD_ESP_4: Enable if add/sub is preferred over 1/2 push/pop. */ - m_ATOM | m_AMD_MULTIPLE | m_K6_GEODE | m_PENT4 | m_NOCONA - | m_CORE2 | m_GENERIC, + /* X86_TUNE_SINGLE_POP: Enable if single pop insn is preferred + over esp addition. */ + m_386 | m_486 | m_PENT | m_PPRO, - /* X86_TUNE_ADD_ESP_8 */ - m_AMD_MULTIPLE | m_ATOM | m_PPRO | m_K6_GEODE | m_386 - | m_486 | m_PENT4 | m_NOCONA | m_CORE2 | m_GENERIC, + /* X86_TUNE_DOUBLE_POP: Enable if double pop insn is preferred + over esp addition. */ + m_PENT, - /* X86_TUNE_SUB_ESP_4 */ - m_AMD_MULTIPLE | m_ATOM | m_PPRO | m_PENT4 | m_NOCONA | m_CORE2 - | m_GENERIC, + /* X86_TUNE_SINGLE_PUSH: Enable if single push insn is preferred + over esp subtraction. */ + m_386 | m_486 | m_PENT | m_K6_GEODE, - /* X86_TUNE_SUB_ESP_8 */ - m_AMD_MULTIPLE | m_ATOM | m_PPRO | m_386 | m_486 - | m_PENT4 | m_NOCONA | m_CORE2 | m_GENERIC, + /* X86_TUNE_DOUBLE_PUSH. Enable if double push insn is preferred + over esp subtraction. */ + m_PENT | m_K6_GEODE, /* X86_TUNE_INTEGER_DFMODE_MOVES: Enable if integer moves are preferred for DFmode copies */ @@ -1576,6 +1576,9 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = { /* X86_TUNE_PAD_RETURNS */ m_AMD_MULTIPLE | m_CORE2 | m_GENERIC, + /* X86_TUNE_PAD_SHORT_FUNCTION: Pad short funtion. */ + m_ATOM, + /* X86_TUNE_EXT_80387_CONSTANTS */ m_K6_GEODE | m_ATHLON_K8 | m_ATOM | m_PENT4 | m_NOCONA | m_PPRO | m_CORE2 | m_GENERIC, @@ -1627,6 +1630,10 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = { /* X86_TUNE_OPT_AGU: Optimize for Address Generation Unit. This flag will impact LEA instruction selection. */ m_ATOM, + + /* X86_TUNE_VECTORIZE_DOUBLE: Enable double precision vector + instructions. */ + ~m_ATOM, }; /* Feature tests against the various architecture variations. */ @@ -1896,7 +1903,6 @@ static const char ix86_force_align_arg_pointer_string[] = "force_align_arg_pointer"; static rtx (*ix86_gen_leave) (void); -static rtx (*ix86_gen_pop1) (rtx); static rtx (*ix86_gen_add3) (rtx, rtx, rtx); static rtx (*ix86_gen_sub3) (rtx, rtx, rtx); static rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx, rtx); @@ -1982,6 +1988,7 @@ static bool ix86_expand_vector_init_one_nonzero (bool, enum machine_mode, static void ix86_add_new_builtins (int); static rtx ix86_expand_vec_perm_builtin (tree); static tree ix86_canonical_va_list_type (tree); +static void predict_jump (int); enum ix86_function_specific_strings { @@ -2021,9 +2028,6 @@ static enum calling_abi ix86_function_abi (const_tree); static int ix86_tune_defaulted; static int ix86_arch_specified; -/* Bit flags that specify the ISA we are compiling for. */ -int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT; - /* A mask of ix86_isa_flags that includes bit X if X was set or cleared on the command line. */ static int ix86_isa_flags_explicit; @@ -2626,6 +2630,7 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune, { "-msseregparm", MASK_SSEREGPARM }, { "-mstack-arg-probe", MASK_STACK_PROBE }, { "-mtls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS }, + { "-m8bit-idiv", MASK_USE_8BIT_IDIV }, }; const char *opts[ARRAY_SIZE (isa_opts) + ARRAY_SIZE (flag_opts) + 6][2]; @@ -2800,17 +2805,12 @@ ix86_debug_options (void) return; } -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. +/* Override various settings based on options. If MAIN_ARGS_P, the + options are from the command line, otherwise they are from + attributes. */ - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - -void -override_options (bool main_args_p) +static void +ix86_option_override_internal (bool main_args_p) { int i; unsigned int ix86_arch_mask, ix86_tune_mask; @@ -3655,7 +3655,6 @@ override_options (bool main_args_p) if (TARGET_64BIT) { ix86_gen_leave = gen_leave_rex64; - ix86_gen_pop1 = gen_popdi1; ix86_gen_add3 = gen_adddi3; ix86_gen_sub3 = gen_subdi3; ix86_gen_sub3_carry = gen_subdi3_carry; @@ -3669,7 +3668,6 @@ override_options (bool main_args_p) else { ix86_gen_leave = gen_leave; - ix86_gen_pop1 = gen_popsi1; ix86_gen_add3 = gen_addsi3; ix86_gen_sub3 = gen_subsi3; ix86_gen_sub3_carry = gen_subsi3_carry; @@ -3708,6 +3706,14 @@ override_options (bool main_args_p) = build_target_option_node (); } +/* Implement the TARGET_OPTION_OVERRIDE hook. */ + +static void +ix86_option_override (void) +{ + ix86_option_override_internal (true); +} + /* Update register usage after having seen the compiler flags. */ void @@ -4104,9 +4110,10 @@ ix86_valid_target_attribute_tree (tree args) if (! ix86_valid_target_attribute_inner_p (args, option_strings)) return NULL_TREE; - /* If the changed options are different from the default, rerun override_options, - and then save the options away. The string options are are attribute options, - and will be undone when we copy the save structure. */ + /* If the changed options are different from the default, rerun + ix86_option_override_internal, and then save the options away. + The string options are are attribute options, and will be undone + when we copy the save structure. */ if (ix86_isa_flags != def->ix86_isa_flags || target_flags != def->target_flags || option_strings[IX86_FUNCTION_SPECIFIC_ARCH] @@ -4132,7 +4139,7 @@ ix86_valid_target_attribute_tree (tree args) ix86_fpmath_string = "sse,387"; /* Do any overrides, such as arch=xxx, or tune=xxx support. */ - override_options (false); + ix86_option_override_internal (false); /* Add any builtin functions with the new isa if any. */ ix86_add_new_builtins (ix86_isa_flags); @@ -4511,8 +4518,8 @@ x86_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED, ASM_OUTPUT_SKIP (file, size ? size : 1); } -void -optimization_options (int level, int size ATTRIBUTE_UNUSED) +static void +ix86_option_optimization (int level, int size ATTRIBUTE_UNUSED) { /* For -O2 and beyond, turn off -fschedule-insns by default. It tends to make the problem with not enough registers even worse. */ @@ -4528,8 +4535,9 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED) /* The default values of these switches depend on the TARGET_64BIT that is not known at this moment. Mark these values with 2 and - let user the to override these. In case there is no command line option - specifying them, we will set the defaults in override_options. */ + let user the to override these. In case there is no command line + option specifying them, we will set the defaults in + ix86_option_override_internal. */ if (optimize >= 1) flag_omit_frame_pointer = 2; @@ -6815,59 +6823,59 @@ ix86_libcall_value (enum machine_mode mode) /* Return true iff type is returned in memory. */ -static int ATTRIBUTE_UNUSED +static bool ATTRIBUTE_UNUSED return_in_memory_32 (const_tree type, enum machine_mode mode) { HOST_WIDE_INT size; if (mode == BLKmode) - return 1; + return true; size = int_size_in_bytes (type); if (MS_AGGREGATE_RETURN && AGGREGATE_TYPE_P (type) && size <= 8) - return 0; + return false; if (VECTOR_MODE_P (mode) || mode == TImode) { /* User-created vectors small enough to fit in EAX. */ if (size < 8) - return 0; + return false; /* MMX/3dNow values are returned in MM0, except when it doesn't exits. */ if (size == 8) - return (TARGET_MMX ? 0 : 1); + return !TARGET_MMX; /* SSE values are returned in XMM0, except when it doesn't exist. */ if (size == 16) - return (TARGET_SSE ? 0 : 1); + return !TARGET_SSE; /* AVX values are returned in YMM0, except when it doesn't exist. */ if (size == 32) - return TARGET_AVX ? 0 : 1; + return !TARGET_AVX; } if (mode == XFmode) - return 0; + return false; if (size > 12) - return 1; + return true; /* OImode shouldn't be used directly. */ gcc_assert (mode != OImode); - return 0; + return false; } -static int ATTRIBUTE_UNUSED +static bool ATTRIBUTE_UNUSED return_in_memory_64 (const_tree type, enum machine_mode mode) { int needed_intregs, needed_sseregs; return !examine_argument (mode, type, 1, &needed_intregs, &needed_sseregs); } -static int ATTRIBUTE_UNUSED +static bool ATTRIBUTE_UNUSED return_in_memory_ms_64 (const_tree type, enum machine_mode mode) { HOST_WIDE_INT size = int_size_in_bytes (type); @@ -6875,10 +6883,10 @@ return_in_memory_ms_64 (const_tree type, enum machine_mode mode) /* __m128 is returned in xmm0. */ if ((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode)) && !COMPLEX_MODE_P (mode) && (GET_MODE_SIZE (mode) == 16 || size == 16)) - return 0; + return false; /* Otherwise, the size must be exactly in [1248]. */ - return (size != 1 && size != 2 && size != 4 && size != 8); + return size != 1 && size != 2 && size != 4 && size != 8; } static bool @@ -7607,10 +7615,10 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, return build_va_arg_indirect_ref (addr); } -/* Return nonzero if OPNUM's MEM should be matched +/* Return true if OPNUM's MEM should be matched in movabs* patterns. */ -int +bool ix86_check_movabs (rtx insn, int opnum) { rtx set, mem; @@ -7623,7 +7631,7 @@ ix86_check_movabs (rtx insn, int opnum) while (GET_CODE (mem) == SUBREG) mem = SUBREG_REG (mem); gcc_assert (MEM_P (mem)); - return (volatile_ok || !MEM_VOLATILE_P (mem)); + return volatile_ok || !MEM_VOLATILE_P (mem); } /* Initialize the table of extra 80387 mathematical constants. */ @@ -7652,8 +7660,8 @@ init_ext_80387_constants (void) ext_80387_constants_init = 1; } -/* Return true if the constant is something that can be loaded with - a special instruction. */ +/* Return non-zero if the constant is something that + can be loaded with a special instruction. */ int standard_80387_constant_p (rtx x) @@ -7829,16 +7837,16 @@ standard_sse_constant_opcode (rtx insn, rtx x) gcc_unreachable (); } -/* Returns 1 if OP contains a symbol reference */ +/* Returns true if OP contains a symbol reference */ -int +bool symbolic_reference_mentioned_p (rtx op) { const char *fmt; int i; if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) - return 1; + return true; fmt = GET_RTX_FORMAT (GET_CODE (op)); for (i = GET_RTX_LENGTH (GET_CODE (op)) - 1; i >= 0; i--) @@ -7849,23 +7857,23 @@ symbolic_reference_mentioned_p (rtx op) for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) - return 1; + return true; } else if (fmt[i] == 'e' && symbolic_reference_mentioned_p (XEXP (op, i))) - return 1; + return true; } - return 0; + return false; } -/* Return 1 if it is appropriate to emit `ret' instructions in the +/* Return true if it is appropriate to emit `ret' instructions in the body of a function. Do this only if the epilogue is simple, needing a couple of insns. Prior to reloading, we can't tell how many registers - must be saved, so return 0 then. Return 0 if there is no frame + must be saved, so return false then. Return false if there is no frame marker to de-allocate. */ -int +bool ix86_can_use_return_insn_p (void) { struct ix86_frame frame; @@ -7900,9 +7908,9 @@ ix86_frame_pointer_required (void) if (SUBTARGET_FRAME_POINTER_REQUIRED) return true; - /* In override_options, TARGET_OMIT_LEAF_FRAME_POINTER turns off - the frame pointer by default. Turn it back on now if we've not - got a leaf function. */ + /* In ix86_option_override_internal, TARGET_OMIT_LEAF_FRAME_POINTER + turns off the frame pointer by default. Turn it back on now if + we've not got a leaf function. */ if (TARGET_OMIT_LEAF_FRAME_POINTER && (!current_function_is_leaf || ix86_current_function_calls_tls_descriptor)) @@ -8016,8 +8024,18 @@ ix86_code_end (void) xops[0] = gen_rtx_REG (Pmode, regno); xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx); + /* Pad stack IP move with 4 instructions (two NOPs count + as one instruction.) */ + if (TARGET_PAD_SHORT_FUNCTION) + { + int i = 8; + + while (i--) + fputs ("\tnop\n", asm_out_file); + } + output_asm_insn ("mov%z0\t{%1, %0|%0, %1}", xops); - output_asm_insn ("ret", xops); + fputs ("\tret\n", asm_out_file); final_end_function (); init_insn_lengths (); free_after_compilation (cfun); @@ -8122,13 +8140,7 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) /* Ensure all queued register saves are flushed before the call. */ if (dwarf2out_do_frame ()) - { - rtx insn; - start_sequence (); - insn = emit_barrier (); - end_sequence (); - dwarf2out_frame_debug (insn, false); - } + dwarf2out_flush_queued_reg_saves (); #endif xops[2] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); xops[2] = gen_rtx_MEM (QImode, xops[2]); @@ -8173,6 +8185,18 @@ gen_push (rtx arg) arg); } +/* Generate an "pop" pattern for input ARG. */ + +static rtx +gen_pop (rtx arg) +{ + return gen_rtx_SET (VOIDmode, + arg, + gen_rtx_MEM (Pmode, + gen_rtx_POST_INC (Pmode, + stack_pointer_rtx))); +} + /* Return >= 0 if there is an unused call-clobbered register available for the entire function. */ @@ -9052,7 +9076,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr) { if (sr->saved) { - rtx x, insn = emit_insn (ix86_gen_pop1 (sr->reg)); + rtx x, insn = emit_insn (gen_pop (sr->reg)); /* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */ RTX_FRAME_RELATED_P (insn) = 1; @@ -9478,7 +9502,7 @@ ix86_expand_prologue (void) { /* The frame pointer is not needed so pop %ebp again. This leaves us with a pristine state. */ - emit_insn (ix86_gen_pop1 (hard_frame_pointer_rtx)); + emit_insn (gen_pop (hard_frame_pointer_rtx)); } } @@ -9613,6 +9637,29 @@ ix86_expand_prologue (void) allocate = frame.stack_pointer_offset - m->fs.sp_offset; + if (flag_stack_usage) + { + /* We start to count from ARG_POINTER. */ + HOST_WIDE_INT stack_size = frame.stack_pointer_offset; + + /* If it was realigned, take into account the fake frame. */ + if (stack_realign_drap) + { + if (ix86_static_chain_on_stack) + stack_size += UNITS_PER_WORD; + + if (!call_used_regs[REGNO (crtl->drap_reg)]) + stack_size += UNITS_PER_WORD; + + /* This over-estimates by 1 minimal-stack-alignment-unit but + mitigates that by counting in the new return address slot. */ + current_function_dynamic_stack_size + += crtl->stack_alignment_needed / BITS_PER_UNIT; + } + + current_function_static_stack_size = stack_size; + } + /* The stack has already been decremented by the instruction calling us so we need to probe unconditionally to preserve the protection area. */ if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) @@ -9651,18 +9698,26 @@ ix86_expand_prologue (void) else { rtx eax = gen_rtx_REG (Pmode, AX_REG); - bool eax_live; + rtx r10 = NULL; + bool eax_live = false; + bool r10_live = false; - if (cfun->machine->call_abi == MS_ABI) - eax_live = false; - else - eax_live = ix86_eax_live_at_start_p (); + if (TARGET_64BIT) + r10_live = (DECL_STATIC_CHAIN (current_function_decl) != 0); + if (!TARGET_64BIT_MS_ABI) + eax_live = ix86_eax_live_at_start_p (); if (eax_live) { emit_insn (gen_push (eax)); allocate -= UNITS_PER_WORD; } + if (r10_live) + { + r10 = gen_rtx_REG (Pmode, R10_REG); + emit_insn (gen_push (r10)); + allocate -= UNITS_PER_WORD; + } emit_move_insn (eax, GEN_INT (allocate)); @@ -9678,11 +9733,18 @@ ix86_expand_prologue (void) } m->fs.sp_offset += allocate; - if (eax_live) - { + if (r10_live && eax_live) + { t = choose_baseaddr (m->fs.sp_offset - allocate); + emit_move_insn (r10, gen_frame_mem (Pmode, t)); + t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD); emit_move_insn (eax, gen_frame_mem (Pmode, t)); } + else if (eax_live || r10_live) + { + t = choose_baseaddr (m->fs.sp_offset - allocate); + emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t)); + } } gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset); @@ -9763,7 +9825,7 @@ static void ix86_emit_restore_reg_using_pop (rtx reg) { struct machine_function *m = cfun->machine; - rtx insn = emit_insn (ix86_gen_pop1 (reg)); + rtx insn = emit_insn (gen_pop (reg)); ix86_add_cfa_restore_note (insn, reg, m->fs.sp_offset); m->fs.sp_offset -= UNITS_PER_WORD; @@ -9786,10 +9848,12 @@ ix86_emit_restore_reg_using_pop (rtx reg) if (m->fs.cfa_reg == stack_pointer_rtx) { - m->fs.cfa_offset -= UNITS_PER_WORD; - add_reg_note (insn, REG_CFA_ADJUST_CFA, - copy_rtx (XVECEXP (PATTERN (insn), 0, 1))); + rtx x = plus_constant (stack_pointer_rtx, UNITS_PER_WORD); + x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); + add_reg_note (insn, REG_CFA_ADJUST_CFA, x); RTX_FRAME_RELATED_P (insn) = 1; + + m->fs.cfa_offset -= UNITS_PER_WORD; } /* When the frame pointer is the CFA, and we pop it, we are @@ -10090,6 +10154,7 @@ ix86_expand_epilogue (int style) } } m->fs.sp_offset = UNITS_PER_WORD; + m->fs.sp_valid = true; } } else @@ -10206,7 +10271,7 @@ ix86_expand_epilogue (int style) /* There is no "pascal" calling convention in any 64bit ABI. */ gcc_assert (!TARGET_64BIT); - insn = emit_insn (gen_popsi1 (ecx)); + insn = emit_insn (gen_pop (ecx)); m->fs.cfa_offset -= UNITS_PER_WORD; m->fs.sp_offset -= UNITS_PER_WORD; @@ -10655,7 +10720,7 @@ legitimate_pic_operand_p (rtx x) /* Determine if a given CONST RTX is a valid memory displacement in PIC mode. */ -int +bool legitimate_pic_address_disp_p (rtx disp) { bool saw_plus; @@ -10700,7 +10765,7 @@ legitimate_pic_address_disp_p (rtx disp) } } if (GET_CODE (disp) != CONST) - return 0; + return false; disp = XEXP (disp, 0); if (TARGET_64BIT) @@ -10711,28 +10776,28 @@ legitimate_pic_address_disp_p (rtx disp) || (XINT (disp, 1) != UNSPEC_GOTPCREL && XINT (disp, 1) != UNSPEC_GOTOFF && XINT (disp, 1) != UNSPEC_PLTOFF)) - return 0; + return false; if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF && GET_CODE (XVECEXP (disp, 0, 0)) != LABEL_REF) - return 0; - return 1; + return false; + return true; } saw_plus = false; if (GET_CODE (disp) == PLUS) { if (!CONST_INT_P (XEXP (disp, 1))) - return 0; + return false; disp = XEXP (disp, 0); saw_plus = true; } if (TARGET_MACHO && darwin_local_data_pic (disp)) - return 1; + return true; if (GET_CODE (disp) != UNSPEC) - return 0; + return false; switch (XINT (disp, 1)) { @@ -10771,7 +10836,7 @@ legitimate_pic_address_disp_p (rtx disp) && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_DYNAMIC); } - return 0; + return false; } /* Recognizes RTL expressions that are valid memory addresses for an @@ -11634,7 +11699,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, } } - if (changed && ix86_legitimate_address_p (mode, x, FALSE)) + if (changed && ix86_legitimate_address_p (mode, x, false)) return x; if (GET_CODE (XEXP (x, 0)) == MULT) @@ -11660,7 +11725,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, x = legitimize_pic_address (x, 0); } - if (changed && ix86_legitimate_address_p (mode, x, FALSE)) + if (changed && ix86_legitimate_address_p (mode, x, false)) return x; if (REG_P (XEXP (x, 0))) @@ -12376,6 +12441,7 @@ get_some_local_dynamic_name (void) Y -- print condition for XOP pcom* instruction. + -- print a branch hint as 'cs' or 'ds' prefix ; -- print a semicolon (after prefixes due to bug in older gas). + @ -- print a segment register of thread base pointer load */ void @@ -12854,6 +12920,19 @@ ix86_print_operand (FILE *file, rtx x, int code) #endif return; + case '@': + if (ASSEMBLER_DIALECT == ASM_ATT) + putc ('%', file); + + /* The kernel uses a different segment register for performance + reasons; a system call would not have to trash the userspace + segment register, which would be expensive. */ + if (TARGET_64BIT && ix86_cmodel != CM_KERNEL) + fputs ("fs", file); + else + fputs ("gs", file); + return; + default: output_operand_lossage ("invalid operand code '%c'", code); } @@ -12984,7 +13063,8 @@ ix86_print_operand (FILE *file, rtx x, int code) static bool ix86_print_operand_punct_valid_p (unsigned char code) { - return (code == '*' || code == '+' || code == '&' || code == ';'); + return (code == '@' || code == '*' || code == '+' + || code == '&' || code == ';'); } /* Print a memory operand whose address is ADDR. */ @@ -13188,15 +13268,33 @@ i386_asm_output_addr_const_extra (FILE *file, rtx x) return true; } -/* Split one or more DImode RTL references into pairs of SImode +/* Split one or more double-mode RTL references into pairs of half-mode references. The RTL can be REG, offsettable MEM, integer constant, or - CONST_DOUBLE. "operands" is a pointer to an array of DImode RTL to + CONST_DOUBLE. "operands" is a pointer to an array of double-mode RTLs to split and "num" is its length. lo_half and hi_half are output arrays that parallel "operands". */ void -split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) +split_double_mode (enum machine_mode mode, rtx operands[], + int num, rtx lo_half[], rtx hi_half[]) { + enum machine_mode half_mode; + unsigned int byte; + + switch (mode) + { + case TImode: + half_mode = DImode; + break; + case DImode: + half_mode = SImode; + break; + default: + gcc_unreachable (); + } + + byte = GET_MODE_SIZE (half_mode); + while (num--) { rtx op = operands[num]; @@ -13205,44 +13303,17 @@ split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) but we still have to handle it. */ if (MEM_P (op)) { - lo_half[num] = adjust_address (op, SImode, 0); - hi_half[num] = adjust_address (op, SImode, 4); + lo_half[num] = adjust_address (op, half_mode, 0); + hi_half[num] = adjust_address (op, half_mode, byte); } else { - lo_half[num] = simplify_gen_subreg (SImode, op, + lo_half[num] = simplify_gen_subreg (half_mode, op, GET_MODE (op) == VOIDmode - ? DImode : GET_MODE (op), 0); - hi_half[num] = simplify_gen_subreg (SImode, op, + ? mode : GET_MODE (op), 0); + hi_half[num] = simplify_gen_subreg (half_mode, op, GET_MODE (op) == VOIDmode - ? DImode : GET_MODE (op), 4); - } - } -} -/* Split one or more TImode RTL references into pairs of DImode - references. The RTL can be REG, offsettable MEM, integer constant, or - CONST_DOUBLE. "operands" is a pointer to an array of DImode RTL to - split and "num" is its length. lo_half and hi_half are output arrays - that parallel "operands". */ - -void -split_ti (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) -{ - while (num--) - { - rtx op = operands[num]; - - /* simplify_subreg refuse to split volatile memory addresses, but we - still have to handle it. */ - if (MEM_P (op)) - { - lo_half[num] = adjust_address (op, DImode, 0); - hi_half[num] = adjust_address (op, DImode, 8); - } - else - { - lo_half[num] = simplify_gen_subreg (DImode, op, TImode, 0); - hi_half[num] = simplify_gen_subreg (DImode, op, TImode, 8); + ? mode : GET_MODE (op), byte); } } } @@ -14518,7 +14589,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, /* Return TRUE or FALSE depending on whether the binary operator meets the appropriate constraints. */ -int +bool ix86_binary_operator_ok (enum rtx_code code, enum machine_mode mode, rtx operands[3]) { @@ -14528,7 +14599,7 @@ ix86_binary_operator_ok (enum rtx_code code, enum machine_mode mode, /* Both source operands cannot be in memory. */ if (MEM_P (src1) && MEM_P (src2)) - return 0; + return false; /* Canonicalize operand order for commutative operators. */ if (ix86_swap_binary_operands_p (code, mode, operands)) @@ -14540,17 +14611,17 @@ ix86_binary_operator_ok (enum rtx_code code, enum machine_mode mode, /* If the destination is memory, we must have a matching source operand. */ if (MEM_P (dst) && !rtx_equal_p (dst, src1)) - return 0; + return false; /* Source 1 cannot be a constant. */ if (CONSTANT_P (src1)) - return 0; + return false; /* Source 1 cannot be a non-matching memory. */ if (MEM_P (src1) && !rtx_equal_p (dst, src1)) - return 0; + return false; - return 1; + return true; } /* Attempt to expand a unary operator. Make the expansion closer to the @@ -14603,6 +14674,107 @@ ix86_expand_unary_operator (enum rtx_code code, enum machine_mode mode, emit_move_insn (operands[0], dst); } +/* Split 32bit/64bit divmod with 8bit unsigned divmod if dividend and + divisor are within the the range [0-255]. */ + +void +ix86_split_idivmod (enum machine_mode mode, rtx operands[], + bool signed_p) +{ + rtx end_label, qimode_label; + rtx insn, div, mod; + rtx scratch, tmp0, tmp1, tmp2; + rtx (*gen_divmod4_1) (rtx, rtx, rtx, rtx); + rtx (*gen_zero_extend) (rtx, rtx); + rtx (*gen_test_ccno_1) (rtx, rtx); + + switch (mode) + { + case SImode: + gen_divmod4_1 = signed_p ? gen_divmodsi4_1 : gen_udivmodsi4_1; + gen_test_ccno_1 = gen_testsi_ccno_1; + gen_zero_extend = gen_zero_extendqisi2; + break; + case DImode: + gen_divmod4_1 = signed_p ? gen_divmoddi4_1 : gen_udivmoddi4_1; + gen_test_ccno_1 = gen_testdi_ccno_1; + gen_zero_extend = gen_zero_extendqidi2; + break; + default: + gcc_unreachable (); + } + + end_label = gen_label_rtx (); + qimode_label = gen_label_rtx (); + + scratch = gen_reg_rtx (mode); + + /* Use 8bit unsigned divimod if dividend and divisor are within the + the range [0-255]. */ + emit_move_insn (scratch, operands[2]); + scratch = expand_simple_binop (mode, IOR, scratch, operands[3], + scratch, 1, OPTAB_DIRECT); + emit_insn (gen_test_ccno_1 (scratch, GEN_INT (-0x100))); + tmp0 = gen_rtx_REG (CCNOmode, FLAGS_REG); + tmp0 = gen_rtx_EQ (VOIDmode, tmp0, const0_rtx); + tmp0 = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp0, + gen_rtx_LABEL_REF (VOIDmode, qimode_label), + pc_rtx); + insn = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp0)); + predict_jump (REG_BR_PROB_BASE * 50 / 100); + JUMP_LABEL (insn) = qimode_label; + + /* Generate original signed/unsigned divimod. */ + div = gen_divmod4_1 (operands[0], operands[1], + operands[2], operands[3]); + emit_insn (div); + + /* Branch to the end. */ + emit_jump_insn (gen_jump (end_label)); + emit_barrier (); + + /* Generate 8bit unsigned divide. */ + emit_label (qimode_label); + /* Don't use operands[0] for result of 8bit divide since not all + registers support QImode ZERO_EXTRACT. */ + tmp0 = simplify_gen_subreg (HImode, scratch, mode, 0); + tmp1 = simplify_gen_subreg (HImode, operands[2], mode, 0); + tmp2 = simplify_gen_subreg (QImode, operands[3], mode, 0); + emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, tmp2)); + + if (signed_p) + { + div = gen_rtx_DIV (SImode, operands[2], operands[3]); + mod = gen_rtx_MOD (SImode, operands[2], operands[3]); + } + else + { + div = gen_rtx_UDIV (SImode, operands[2], operands[3]); + mod = gen_rtx_UMOD (SImode, operands[2], operands[3]); + } + + /* Extract remainder from AH. */ + tmp1 = gen_rtx_ZERO_EXTRACT (mode, tmp0, GEN_INT (8), GEN_INT (8)); + if (REG_P (operands[1])) + insn = emit_move_insn (operands[1], tmp1); + else + { + /* Need a new scratch register since the old one has result + of 8bit divide. */ + scratch = gen_reg_rtx (mode); + emit_move_insn (scratch, tmp1); + insn = emit_move_insn (operands[1], scratch); + } + set_unique_reg_note (insn, REG_EQUAL, mod); + + /* Zero extend quotient from AL. */ + tmp1 = gen_lowpart (QImode, tmp0); + insn = emit_insn (gen_zero_extend (operands[0], tmp1)); + set_unique_reg_note (insn, REG_EQUAL, div); + + emit_label (end_label); +} + #define LEA_SEARCH_THRESHOLD 12 /* Search backward for non-agu definition of register number REGNO1 @@ -14823,15 +14995,19 @@ ix86_lea_for_add_ok (rtx insn, rtx operands[]) else { int dist_define, dist_use; + + /* Return false if REGNO0 isn't used in memory address. */ + dist_use = distance_agu_use (regno0, insn); + if (dist_use <= 0) + return false; + dist_define = distance_non_agu_define (regno1, regno2, insn); if (dist_define <= 0) return true; /* If this insn has both backward non-agu dependence and forward agu dependence, the one with short distance take effect. */ - dist_use = distance_agu_use (regno0, insn); - if (dist_use <= 0 - || (dist_define + IX86_LEA_PRIORITY) < dist_use) + if ((dist_define + IX86_LEA_PRIORITY) < dist_use) return false; return true; @@ -14913,7 +15089,7 @@ ix86_dep_by_shift_count (const_rtx set_insn, const_rtx use_insn) /* Return TRUE or FALSE depending on whether the unary operator meets the appropriate constraints. */ -int +bool ix86_unary_operator_ok (enum rtx_code code ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, rtx operands[2] ATTRIBUTE_UNUSED) @@ -14922,8 +15098,8 @@ ix86_unary_operator_ok (enum rtx_code code ATTRIBUTE_UNUSED, if ((MEM_P (operands[0]) || MEM_P (operands[1])) && ! rtx_equal_p (operands[0], operands[1])) - return FALSE; - return TRUE; + return false; + return true; } /* Return TRUE if the operands to a vec_interleave_{high,low}v2df @@ -15501,7 +15677,7 @@ ix86_split_copysign_var (rtx operands[]) has source and destination with matching CC modes, and that the CC mode is at least as constrained as REQ_MODE. */ -int +bool ix86_match_ccmode (rtx insn, enum machine_mode req_mode) { rtx set; @@ -15520,19 +15696,19 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) if (req_mode != CCNOmode && (req_mode != CCmode || XEXP (SET_SRC (set), 1) != const0_rtx)) - return 0; + return false; break; case CCmode: if (req_mode == CCGCmode) - return 0; + return false; /* FALLTHRU */ case CCGCmode: if (req_mode == CCGOCmode || req_mode == CCNOmode) - return 0; + return false; /* FALLTHRU */ case CCGOCmode: if (req_mode == CCZmode) - return 0; + return false; /* FALLTHRU */ case CCAmode: case CCCmode: @@ -15545,7 +15721,7 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) gcc_unreachable (); } - return (GET_MODE (SET_SRC (set)) == set_mode); + return GET_MODE (SET_SRC (set)) == set_mode; } /* Generate insn patterns to do an integer compare of OPERANDS. */ @@ -16108,9 +16284,10 @@ ix86_expand_compare (enum rtx_code code, rtx op0, rtx op1) void ix86_expand_branch (enum rtx_code code, rtx op0, rtx op1, rtx label) { + enum machine_mode mode = GET_MODE (op0); rtx tmp; - switch (GET_MODE (op0)) + switch (mode) { case SFmode: case DFmode: @@ -16141,18 +16318,11 @@ ix86_expand_branch (enum rtx_code code, rtx op0, rtx op1, rtx label) tmp = op0, op0 = op1, op1 = tmp; code = swap_condition (code); } - if (GET_MODE (op0) == DImode) - { - split_di (&op0, 1, lo+0, hi+0); - split_di (&op1, 1, lo+1, hi+1); - submode = SImode; - } - else - { - split_ti (&op0, 1, lo+0, hi+0); - split_ti (&op1, 1, lo+1, hi+1); - submode = DImode; - } + + split_double_mode (mode, &op0, 1, lo+0, hi+0); + split_double_mode (mode, &op1, 1, lo+1, hi+1); + + submode = mode == DImode ? SImode : DImode; /* When comparing for equality, we can use (hi0^hi1)|(lo0^lo1) to avoid two branches. This costs one extra insn, so disable when @@ -16309,7 +16479,7 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) enum machine_mode mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1); - /* Do not handle DImode compares that go through special path. */ + /* Do not handle double-mode compares that go through special path. */ if (mode == (TARGET_64BIT ? TImode : DImode)) return false; @@ -16429,7 +16599,7 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) return true; } -int +bool ix86_expand_int_movcc (rtx operands[]) { enum rtx_code code = GET_CODE (operands[1]), compare_code; @@ -16609,7 +16779,7 @@ ix86_expand_int_movcc (rtx operands[]) if (!rtx_equal_p (tmp, out)) emit_move_insn (copy_rtx (out), copy_rtx (tmp)); - return 1; /* DONE */ + return true; } if (diff < 0) @@ -16687,7 +16857,7 @@ ix86_expand_int_movcc (rtx operands[]) if (out != operands[0]) emit_move_insn (operands[0], out); - return 1; /* DONE */ + return true; } } @@ -16746,7 +16916,7 @@ ix86_expand_int_movcc (rtx operands[]) if (!rtx_equal_p (out, operands[0])) emit_move_insn (operands[0], copy_rtx (out)); - return 1; /* DONE */ + return true; } /* @@ -16840,7 +17010,7 @@ ix86_expand_int_movcc (rtx operands[]) if (!rtx_equal_p (out, operands[0])) emit_move_insn (operands[0], copy_rtx (out)); - return 1; /* DONE */ + return true; } } @@ -16852,7 +17022,7 @@ ix86_expand_int_movcc (rtx operands[]) rtx var, orig_out, out, tmp; if (BRANCH_COST (optimize_insn_for_speed_p (), false) <= 2) - return 0; /* FAIL */ + return false; /* If one of the two operands is an interesting constant, load a constant with the above and mask it in with a logical operation. */ @@ -16865,7 +17035,7 @@ ix86_expand_int_movcc (rtx operands[]) else if (INTVAL (operands[2]) == -1 && operands[3] != const0_rtx) operands[3] = const0_rtx, op = ior_optab; else - return 0; /* FAIL */ + return false; } else if (CONST_INT_P (operands[3])) { @@ -16875,10 +17045,10 @@ ix86_expand_int_movcc (rtx operands[]) else if (INTVAL (operands[3]) == -1 && operands[3] != const0_rtx) operands[2] = const0_rtx, op = ior_optab; else - return 0; /* FAIL */ + return false; } else - return 0; /* FAIL */ + return false; orig_out = operands[0]; tmp = gen_reg_rtx (mode); @@ -16886,7 +17056,7 @@ ix86_expand_int_movcc (rtx operands[]) /* Recurse to get the constant loaded. */ if (ix86_expand_int_movcc (operands) == 0) - return 0; /* FAIL */ + return false; /* Mask in the interesting variable. */ out = expand_binop (mode, op, var, tmp, orig_out, 0, @@ -16894,7 +17064,7 @@ ix86_expand_int_movcc (rtx operands[]) if (!rtx_equal_p (out, orig_out)) emit_move_insn (copy_rtx (orig_out), copy_rtx (out)); - return 1; /* DONE */ + return true; } /* @@ -16927,8 +17097,7 @@ ix86_expand_int_movcc (rtx operands[]) gen_rtx_IF_THEN_ELSE (mode, compare_op, operands[2], operands[3]))); - - return 1; /* DONE */ + return true; } /* Swap, force into registers, or otherwise massage the two operands @@ -17126,7 +17295,7 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) /* Expand a floating-point conditional move. Return true if successful. */ -int +bool ix86_expand_fp_movcc (rtx operands[]) { enum machine_mode mode = GET_MODE (operands[0]); @@ -17146,20 +17315,20 @@ ix86_expand_fp_movcc (rtx operands[]) if (cmode == VOIDmode) cmode = GET_MODE (op1); if (cmode != mode) - return 0; + return false; code = ix86_prepare_sse_fp_compare_args (operands[0], code, &op0, &op1); if (code == UNKNOWN) - return 0; + return false; if (ix86_expand_sse_fp_minmax (operands[0], code, op0, op1, operands[2], operands[3])) - return 1; + return true; tmp = ix86_expand_sse_cmp (operands[0], code, op0, op1, operands[2], operands[3]); ix86_expand_sse_movcc (operands[0], tmp, operands[2], operands[3]); - return 1; + return true; } /* The floating point conditional move instructions don't directly @@ -17178,7 +17347,7 @@ ix86_expand_fp_movcc (rtx operands[]) gen_rtx_IF_THEN_ELSE (mode, compare_op, operands[2], operands[3]))); - return 1; + return true; } /* Expand a floating-point vector conditional move; a vcond operation @@ -17397,19 +17566,19 @@ ix86_expand_sse4_unpack (rtx operands[2], bool unsigned_p, bool high_p) if (unsigned_p) unpack = gen_sse4_1_zero_extendv8qiv8hi2; else - unpack = gen_sse4_1_extendv8qiv8hi2; + unpack = gen_sse4_1_sign_extendv8qiv8hi2; break; case V8HImode: if (unsigned_p) unpack = gen_sse4_1_zero_extendv4hiv4si2; else - unpack = gen_sse4_1_extendv4hiv4si2; + unpack = gen_sse4_1_sign_extendv4hiv4si2; break; case V4SImode: if (unsigned_p) unpack = gen_sse4_1_zero_extendv2siv2di2; else - unpack = gen_sse4_1_extendv2siv2di2; + unpack = gen_sse4_1_sign_extendv2siv2di2; break; default: gcc_unreachable (); @@ -17433,7 +17602,7 @@ ix86_expand_sse4_unpack (rtx operands[2], bool unsigned_p, bool high_p) /* Expand conditional increment or decrement using adb/sbb instructions. The default case using setcc followed by the conditional move can be done by generic code. */ -int +bool ix86_expand_int_addcc (rtx operands[]) { enum rtx_code code = GET_CODE (operands[1]); @@ -17448,9 +17617,9 @@ ix86_expand_int_addcc (rtx operands[]) if (operands[3] != const1_rtx && operands[3] != constm1_rtx) - return 0; + return false; if (!ix86_expand_carry_flag_compare (code, op0, op1, &compare_op)) - return 0; + return false; code = GET_CODE (compare_op); flags = XEXP (compare_op, 0); @@ -17518,12 +17687,12 @@ ix86_expand_int_addcc (rtx operands[]) } emit_insn (insn (operands[0], operands[2], val, flags, compare_op)); - return 1; /* DONE */ + return true; } -/* Split operands 0 and 1 into SImode parts. Similar to split_di, but - works for floating pointer parameters and nonoffsetable memories. +/* Split operands 0 and 1 into half-mode parts. Similar to split_double_mode, + but works for floating pointer parameters and nonoffsetable memories. For pushes, it returns just stack offsets; the values will be saved in the right order. Maximally three parts are generated. */ @@ -17576,7 +17745,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) if (!TARGET_64BIT) { if (mode == DImode) - split_di (&operand, 1, &parts[0], &parts[1]); + split_double_mode (mode, &operand, 1, &parts[0], &parts[1]); else { int i; @@ -17627,7 +17796,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) else { if (mode == TImode) - split_ti (&operand, 1, &parts[0], &parts[1]); + split_double_mode (mode, &operand, 1, &parts[0], &parts[1]); if (mode == XFmode || mode == TFmode) { enum machine_mode upper_mode = mode==XFmode ? SImode : DImode; @@ -17698,7 +17867,7 @@ ix86_split_long_move (rtx operands[]) /* The DFmode expanders may ask us to move double. For 64bit target this is single move. By hiding the fact here we simplify i386.md splitters. */ - if (GET_MODE_SIZE (GET_MODE (operands[0])) == 8 && TARGET_64BIT) + if (TARGET_64BIT && GET_MODE_SIZE (GET_MODE (operands[0])) == 8) { /* Optimize constant pool reference to immediates. This is used by fp moves, that force all constants to memory to allow combining. */ @@ -17908,62 +18077,62 @@ ix86_split_long_move (rtx operands[]) static void ix86_expand_ashl_const (rtx operand, int count, enum machine_mode mode) { - if (count == 1) + rtx (*insn)(rtx, rtx, rtx); + + if (count == 1 + || (count * ix86_cost->add <= ix86_cost->shift_const + && !optimize_insn_for_size_p ())) { - emit_insn ((mode == DImode - ? gen_addsi3 - : gen_adddi3) (operand, operand, operand)); + insn = mode == DImode ? gen_addsi3 : gen_adddi3; + while (count-- > 0) + emit_insn (insn (operand, operand, operand)); } - else if (!optimize_insn_for_size_p () - && count * ix86_cost->add <= ix86_cost->shift_const) + else { - int i; - for (i=0; i> 1; + rtx low[2], high[2]; int count; - const int single_width = mode == DImode ? 32 : 64; if (CONST_INT_P (operands[2])) { - (mode == DImode ? split_di : split_ti) (operands, 2, low, high); - count = INTVAL (operands[2]) & (single_width * 2 - 1); + split_double_mode (mode, operands, 2, low, high); + count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1); - if (count >= single_width) + if (count >= half_width) { emit_move_insn (high[0], low[1]); emit_move_insn (low[0], const0_rtx); - if (count > single_width) - ix86_expand_ashl_const (high[0], count - single_width, mode); + if (count > half_width) + ix86_expand_ashl_const (high[0], count - half_width, mode); } else { + gen_shld = mode == DImode ? gen_x86_shld : gen_x86_64_shld; + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn ((mode == DImode - ? gen_x86_shld - : gen_x86_64_shld) (high[0], low[0], GEN_INT (count))); + + emit_insn (gen_shld (high[0], low[0], GEN_INT (count))); ix86_expand_ashl_const (low[0], count, mode); } return; } - (mode == DImode ? split_di : split_ti) (operands, 1, low, high); + split_double_mode (mode, operands, 1, low, high); + + gen_ashl3 = mode == DImode ? gen_ashlsi3 : gen_ashldi3; if (operands[1] == const1_rtx) { @@ -17975,7 +18144,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) ix86_expand_clear (low[0]); ix86_expand_clear (high[0]); - emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (single_width))); + emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (half_width))); d = gen_lowpart (QImode, low[0]); d = gen_rtx_STRICT_LOW_PART (VOIDmode, d); @@ -17995,33 +18164,44 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) pentium4 a bit; no one else seems to care much either way. */ else { + enum machine_mode half_mode; + rtx (*gen_lshr3)(rtx, rtx, rtx); + rtx (*gen_and3)(rtx, rtx, rtx); + rtx (*gen_xor3)(rtx, rtx, rtx); + HOST_WIDE_INT bits; rtx x; - if (TARGET_PARTIAL_REG_STALL && !optimize_insn_for_size_p ()) - x = gen_rtx_ZERO_EXTEND (mode == DImode ? SImode : DImode, operands[2]); + if (mode == DImode) + { + half_mode = SImode; + gen_lshr3 = gen_lshrsi3; + gen_and3 = gen_andsi3; + gen_xor3 = gen_xorsi3; + bits = 5; + } else - x = gen_lowpart (mode == DImode ? SImode : DImode, operands[2]); + { + half_mode = DImode; + gen_lshr3 = gen_lshrdi3; + gen_and3 = gen_anddi3; + gen_xor3 = gen_xordi3; + bits = 6; + } + + if (TARGET_PARTIAL_REG_STALL && !optimize_insn_for_size_p ()) + x = gen_rtx_ZERO_EXTEND (half_mode, operands[2]); + else + x = gen_lowpart (half_mode, operands[2]); emit_insn (gen_rtx_SET (VOIDmode, high[0], x)); - emit_insn ((mode == DImode - ? gen_lshrsi3 - : gen_lshrdi3) (high[0], high[0], - GEN_INT (mode == DImode ? 5 : 6))); - emit_insn ((mode == DImode - ? gen_andsi3 - : gen_anddi3) (high[0], high[0], const1_rtx)); + emit_insn (gen_lshr3 (high[0], high[0], GEN_INT (bits))); + emit_insn (gen_and3 (high[0], high[0], const1_rtx)); emit_move_insn (low[0], high[0]); - emit_insn ((mode == DImode - ? gen_xorsi3 - : gen_xordi3) (low[0], low[0], const1_rtx)); + emit_insn (gen_xor3 (low[0], low[0], const1_rtx)); } - emit_insn ((mode == DImode - ? gen_ashlsi3 - : gen_ashldi3) (low[0], low[0], operands[2])); - emit_insn ((mode == DImode - ? gen_ashlsi3 - : gen_ashldi3) (high[0], high[0], operands[2])); + emit_insn (gen_ashl3 (low[0], low[0], operands[2])); + emit_insn (gen_ashl3 (high[0], high[0], operands[2])); return; } @@ -18037,176 +18217,177 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) } else { + gen_shld = mode == DImode ? gen_x86_shld : gen_x86_64_shld; + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - (mode == DImode ? split_di : split_ti) (operands, 1, low, high); - emit_insn ((mode == DImode - ? gen_x86_shld - : gen_x86_64_shld) (high[0], low[0], operands[2])); + split_double_mode (mode, operands, 1, low, high); + emit_insn (gen_shld (high[0], low[0], operands[2])); } - emit_insn ((mode == DImode - ? gen_ashlsi3 - : gen_ashldi3) (low[0], low[0], operands[2])); + emit_insn (gen_ashl3 (low[0], low[0], operands[2])); if (TARGET_CMOVE && scratch) { + rtx (*gen_x86_shift_adj_1)(rtx, rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_1 : gen_x86_shiftdi_adj_1; + ix86_expand_clear (scratch); - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_1 - : gen_x86_shiftdi_adj_1) (high[0], low[0], operands[2], - scratch)); + emit_insn (gen_x86_shift_adj_1 (high[0], low[0], operands[2], scratch)); } else - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_2 - : gen_x86_shiftdi_adj_2) (high[0], low[0], operands[2])); + { + rtx (*gen_x86_shift_adj_2)(rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_2 : gen_x86_shiftdi_adj_2; + + emit_insn (gen_x86_shift_adj_2 (high[0], low[0], operands[2])); + } } void ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode) { + rtx (*gen_ashr3)(rtx, rtx, rtx) + = mode == DImode ? gen_ashrsi3 : gen_ashrdi3; + rtx (*gen_shrd)(rtx, rtx, rtx); + int half_width = GET_MODE_BITSIZE (mode) >> 1; + rtx low[2], high[2]; int count; - const int single_width = mode == DImode ? 32 : 64; if (CONST_INT_P (operands[2])) { - (mode == DImode ? split_di : split_ti) (operands, 2, low, high); - count = INTVAL (operands[2]) & (single_width * 2 - 1); + split_double_mode (mode, operands, 2, low, high); + count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1); - if (count == single_width * 2 - 1) + if (count == GET_MODE_BITSIZE (mode) - 1) { emit_move_insn (high[0], high[1]); - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (high[0], high[0], - GEN_INT (single_width - 1))); + emit_insn (gen_ashr3 (high[0], high[0], + GEN_INT (half_width - 1))); emit_move_insn (low[0], high[0]); } - else if (count >= single_width) + else if (count >= half_width) { emit_move_insn (low[0], high[1]); emit_move_insn (high[0], low[0]); - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (high[0], high[0], - GEN_INT (single_width - 1))); - if (count > single_width) - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (low[0], low[0], - GEN_INT (count - single_width))); + emit_insn (gen_ashr3 (high[0], high[0], + GEN_INT (half_width - 1))); + + if (count > half_width) + emit_insn (gen_ashr3 (low[0], low[0], + GEN_INT (count - half_width))); } else { + gen_shrd = mode == DImode ? gen_x86_shrd : gen_x86_64_shrd; + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn ((mode == DImode - ? gen_x86_shrd - : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (high[0], high[0], GEN_INT (count))); + + emit_insn (gen_shrd (low[0], high[0], GEN_INT (count))); + emit_insn (gen_ashr3 (high[0], high[0], GEN_INT (count))); } } else { - if (!rtx_equal_p (operands[0], operands[1])) + gen_shrd = mode == DImode ? gen_x86_shrd : gen_x86_64_shrd; + + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - (mode == DImode ? split_di : split_ti) (operands, 1, low, high); + split_double_mode (mode, operands, 1, low, high); - emit_insn ((mode == DImode - ? gen_x86_shrd - : gen_x86_64_shrd) (low[0], high[0], operands[2])); - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (high[0], high[0], operands[2])); + emit_insn (gen_shrd (low[0], high[0], operands[2])); + emit_insn (gen_ashr3 (high[0], high[0], operands[2])); if (TARGET_CMOVE && scratch) { + rtx (*gen_x86_shift_adj_1)(rtx, rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_1 : gen_x86_shiftdi_adj_1; + emit_move_insn (scratch, high[0]); - emit_insn ((mode == DImode - ? gen_ashrsi3 - : gen_ashrdi3) (scratch, scratch, - GEN_INT (single_width - 1))); - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_1 - : gen_x86_shiftdi_adj_1) (low[0], high[0], operands[2], - scratch)); + emit_insn (gen_ashr3 (scratch, scratch, + GEN_INT (half_width - 1))); + emit_insn (gen_x86_shift_adj_1 (low[0], high[0], operands[2], + scratch)); } else - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_3 - : gen_x86_shiftdi_adj_3) (low[0], high[0], operands[2])); + { + rtx (*gen_x86_shift_adj_3)(rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_3 : gen_x86_shiftdi_adj_3; + + emit_insn (gen_x86_shift_adj_3 (low[0], high[0], operands[2])); + } } } void ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode) { + rtx (*gen_lshr3)(rtx, rtx, rtx) + = mode == DImode ? gen_lshrsi3 : gen_lshrdi3; + rtx (*gen_shrd)(rtx, rtx, rtx); + int half_width = GET_MODE_BITSIZE (mode) >> 1; + rtx low[2], high[2]; int count; - const int single_width = mode == DImode ? 32 : 64; if (CONST_INT_P (operands[2])) { - (mode == DImode ? split_di : split_ti) (operands, 2, low, high); - count = INTVAL (operands[2]) & (single_width * 2 - 1); + split_double_mode (mode, operands, 2, low, high); + count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1); - if (count >= single_width) + if (count >= half_width) { emit_move_insn (low[0], high[1]); ix86_expand_clear (high[0]); - if (count > single_width) - emit_insn ((mode == DImode - ? gen_lshrsi3 - : gen_lshrdi3) (low[0], low[0], - GEN_INT (count - single_width))); + if (count > half_width) + emit_insn (gen_lshr3 (low[0], low[0], + GEN_INT (count - half_width))); } else { + gen_shrd = mode == DImode ? gen_x86_shrd : gen_x86_64_shrd; + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn ((mode == DImode - ? gen_x86_shrd - : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); - emit_insn ((mode == DImode - ? gen_lshrsi3 - : gen_lshrdi3) (high[0], high[0], GEN_INT (count))); + + emit_insn (gen_shrd (low[0], high[0], GEN_INT (count))); + emit_insn (gen_lshr3 (high[0], high[0], GEN_INT (count))); } } else { + gen_shrd = mode == DImode ? gen_x86_shrd : gen_x86_64_shrd; + if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - (mode == DImode ? split_di : split_ti) (operands, 1, low, high); + split_double_mode (mode, operands, 1, low, high); - emit_insn ((mode == DImode - ? gen_x86_shrd - : gen_x86_64_shrd) (low[0], high[0], operands[2])); - emit_insn ((mode == DImode - ? gen_lshrsi3 - : gen_lshrdi3) (high[0], high[0], operands[2])); + emit_insn (gen_shrd (low[0], high[0], operands[2])); + emit_insn (gen_lshr3 (high[0], high[0], operands[2])); - /* Heh. By reversing the arguments, we can reuse this pattern. */ if (TARGET_CMOVE && scratch) { + rtx (*gen_x86_shift_adj_1)(rtx, rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_1 : gen_x86_shiftdi_adj_1; + ix86_expand_clear (scratch); - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_1 - : gen_x86_shiftdi_adj_1) (low[0], high[0], operands[2], - scratch)); + emit_insn (gen_x86_shift_adj_1 (low[0], high[0], operands[2], + scratch)); } else - emit_insn ((mode == DImode - ? gen_x86_shiftsi_adj_2 - : gen_x86_shiftdi_adj_2) (low[0], high[0], operands[2])); + { + rtx (*gen_x86_shift_adj_2)(rtx, rtx, rtx) + = mode == DImode ? gen_x86_shiftsi_adj_2 : gen_x86_shiftdi_adj_2; + + emit_insn (gen_x86_shift_adj_2 (low[0], high[0], operands[2])); + } } } @@ -18243,10 +18424,10 @@ ix86_expand_aligntest (rtx variable, int value, bool epilogue) static void ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value) { - if (GET_MODE (countreg) == DImode) - emit_insn (gen_adddi3 (countreg, countreg, GEN_INT (-value))); - else - emit_insn (gen_addsi3 (countreg, countreg, GEN_INT (-value))); + rtx (*gen_add)(rtx, rtx, rtx) + = GET_MODE (countreg) == DImode ? gen_adddi3 : gen_addsi3; + + emit_insn (gen_add (countreg, countreg, GEN_INT (-value))); } /* Zero extend possibly SImode EXP to Pmode register. */ @@ -19062,7 +19243,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, { unsigned int i; enum stringop_alg alg = libcall; - for (i = 0; i < NAX_STRINGOP_ALGS; i++) + for (i = 0; i < MAX_STRINGOP_ALGS; i++) { /* We get here if the algorithms that were not libcall-based were rep-prefix based and we are unable to use rep prefixes @@ -19108,7 +19289,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, int i; bool any_alg_usable_p = true; - for (i = 0; i < NAX_STRINGOP_ALGS; i++) + for (i = 0; i < MAX_STRINGOP_ALGS; i++) { enum stringop_alg candidate = algs->size[i].alg; any_alg_usable_p = any_alg_usable_p && ALG_USABLE_P (candidate); @@ -19225,7 +19406,7 @@ smallest_pow2_greater_than (int val) 4) Epilogue: code copying tail of the block that is too small to be handled by main body (or up to size guarded by prologue guard). */ -int +bool ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, rtx expected_align_exp, rtx expected_size_exp) { @@ -19261,7 +19442,7 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, /* Make sure we don't need to care about overflow later on. */ if (count > ((unsigned HOST_WIDE_INT) 1 << 30)) - return 0; + return false; /* Step 0: Decide on preferred algorithm, desired alignment and size of chunks to be copied by main loop. */ @@ -19273,7 +19454,7 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, align = desired_align; if (alg == libcall) - return 0; + return false; gcc_assert (alg != no_stringop); if (!count) count_exp = copy_to_mode_reg (GET_MODE (count_exp), count_exp); @@ -19519,7 +19700,7 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, epilogue_size_needed); if (jump_around_label) emit_label (jump_around_label); - return 1; + return true; } /* Helper function for memcpy. For QImode value 0xXY produce @@ -19618,7 +19799,7 @@ promote_duplicated_reg_to_size (rtx val, int size_needed, int desired_align, int /* Expand string clear operation (bzero). Use i386 string operations when profitable. See expand_movmem comment for explanation of individual steps performed. */ -int +bool ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, rtx expected_align_exp, rtx expected_size_exp) { @@ -19650,7 +19831,7 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, /* Make sure we don't need to care about overflow later on. */ if (count > ((unsigned HOST_WIDE_INT) 1 << 30)) - return 0; + return false; /* Step 0: Decide on preferred algorithm, desired alignment and size of chunks to be copied by main loop. */ @@ -19662,7 +19843,7 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, align = desired_align; if (alg == libcall) - return 0; + return false; gcc_assert (alg != no_stringop); if (!count) count_exp = copy_to_mode_reg (counter_mode (count_exp), count_exp); @@ -19908,7 +20089,7 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, } if (jump_around_label) emit_label (jump_around_label); - return 1; + return true; } /* Expand the appropriate insns for doing strlen if not just doing @@ -20086,7 +20267,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx) /* Expand strlen. */ -int +bool ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align) { rtx addr, scratch1, scratch2, scratch3, scratch4; @@ -20098,7 +20279,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align) && !TARGET_INLINE_ALL_STRINGOPS && !optimize_insn_for_size_p () && (!CONST_INT_P (align) || INTVAL (align) < 4)) - return 0; + return false; addr = force_reg (Pmode, XEXP (src, 0)); scratch1 = gen_reg_rtx (Pmode); @@ -20147,7 +20328,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align) emit_insn (ix86_gen_one_cmpl2 (scratch2, scratch1)); emit_insn (ix86_gen_add3 (out, scratch2, constm1_rtx)); } - return 1; + return true; } /* For given symbol (function) construct code to compute address of it's PLT @@ -23075,12 +23256,12 @@ static const struct builtin_description bdesc_args[] = { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_pblendvb, "__builtin_ia32_pblendvb128", IX86_BUILTIN_PBLENDVB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI }, { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_pblendw, "__builtin_ia32_pblendw128", IX86_BUILTIN_PBLENDW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_INT }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv8qiv8hi2, "__builtin_ia32_pmovsxbw128", IX86_BUILTIN_PMOVSXBW128, UNKNOWN, (int) V8HI_FTYPE_V16QI }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4qiv4si2, "__builtin_ia32_pmovsxbd128", IX86_BUILTIN_PMOVSXBD128, UNKNOWN, (int) V4SI_FTYPE_V16QI }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2qiv2di2, "__builtin_ia32_pmovsxbq128", IX86_BUILTIN_PMOVSXBQ128, UNKNOWN, (int) V2DI_FTYPE_V16QI }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4hiv4si2, "__builtin_ia32_pmovsxwd128", IX86_BUILTIN_PMOVSXWD128, UNKNOWN, (int) V4SI_FTYPE_V8HI }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2hiv2di2, "__builtin_ia32_pmovsxwq128", IX86_BUILTIN_PMOVSXWQ128, UNKNOWN, (int) V2DI_FTYPE_V8HI }, - { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2siv2di2, "__builtin_ia32_pmovsxdq128", IX86_BUILTIN_PMOVSXDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv8qiv8hi2, "__builtin_ia32_pmovsxbw128", IX86_BUILTIN_PMOVSXBW128, UNKNOWN, (int) V8HI_FTYPE_V16QI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv4qiv4si2, "__builtin_ia32_pmovsxbd128", IX86_BUILTIN_PMOVSXBD128, UNKNOWN, (int) V4SI_FTYPE_V16QI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv2qiv2di2, "__builtin_ia32_pmovsxbq128", IX86_BUILTIN_PMOVSXBQ128, UNKNOWN, (int) V2DI_FTYPE_V16QI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv4hiv4si2, "__builtin_ia32_pmovsxwd128", IX86_BUILTIN_PMOVSXWD128, UNKNOWN, (int) V4SI_FTYPE_V8HI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv2hiv2di2, "__builtin_ia32_pmovsxwq128", IX86_BUILTIN_PMOVSXWQ128, UNKNOWN, (int) V2DI_FTYPE_V8HI }, + { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_sign_extendv2siv2di2, "__builtin_ia32_pmovsxdq128", IX86_BUILTIN_PMOVSXDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI }, { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv8qiv8hi2, "__builtin_ia32_pmovzxbw128", IX86_BUILTIN_PMOVZXBW128, UNKNOWN, (int) V8HI_FTYPE_V16QI }, { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv4qiv4si2, "__builtin_ia32_pmovzxbd128", IX86_BUILTIN_PMOVZXBD128, UNKNOWN, (int) V4SI_FTYPE_V16QI }, { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2qiv2di2, "__builtin_ia32_pmovzxbq128", IX86_BUILTIN_PMOVZXBQ128, UNKNOWN, (int) V2DI_FTYPE_V16QI }, @@ -25980,7 +26161,7 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) case DImode: { rtx operands[2]; - split_di (&operand, 1, operands, operands + 1); + split_double_mode (mode, &operand, 1, operands, operands + 1); emit_insn ( gen_rtx_SET (VOIDmode, gen_rtx_MEM (SImode, @@ -26184,6 +26365,32 @@ ix86_secondary_reload (bool in_p, rtx x, reg_class_t rclass, return NO_REGS; } +/* Implement TARGET_CLASS_LIKELY_SPILLED_P. */ + +static bool +ix86_class_likely_spilled_p (reg_class_t rclass) +{ + switch (rclass) + { + case AREG: + case DREG: + case CREG: + case BREG: + case AD_REGS: + case SIREG: + case DIREG: + case SSE_FIRST_REG: + case FP_TOP_REG: + case FP_SECOND_REG: + return true; + + default: + break; + } + + return false; +} + /* If we are copying between general and FP registers, we need a memory location. The same is true for SSE and MMX registers. @@ -26197,9 +26404,9 @@ ix86_secondary_reload (bool in_p, rtx x, reg_class_t rclass, When STRICT is false, we are being called from REGISTER_MOVE_COST, so do not enforce these sanity checks. */ -static inline int +static inline bool inline_secondary_memory_needed (enum reg_class class1, enum reg_class class2, - enum machine_mode mode, int strict) + enum machine_mode mode, int strict) { if (MAYBE_FLOAT_CLASS_P (class1) != FLOAT_CLASS_P (class1) || MAYBE_FLOAT_CLASS_P (class2) != FLOAT_CLASS_P (class2) @@ -26240,7 +26447,7 @@ inline_secondary_memory_needed (enum reg_class class1, enum reg_class class2, return false; } -int +bool ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2, enum machine_mode mode, int strict) { @@ -27482,7 +27689,6 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) } } -#ifdef ASM_OUTPUT_MAX_SKIP_PAD /* We don't have exact information about the insn sizes, but we may assume quite safely that we are informed about all 1 byte insns and memory address sizes. This is enough to eliminate unnecessary padding in @@ -27544,6 +27750,8 @@ min_insn_size (rtx insn) return 2; } +#ifdef ASM_OUTPUT_MAX_SKIP_PAD + /* AMD K8 core mispredicts jumps when there are more than 3 jumps in 16 byte window. */ @@ -27699,6 +27907,120 @@ ix86_pad_returns (void) } } +/* Count the minimum number of instructions in BB. Return 4 if the + number of instructions >= 4. */ + +static int +ix86_count_insn_bb (basic_block bb) +{ + rtx insn; + int insn_count = 0; + + /* Count number of instructions in this block. Return 4 if the number + of instructions >= 4. */ + FOR_BB_INSNS (bb, insn) + { + /* Only happen in exit blocks. */ + if (JUMP_P (insn) + && GET_CODE (PATTERN (insn)) == RETURN) + break; + + if (NONDEBUG_INSN_P (insn) + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER) + { + insn_count++; + if (insn_count >= 4) + return insn_count; + } + } + + return insn_count; +} + + +/* Count the minimum number of instructions in code path in BB. + Return 4 if the number of instructions >= 4. */ + +static int +ix86_count_insn (basic_block bb) +{ + edge e; + edge_iterator ei; + int min_prev_count; + + /* Only bother counting instructions along paths with no + more than 2 basic blocks between entry and exit. Given + that BB has an edge to exit, determine if a predecessor + of BB has an edge from entry. If so, compute the number + of instructions in the predecessor block. If there + happen to be multiple such blocks, compute the minimum. */ + min_prev_count = 4; + FOR_EACH_EDGE (e, ei, bb->preds) + { + edge prev_e; + edge_iterator prev_ei; + + if (e->src == ENTRY_BLOCK_PTR) + { + min_prev_count = 0; + break; + } + FOR_EACH_EDGE (prev_e, prev_ei, e->src->preds) + { + if (prev_e->src == ENTRY_BLOCK_PTR) + { + int count = ix86_count_insn_bb (e->src); + if (count < min_prev_count) + min_prev_count = count; + break; + } + } + } + + if (min_prev_count < 4) + min_prev_count += ix86_count_insn_bb (bb); + + return min_prev_count; +} + +/* Pad short funtion to 4 instructions. */ + +static void +ix86_pad_short_function (void) +{ + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + { + rtx ret = BB_END (e->src); + if (JUMP_P (ret) && GET_CODE (PATTERN (ret)) == RETURN) + { + int insn_count = ix86_count_insn (e->src); + + /* Pad short function. */ + if (insn_count < 4) + { + rtx insn = ret; + + /* Find epilogue. */ + while (insn + && (!NOTE_P (insn) + || NOTE_KIND (insn) != NOTE_INSN_EPILOGUE_BEG)) + insn = PREV_INSN (insn); + + if (!insn) + insn = ret; + + /* Two NOPs are counted as one instruction. */ + insn_count = 2 * (4 - insn_count); + emit_insn_before (gen_nops (GEN_INT (insn_count)), insn); + } + } + } +} + /* Implement machine specific optimizations. We implement padding of returns for K8 CPUs and pass to avoid 4 jumps in the single 16 byte window. */ static void @@ -27706,7 +28028,9 @@ ix86_reorg (void) { if (optimize && optimize_function_for_speed_p (cfun)) { - if (TARGET_PAD_RETURNS) + if (TARGET_PAD_SHORT_FUNCTION) + ix86_pad_short_function (); + else if (TARGET_PAD_RETURNS) ix86_pad_returns (); #ifdef ASM_OUTPUT_MAX_SKIP_PAD if (TARGET_FOUR_JUMP_LIMIT) @@ -31465,6 +31789,828 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree) return 0; } +#undef TARGET_SCHED_DISPATCH +#define TARGET_SCHED_DISPATCH has_dispatch +#undef TARGET_SCHED_DISPATCH_DO +#define TARGET_SCHED_DISPATCH_DO do_dispatch + +/* The size of the dispatch window is the total number of bytes of + object code allowed in a window. */ +#define DISPATCH_WINDOW_SIZE 16 + +/* Number of dispatch windows considered for scheduling. */ +#define MAX_DISPATCH_WINDOWS 3 + +/* Maximum number of instructions in a window. */ +#define MAX_INSN 4 + +/* Maximum number of immediate operands in a window. */ +#define MAX_IMM 4 + +/* Maximum number of immediate bits allowed in a window. */ +#define MAX_IMM_SIZE 128 + +/* Maximum number of 32 bit immediates allowed in a window. */ +#define MAX_IMM_32 4 + +/* Maximum number of 64 bit immediates allowed in a window. */ +#define MAX_IMM_64 2 + +/* Maximum total of loads or prefetches allowed in a window. */ +#define MAX_LOAD 2 + +/* Maximum total of stores allowed in a window. */ +#define MAX_STORE 1 + +#undef BIG +#define BIG 100 + + +/* Dispatch groups. Istructions that affect the mix in a dispatch window. */ +enum dispatch_group { + disp_no_group = 0, + disp_load, + disp_store, + disp_load_store, + disp_prefetch, + disp_imm, + disp_imm_32, + disp_imm_64, + disp_branch, + disp_cmp, + disp_jcc, + disp_last +}; + +/* Number of allowable groups in a dispatch window. It is an array + indexed by dispatch_group enum. 100 is used as a big number, + because the number of these kind of operations does not have any + effect in dispatch window, but we need them for other reasons in + the table. */ +static unsigned int num_allowable_groups[disp_last] = { + 0, 2, 1, 1, 2, 4, 4, 2, 1, BIG, BIG +}; + +char group_name[disp_last + 1][16] = { + "disp_no_group", "disp_load", "disp_store", "disp_load_store", + "disp_prefetch", "disp_imm", "disp_imm_32", "disp_imm_64", + "disp_branch", "disp_cmp", "disp_jcc", "disp_last" +}; + +/* Instruction path. */ +enum insn_path { + no_path = 0, + path_single, /* Single micro op. */ + path_double, /* Double micro op. */ + path_multi, /* Instructions with more than 2 micro op.. */ + last_path +}; + +/* sched_insn_info defines a window to the instructions scheduled in + the basic block. It contains a pointer to the insn_info table and + the instruction scheduled. + + Windows are allocated for each basic block and are linked + together. */ +typedef struct sched_insn_info_s { + rtx insn; + enum dispatch_group group; + enum insn_path path; + int byte_len; + int imm_bytes; +} sched_insn_info; + +/* Linked list of dispatch windows. This is a two way list of + dispatch windows of a basic block. It contains information about + the number of uops in the window and the total number of + instructions and of bytes in the object code for this dispatch + window. */ +typedef struct dispatch_windows_s { + int num_insn; /* Number of insn in the window. */ + int num_uops; /* Number of uops in the window. */ + int window_size; /* Number of bytes in the window. */ + int window_num; /* Window number between 0 or 1. */ + int num_imm; /* Number of immediates in an insn. */ + int num_imm_32; /* Number of 32 bit immediates in an insn. */ + int num_imm_64; /* Number of 64 bit immediates in an insn. */ + int imm_size; /* Total immediates in the window. */ + int num_loads; /* Total memory loads in the window. */ + int num_stores; /* Total memory stores in the window. */ + int violation; /* Violation exists in window. */ + sched_insn_info *window; /* Pointer to the window. */ + struct dispatch_windows_s *next; + struct dispatch_windows_s *prev; +} dispatch_windows; + +/* Immediate valuse used in an insn. */ +typedef struct imm_info_s + { + int imm; + int imm32; + int imm64; + } imm_info; + +static dispatch_windows *dispatch_window_list; +static dispatch_windows *dispatch_window_list1; + +/* Get dispatch group of insn. */ + +static enum dispatch_group +get_mem_group (rtx insn) +{ + enum attr_memory memory; + + if (INSN_CODE (insn) < 0) + return disp_no_group; + memory = get_attr_memory (insn); + if (memory == MEMORY_STORE) + return disp_store; + + if (memory == MEMORY_LOAD) + return disp_load; + + if (memory == MEMORY_BOTH) + return disp_load_store; + + return disp_no_group; +} + +/* Return true if insn is a compare instruction. */ + +static bool +is_cmp (rtx insn) +{ + enum attr_type type; + + type = get_attr_type (insn); + return (type == TYPE_TEST + || type == TYPE_ICMP + || type == TYPE_FCMP + || GET_CODE (PATTERN (insn)) == COMPARE); +} + +/* Return true if a dispatch violation encountered. */ + +static bool +dispatch_violation (void) +{ + if (dispatch_window_list->next) + return dispatch_window_list->next->violation; + return dispatch_window_list->violation; +} + +/* Return true if insn is a branch instruction. */ + +static bool +is_branch (rtx insn) +{ + return (CALL_P (insn) || JUMP_P (insn)); +} + +/* Return true if insn is a prefetch instruction. */ + +static bool +is_prefetch (rtx insn) +{ + return NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == PREFETCH; +} + +/* This function initializes a dispatch window and the list container holding a + pointer to the window. */ + +static void +init_window (int window_num) +{ + int i; + dispatch_windows *new_list; + + if (window_num == 0) + new_list = dispatch_window_list; + else + new_list = dispatch_window_list1; + + new_list->num_insn = 0; + new_list->num_uops = 0; + new_list->window_size = 0; + new_list->next = NULL; + new_list->prev = NULL; + new_list->window_num = window_num; + new_list->num_imm = 0; + new_list->num_imm_32 = 0; + new_list->num_imm_64 = 0; + new_list->imm_size = 0; + new_list->num_loads = 0; + new_list->num_stores = 0; + new_list->violation = false; + + for (i = 0; i < MAX_INSN; i++) + { + new_list->window[i].insn = NULL; + new_list->window[i].group = disp_no_group; + new_list->window[i].path = no_path; + new_list->window[i].byte_len = 0; + new_list->window[i].imm_bytes = 0; + } + return; +} + +/* This function allocates and initializes a dispatch window and the + list container holding a pointer to the window. */ + +static dispatch_windows * +allocate_window (void) +{ + dispatch_windows *new_list = XNEW (struct dispatch_windows_s); + new_list->window = XNEWVEC (struct sched_insn_info_s, MAX_INSN + 1); + + return new_list; +} + +/* This routine initializes the dispatch scheduling information. It + initiates building dispatch scheduler tables and constructs the + first dispatch window. */ + +static void +init_dispatch_sched (void) +{ + /* Allocate a dispatch list and a window. */ + dispatch_window_list = allocate_window (); + dispatch_window_list1 = allocate_window (); + init_window (0); + init_window (1); +} + +/* This function returns true if a branch is detected. End of a basic block + does not have to be a branch, but here we assume only branches end a + window. */ + +static bool +is_end_basic_block (enum dispatch_group group) +{ + return group == disp_branch; +} + +/* This function is called when the end of a window processing is reached. */ + +static void +process_end_window (void) +{ + gcc_assert (dispatch_window_list->num_insn <= MAX_INSN); + if (dispatch_window_list->next) + { + gcc_assert (dispatch_window_list1->num_insn <= MAX_INSN); + gcc_assert (dispatch_window_list->window_size + + dispatch_window_list1->window_size <= 48); + init_window (1); + } + init_window (0); +} + +/* Allocates a new dispatch window and adds it to WINDOW_LIST. + WINDOW_NUM is either 0 or 1. A maximum of two windows are generated + for 48 bytes of instructions. Note that these windows are not dispatch + windows that their sizes are DISPATCH_WINDOW_SIZE. */ + +static dispatch_windows * +allocate_next_window (int window_num) +{ + if (window_num == 0) + { + if (dispatch_window_list->next) + init_window (1); + init_window (0); + return dispatch_window_list; + } + + dispatch_window_list->next = dispatch_window_list1; + dispatch_window_list1->prev = dispatch_window_list; + + return dispatch_window_list1; +} + +/* Increment the number of immediate operands of an instruction. */ + +static int +find_constant_1 (rtx *in_rtx, imm_info *imm_values) +{ + if (*in_rtx == 0) + return 0; + + switch ( GET_CODE (*in_rtx)) + { + case CONST: + case SYMBOL_REF: + case CONST_INT: + (imm_values->imm)++; + if (x86_64_immediate_operand (*in_rtx, SImode)) + (imm_values->imm32)++; + else + (imm_values->imm64)++; + break; + + case CONST_DOUBLE: + (imm_values->imm)++; + (imm_values->imm64)++; + break; + + case CODE_LABEL: + if (LABEL_KIND (*in_rtx) == LABEL_NORMAL) + { + (imm_values->imm)++; + (imm_values->imm32)++; + } + break; + + default: + break; + } + + return 0; +} + +/* Compute number of immediate operands of an instruction. */ + +static void +find_constant (rtx in_rtx, imm_info *imm_values) +{ + for_each_rtx (INSN_P (in_rtx) ? &PATTERN (in_rtx) : &in_rtx, + (rtx_function) find_constant_1, (void *) imm_values); +} + +/* Return total size of immediate operands of an instruction along with number + of corresponding immediate-operands. It initializes its parameters to zero + befor calling FIND_CONSTANT. + INSN is the input instruction. IMM is the total of immediates. + IMM32 is the number of 32 bit immediates. IMM64 is the number of 64 + bit immediates. */ + +static int +get_num_immediates (rtx insn, int *imm, int *imm32, int *imm64) +{ + imm_info imm_values = {0, 0, 0}; + + find_constant (insn, &imm_values); + *imm = imm_values.imm; + *imm32 = imm_values.imm32; + *imm64 = imm_values.imm64; + return imm_values.imm32 * 4 + imm_values.imm64 * 8; +} + +/* This function indicates if an operand of an instruction is an + immediate. */ + +static bool +has_immediate (rtx insn) +{ + int num_imm_operand; + int num_imm32_operand; + int num_imm64_operand; + + if (insn) + return get_num_immediates (insn, &num_imm_operand, &num_imm32_operand, + &num_imm64_operand); + return false; +} + +/* Return single or double path for instructions. */ + +static enum insn_path +get_insn_path (rtx insn) +{ + enum attr_amdfam10_decode path = get_attr_amdfam10_decode (insn); + + if ((int)path == 0) + return path_single; + + if ((int)path == 1) + return path_double; + + return path_multi; +} + +/* Return insn dispatch group. */ + +static enum dispatch_group +get_insn_group (rtx insn) +{ + enum dispatch_group group = get_mem_group (insn); + if (group) + return group; + + if (is_branch (insn)) + return disp_branch; + + if (is_cmp (insn)) + return disp_cmp; + + if (has_immediate (insn)) + return disp_imm; + + if (is_prefetch (insn)) + return disp_prefetch; + + return disp_no_group; +} + +/* Count number of GROUP restricted instructions in a dispatch + window WINDOW_LIST. */ + +static int +count_num_restricted (rtx insn, dispatch_windows *window_list) +{ + enum dispatch_group group = get_insn_group (insn); + int imm_size; + int num_imm_operand; + int num_imm32_operand; + int num_imm64_operand; + + if (group == disp_no_group) + return 0; + + if (group == disp_imm) + { + imm_size = get_num_immediates (insn, &num_imm_operand, &num_imm32_operand, + &num_imm64_operand); + if (window_list->imm_size + imm_size > MAX_IMM_SIZE + || num_imm_operand + window_list->num_imm > MAX_IMM + || (num_imm32_operand > 0 + && (window_list->num_imm_32 + num_imm32_operand > MAX_IMM_32 + || window_list->num_imm_64 * 2 + num_imm32_operand > MAX_IMM_32)) + || (num_imm64_operand > 0 + && (window_list->num_imm_64 + num_imm64_operand > MAX_IMM_64 + || window_list->num_imm_32 + num_imm64_operand * 2 > MAX_IMM_32)) + || (window_list->imm_size + imm_size == MAX_IMM_SIZE + && num_imm64_operand > 0 + && ((window_list->num_imm_64 > 0 + && window_list->num_insn >= 2) + || window_list->num_insn >= 3))) + return BIG; + + return 1; + } + + if ((group == disp_load_store + && (window_list->num_loads >= MAX_LOAD + || window_list->num_stores >= MAX_STORE)) + || ((group == disp_load + || group == disp_prefetch) + && window_list->num_loads >= MAX_LOAD) + || (group == disp_store + && window_list->num_stores >= MAX_STORE)) + return BIG; + + return 1; +} + +/* This function returns true if insn satisfies dispatch rules on the + last window scheduled. */ + +static bool +fits_dispatch_window (rtx insn) +{ + dispatch_windows *window_list = dispatch_window_list; + dispatch_windows *window_list_next = dispatch_window_list->next; + unsigned int num_restrict; + enum dispatch_group group = get_insn_group (insn); + enum insn_path path = get_insn_path (insn); + int sum; + + /* Make disp_cmp and disp_jcc get scheduled at the latest. These + instructions should be given the lowest priority in the + scheduling process in Haifa scheduler to make sure they will be + scheduled in the same dispatch window as the refrence to them. */ + if (group == disp_jcc || group == disp_cmp) + return false; + + /* Check nonrestricted. */ + if (group == disp_no_group || group == disp_branch) + return true; + + /* Get last dispatch window. */ + if (window_list_next) + window_list = window_list_next; + + if (window_list->window_num == 1) + { + sum = window_list->prev->window_size + window_list->window_size; + + if (sum == 32 + || (min_insn_size (insn) + sum) >= 48) + /* Window 1 is full. Go for next window. */ + return true; + } + + num_restrict = count_num_restricted (insn, window_list); + + if (num_restrict > num_allowable_groups[group]) + return false; + + /* See if it fits in the first window. */ + if (window_list->window_num == 0) + { + /* The first widow should have only single and double path + uops. */ + if (path == path_double + && (window_list->num_uops + 2) > MAX_INSN) + return false; + else if (path != path_single) + return false; + } + return true; +} + +/* Add an instruction INSN with NUM_UOPS micro-operations to the + dispatch window WINDOW_LIST. */ + +static void +add_insn_window (rtx insn, dispatch_windows *window_list, int num_uops) +{ + int byte_len = min_insn_size (insn); + int num_insn = window_list->num_insn; + int imm_size; + sched_insn_info *window = window_list->window; + enum dispatch_group group = get_insn_group (insn); + enum insn_path path = get_insn_path (insn); + int num_imm_operand; + int num_imm32_operand; + int num_imm64_operand; + + if (!window_list->violation && group != disp_cmp + && !fits_dispatch_window (insn)) + window_list->violation = true; + + imm_size = get_num_immediates (insn, &num_imm_operand, &num_imm32_operand, + &num_imm64_operand); + + /* Initialize window with new instruction. */ + window[num_insn].insn = insn; + window[num_insn].byte_len = byte_len; + window[num_insn].group = group; + window[num_insn].path = path; + window[num_insn].imm_bytes = imm_size; + + window_list->window_size += byte_len; + window_list->num_insn = num_insn + 1; + window_list->num_uops = window_list->num_uops + num_uops; + window_list->imm_size += imm_size; + window_list->num_imm += num_imm_operand; + window_list->num_imm_32 += num_imm32_operand; + window_list->num_imm_64 += num_imm64_operand; + + if (group == disp_store) + window_list->num_stores += 1; + else if (group == disp_load + || group == disp_prefetch) + window_list->num_loads += 1; + else if (group == disp_load_store) + { + window_list->num_stores += 1; + window_list->num_loads += 1; + } +} + +/* Adds a scheduled instruction, INSN, to the current dispatch window. + If the total bytes of instructions or the number of instructions in + the window exceed allowable, it allocates a new window. */ + +static void +add_to_dispatch_window (rtx insn) +{ + int byte_len; + dispatch_windows *window_list; + dispatch_windows *next_list; + dispatch_windows *window0_list; + enum insn_path path; + enum dispatch_group insn_group; + bool insn_fits; + int num_insn; + int num_uops; + int window_num; + int insn_num_uops; + int sum; + + if (INSN_CODE (insn) < 0) + return; + + byte_len = min_insn_size (insn); + window_list = dispatch_window_list; + next_list = window_list->next; + path = get_insn_path (insn); + insn_group = get_insn_group (insn); + + /* Get the last dispatch window. */ + if (next_list) + window_list = dispatch_window_list->next; + + if (path == path_single) + insn_num_uops = 1; + else if (path == path_double) + insn_num_uops = 2; + else + insn_num_uops = (int) path; + + /* If current window is full, get a new window. + Window number zero is full, if MAX_INSN uops are scheduled in it. + Window number one is full, if window zero's bytes plus window + one's bytes is 32, or if the bytes of the new instruction added + to the total makes it greater than 48, or it has already MAX_INSN + instructions in it. */ + num_insn = window_list->num_insn; + num_uops = window_list->num_uops; + window_num = window_list->window_num; + insn_fits = fits_dispatch_window (insn); + + if (num_insn >= MAX_INSN + || num_uops + insn_num_uops > MAX_INSN + || !(insn_fits)) + { + window_num = ~window_num & 1; + window_list = allocate_next_window (window_num); + } + + if (window_num == 0) + { + add_insn_window (insn, window_list, insn_num_uops); + if (window_list->num_insn >= MAX_INSN + && insn_group == disp_branch) + { + process_end_window (); + return; + } + } + else if (window_num == 1) + { + window0_list = window_list->prev; + sum = window0_list->window_size + window_list->window_size; + if (sum == 32 + || (byte_len + sum) >= 48) + { + process_end_window (); + window_list = dispatch_window_list; + } + + add_insn_window (insn, window_list, insn_num_uops); + } + else + gcc_unreachable (); + + if (is_end_basic_block (insn_group)) + { + /* End of basic block is reached do end-basic-block process. */ + process_end_window (); + return; + } +} + +/* Print the dispatch window, WINDOW_NUM, to FILE. */ + +DEBUG_FUNCTION static void +debug_dispatch_window_file (FILE *file, int window_num) +{ + dispatch_windows *list; + int i; + + if (window_num == 0) + list = dispatch_window_list; + else + list = dispatch_window_list1; + + fprintf (file, "Window #%d:\n", list->window_num); + fprintf (file, " num_insn = %d, num_uops = %d, window_size = %d\n", + list->num_insn, list->num_uops, list->window_size); + fprintf (file, " num_imm = %d, num_imm_32 = %d, num_imm_64 = %d, imm_size = %d\n", + list->num_imm, list->num_imm_32, list->num_imm_64, list->imm_size); + + fprintf (file, " num_loads = %d, num_stores = %d\n", list->num_loads, + list->num_stores); + fprintf (file, " insn info:\n"); + + for (i = 0; i < MAX_INSN; i++) + { + if (!list->window[i].insn) + break; + fprintf (file, " group[%d] = %s, insn[%d] = %p, path[%d] = %d byte_len[%d] = %d, imm_bytes[%d] = %d\n", + i, group_name[list->window[i].group], + i, (void *)list->window[i].insn, + i, list->window[i].path, + i, list->window[i].byte_len, + i, list->window[i].imm_bytes); + } +} + +/* Print to stdout a dispatch window. */ + +DEBUG_FUNCTION void +debug_dispatch_window (int window_num) +{ + debug_dispatch_window_file (stdout, window_num); +} + +/* Print INSN dispatch information to FILE. */ + +DEBUG_FUNCTION static void +debug_insn_dispatch_info_file (FILE *file, rtx insn) +{ + int byte_len; + enum insn_path path; + enum dispatch_group group; + int imm_size; + int num_imm_operand; + int num_imm32_operand; + int num_imm64_operand; + + if (INSN_CODE (insn) < 0) + return; + + byte_len = min_insn_size (insn); + path = get_insn_path (insn); + group = get_insn_group (insn); + imm_size = get_num_immediates (insn, &num_imm_operand, &num_imm32_operand, + &num_imm64_operand); + + fprintf (file, " insn info:\n"); + fprintf (file, " group = %s, path = %d, byte_len = %d\n", + group_name[group], path, byte_len); + fprintf (file, " num_imm = %d, num_imm_32 = %d, num_imm_64 = %d, imm_size = %d\n", + num_imm_operand, num_imm32_operand, num_imm64_operand, imm_size); +} + +/* Print to STDERR the status of the ready list with respect to + dispatch windows. */ + +DEBUG_FUNCTION void +debug_ready_dispatch (void) +{ + int i; + int no_ready = number_in_ready (); + + fprintf (stdout, "Number of ready: %d\n", no_ready); + + for (i = 0; i < no_ready; i++) + debug_insn_dispatch_info_file (stdout, get_ready_element (i)); +} + +/* This routine is the driver of the dispatch scheduler. */ + +static void +do_dispatch (rtx insn, int mode) +{ + if (mode == DISPATCH_INIT) + init_dispatch_sched (); + else if (mode == ADD_TO_DISPATCH_WINDOW) + add_to_dispatch_window (insn); +} + +/* Return TRUE if Dispatch Scheduling is supported. */ + +static bool +has_dispatch (rtx insn, int action) +{ + if (ix86_tune == PROCESSOR_BDVER1 && flag_dispatch_scheduler) + switch (action) + { + default: + return false; + + case IS_DISPATCH_ON: + return true; + break; + + case IS_CMP: + return is_cmp (insn); + + case DISPATCH_VIOLATION: + return dispatch_violation (); + + case FITS_DISPATCH_WINDOW: + return fits_dispatch_window (insn); + } + + return false; +} + +/* ??? No autovectorization into MMX or 3DNOW until we can reliably + place emms and femms instructions. */ + +static unsigned int +ix86_units_per_simd_word (enum machine_mode mode) +{ + /* Disable double precision vectorizer if needed. */ + if (mode == DFmode && !TARGET_VECTORIZE_DOUBLE) + return UNITS_PER_WORD; + +#if 0 + /* FIXME: AVX has 32byte floating point vector operations and 16byte + integer vector operations. But vectorizer doesn't support + different sizes for integer and floating point vectors. We limit + vector size to 16byte. */ + if (TARGET_AVX) + return (mode == DFmode || mode == SFmode) ? 32 : 16; + else +#endif + return TARGET_SSE ? 16 : UNITS_PER_WORD; +} + /* Initialize the GCC target structure. */ #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY ix86_return_in_memory @@ -31598,6 +32744,11 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree) #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION ix86_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE ix86_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION ix86_option_optimization + #undef TARGET_REGISTER_MOVE_COST #define TARGET_REGISTER_MOVE_COST ix86_register_move_cost #undef TARGET_MEMORY_MOVE_COST @@ -31702,6 +32853,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree) #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD ix86_secondary_reload +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P ix86_class_likely_spilled_p + #undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST #define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST \ ix86_builtin_vectorization_cost @@ -31711,6 +32865,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree) #undef TARGET_VECTORIZE_BUILTIN_VEC_PERM_OK #define TARGET_VECTORIZE_BUILTIN_VEC_PERM_OK \ ix86_vectorize_builtin_vec_perm_ok +#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD +#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD \ + ix86_units_per_simd_word #undef TARGET_SET_CURRENT_FUNCTION #define TARGET_SET_CURRENT_FUNCTION ix86_set_current_function diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 9ef0a1b28eb..f868f98f79b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -90,7 +90,7 @@ enum stringop_alg unrolled_loop }; -#define NAX_STRINGOP_ALGS 4 +#define MAX_STRINGOP_ALGS 4 /* Specify what algorithm to use for stringops on known size. When size is unknown, the UNKNOWN_SIZE alg is used. When size is @@ -107,7 +107,7 @@ struct stringop_algs const struct stringop_strategy { const int max; const enum stringop_alg alg; - } size [NAX_STRINGOP_ALGS]; + } size [MAX_STRINGOP_ALGS]; }; /* Define the specific costs for a given cpu */ @@ -274,10 +274,10 @@ enum ix86_tune_indices { X86_TUNE_HIMODE_MATH, X86_TUNE_PROMOTE_QI_REGS, X86_TUNE_PROMOTE_HI_REGS, - X86_TUNE_ADD_ESP_4, - X86_TUNE_ADD_ESP_8, - X86_TUNE_SUB_ESP_4, - X86_TUNE_SUB_ESP_8, + X86_TUNE_SINGLE_POP, + X86_TUNE_DOUBLE_POP, + X86_TUNE_SINGLE_PUSH, + X86_TUNE_DOUBLE_PUSH, X86_TUNE_INTEGER_DFMODE_MOVES, X86_TUNE_PARTIAL_REG_DEPENDENCY, X86_TUNE_SSE_PARTIAL_REG_DEPENDENCY, @@ -299,6 +299,7 @@ enum ix86_tune_indices { X86_TUNE_USE_BT, X86_TUNE_USE_INCDEC, X86_TUNE_PAD_RETURNS, + X86_TUNE_PAD_SHORT_FUNCTION, X86_TUNE_EXT_80387_CONSTANTS, X86_TUNE_SHORTEN_X87_SSE, X86_TUNE_AVOID_VECTOR_DECODE, @@ -312,6 +313,7 @@ enum ix86_tune_indices { X86_TUNE_USE_VECTOR_CONVERTS, X86_TUNE_FUSE_CMP_AND_BRANCH, X86_TUNE_OPT_AGU, + X86_TUNE_VECTORIZE_DOUBLE, X86_TUNE_LAST }; @@ -348,10 +350,10 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST]; #define TARGET_HIMODE_MATH ix86_tune_features[X86_TUNE_HIMODE_MATH] #define TARGET_PROMOTE_QI_REGS ix86_tune_features[X86_TUNE_PROMOTE_QI_REGS] #define TARGET_PROMOTE_HI_REGS ix86_tune_features[X86_TUNE_PROMOTE_HI_REGS] -#define TARGET_ADD_ESP_4 ix86_tune_features[X86_TUNE_ADD_ESP_4] -#define TARGET_ADD_ESP_8 ix86_tune_features[X86_TUNE_ADD_ESP_8] -#define TARGET_SUB_ESP_4 ix86_tune_features[X86_TUNE_SUB_ESP_4] -#define TARGET_SUB_ESP_8 ix86_tune_features[X86_TUNE_SUB_ESP_8] +#define TARGET_SINGLE_POP ix86_tune_features[X86_TUNE_SINGLE_POP] +#define TARGET_DOUBLE_POP ix86_tune_features[X86_TUNE_DOUBLE_POP] +#define TARGET_SINGLE_PUSH ix86_tune_features[X86_TUNE_SINGLE_PUSH] +#define TARGET_DOUBLE_PUSH ix86_tune_features[X86_TUNE_DOUBLE_PUSH] #define TARGET_INTEGER_DFMODE_MOVES \ ix86_tune_features[X86_TUNE_INTEGER_DFMODE_MOVES] #define TARGET_PARTIAL_REG_DEPENDENCY \ @@ -384,6 +386,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST]; #define TARGET_USE_BT ix86_tune_features[X86_TUNE_USE_BT] #define TARGET_USE_INCDEC ix86_tune_features[X86_TUNE_USE_INCDEC] #define TARGET_PAD_RETURNS ix86_tune_features[X86_TUNE_PAD_RETURNS] +#define TARGET_PAD_SHORT_FUNCTION \ + ix86_tune_features[X86_TUNE_PAD_SHORT_FUNCTION] #define TARGET_EXT_80387_CONSTANTS \ ix86_tune_features[X86_TUNE_EXT_80387_CONSTANTS] #define TARGET_SHORTEN_X87_SSE ix86_tune_features[X86_TUNE_SHORTEN_X87_SSE] @@ -404,6 +408,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST]; #define TARGET_FUSE_CMP_AND_BRANCH \ ix86_tune_features[X86_TUNE_FUSE_CMP_AND_BRANCH] #define TARGET_OPT_AGU ix86_tune_features[X86_TUNE_OPT_AGU] +#define TARGET_VECTORIZE_DOUBLE \ + ix86_tune_features[X86_TUNE_VECTORIZE_DOUBLE] /* Feature tests against the various architecture variations. */ enum ix86_arch_indices { @@ -503,21 +509,6 @@ extern enum calling_abi ix86_abi; with the rounding mode forced to 53 bits. */ #define TARGET_96_ROUND_53_LONG_DOUBLE 0 -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - -#define OVERRIDE_OPTIONS override_options (true) - -/* Define this to change the optimizations performed by default. */ -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - optimization_options ((LEVEL), (SIZE)) - /* -march=native handling only makes sense with compiler running on an x86 or x86_64 chip. If changing this condition, also change the condition in driver-i386.c. */ @@ -555,15 +546,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #ifndef CC1_CPU_SPEC #define CC1_CPU_SPEC_1 "\ -%{mcpu=*:-mtune=%* \ -%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n} \ -%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. + (((BYTES) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD) + +/* If defined, the maximum amount of space required for outgoing arguments + will be computed and placed into the variable `crtl->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. MS ABI seem to require 16 byte alignment everywhere except for function prologue and apilogue. This is not possible without @@ -1588,8 +1529,9 @@ typedef struct ix86_args { int mmx_nregs; /* # mmx registers available for passing */ int mmx_regno; /* next available mmx register number */ int maybe_vaarg; /* true for calls to possibly vardic fncts. */ - int float_in_sse; /* 1 if in 32-bit mode SFmode (2 for DFmode) should - be passed in SSE registers. Otherwise 0. */ + int float_in_sse; /* Set to 1 or 2 for 32bit targets if + SFmode/DFmode arguments should be passed + in SSE registers. Otherwise 0. */ enum calling_abi call_abi; /* Set to SYSV_ABI for sysv abi. Otherwise MS_ABI for ms abi. */ } CUMULATIVE_ARGS; @@ -1776,8 +1718,10 @@ typedef struct ix86_args { #define X86_32_REGPARM_MAX 3 #define REGPARM_MAX \ - (TARGET_64BIT ? (TARGET_64BIT_MS_ABI ? X86_64_MS_REGPARM_MAX \ - : X86_64_REGPARM_MAX) \ + (TARGET_64BIT \ + ? (TARGET_64BIT_MS_ABI \ + ? X86_64_MS_REGPARM_MAX \ + : X86_64_REGPARM_MAX) \ : X86_32_REGPARM_MAX) #define X86_64_SSE_REGPARM_MAX 8 @@ -1786,12 +1730,13 @@ typedef struct ix86_args { #define X86_32_SSE_REGPARM_MAX (TARGET_SSE ? (TARGET_MACHO ? 4 : 3) : 0) #define SSE_REGPARM_MAX \ - (TARGET_64BIT ? (TARGET_64BIT_MS_ABI ? X86_64_MS_SSE_REGPARM_MAX \ - : X86_64_SSE_REGPARM_MAX) \ + (TARGET_64BIT \ + ? (TARGET_64BIT_MS_ABI \ + ? X86_64_MS_SSE_REGPARM_MAX \ + : X86_64_SSE_REGPARM_MAX) \ : X86_32_SSE_REGPARM_MAX) #define MMX_REGPARM_MAX (TARGET_64BIT ? 0 : (TARGET_MMX ? 3 : 0)) - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ @@ -2004,8 +1949,8 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; #define INCOMING_FRAME_SP_OFFSET UNITS_PER_WORD /* Describe how we implement __builtin_eh_return. */ -#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM) -#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 2) +#define EH_RETURN_DATA_REGNO(N) ((N) <= DX_REG ? (N) : INVALID_REGNUM) +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, CX_REG) /* Select a format to encode pointers in exception handling data. CODE @@ -2406,6 +2351,9 @@ struct GTY(()) machine_function { #define SYMBOL_REF_DLLEXPORT_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) != 0) +extern void debug_ready_dispatch (void); +extern void debug_dispatch_window (int); + /* Local variables: version-control: t diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 4d4e4c9c992..55086f3c12e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -59,6 +59,7 @@ ;; Y -- print condition for XOP pcom* instruction. ;; + -- print a branch hint as 'cs' or 'ds' prefix ;; ; -- print a semicolon (after prefixes due to bug in older gas). +;; @ -- print a segment register of thread base pointer load ;; UNSPEC usage: @@ -102,6 +103,7 @@ UNSPEC_REP UNSPEC_LD_MPIC ; load_macho_picbase UNSPEC_TRUNC_NOOP + UNSPEC_DIV_ALREADY_SPLIT ;; For SSE/MMX support: UNSPEC_FIX_NOTRUNC @@ -245,6 +247,7 @@ UNSPECV_LOCK UNSPECV_PROLOGUE_USE UNSPECV_CLD + UNSPECV_NOPS UNSPECV_VZEROALL UNSPECV_VZEROUPPER UNSPECV_RDTSC @@ -821,6 +824,12 @@ ;; Instruction suffix for integer modes. (define_mode_attr imodesuffix [(QI "b") (HI "w") (SI "l") (DI "q")]) +;; Pointer size prefix for integer modes (Intel asm dialect) +(define_mode_attr iptrsize [(QI "BYTE") + (HI "WORD") + (SI "DWORD") + (DI "QWORD")]) + ;; Register class for integer modes. (define_mode_attr r [(QI "q") (HI "r") (SI "r") (DI "r")]) @@ -858,6 +867,13 @@ (SI "immediate_operand") (DI "x86_64_immediate_operand")]) +;; Nonmemory operand predicate for integer modes. +(define_mode_attr nonmemory_operand + [(QI "nonmemory_operand") + (HI "nonmemory_operand") + (SI "nonmemory_operand") + (DI "x86_64_nonmemory_operand")]) + ;; Operand predicate for shifts. (define_mode_attr shift_operand [(QI "nonimmediate_operand") @@ -965,9 +981,7 @@ (define_expand "cmp_1" [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:SWI48 0 "nonimmediate_operand" "") - (match_operand:SWI48 1 "" "")))] - "" - "") + (match_operand:SWI48 1 "" "")))]) (define_insn "*cmp_ccno_1" [(set (reg FLAGS_REG) @@ -1052,9 +1066,7 @@ (match_operand 0 "ext_register_operand" "") (const_int 8) (const_int 8)) 0) - (match_operand:QI 1 "immediate_operand" "")))] - "" - "") + (match_operand:QI 1 "immediate_operand" "")))]) (define_insn "*cmpqi_ext_3_insn" [(set (reg FLAGS_REG) @@ -1592,58 +1604,7 @@ (set_attr "athlon_decode" "vector") (set_attr "amdfam10_decode" "direct")]) -;; Move instructions. - -(define_expand "movoi" - [(set (match_operand:OI 0 "nonimmediate_operand" "") - (match_operand:OI 1 "general_operand" ""))] - "TARGET_AVX" - "ix86_expand_move (OImode, operands); DONE;") - -(define_expand "movti" - [(set (match_operand:TI 0 "nonimmediate_operand" "") - (match_operand:TI 1 "nonimmediate_operand" ""))] - "TARGET_64BIT || TARGET_SSE" -{ - if (TARGET_64BIT) - ix86_expand_move (TImode, operands); - else if (push_operand (operands[0], TImode)) - ix86_expand_push (TImode, operands[1]); - else - ix86_expand_vector_move (TImode, operands); - DONE; -}) - -;; This expands to what emit_move_complex would generate if we didn't -;; have a movti pattern. Having this avoids problems with reload on -;; 32-bit targets when SSE is present, but doesn't seem to be harmful -;; to have around all the time. -(define_expand "movcdi" - [(set (match_operand:CDI 0 "nonimmediate_operand" "") - (match_operand:CDI 1 "general_operand" ""))] - "" -{ - if (push_operand (operands[0], CDImode)) - emit_move_complex_push (CDImode, operands[0], operands[1]); - else - emit_move_complex_parts (operands[0], operands[1]); - DONE; -}) - -(define_expand "mov" - [(set (match_operand:SWI1248x 0 "nonimmediate_operand" "") - (match_operand:SWI1248x 1 "general_operand" ""))] - "" - "ix86_expand_move (mode, operands); DONE;") - -;; Push/pop instructions. They are separate since autoinc/dec is not a -;; general_operand. -;; -;; %%% We don't use a post-inc memory reference because x86 is not a -;; general AUTO_INC_DEC host, which impacts how it is treated in flow. -;; Changing this impacts compiler performance on other non-AUTO_INC_DEC -;; targets without our curiosities, and it is just as easy to represent -;; this differently. +;; Push/pop instructions. (define_insn "*pushdi2_rex64" [(set (match_operand:DI 0 "push_operand" "=<,!<") @@ -1666,8 +1627,7 @@ "TARGET_64BIT && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) ;; We need to define this as both peepholer and splitter for case ;; peephole2 pass is not run. @@ -1680,7 +1640,7 @@ [(set (match_dup 0) (match_dup 1)) (set (match_dup 2) (match_dup 3))] { - split_di (&operands[1], 1, &operands[2], &operands[3]); + split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]); operands[1] = gen_lowpart (DImode, operands[2]); operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx, @@ -1697,7 +1657,7 @@ [(set (match_dup 0) (match_dup 1)) (set (match_dup 2) (match_dup 3))] { - split_di (&operands[1], 1, &operands[2], &operands[3]); + split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]); operands[1] = gen_lowpart (DImode, operands[2]); operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx, @@ -1730,7 +1690,7 @@ ;; "push a byte/word". But actually we use pushl, which has the effect ;; of rounding the amount pushed up to a word. -;; For 64BIT abi we always round up to 8 bytes. +;; For TARGET_64BIT we always round up to 8 bytes. (define_insn "*push2_rex64" [(set (match_operand:SWI124 0 "push_operand" "=X") (match_operand:SWI124 1 "nonmemory_no_elim_operand" "r"))] @@ -1756,47 +1716,66 @@ [(set_attr "type" "push") (set_attr "mode" "")]) -(define_insn "popdi1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r*m") - (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) - (plus:DI (reg:DI SP_REG) (const_int 8)))] - "TARGET_64BIT" - "pop{q}\t%0" - [(set_attr "type" "pop") - (set_attr "mode" "DI")]) - -(define_insn "popsi1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r*m") - (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) (const_int 4)))] - "!TARGET_64BIT" - "pop{l}\t%0" +(define_insn "*pop1" + [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") + (match_operand:P 1 "pop_operand" ">"))] + "" + "pop{}\t%0" [(set_attr "type" "pop") - (set_attr "mode" "SI")]) + (set_attr "mode" "")]) -(define_insn "*popdi1_epilogue" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r*m") - (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) - (plus:DI (reg:DI SP_REG) (const_int 8))) +(define_insn "*pop1_epilogue" + [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") + (match_operand:P 1 "pop_operand" ">")) (clobber (mem:BLK (scratch)))] - "TARGET_64BIT" - "pop{q}\t%0" + "" + "pop{}\t%0" [(set_attr "type" "pop") - (set_attr "mode" "DI")]) + (set_attr "mode" "")]) + +;; Move instructions. -(define_insn "*popsi1_epilogue" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r*m") - (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) (const_int 4))) - (clobber (mem:BLK (scratch)))] - "!TARGET_64BIT" - "pop{l}\t%0" - [(set_attr "type" "pop") - (set_attr "mode" "SI")]) +(define_expand "movoi" + [(set (match_operand:OI 0 "nonimmediate_operand" "") + (match_operand:OI 1 "general_operand" ""))] + "TARGET_AVX" + "ix86_expand_move (OImode, operands); DONE;") + +(define_expand "movti" + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (match_operand:TI 1 "nonimmediate_operand" ""))] + "TARGET_64BIT || TARGET_SSE" +{ + if (TARGET_64BIT) + ix86_expand_move (TImode, operands); + else if (push_operand (operands[0], TImode)) + ix86_expand_push (TImode, operands[1]); + else + ix86_expand_vector_move (TImode, operands); + DONE; +}) + +;; This expands to what emit_move_complex would generate if we didn't +;; have a movti pattern. Having this avoids problems with reload on +;; 32-bit targets when SSE is present, but doesn't seem to be harmful +;; to have around all the time. +(define_expand "movcdi" + [(set (match_operand:CDI 0 "nonimmediate_operand" "") + (match_operand:CDI 1 "general_operand" ""))] + "" +{ + if (push_operand (operands[0], CDImode)) + emit_move_complex_push (CDImode, operands[0], operands[1]); + else + emit_move_complex_parts (operands[0], operands[1]); + DONE; +}) + +(define_expand "mov" + [(set (match_operand:SWI1248x 0 "nonimmediate_operand" "") + (match_operand:SWI1248x 1 "general_operand" ""))] + "" + "ix86_expand_move (mode, operands); DONE;") (define_insn "*mov_xor" [(set (match_operand:SWI48 0 "register_operand" "=r") @@ -2059,8 +2038,7 @@ "TARGET_64BIT && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) ;; We need to define this as both peepholer and splitter for case ;; peephole2 pass is not run. @@ -2072,7 +2050,7 @@ && !x86_64_immediate_operand (operands[1], DImode) && 1" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] - "split_di (&operands[0], 2, &operands[2], &operands[4]);") + "split_double_mode (DImode, &operands[0], 2, &operands[2], &operands[4]);") (define_split [(set (match_operand:DI 0 "memory_operand" "") @@ -2083,7 +2061,7 @@ && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] - "split_di (&operands[0], 2, &operands[2], &operands[4]);") + "split_double_mode (DImode, &operands[0], 2, &operands[2], &operands[4]);") (define_insn "*movdi_internal" [(set (match_operand:DI 0 "nonimmediate_operand" @@ -2564,9 +2542,7 @@ [(set (zero_extract:SWI48 (match_operand 0 "ext_register_operand" "") (const_int 8) (const_int 8)) - (match_operand:SWI48 1 "nonmemory_operand" ""))] - "" - "") + (match_operand:SWI48 1 "nonmemory_operand" ""))]) (define_insn "*mov_insv_1_rex64" [(set (zero_extract:SWI48x (match_operand 0 "ext_register_operand" "+Q") @@ -2599,22 +2575,7 @@ [(set_attr "type" "imov") (set_attr "mode" "QI")]) -;; Floating point move instructions. - -(define_expand "movtf" - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "nonimmediate_operand" ""))] - "TARGET_SSE2" -{ - ix86_expand_move (TFmode, operands); - DONE; -}) - -(define_expand "mov" - [(set (match_operand:X87MODEF 0 "nonimmediate_operand" "") - (match_operand:X87MODEF 1 "general_operand" ""))] - "" - "ix86_expand_move (mode, operands); DONE;") +;; Floating point push instructions. (define_insn "*pushtf" [(set (match_operand:TF 0 "push_operand" "=<,<,<") @@ -2630,20 +2591,19 @@ (define_split [(set (match_operand:TF 0 "push_operand" "") + (match_operand:TF 1 "sse_reg_operand" ""))] + "TARGET_SSE2 && reload_completed" + [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -16))) + (set (mem:TF (reg:P SP_REG)) (match_dup 1))]) + +(define_split + [(set (match_operand:TF 0 "push_operand" "") (match_operand:TF 1 "general_operand" ""))] "TARGET_SSE2 && reload_completed && !SSE_REG_P (operands[1])" [(const_int 0)] "ix86_split_long_move (operands); DONE;") -(define_split - [(set (match_operand:TF 0 "push_operand" "") - (match_operand:TF 1 "any_fp_register_operand" ""))] - "TARGET_SSE2" - [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -16))) - (set (mem:TF (reg:P SP_REG)) (match_dup 1))] - "") - (define_insn "*pushxf" [(set (match_operand:XF 0 "push_operand" "=<,<") (match_operand:XF 1 "general_no_elim_operand" "f,ro"))] @@ -2676,7 +2636,7 @@ (define_split [(set (match_operand:XF 0 "push_operand" "") - (match_operand:XF 1 "any_fp_register_operand" ""))] + (match_operand:XF 1 "fp_register_operand" ""))] "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) (set (mem:XF (reg:P SP_REG)) (match_dup 1))] @@ -2686,7 +2646,7 @@ [(set (match_operand:XF 0 "push_operand" "") (match_operand:XF 1 "general_operand" ""))] "reload_completed - && !ANY_FP_REG_P (operands[1])" + && !FP_REG_P (operands[1])" [(const_int 0)] "ix86_split_long_move (operands); DONE;") @@ -2725,8 +2685,7 @@ (match_operand:DF 1 "any_fp_register_operand" ""))] "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -8))) - (set (mem:DF (reg:P SP_REG)) (match_dup 1))] - "") + (set (mem:DF (reg:P SP_REG)) (match_dup 1))]) (define_split [(set (match_operand:DF 0 "push_operand" "") @@ -2779,6 +2738,23 @@ [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) (set (mem:SF (reg:P SP_REG)) (match_dup 1))] "operands[2] = GEN_INT (-GET_MODE_SIZE (mode));") + +;; Floating point move instructions. + +(define_expand "movtf" + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "nonimmediate_operand" ""))] + "TARGET_SSE2" +{ + ix86_expand_move (TFmode, operands); + DONE; +}) + +(define_expand "mov" + [(set (match_operand:X87MODEF 0 "nonimmediate_operand" "") + (match_operand:X87MODEF 1 "general_operand" ""))] + "" + "ix86_expand_move (mode, operands); DONE;") (define_insn "*movtf_internal" [(set (match_operand:TF 0 "nonimmediate_operand" "=x,m,x,?r,?o") @@ -2895,12 +2871,12 @@ (match_operand:XF 1 "general_operand" ""))] "reload_completed && !(MEM_P (operands[0]) && MEM_P (operands[1])) - && ! (ANY_FP_REG_P (operands[0]) || + && ! (FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG - && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && FP_REG_P (SUBREG_REG (operands[0])))) + && ! (FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG - && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" + && FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] "ix86_split_long_move (operands); DONE;") @@ -3226,6 +3202,7 @@ case 3: case 4: return "#"; + case 5: switch (get_attr_mode (insn)) { @@ -3587,9 +3564,92 @@ ;; Zero extension instructions +(define_expand "zero_extendsidi2" + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] + "" +{ + if (!TARGET_64BIT) + { + emit_insn (gen_zero_extendsidi2_1 (operands[0], operands[1])); + DONE; + } +}) + +(define_insn "*zero_extendsidi2_rex64" + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*Y2") + (zero_extend:DI + (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] + "TARGET_64BIT" + "@ + mov\t{%k1, %k0|%k0, %k1} + # + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} + %vmovd\t{%1, %0|%0, %1} + %vmovd\t{%1, %0|%0, %1}" + [(set_attr "type" "imovx,imov,mmxmov,mmxmov,ssemov,ssemov") + (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex") + (set_attr "prefix_0f" "0,*,*,*,*,*") + (set_attr "mode" "SI,DI,DI,DI,TI,TI")]) + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (zero_extend:DI (match_dup 0)))] + "TARGET_64BIT" + [(set (match_dup 4) (const_int 0))] + "split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);") + +;; %%% Kill me once multi-word ops are sane. +(define_insn "zero_extendsidi2_1" + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?*y,?*Yi,*Y2") + (zero_extend:DI + (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT" + "@ + # + # + # + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} + %vmovd\t{%1, %0|%0, %1} + %vmovd\t{%1, %0|%0, %1}" + [(set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov") + (set_attr "prefix" "*,*,*,orig,orig,maybe_vex,maybe_vex") + (set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && reload_completed + && true_regnum (operands[0]) == true_regnum (operands[1])" + [(set (match_dup 4) (const_int 0))] + "split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);") + +(define_split + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && reload_completed + && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0]))" + [(set (match_dup 3) (match_dup 1)) + (set (match_dup 4) (const_int 0))] + "split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);") + +(define_insn "zero_extenddi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI + (match_operand:SWI12 1 "nonimmediate_operand" "m")))] + "TARGET_64BIT" + "movz{l|x}\t{%1, %k0|%k0, %1}" + [(set_attr "type" "imovx") + (set_attr "mode" "SI")]) + (define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))] + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))] "" { if (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)) @@ -3600,92 +3660,53 @@ } }) -(define_insn "zero_extendhisi2_and" +(define_insn_and_split "zero_extendhisi2_and" [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (match_operand:HI 1 "register_operand" "0"))) + (zero_extend:SI (match_operand:HI 1 "register_operand" "0"))) (clobber (reg:CC FLAGS_REG))] "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)" "#" - [(set_attr "type" "alu1") - (set_attr "mode" "SI")]) - -(define_split - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:HI 1 "register_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "reload_completed && TARGET_ZERO_EXTEND_WITH_AND - && optimize_function_for_speed_p (cfun)" + "&& reload_completed" [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 65535))) (clobber (reg:CC FLAGS_REG))])] - "") + "" + [(set_attr "type" "alu1") + (set_attr "mode" "SI")]) (define_insn "*zero_extendhisi2_movzwl" [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "rm")))] + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "rm")))] "!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)" "movz{wl|x}\t{%1, %0|%0, %1}" [(set_attr "type" "imovx") (set_attr "mode" "SI")]) -(define_expand "zero_extendqihi2" +(define_expand "zero_extendqi2" [(parallel - [(set (match_operand:HI 0 "register_operand" "") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") + [(set (match_operand:SWI24 0 "register_operand" "") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" ""))) + (clobber (reg:CC FLAGS_REG))])]) -(define_insn "*zero_extendqihi2_and" - [(set (match_operand:HI 0 "register_operand" "=r,?&q") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,qm"))) +(define_insn "*zero_extendqi2_and" + [(set (match_operand:SWI24 0 "register_operand" "=r,?&q") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" "0,qm"))) (clobber (reg:CC FLAGS_REG))] "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)" "#" [(set_attr "type" "alu1") - (set_attr "mode" "HI")]) - -(define_insn "*zero_extendqihi2_movzbw_and" - [(set (match_operand:HI 0 "register_operand" "=r,r") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm,0"))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)" - "#" - [(set_attr "type" "imovx,alu1") - (set_attr "mode" "HI")]) - -; zero extend to SImode here to avoid partial register stalls -(define_insn "*zero_extendqihi2_movzbl" - [(set (match_operand:HI 0 "register_operand" "=r") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))] - "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)) - && reload_completed" - "movz{bl|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) - -;; For the movzbw case strip only the clobber -(define_split - [(set (match_operand:HI 0 "register_operand" "") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "reload_completed - && (!TARGET_ZERO_EXTEND_WITH_AND - || optimize_function_for_size_p (cfun)) - && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" - [(set (match_operand:HI 0 "register_operand" "") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]) + (set_attr "mode" "")]) ;; When source and destination does not overlap, clear destination ;; first and then do the movb (define_split - [(set (match_operand:HI 0 "register_operand" "") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) + [(set (match_operand:SWI24 0 "register_operand" "") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] "reload_completed + && (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)) && ANY_QI_REG_P (operands[0]) - && (TARGET_ZERO_EXTEND_WITH_AND - && optimize_function_for_speed_p (cfun)) + && (ANY_QI_REG_P (operands[1]) || MEM_P (operands[1])) && !reg_overlap_mentioned_p (operands[0], operands[1])" [(set (strict_low_part (match_dup 2)) (match_dup 1))] { @@ -3693,206 +3714,61 @@ ix86_expand_clear (operands[0]); }) -;; Rest is handled by single and. -(define_split - [(set (match_operand:HI 0 "register_operand" "") - (zero_extend:HI (match_operand:QI 1 "register_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "reload_completed - && true_regnum (operands[0]) == true_regnum (operands[1])" - [(parallel [(set (match_dup 0) (and:HI (match_dup 0) (const_int 255))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_expand "zero_extendqisi2" - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") - -(define_insn "*zero_extendqisi2_and" - [(set (match_operand:SI 0 "register_operand" "=r,?&q") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0,qm"))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)" - "#" - [(set_attr "type" "alu1") - (set_attr "mode" "SI")]) - -(define_insn "*zero_extendqisi2_movzbl_and" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm,0"))) +(define_insn "*zero_extendqi2_movzbl_and" + [(set (match_operand:SWI24 0 "register_operand" "=r,r") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" "qm,0"))) (clobber (reg:CC FLAGS_REG))] "!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)" "#" [(set_attr "type" "imovx,alu1") - (set_attr "mode" "SI")]) - -(define_insn "*zero_extendqisi2_movzbl" - [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm")))] - "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)) - && reload_completed" - "movz{bl|x}\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) + (set_attr "mode" "")]) ;; For the movzbl case strip only the clobber (define_split - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) + [(set (match_operand:SWI24 0 "register_operand" "") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_dup 0) - (zero_extend:SI (match_dup 1)))]) + (zero_extend:SWI24 (match_dup 1)))]) -;; When source and destination does not overlap, clear destination -;; first and then do the movb -(define_split - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))] +; zero extend to SImode to avoid partial register stalls +(define_insn "*zero_extendqi2_movzbl" + [(set (match_operand:SWI24 0 "register_operand" "=r") + (zero_extend:SWI24 (match_operand:QI 1 "nonimmediate_operand" "qm")))] "reload_completed - && ANY_QI_REG_P (operands[0]) - && (ANY_QI_REG_P (operands[1]) || MEM_P (operands[1])) - && (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)) - && !reg_overlap_mentioned_p (operands[0], operands[1])" - [(set (strict_low_part (match_dup 2)) (match_dup 1))] -{ - operands[2] = gen_lowpart (QImode, operands[0]); - ix86_expand_clear (operands[0]); -}) + && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun))" + "movz{bl|x}\t{%1, %k0|%k0, %1}" + [(set_attr "type" "imovx") + (set_attr "mode" "SI")]) ;; Rest is handled by single and. (define_split - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "register_operand" ""))) + [(set (match_operand:SWI24 0 "register_operand" "") + (zero_extend:SWI24 (match_operand:QI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG))] "reload_completed && true_regnum (operands[0]) == true_regnum (operands[1])" - [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 255))) - (clobber (reg:CC FLAGS_REG))])] - "") - -;; %%% Kill me once multi-word ops are sane. -(define_expand "zero_extendsidi2" - [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] - "" -{ - if (!TARGET_64BIT) - { - emit_insn (gen_zero_extendsidi2_32 (operands[0], operands[1])); - DONE; - } -}) - -(define_insn "zero_extendsidi2_32" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?*y,?*Yi,*Y2") - (zero_extend:DI - (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_64BIT" - "@ - # - # - # - movd\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1}" - [(set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov") - (set_attr "prefix" "*,*,*,orig,orig,maybe_vex,maybe_vex") - (set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")]) - -(define_insn "zero_extendsidi2_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*Y2") - (zero_extend:DI - (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] - "TARGET_64BIT" - "@ - mov\t{%k1, %k0|%k0, %k1} - # - movd\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx,imov,mmxmov,mmxmov,ssemov,ssemov") - (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex") - (set_attr "prefix_0f" "0,*,*,*,*,*") - (set_attr "mode" "SI,DI,DI,DI,TI,TI")]) - -(define_split - [(set (match_operand:DI 0 "memory_operand" "") - (zero_extend:DI (match_dup 0)))] - "TARGET_64BIT" - [(set (match_dup 4) (const_int 0))] - "split_di (&operands[0], 1, &operands[3], &operands[4]);") - -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_64BIT && reload_completed - && true_regnum (operands[0]) == true_regnum (operands[1])" - [(set (match_dup 4) (const_int 0))] - "split_di (&operands[0], 1, &operands[3], &operands[4]);") - -(define_split - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_64BIT && reload_completed - && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0]))" - [(set (match_dup 3) (match_dup 1)) - (set (match_dup 4) (const_int 0))] - "split_di (&operands[0], 1, &operands[3], &operands[4]);") - -(define_insn "zero_extendhidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "rm")))] - "TARGET_64BIT" - "movz{wl|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) - -(define_insn "zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "rm")))] - "TARGET_64BIT" - "movz{bl|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) + [(parallel [(set (match_dup 0) (and:SWI24 (match_dup 0) (const_int 255))) + (clobber (reg:CC FLAGS_REG))])]) ;; Sign extension instructions (define_expand "extendsidi2" - [(parallel [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (match_scratch:SI 2 ""))])] + [(set (match_operand:DI 0 "register_operand" "") + (sign_extend:DI (match_operand:SI 1 "register_operand" "")))] "" { - if (TARGET_64BIT) + if (!TARGET_64BIT) { - emit_insn (gen_extendsidi2_rex64 (operands[0], operands[1])); + emit_insn (gen_extendsidi2_1 (operands[0], operands[1])); DONE; } }) -(define_insn "*extendsidi2_1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=*A,r,?r,?*o") - (sign_extend:DI (match_operand:SI 1 "register_operand" "0,0,r,r"))) - (clobber (reg:CC FLAGS_REG)) - (clobber (match_scratch:SI 2 "=X,X,X,&r"))] - "!TARGET_64BIT" - "#") - -(define_insn "extendsidi2_rex64" +(define_insn "*extendsidi2_rex64" [(set (match_operand:DI 0 "register_operand" "=*a,r") (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "*0,rm")))] "TARGET_64BIT" @@ -3904,21 +3780,13 @@ (set_attr "prefix_0f" "0") (set_attr "modrm" "0,1")]) -(define_insn "extendhidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (sign_extend:DI (match_operand:HI 1 "nonimmediate_operand" "rm")))] - "TARGET_64BIT" - "movs{wq|x}\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "DI")]) - -(define_insn "extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (sign_extend:DI (match_operand:QI 1 "nonimmediate_operand" "qm")))] - "TARGET_64BIT" - "movs{bq|x}\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "DI")]) +(define_insn "extendsidi2_1" + [(set (match_operand:DI 0 "nonimmediate_operand" "=*A,r,?r,?*o") + (sign_extend:DI (match_operand:SI 1 "register_operand" "0,0,r,r"))) + (clobber (reg:CC FLAGS_REG)) + (clobber (match_scratch:SI 2 "=X,X,X,&r"))] + "!TARGET_64BIT" + "#") ;; Extend to memory case when source register does die. (define_split @@ -3933,7 +3801,7 @@ (parallel [(set (match_dup 1) (ashiftrt:SI (match_dup 1) (const_int 31))) (clobber (reg:CC FLAGS_REG))]) (set (match_dup 4) (match_dup 1))] - "split_di (&operands[0], 1, &operands[3], &operands[4]);") + "split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);") ;; Extend to memory case when source register does not die. (define_split @@ -3944,7 +3812,7 @@ "reload_completed" [(const_int 0)] { - split_di (&operands[0], 1, &operands[3], &operands[4]); + split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]); emit_move_insn (operands[3], operands[1]); @@ -3974,7 +3842,7 @@ "reload_completed" [(const_int 0)] { - split_di (&operands[0], 1, &operands[3], &operands[4]); + split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]); if (true_regnum (operands[3]) != true_regnum (operands[1])) emit_move_insn (operands[3], operands[1]); @@ -3995,6 +3863,15 @@ DONE; }) +(define_insn "extenddi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI + (match_operand:SWI12 1 "nonimmediate_operand" "m")))] + "TARGET_64BIT" + "movs{q|x}\t{%1, %0|%0, %1}" + [(set_attr "type" "imovx") + (set_attr "mode" "DI")]) + (define_insn "extendhisi2" [(set (match_operand:SI 0 "register_operand" "=*a,r") (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "*0,rm")))] @@ -4024,7 +3901,8 @@ (define_insn "*extendhisi2_zext" [(set (match_operand:DI 0 "register_operand" "=*a,r") (zero_extend:DI - (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "*0,rm"))))] + (sign_extend:SI + (match_operand:HI 1 "nonimmediate_operand" "*0,rm"))))] "TARGET_64BIT" { switch (get_attr_prefix_0f (insn)) @@ -4048,6 +3926,23 @@ (const_string "0") (const_string "1")))]) +(define_insn "extendqisi2" + [(set (match_operand:SI 0 "register_operand" "=r") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm")))] + "" + "movs{bl|x}\t{%1, %0|%0, %1}" + [(set_attr "type" "imovx") + (set_attr "mode" "SI")]) + +(define_insn "*extendqisi2_zext" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm"))))] + "TARGET_64BIT" + "movs{bl|x}\t{%1, %k0|%k0, %1}" + [(set_attr "type" "imovx") + (set_attr "mode" "SI")]) + (define_insn "extendqihi2" [(set (match_operand:HI 0 "register_operand" "=*a,r") (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "*0,qm")))] @@ -4073,65 +3968,28 @@ (if_then_else (eq_attr "prefix_0f" "0") (const_string "0") (const_string "1")))]) - -(define_insn "extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=r") - (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm")))] - "" - "movs{bl|x}\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) - -(define_insn "*extendqisi2_zext" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI - (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm"))))] - "TARGET_64BIT" - "movs{bl|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) ;; Conversions between float and double. -;; These are all no-ops in the model used for the 80387. So just -;; emit moves. +;; These are all no-ops in the model used for the 80387. +;; So just emit moves. ;; %%% Kill these when call knows how to work out a DFmode push earlier. -(define_insn "*dummy_extendsfdf2" - [(set (match_operand:DF 0 "push_operand" "=<") - (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fY2")))] - "0" - "#") - (define_split [(set (match_operand:DF 0 "push_operand" "") (float_extend:DF (match_operand:SF 1 "fp_register_operand" "")))] - "" + "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -8))) (set (mem:DF (reg:P SP_REG)) (float_extend:DF (match_dup 1)))]) -(define_insn "*dummy_extendsfxf2" - [(set (match_operand:XF 0 "push_operand" "=<") - (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "f")))] - "0" - "#") - (define_split [(set (match_operand:XF 0 "push_operand" "") - (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))] - "" + (float_extend:XF (match_operand:MODEF 1 "fp_register_operand" "")))] + "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) (set (mem:XF (reg:P SP_REG)) (float_extend:XF (match_dup 1)))] "operands[2] = GEN_INT (-GET_MODE_SIZE (XFmode));") -(define_split - [(set (match_operand:XF 0 "push_operand" "") - (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))] - "" - [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) - (set (mem:DF (reg:P SP_REG)) (float_extend:XF (match_dup 1)))] - "operands[2] = GEN_INT (-GET_MODE_SIZE (XFmode));") - (define_expand "extendsfdf2" [(set (match_operand:DF 0 "nonimmediate_operand" "") (float_extend:DF (match_operand:SF 1 "general_operand" "")))] @@ -4345,8 +4203,7 @@ (define_expand "truncdfsf2_with_temp" [(parallel [(set (match_operand:SF 0 "" "") (float_truncate:SF (match_operand:DF 1 "" ""))) - (clobber (match_operand:SF 2 "" ""))])] - "") + (clobber (match_operand:SF 2 "" ""))])]) (define_insn "*truncdfsf_fast_mixed" [(set (match_operand:SF 0 "nonimmediate_operand" "=fm,x") @@ -4451,9 +4308,7 @@ "reload_completed" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] -{ - operands[1] = gen_rtx_REG (SFmode, true_regnum (operands[1])); -}) + "operands[1] = gen_rtx_REG (SFmode, true_regnum (operands[1]));") ;; Conversion from XFmode to {SF,DF}mode @@ -4474,9 +4329,9 @@ } else { - enum ix86_stack_slot slot = (virtuals_instantiated - ? SLOT_TEMP - : SLOT_VIRTUAL); + enum ix86_stack_slot slot = (virtuals_instantiated + ? SLOT_TEMP + : SLOT_VIRTUAL); operands[2] = assign_386_stack_local (mode, slot); } }) @@ -4534,8 +4389,7 @@ (clobber (match_operand:MODEF 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (float_truncate:MODEF (match_dup 1))) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) (define_split [(set (match_operand:MODEF 0 "memory_operand" "") @@ -4543,8 +4397,7 @@ (match_operand:XF 1 "register_operand" ""))) (clobber (match_operand:MODEF 2 "memory_operand" ""))] "TARGET_80387" - [(set (match_dup 0) (float_truncate:MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float_truncate:MODEF (match_dup 1)))]) ;; Signed conversion to DImode. @@ -4726,8 +4579,7 @@ "TARGET_SHORTEN_X87_SSE && !(TARGET_AVOID_VECTOR_DECODE && optimize_insn_for_speed_p ()) && peep2_reg_dead_p (2, operands[0])" - [(set (match_dup 2) (fix:SSEMODEI24 (match_dup 1)))] - "") + [(set (match_dup 2) (fix:SSEMODEI24 (match_dup 1)))]) ;; Avoid vector decoded forms of the instruction. (define_peephole2 @@ -4736,8 +4588,7 @@ (fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))] "TARGET_AVOID_VECTOR_DECODE && optimize_insn_for_speed_p ()" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))] - "") + (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))]) (define_peephole2 [(match_scratch:SF 2 "x") @@ -4745,8 +4596,7 @@ (fix:SSEMODEI24 (match_operand:SF 1 "memory_operand" "")))] "TARGET_AVOID_VECTOR_DECODE && optimize_insn_for_speed_p ()" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))] - "") + (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))]) (define_insn_and_split "fix_trunc_fisttp_i387_1" [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") @@ -4810,8 +4660,7 @@ "reload_completed" [(parallel [(set (match_dup 2) (fix:X87MODEI (match_dup 1))) (clobber (match_dup 3))]) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) (define_split [(set (match_operand:X87MODEI 0 "memory_operand" "") @@ -4820,8 +4669,7 @@ (clobber (match_scratch 3 ""))] "reload_completed" [(parallel [(set (match_dup 0) (fix:X87MODEI (match_dup 1))) - (clobber (match_dup 3))])] - "") + (clobber (match_dup 3))])]) ;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description ;; of the machinery. Please note the clobber of FLAGS_REG. In i387 control @@ -4902,8 +4750,7 @@ (use (match_dup 2)) (use (match_dup 3)) (clobber (match_dup 5))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:DI 0 "memory_operand" "") @@ -4916,8 +4763,7 @@ [(parallel [(set (match_dup 0) (fix:DI (match_dup 1))) (use (match_dup 2)) (use (match_dup 3)) - (clobber (match_dup 5))])] - "") + (clobber (match_dup 5))])]) (define_insn "fix_trunc_i387" [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") @@ -4956,8 +4802,7 @@ [(parallel [(set (match_dup 4) (fix:X87MODEI12 (match_dup 1))) (use (match_dup 2)) (use (match_dup 3))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") @@ -4968,15 +4813,15 @@ "reload_completed" [(parallel [(set (match_dup 0) (fix:X87MODEI12 (match_dup 1))) (use (match_dup 2)) - (use (match_dup 3))])] - "") + (use (match_dup 3))])]) (define_insn "x86_fnstcw_1" [(set (match_operand:HI 0 "memory_operand" "=m") (unspec:HI [(reg:HI FPCR_REG)] UNSPEC_FSTCW))] "TARGET_80387" "fnstcw\t%0" - [(set (attr "length") (symbol_ref "ix86_attr_length_address_default (insn) + 2")) + [(set (attr "length") + (symbol_ref "ix86_attr_length_address_default (insn) + 2")) (set_attr "mode" "HI") (set_attr "unit" "i387")]) @@ -4985,7 +4830,8 @@ (unspec:HI [(match_operand:HI 0 "memory_operand" "m")] UNSPEC_FLDCW))] "TARGET_80387" "fldcw\t%0" - [(set (attr "length") (symbol_ref "ix86_attr_length_address_default (insn) + 2")) + [(set (attr "length") + (symbol_ref "ix86_attr_length_address_default (insn) + 2")) (set_attr "mode" "HI") (set_attr "unit" "i387") (set_attr "athlon_decode" "vector") @@ -5001,8 +4847,7 @@ (float:X87MODEF (match_operand:HI 1 "nonimmediate_operand" "")))] "TARGET_80387 && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) - || TARGET_MIX_SSE_I387)" - "") + || TARGET_MIX_SSE_I387)") ;; Pre-reload splitter to add memory clobber to the pattern. (define_insn_and_split "*floathi2_1" @@ -5052,8 +4897,7 @@ || TARGET_MIX_SSE_I387) && reload_completed" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (float:X87MODEF (match_dup 2)))] - "") + (set (match_dup 0) (float:X87MODEF (match_dup 2)))]) (define_split [(set (match_operand:X87MODEF 0 "register_operand" "") @@ -5063,8 +4907,7 @@ && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && reload_completed" - [(set (match_dup 0) (float:X87MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:X87MODEF (match_dup 1)))]) (define_expand "float2" [(set (match_operand:X87MODEF 0 "register_operand" "") @@ -5189,8 +5032,7 @@ && (SSE_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))" - [(set (match_dup 0) (float:MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:MODEF (match_dup 1)))]) (define_split [(set (match_operand:MODEF 0 "register_operand" "") @@ -5204,8 +5046,7 @@ || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (float:MODEF (match_dup 2)))] - "") + (set (match_dup 0) (float:MODEF (match_dup 2)))]) (define_insn "*float2_mixed_interunit" [(set (match_operand:MODEF 0 "register_operand" "=f,x,x") @@ -5448,8 +5289,7 @@ && (SSE_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))" - [(set (match_dup 0) (float:MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:MODEF (match_dup 1)))]) (define_insn "*float2_sse_nointerunit" [(set (match_operand:MODEF 0 "register_operand" "=x") @@ -5484,8 +5324,7 @@ || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (float:MODEF (match_dup 2)))] - "") + (set (match_dup 0) (float:MODEF (match_dup 2)))]) (define_split [(set (match_operand:MODEF 0 "register_operand" "") @@ -5497,8 +5336,7 @@ && (SSE_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))" - [(set (match_dup 0) (float:MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:MODEF (match_dup 1)))]) (define_insn "*float2_i387_with_temp" [(set (match_operand:X87MODEF 0 "register_operand" "=f,f") @@ -5535,8 +5373,7 @@ && reload_completed && FP_REG_P (operands[0])" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (float:X87MODEF (match_dup 2)))] - "") + (set (match_dup 0) (float:X87MODEF (match_dup 2)))]) (define_split [(set (match_operand:X87MODEF 0 "register_operand" "") @@ -5546,8 +5383,7 @@ && X87_ENABLE_FLOAT (mode, mode) && reload_completed && FP_REG_P (operands[0])" - [(set (match_dup 0) (float:X87MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:X87MODEF (match_dup 1)))]) ;; Avoid store forwarding (partial memory) stall penalty ;; by passing DImode value through XMM registers. */ @@ -5605,8 +5441,7 @@ && !TARGET_64BIT && optimize_function_for_speed_p (cfun) && reload_completed && FP_REG_P (operands[0])" - [(set (match_dup 0) (float:X87MODEF (match_dup 1)))] - "") + [(set (match_dup 0) (float:X87MODEF (match_dup 1)))]) ;; Avoid store forwarding (partial memory) stall penalty by extending ;; SImode value to DImode through XMM register instead of pushing two @@ -5735,7 +5570,7 @@ (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0)) (match_dup 5)))) (clobber (reg:CC FLAGS_REG))])] - "split_ (&operands[0], 3, &operands[0], &operands[3]);") + "split_double_mode (mode, &operands[0], 3, &operands[0], &operands[3]);") (define_insn "*add3_cc" [(set (reg:CC FLAGS_REG) @@ -6176,8 +6011,7 @@ "TARGET_64BIT && reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(set (match_dup 0) - (plus:DI (match_dup 1) (match_dup 2)))] - "") + (plus:DI (match_dup 1) (match_dup 2)))]) ;; Convert lea to the lea pattern to avoid flags dependency. (define_split @@ -6766,7 +6600,7 @@ (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0)) (match_dup 5)))) (clobber (reg:CC FLAGS_REG))])] - "split_ (&operands[0], 3, &operands[0], &operands[3]);") + "split_double_mode (mode, &operands[0], 3, &operands[0], &operands[3]);") (define_insn "*sub_1" [(set (match_operand:SWI 0 "nonimmediate_operand" "=m,") @@ -6870,8 +6704,7 @@ (const_int 0)]) (match_operand:SWI 2 "" "")))) (clobber (reg:CC FLAGS_REG))])] - "ix86_binary_operator_ok (, mode, operands)" - "") + "ix86_binary_operator_ok (, mode, operands)") (define_insn "*3_carry" [(set (match_operand:SWI 0 "nonimmediate_operand" "=m,") @@ -6980,8 +6813,7 @@ (plusminus:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "TARGET_80387" - "") + "TARGET_80387") (define_expand "3" [(set (match_operand:MODEF 0 "register_operand" "") @@ -6989,8 +6821,7 @@ (match_operand:MODEF 1 "register_operand" "") (match_operand:MODEF 2 "nonimmediate_operand" "")))] "(TARGET_80387 && X87_ENABLE_ARITH (mode)) - || (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)" - "") + || (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)") ;; Multiply instructions @@ -6999,9 +6830,7 @@ (mult:SWIM248 (match_operand:SWIM248 1 "register_operand" "") (match_operand:SWIM248 2 "" ""))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") + (clobber (reg:CC FLAGS_REG))])]) (define_expand "mulqi3" [(parallel [(set (match_operand:QI 0 "register_operand" "") @@ -7009,8 +6838,7 @@ (match_operand:QI 1 "register_operand" "") (match_operand:QI 2 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "TARGET_QIMODE_MATH" - "") + "TARGET_QIMODE_MATH") ;; On AMDFAM10 ;; IMUL reg32/64, reg32/64, imm8 Direct @@ -7140,9 +6968,7 @@ (match_operand:DWIH 1 "nonimmediate_operand" "")) (any_extend: (match_operand:DWIH 2 "register_operand" "")))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") + (clobber (reg:CC FLAGS_REG))])]) (define_expand "mulqihi3" [(parallel [(set (match_operand:HI 0 "register_operand" "") @@ -7152,8 +6978,7 @@ (any_extend:HI (match_operand:QI 2 "register_operand" "")))) (clobber (reg:CC FLAGS_REG))])] - "TARGET_QIMODE_MATH" - "") + "TARGET_QIMODE_MATH") (define_insn "*mul3_1" [(set (match_operand: 0 "register_operand" "=A") @@ -7285,16 +7110,14 @@ [(set (match_operand:XF 0 "register_operand" "") (mult:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "TARGET_80387" - "") + "TARGET_80387") (define_expand "mul3" [(set (match_operand:MODEF 0 "register_operand" "") (mult:MODEF (match_operand:MODEF 1 "register_operand" "") (match_operand:MODEF 2 "nonimmediate_operand" "")))] "(TARGET_80387 && X87_ENABLE_ARITH (mode)) - || (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)" - "") + || (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)") ;; Divide instructions @@ -7304,16 +7127,14 @@ [(set (match_operand:XF 0 "register_operand" "") (div:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "TARGET_80387" - "") + "TARGET_80387") (define_expand "divdf3" [(set (match_operand:DF 0 "register_operand" "") (div:DF (match_operand:DF 1 "register_operand" "") (match_operand:DF 2 "nonimmediate_operand" "")))] "(TARGET_80387 && X87_ENABLE_ARITH (DFmode)) - || (TARGET_SSE2 && TARGET_SSE_MATH)" - "") + || (TARGET_SSE2 && TARGET_SSE_MATH)") (define_expand "divsf3" [(set (match_operand:SF 0 "register_operand" "") @@ -7334,6 +7155,117 @@ ;; Divmod instructions. +(define_expand "divmod4" + [(parallel [(set (match_operand:SWIM248 0 "register_operand" "") + (div:SWIM248 + (match_operand:SWIM248 1 "register_operand" "") + (match_operand:SWIM248 2 "nonimmediate_operand" ""))) + (set (match_operand:SWIM248 3 "register_operand" "") + (mod:SWIM248 (match_dup 1) (match_dup 2))) + (clobber (reg:CC FLAGS_REG))])]) + +;; Split with 8bit unsigned divide: +;; if (dividend an divisor are in [0-255]) +;; use 8bit unsigned integer divide +;; else +;; use original integer divide +(define_split + [(set (match_operand:SWI48 0 "register_operand" "") + (div:SWI48 (match_operand:SWI48 2 "register_operand" "") + (match_operand:SWI48 3 "nonimmediate_operand" ""))) + (set (match_operand:SWI48 1 "register_operand" "") + (mod:SWI48 (match_dup 2) (match_dup 3))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_8BIT_IDIV + && TARGET_QIMODE_MATH + && can_create_pseudo_p () + && !optimize_insn_for_size_p ()" + [(const_int 0)] + "ix86_split_idivmod (mode, operands, true); DONE;") + +(define_insn_and_split "divmod4_1" + [(set (match_operand:SWI48 0 "register_operand" "=a") + (div:SWI48 (match_operand:SWI48 2 "register_operand" "0") + (match_operand:SWI48 3 "nonimmediate_operand" "rm"))) + (set (match_operand:SWI48 1 "register_operand" "=&d") + (mod:SWI48 (match_dup 2) (match_dup 3))) + (unspec [(const_int 0)] UNSPEC_DIV_ALREADY_SPLIT) + (clobber (reg:CC FLAGS_REG))] + "" + "#" + "reload_completed" + [(parallel [(set (match_dup 1) + (ashiftrt:SWI48 (match_dup 4) (match_dup 5))) + (clobber (reg:CC FLAGS_REG))]) + (parallel [(set (match_dup 0) + (div:SWI48 (match_dup 2) (match_dup 3))) + (set (match_dup 1) + (mod:SWI48 (match_dup 2) (match_dup 3))) + (use (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode)-1); + + if (optimize_function_for_size_p (cfun) || TARGET_USE_CLTD) + operands[4] = operands[2]; + else + { + /* Avoid use of cltd in favor of a mov+shift. */ + emit_move_insn (operands[1], operands[2]); + operands[4] = operands[1]; + } +} + [(set_attr "type" "multi") + (set_attr "mode" "")]) + +(define_insn_and_split "*divmod4" + [(set (match_operand:SWIM248 0 "register_operand" "=a") + (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0") + (match_operand:SWIM248 3 "nonimmediate_operand" "rm"))) + (set (match_operand:SWIM248 1 "register_operand" "=&d") + (mod:SWIM248 (match_dup 2) (match_dup 3))) + (clobber (reg:CC FLAGS_REG))] + "" + "#" + "reload_completed" + [(parallel [(set (match_dup 1) + (ashiftrt:SWIM248 (match_dup 4) (match_dup 5))) + (clobber (reg:CC FLAGS_REG))]) + (parallel [(set (match_dup 0) + (div:SWIM248 (match_dup 2) (match_dup 3))) + (set (match_dup 1) + (mod:SWIM248 (match_dup 2) (match_dup 3))) + (use (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode)-1); + + if (mode != HImode + && (optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)) + operands[4] = operands[2]; + else + { + /* Avoid use of cltd in favor of a mov+shift. */ + emit_move_insn (operands[1], operands[2]); + operands[4] = operands[1]; + } +} + [(set_attr "type" "multi") + (set_attr "mode" "")]) + +(define_insn "*divmod4_noext" + [(set (match_operand:SWIM248 0 "register_operand" "=a") + (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0") + (match_operand:SWIM248 3 "nonimmediate_operand" "rm"))) + (set (match_operand:SWIM248 1 "register_operand" "=d") + (mod:SWIM248 (match_dup 2) (match_dup 3))) + (use (match_operand:SWIM248 4 "register_operand" "1")) + (clobber (reg:CC FLAGS_REG))] + "" + "idiv{}\t%3" + [(set_attr "type" "idiv") + (set_attr "mode" "")]) + (define_expand "divmodqi4" [(parallel [(set (match_operand:QI 0 "register_operand" "") (div:QI @@ -7371,44 +7303,6 @@ DONE; }) -(define_expand "udivmodqi4" - [(parallel [(set (match_operand:QI 0 "register_operand" "") - (udiv:QI - (match_operand:QI 1 "register_operand" "") - (match_operand:QI 2 "nonimmediate_operand" ""))) - (set (match_operand:QI 3 "register_operand" "") - (umod:QI (match_dup 1) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "TARGET_QIMODE_MATH" -{ - rtx div, mod, insn; - rtx tmp0, tmp1; - - tmp0 = gen_reg_rtx (HImode); - tmp1 = gen_reg_rtx (HImode); - - /* Extend operands[1] to HImode. Generate 8bit divide. Result is - in AX. */ - emit_insn (gen_zero_extendqihi2 (tmp1, operands[1])); - emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, operands[2])); - - /* Extract remainder from AH. */ - tmp1 = gen_rtx_ZERO_EXTRACT (SImode, tmp0, GEN_INT (8), GEN_INT (8)); - tmp1 = simplify_gen_subreg (QImode, tmp1, SImode, 0); - insn = emit_move_insn (operands[3], tmp1); - - mod = gen_rtx_UMOD (QImode, operands[1], operands[2]); - set_unique_reg_note (insn, REG_EQUAL, mod); - - /* Extract quotient from AL. */ - insn = emit_move_insn (operands[0], gen_lowpart (QImode, tmp0)); - - div = gen_rtx_UDIV (QImode, operands[1], operands[2]); - set_unique_reg_note (insn, REG_EQUAL, div); - - DONE; -}) - ;; Divide AX by r/m8, with result stored in ;; AL <- Quotient ;; AH <- Remainder @@ -7434,95 +7328,56 @@ [(set_attr "type" "idiv") (set_attr "mode" "QI")]) -(define_insn "udivmodhiqi3" - [(set (match_operand:HI 0 "register_operand" "=a") - (ior:HI - (ashift:HI - (zero_extend:HI - (truncate:QI - (mod:HI (match_operand:HI 1 "register_operand" "0") - (zero_extend:HI - (match_operand:QI 2 "nonimmediate_operand" "qm"))))) - (const_int 8)) - (zero_extend:HI - (truncate:QI - (div:HI (match_dup 1) (zero_extend:HI (match_dup 2))))))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_QIMODE_MATH" - "div{b}\t%2" - [(set_attr "type" "idiv") - (set_attr "mode" "QI")]) - -(define_expand "divmod4" +(define_expand "udivmod4" [(parallel [(set (match_operand:SWIM248 0 "register_operand" "") - (div:SWIM248 + (udiv:SWIM248 (match_operand:SWIM248 1 "register_operand" "") (match_operand:SWIM248 2 "nonimmediate_operand" ""))) (set (match_operand:SWIM248 3 "register_operand" "") - (mod:SWIM248 (match_dup 1) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") + (umod:SWIM248 (match_dup 1) (match_dup 2))) + (clobber (reg:CC FLAGS_REG))])]) -(define_insn_and_split "*divmod4" - [(set (match_operand:SWIM248 0 "register_operand" "=a") - (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0") - (match_operand:SWIM248 3 "nonimmediate_operand" "rm"))) - (set (match_operand:SWIM248 1 "register_operand" "=&d") - (mod:SWIM248 (match_dup 2) (match_dup 3))) +;; Split with 8bit unsigned divide: +;; if (dividend an divisor are in [0-255]) +;; use 8bit unsigned integer divide +;; else +;; use original integer divide +(define_split + [(set (match_operand:SWI48 0 "register_operand" "") + (udiv:SWI48 (match_operand:SWI48 2 "register_operand" "") + (match_operand:SWI48 3 "nonimmediate_operand" ""))) + (set (match_operand:SWI48 1 "register_operand" "") + (umod:SWI48 (match_dup 2) (match_dup 3))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_8BIT_IDIV + && TARGET_QIMODE_MATH + && can_create_pseudo_p () + && !optimize_insn_for_size_p ()" + [(const_int 0)] + "ix86_split_idivmod (mode, operands, false); DONE;") + +(define_insn_and_split "udivmod4_1" + [(set (match_operand:SWI48 0 "register_operand" "=a") + (udiv:SWI48 (match_operand:SWI48 2 "register_operand" "0") + (match_operand:SWI48 3 "nonimmediate_operand" "rm"))) + (set (match_operand:SWI48 1 "register_operand" "=&d") + (umod:SWI48 (match_dup 2) (match_dup 3))) + (unspec [(const_int 0)] UNSPEC_DIV_ALREADY_SPLIT) (clobber (reg:CC FLAGS_REG))] "" "#" "reload_completed" - [(parallel [(set (match_dup 1) - (ashiftrt:SWIM248 (match_dup 4) (match_dup 5))) - (clobber (reg:CC FLAGS_REG))]) + [(set (match_dup 1) (const_int 0)) (parallel [(set (match_dup 0) - (div:SWIM248 (match_dup 2) (match_dup 3))) + (udiv:SWI48 (match_dup 2) (match_dup 3))) (set (match_dup 1) - (mod:SWIM248 (match_dup 2) (match_dup 3))) + (umod:SWI48 (match_dup 2) (match_dup 3))) (use (match_dup 1)) (clobber (reg:CC FLAGS_REG))])] -{ - operands[5] = GEN_INT (GET_MODE_BITSIZE (mode)-1); - - if (mode != HImode - && (optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)) - operands[4] = operands[2]; - else - { - /* Avoid use of cltd in favor of a mov+shift. */ - emit_move_insn (operands[1], operands[2]); - operands[4] = operands[1]; - } -} - [(set_attr "type" "multi") - (set_attr "mode" "")]) - -(define_insn "*divmod4_noext" - [(set (match_operand:SWIM248 0 "register_operand" "=a") - (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0") - (match_operand:SWIM248 3 "nonimmediate_operand" "rm"))) - (set (match_operand:SWIM248 1 "register_operand" "=d") - (mod:SWIM248 (match_dup 2) (match_dup 3))) - (use (match_operand:SWIM248 4 "register_operand" "1")) - (clobber (reg:CC FLAGS_REG))] "" - "idiv{}\t%3" - [(set_attr "type" "idiv") + [(set_attr "type" "multi") (set_attr "mode" "")]) -(define_expand "udivmod4" - [(parallel [(set (match_operand:SWIM248 0 "register_operand" "") - (udiv:SWIM248 - (match_operand:SWIM248 1 "register_operand" "") - (match_operand:SWIM248 2 "nonimmediate_operand" ""))) - (set (match_operand:SWIM248 3 "register_operand" "") - (umod:SWIM248 (match_dup 1) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") - (define_insn_and_split "*udivmod4" [(set (match_operand:SWIM248 0 "register_operand" "=a") (udiv:SWIM248 (match_operand:SWIM248 2 "register_operand" "0") @@ -7557,26 +7412,83 @@ [(set_attr "type" "idiv") (set_attr "mode" "")]) -;; We cannot use div/idiv for double division, because it causes -;; "division by zero" on the overflow and that's not what we expect -;; from truncate. Because true (non truncating) double division is -;; never generated, we can't create this insn anyway. -; -;(define_insn "" -; [(set (match_operand:SI 0 "register_operand" "=a") -; (truncate:SI -; (udiv:DI (match_operand:DI 1 "register_operand" "A") -; (zero_extend:DI -; (match_operand:SI 2 "nonimmediate_operand" "rm"))))) -; (set (match_operand:SI 3 "register_operand" "=d") -; (truncate:SI -; (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2))))) -; (clobber (reg:CC FLAGS_REG))] -; "" -; "div{l}\t{%2, %0|%0, %2}" -; [(set_attr "type" "idiv")]) - -;;- Logical AND instructions +(define_expand "udivmodqi4" + [(parallel [(set (match_operand:QI 0 "register_operand" "") + (udiv:QI + (match_operand:QI 1 "register_operand" "") + (match_operand:QI 2 "nonimmediate_operand" ""))) + (set (match_operand:QI 3 "register_operand" "") + (umod:QI (match_dup 1) (match_dup 2))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_QIMODE_MATH" +{ + rtx div, mod, insn; + rtx tmp0, tmp1; + + tmp0 = gen_reg_rtx (HImode); + tmp1 = gen_reg_rtx (HImode); + + /* Extend operands[1] to HImode. Generate 8bit divide. Result is + in AX. */ + emit_insn (gen_zero_extendqihi2 (tmp1, operands[1])); + emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, operands[2])); + + /* Extract remainder from AH. */ + tmp1 = gen_rtx_ZERO_EXTRACT (SImode, tmp0, GEN_INT (8), GEN_INT (8)); + tmp1 = simplify_gen_subreg (QImode, tmp1, SImode, 0); + insn = emit_move_insn (operands[3], tmp1); + + mod = gen_rtx_UMOD (QImode, operands[1], operands[2]); + set_unique_reg_note (insn, REG_EQUAL, mod); + + /* Extract quotient from AL. */ + insn = emit_move_insn (operands[0], gen_lowpart (QImode, tmp0)); + + div = gen_rtx_UDIV (QImode, operands[1], operands[2]); + set_unique_reg_note (insn, REG_EQUAL, div); + + DONE; +}) + +(define_insn "udivmodhiqi3" + [(set (match_operand:HI 0 "register_operand" "=a") + (ior:HI + (ashift:HI + (zero_extend:HI + (truncate:QI + (mod:HI (match_operand:HI 1 "register_operand" "0") + (zero_extend:HI + (match_operand:QI 2 "nonimmediate_operand" "qm"))))) + (const_int 8)) + (zero_extend:HI + (truncate:QI + (div:HI (match_dup 1) (zero_extend:HI (match_dup 2))))))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_QIMODE_MATH" + "div{b}\t%2" + [(set_attr "type" "idiv") + (set_attr "mode" "QI")]) + +;; We cannot use div/idiv for double division, because it causes +;; "division by zero" on the overflow and that's not what we expect +;; from truncate. Because true (non truncating) double division is +;; never generated, we can't create this insn anyway. +; +;(define_insn "" +; [(set (match_operand:SI 0 "register_operand" "=a") +; (truncate:SI +; (udiv:DI (match_operand:DI 1 "register_operand" "A") +; (zero_extend:DI +; (match_operand:SI 2 "nonimmediate_operand" "rm"))))) +; (set (match_operand:SI 3 "register_operand" "=d") +; (truncate:SI +; (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2))))) +; (clobber (reg:CC FLAGS_REG))] +; "" +; "div{l}\t{%2, %0|%0, %2}" +; [(set_attr "type" "idiv")]) + +;;- Logical AND instructions ;; On Pentium, "test imm, reg" is pairable only with eax, ax, and al. ;; Note that this excludes ah. @@ -7586,17 +7498,21 @@ (compare:CCNO (and:SI (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "nonmemory_operand" "")) - (const_int 0)))] - "" - "") + (const_int 0)))]) (define_expand "testqi_ccz_1" [(set (reg:CCZ FLAGS_REG) (compare:CCZ (and:QI (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "nonmemory_operand" "")) - (const_int 0)))] - "" - "") + (const_int 0)))]) + +(define_expand "testdi_ccno_1" + [(set (reg:CCNO FLAGS_REG) + (compare:CCNO + (and:DI (match_operand:DI 0 "nonimmediate_operand" "") + (match_operand:DI 1 "x86_64_szext_general_operand" "")) + (const_int 0)))] + "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))") (define_insn "*testdi_1" [(set (reg FLAGS_REG) @@ -7666,9 +7582,7 @@ (const_int 8) (const_int 8)) (match_operand 1 "const_int_operand" "")) - (const_int 0)))] - "" - "") + (const_int 0)))]) (define_insn "*testqi_ext_0" [(set (reg FLAGS_REG) @@ -8598,9 +8512,7 @@ (match_dup 1) (const_int 8) (const_int 8)) - (match_dup 2)))])] - "" - "") + (match_dup 2)))])]) (define_insn "*xorqi_cc_ext_1_rex64" [(set (reg FLAGS_REG) @@ -8681,7 +8593,7 @@ [(set (match_dup 2) (neg:DWIH (match_dup 2))) (clobber (reg:CC FLAGS_REG))])] - "split_ (&operands[0], 2, &operands[0], &operands[2]);") + "split_double_mode (mode, &operands[0], 2, &operands[0], &operands[2]);") (define_insn "*neg2_1" [(set (match_operand:SWI 0 "nonimmediate_operand" "=m") @@ -8966,10 +8878,7 @@ (match_operand:CSGNMODE 2 "register_operand" "")] "(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) || (TARGET_SSE2 && (mode == TFmode))" -{ - ix86_expand_copysign (operands); - DONE; -}) + "ix86_expand_copysign (operands); DONE;") (define_insn_and_split "copysign3_const" [(set (match_operand:CSGNMODE 0 "register_operand" "=x") @@ -8983,10 +8892,7 @@ "#" "&& reload_completed" [(const_int 0)] -{ - ix86_split_copysign_const (operands); - DONE; -}) + "ix86_split_copysign_const (operands); DONE;") (define_insn "copysign3_var" [(set (match_operand:CSGNMODE 0 "register_operand" "=x,x,x,x,x") @@ -9014,10 +8920,7 @@ || (TARGET_SSE2 && (mode == TFmode))) && reload_completed" [(const_int 0)] -{ - ix86_split_copysign_var (operands); - DONE; -}) + "ix86_split_copysign_var (operands); DONE;") ;; One complement instructions @@ -9080,8 +8983,7 @@ (match_op_dup 2 [(xor:SWI (match_dup 3) (const_int -1)) (const_int 0)])) (set (match_dup 1) - (xor:SWI (match_dup 3) (const_int -1)))])] - "") + (xor:SWI (match_dup 3) (const_int -1)))])]) ;; ??? Currently never generated - xor is used instead. (define_insn "*one_cmplsi2_2_zext" @@ -9108,8 +9010,7 @@ (match_op_dup 2 [(xor:SI (match_dup 3) (const_int -1)) (const_int 0)])) (set (match_dup 1) - (zero_extend:DI (xor:SI (match_dup 3) (const_int -1))))])] - "") + (zero_extend:DI (xor:SI (match_dup 3) (const_int -1))))])]) ;; Shift instructions @@ -10171,7 +10072,7 @@ { operands[6] = GEN_INT (GET_MODE_BITSIZE (mode)); - split_ (&operands[0], 1, &operands[4], &operands[5]); + split_double_mode (mode, &operands[0], 1, &operands[4], &operands[5]); }) (define_insn_and_split "ix86_rotr3_doubleword" @@ -10199,7 +10100,7 @@ { operands[6] = GEN_INT (GET_MODE_BITSIZE (mode)); - split_ (&operands[0], 1, &operands[4], &operands[5]); + split_double_mode (mode, &operands[0], 1, &operands[4], &operands[5]); }) (define_insn "*3_1" @@ -10283,8 +10184,7 @@ && (TARGET_USE_XCHGB || optimize_function_for_size_p (cfun))" [(parallel [(set (strict_low_part (match_dup 0)) (bswap:HI (match_dup 0))) - (clobber (reg:CC FLAGS_REG))])] - "") + (clobber (reg:CC FLAGS_REG))])]) ;; Bit set / bit test instructions @@ -10593,9 +10493,7 @@ (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] -{ - PUT_MODE (operands[1], QImode); -}) + "PUT_MODE (operands[1], QImode);") (define_split [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) @@ -10604,9 +10502,7 @@ (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] -{ - PUT_MODE (operands[1], QImode); -}) + "PUT_MODE (operands[1], QImode);") (define_split [(set (match_operand:QI 0 "nonimmediate_operand" "") @@ -10735,9 +10631,7 @@ (if_then_else (match_dup 0) (label_ref (match_dup 1)) (pc)))] -{ - PUT_MODE (operands[0], VOIDmode); -}) + "PUT_MODE (operands[0], VOIDmode);") (define_split [(set (pc) @@ -11572,6 +11466,25 @@ (set_attr "length_immediate" "0") (set_attr "modrm" "0")]) +;; Generate nops. Operand 0 is the number of nops, up to 8. +(define_insn "nops" + [(unspec_volatile [(match_operand 0 "const_int_operand" "")] + UNSPECV_NOPS)] + "reload_completed" +{ + int num = INTVAL (operands[0]); + + gcc_assert (num >= 1 && num <= 8); + + while (num--) + fputs ("\tnop\n", asm_out_file); + + return ""; +} + [(set (attr "length") (symbol_ref "INTVAL (operands[0])")) + (set_attr "length_immediate" "0") + (set_attr "modrm" "0")]) + ;; Pad to 16-byte boundary, max skip in op0. Used to avoid ;; branch prediction penalty for the third jump in a 16-byte ;; block on K8. @@ -12222,53 +12135,30 @@ UNSPEC_TLS_GD)) (clobber (match_dup 4)) (clobber (match_dup 5)) - (clobber (reg:CC FLAGS_REG))])] - "") - -;; Load and add the thread base pointer from %gs:0. - -(define_insn "*load_tp_si" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(const_int 0)] UNSPEC_TP))] - "!TARGET_64BIT" - "mov{l}\t{%%gs:0, %0|%0, DWORD PTR gs:0}" - [(set_attr "type" "imov") - (set_attr "modrm" "0") - (set_attr "length" "7") - (set_attr "memory" "load") - (set_attr "imm_disp" "false")]) + (clobber (reg:CC FLAGS_REG))])]) -(define_insn "*add_tp_si" - [(set (match_operand:SI 0 "register_operand" "=r") - (plus:SI (unspec:SI [(const_int 0)] UNSPEC_TP) - (match_operand:SI 1 "register_operand" "0"))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_64BIT" - "add{l}\t{%%gs:0, %0|%0, DWORD PTR gs:0}" - [(set_attr "type" "alu") - (set_attr "modrm" "0") - (set_attr "length" "7") - (set_attr "memory" "load") - (set_attr "imm_disp" "false")]) +;; Segment register for the thread base ptr load +(define_mode_attr tp_seg [(SI "gs") (DI "fs")]) -(define_insn "*load_tp_di" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(const_int 0)] UNSPEC_TP))] - "TARGET_64BIT" - "mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}" +;; Load and add the thread base pointer from %gs:0. +(define_insn "*load_tp_" + [(set (match_operand:P 0 "register_operand" "=r") + (unspec:P [(const_int 0)] UNSPEC_TP))] + "" + "mov{}\t{%%:0, %0|%0, PTR :0}" [(set_attr "type" "imov") (set_attr "modrm" "0") (set_attr "length" "7") (set_attr "memory" "load") (set_attr "imm_disp" "false")]) -(define_insn "*add_tp_di" - [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (unspec:DI [(const_int 0)] UNSPEC_TP) - (match_operand:DI 1 "register_operand" "0"))) +(define_insn "*add_tp_" + [(set (match_operand:P 0 "register_operand" "=r") + (plus:P (unspec:P [(const_int 0)] UNSPEC_TP) + (match_operand:P 1 "register_operand" "0"))) (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT" - "add{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}" + "" + "add{}\t{%%:0, %0|%0, PTR :0}" [(set_attr "type" "alu") (set_attr "modrm" "0") (set_attr "length" "7") @@ -12402,8 +12292,6 @@ operands[4] = can_create_pseudo_p () ? gen_reg_rtx (Pmode) : operands[0]; emit_insn (gen_tls_dynamic_gnu2_64 (operands[4], operands[1])); }) - -;; ;; These patterns match the binary 387 instructions for addM3, subM3, ;; mulM3 and divM3. There are three patterns for each of DFmode and @@ -13188,8 +13076,7 @@ (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) && !(reload_completed || reload_in_progress)" - [(set (match_dup 1) (unspec:XF [(match_dup 2)] UNSPEC_SIN))] - "") + [(set (match_dup 1) (unspec:XF [(match_dup 2)] UNSPEC_SIN))]) (define_split [(set (match_operand:XF 0 "register_operand" "") @@ -13199,8 +13086,7 @@ (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) && !(reload_completed || reload_in_progress)" - [(set (match_dup 0) (unspec:XF [(match_dup 2)] UNSPEC_COS))] - "") + [(set (match_dup 0) (unspec:XF [(match_dup 2)] UNSPEC_COS))]) (define_insn "sincos_extendxf3_i387" [(set (match_operand:XF 0 "register_operand" "=f") @@ -13226,8 +13112,8 @@ (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SINCOS_SIN))] "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) && !(reload_completed || reload_in_progress)" - [(set (match_dup 1) (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SIN))] - "") + [(set (match_dup 1) + (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SIN))]) (define_split [(set (match_operand:XF 0 "register_operand" "") @@ -13238,8 +13124,8 @@ (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SINCOS_SIN))] "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) && !(reload_completed || reload_in_progress)" - [(set (match_dup 0) (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_COS))] - "") + [(set (match_dup 0) + (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_COS))]) (define_expand "sincos3" [(use (match_operand:MODEF 0 "register_operand" "")) @@ -13355,8 +13241,7 @@ UNSPEC_FPATAN)) (clobber (match_scratch:XF 3 ""))])] "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "") + && flag_unsafe_math_optimizations") (define_expand "atan23" [(use (match_operand:MODEF 0 "register_operand" "")) @@ -13707,9 +13592,7 @@ (unspec:XF [(match_dup 1)] UNSPEC_XTRACT_EXP))])] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" -{ - operands[2] = gen_reg_rtx (XFmode); -}) + "operands[2] = gen_reg_rtx (XFmode);") (define_expand "logb2" [(use (match_operand:MODEF 0 "register_operand" "")) @@ -14093,9 +13976,7 @@ (unspec:XF [(match_dup 1)] UNSPEC_XTRACT_EXP))])] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" -{ - operands[2] = gen_reg_rtx (XFmode); -}) + "operands[2] = gen_reg_rtx (XFmode);") (define_expand "significand2" [(use (match_operand:MODEF 0 "register_operand" "")) @@ -14238,8 +14119,7 @@ "reload_completed" [(parallel [(set (match_dup 2) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) (clobber (match_dup 3))]) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) (define_split [(set (match_operand:DI 0 "memory_operand" "") @@ -14249,8 +14129,7 @@ (clobber (match_scratch 3 ""))] "reload_completed" [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) - (clobber (match_dup 3))])] - "") + (clobber (match_dup 3))])]) (define_insn_and_split "*fist2_1" [(set (match_operand:X87MODEI12 0 "register_operand" "") @@ -14296,8 +14175,7 @@ (clobber (match_operand:X87MODEI12 2 "memory_operand" ""))] "reload_completed" [(set (match_dup 2) (unspec:X87MODEI12 [(match_dup 1)] UNSPEC_FIST)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) (define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") @@ -14305,23 +14183,20 @@ UNSPEC_FIST)) (clobber (match_operand:X87MODEI12 2 "memory_operand" ""))] "reload_completed" - [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] UNSPEC_FIST))] - "") + [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] UNSPEC_FIST))]) (define_expand "lrintxf2" [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST))] - "TARGET_USE_FANCY_MATH_387" - "") + "TARGET_USE_FANCY_MATH_387") (define_expand "lrint2" [(set (match_operand:SSEMODEI24 0 "nonimmediate_operand" "") (unspec:SSEMODEI24 [(match_operand:MODEF 1 "register_operand" "")] UNSPEC_FIX_NOTRUNC))] "SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH - && ((mode != DImode) || TARGET_64BIT)" - "") + && ((mode != DImode) || TARGET_64BIT)") (define_expand "lround2" [(match_operand:SSEMODEI24 0 "nonimmediate_operand" "") @@ -14502,8 +14377,7 @@ (use (match_dup 2)) (use (match_dup 3)) (clobber (match_dup 5))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:DI 0 "memory_operand" "") @@ -14517,8 +14391,7 @@ [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_FLOOR)) (use (match_dup 2)) (use (match_dup 3)) - (clobber (match_dup 5))])] - "") + (clobber (match_dup 5))])]) (define_insn "fist2_floor" [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") @@ -14559,8 +14432,7 @@ UNSPEC_FIST_FLOOR)) (use (match_dup 2)) (use (match_dup 3))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") @@ -14573,8 +14445,7 @@ [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] UNSPEC_FIST_FLOOR)) (use (match_dup 2)) - (use (match_dup 3))])] - "") + (use (match_dup 3))])]) (define_expand "lfloorxf2" [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") @@ -14583,8 +14454,7 @@ (clobber (reg:CC FLAGS_REG))])] "TARGET_USE_FANCY_MATH_387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) - && flag_unsafe_math_optimizations" - "") + && flag_unsafe_math_optimizations") (define_expand "lfloor2" [(match_operand:SWI48 0 "nonimmediate_operand" "") @@ -14764,8 +14634,7 @@ (use (match_dup 2)) (use (match_dup 3)) (clobber (match_dup 5))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:DI 0 "memory_operand" "") @@ -14779,8 +14648,7 @@ [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_CEIL)) (use (match_dup 2)) (use (match_dup 3)) - (clobber (match_dup 5))])] - "") + (clobber (match_dup 5))])]) (define_insn "fist2_ceil" [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") @@ -14821,8 +14689,7 @@ UNSPEC_FIST_CEIL)) (use (match_dup 2)) (use (match_dup 3))]) - (set (match_dup 0) (match_dup 4))] - "") + (set (match_dup 0) (match_dup 4))]) (define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") @@ -14835,8 +14702,7 @@ [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] UNSPEC_FIST_CEIL)) (use (match_dup 2)) - (use (match_dup 3))])] - "") + (use (match_dup 3))])]) (define_expand "lceilxf2" [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") @@ -14845,8 +14711,7 @@ (clobber (reg:CC FLAGS_REG))])] "TARGET_USE_FANCY_MATH_387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) - && flag_unsafe_math_optimizations" - "") + && flag_unsafe_math_optimizations") (define_expand "lceil2" [(match_operand:SWI48 0 "nonimmediate_operand" "") @@ -14996,7 +14861,6 @@ && flag_unsafe_math_optimizations" { emit_insn (gen_frndintxf2_mask_pm (operands[0], operands[1])); - DONE; }) @@ -15957,8 +15821,7 @@ (use (match_dup 3)) (clobber (match_dup 0)) (clobber (match_dup 1)) - (clobber (match_dup 2))])] - "") + (clobber (match_dup 2))])]) ;; ...and this one handles cmpstrn*_1. (define_peephole2 @@ -15993,10 +15856,7 @@ (use (reg:CC FLAGS_REG)) (clobber (match_dup 0)) (clobber (match_dup 1)) - (clobber (match_dup 2))])] - "") - - + (clobber (match_dup 2))])]) ;; Conditional move instructions. @@ -16021,9 +15881,7 @@ (const_int 0)]) (const_int -1) (const_int 0))) - (clobber (reg:CC FLAGS_REG))])] - "" - "") + (clobber (reg:CC FLAGS_REG))])]) (define_insn "*x86_movcc_0_m1" [(set (match_operand:SWI48 0 "register_operand" "=r") @@ -16183,8 +16041,8 @@ (match_dup 7) (match_dup 8)))] { - split_di (&operands[2], 2, &operands[5], &operands[7]); - split_di (&operands[0], 1, &operands[2], &operands[3]); + split_double_mode (DImode, &operands[2], 2, &operands[5], &operands[7]); + split_double_mode (DImode, &operands[0], 1, &operands[2], &operands[3]); }) (define_insn "*movxfcc_1" @@ -16312,11 +16170,13 @@ ;; 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]); + 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]);") + operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]), + GET_MODE (operands[2]), + operands[1], operands[0]);") ;; Conditional addition patterns (define_expand "addcc" @@ -16326,7 +16186,6 @@ (match_operand:SWI 3 "const_int_operand" "")] "" "if (ix86_expand_int_addcc (operands)) DONE; else FAIL;") - ;; Misc patterns (?) @@ -16650,33 +16509,21 @@ "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. ;; Don't push memory operands (define_peephole2 - [(set (match_operand:SI 0 "push_operand" "") - (match_operand:SI 1 "memory_operand" "")) - (match_scratch:SI 2 "r")] - "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY - && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") - -(define_peephole2 - [(set (match_operand:DI 0 "push_operand" "") - (match_operand:DI 1 "memory_operand" "")) - (match_scratch:DI 2 "r")] + [(set (match_operand:SWI 0 "push_operand" "") + (match_operand:SWI 1 "memory_operand" "")) + (match_scratch:SWI 2 "")] "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) -;; We need to handle SFmode only, because DFmode and XFmode is split to +;; We need to handle SFmode only, because DFmode and XFmode are split to ;; SImode pushes. (define_peephole2 [(set (match_operand:SF 0 "push_operand" "") @@ -16685,51 +16532,16 @@ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") - -(define_peephole2 - [(set (match_operand:HI 0 "push_operand" "") - (match_operand:HI 1 "memory_operand" "")) - (match_scratch:HI 2 "r")] - "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY - && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") - -(define_peephole2 - [(set (match_operand:QI 0 "push_operand" "") - (match_operand:QI 1 "memory_operand" "")) - (match_scratch:QI 2 "q")] - "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY - && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) ;; Don't move an immediate directly to memory when the instruction ;; gets too big. (define_peephole2 - [(match_scratch:SI 1 "r") - (set (match_operand:SI 0 "memory_operand" "") - (const_int 0))] - "optimize_insn_for_speed_p () - && ! TARGET_USE_MOV0 - && TARGET_SPLIT_LONG_MOVES - && get_attr_length (insn) >= ix86_cur_cost ()->large_insn - && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 1) (const_int 0)) - (clobber (reg:CC FLAGS_REG))]) - (set (match_dup 0) (match_dup 1))] - "") - -(define_peephole2 - [(match_scratch:HI 1 "r") - (set (match_operand:HI 0 "memory_operand" "") + [(match_scratch:SWI124 1 "") + (set (match_operand:SWI124 0 "memory_operand" "") (const_int 0))] "optimize_insn_for_speed_p () - && ! TARGET_USE_MOV0 + && !TARGET_USE_MOV0 && TARGET_SPLIT_LONG_MOVES && get_attr_length (insn) >= ix86_cur_cost ()->large_insn && peep2_regno_dead_p (0, FLAGS_REG)" @@ -16739,51 +16551,14 @@ "operands[2] = gen_lowpart (SImode, operands[1]);") (define_peephole2 - [(match_scratch:QI 1 "q") - (set (match_operand:QI 0 "memory_operand" "") - (const_int 0))] - "optimize_insn_for_speed_p () - && ! TARGET_USE_MOV0 - && TARGET_SPLIT_LONG_MOVES - && get_attr_length (insn) >= ix86_cur_cost ()->large_insn - && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 2) (const_int 0)) - (clobber (reg:CC FLAGS_REG))]) - (set (match_dup 0) (match_dup 1))] - "operands[2] = gen_lowpart (SImode, operands[1]);") - -(define_peephole2 - [(match_scratch:SI 2 "r") - (set (match_operand:SI 0 "memory_operand" "") - (match_operand:SI 1 "immediate_operand" ""))] + [(match_scratch:SWI124 2 "") + (set (match_operand:SWI124 0 "memory_operand" "") + (match_operand:SWI124 1 "immediate_operand" ""))] "optimize_insn_for_speed_p () && TARGET_SPLIT_LONG_MOVES && get_attr_length (insn) >= ix86_cur_cost ()->large_insn" [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") - -(define_peephole2 - [(match_scratch:HI 2 "r") - (set (match_operand:HI 0 "memory_operand" "") - (match_operand:HI 1 "immediate_operand" ""))] - "optimize_insn_for_speed_p () - && TARGET_SPLIT_LONG_MOVES - && get_attr_length (insn) >= ix86_cur_cost ()->large_insn" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") - -(define_peephole2 - [(match_scratch:QI 2 "q") - (set (match_operand:QI 0 "memory_operand" "") - (match_operand:QI 1 "immediate_operand" ""))] - "optimize_insn_for_speed_p () - && TARGET_SPLIT_LONG_MOVES - && get_attr_length (insn) >= ix86_cur_cost ()->large_insn" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) ;; Don't compare memory with zero, load and use a test instead. (define_peephole2 @@ -16794,8 +16569,7 @@ (match_scratch:SI 3 "r")] "optimize_insn_for_speed_p () && ix86_match_ccmode (insn, CCNOmode)" [(set (match_dup 3) (match_dup 2)) - (set (match_dup 0) (match_op_dup 1 [(match_dup 3) (const_int 0)]))] - "") + (set (match_dup 0) (match_op_dup 1 [(match_dup 3) (const_int 0)]))]) ;; NOT is not pairable on Pentium, while XOR is, but one byte longer. ;; Don't split NOTs with a displacement operand, because resulting XOR @@ -16809,46 +16583,18 @@ ;; lifetime information then. (define_peephole2 - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (not:SI (match_operand:SI 1 "nonimmediate_operand" "")))] - "optimize_insn_for_speed_p () - && ((TARGET_NOT_UNPAIRABLE - && (!MEM_P (operands[0]) - || !memory_displacement_operand (operands[0], SImode))) - || (TARGET_NOT_VECTORMODE && long_memory_operand (operands[0], SImode))) - && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) - (xor:SI (match_dup 1) (const_int -1))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_peephole2 - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (not:HI (match_operand:HI 1 "nonimmediate_operand" "")))] - "optimize_insn_for_speed_p () - && ((TARGET_NOT_UNPAIRABLE - && (!MEM_P (operands[0]) - || !memory_displacement_operand (operands[0], HImode))) - || (TARGET_NOT_VECTORMODE && long_memory_operand (operands[0], HImode))) - && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) - (xor:HI (match_dup 1) (const_int -1))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_peephole2 - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (not:QI (match_operand:QI 1 "nonimmediate_operand" "")))] + [(set (match_operand:SWI124 0 "nonimmediate_operand" "") + (not:SWI124 (match_operand:SWI124 1 "nonimmediate_operand" "")))] "optimize_insn_for_speed_p () && ((TARGET_NOT_UNPAIRABLE - && (!MEM_P (operands[0]) - || !memory_displacement_operand (operands[0], QImode))) - || (TARGET_NOT_VECTORMODE && long_memory_operand (operands[0], QImode))) + && (!MEM_P (operands[0]) + || !memory_displacement_operand (operands[0], mode))) + || (TARGET_NOT_VECTORMODE + && long_memory_operand (operands[0], mode))) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) - (xor:QI (match_dup 1) (const_int -1))) - (clobber (reg:CC FLAGS_REG))])] - "") + (xor:SWI124 (match_dup 1) (const_int -1))) + (clobber (reg:CC FLAGS_REG))])]) ;; Non pairable "test imm, reg" instructions can be translated to ;; "and imm, reg" if reg dies. The "and" form is also shorter (one @@ -16872,8 +16618,7 @@ (match_op_dup 1 [(and:SI (match_dup 2) (match_dup 3)) (const_int 0)])) (set (match_dup 2) - (and:SI (match_dup 2) (match_dup 3)))])] - "") + (and:SI (match_dup 2) (match_dup 3)))])]) ;; We don't need to handle HImode case, because it will be promoted to SImode ;; on ! TARGET_PARTIAL_REG_STALL @@ -16893,8 +16638,7 @@ (match_op_dup 1 [(and:QI (match_dup 2) (match_dup 3)) (const_int 0)])) (set (match_dup 2) - (and:QI (match_dup 2) (match_dup 3)))])] - "") + (and:QI (match_dup 2) (match_dup 3)))])]) (define_peephole2 [(set (match_operand 0 "flags_reg_operand" "") @@ -16927,8 +16671,7 @@ (match_dup 2) (const_int 8) (const_int 8)) - (match_dup 3)))])] - "") + (match_dup 3)))])]) ;; Don't do logical operations with memory inputs. (define_peephole2 @@ -16942,8 +16685,7 @@ [(set (match_dup 2) (match_dup 1)) (parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 0) (match_dup 2)])) - (clobber (reg:CC FLAGS_REG))])] - "") + (clobber (reg:CC FLAGS_REG))])]) (define_peephole2 [(match_scratch:SI 2 "r") @@ -16956,8 +16698,7 @@ [(set (match_dup 2) (match_dup 1)) (parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 2) (match_dup 0)])) - (clobber (reg:CC FLAGS_REG))])] - "") + (clobber (reg:CC FLAGS_REG))])]) ;; Prefer Load+RegOp to Mov+MemOp. Watch out for cases when the memory address ;; refers to the destination of the load! @@ -16991,8 +16732,7 @@ || (SSE_REG_P (operands[0]) && SSE_REG_P (operands[1])))" [(set (match_dup 0) (match_dup 2)) (set (match_dup 0) - (match_op_dup 3 [(match_dup 0) (match_dup 1)]))] - "") + (match_op_dup 3 [(match_dup 0) (match_dup 1)]))]) ; Don't do logical operations with memory outputs ; @@ -17014,8 +16754,7 @@ (parallel [(set (match_dup 2) (match_op_dup 3 [(match_dup 2) (match_dup 1)])) (clobber (reg:CC FLAGS_REG))]) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) (define_peephole2 [(match_scratch:SI 2 "r") @@ -17031,8 +16770,7 @@ (parallel [(set (match_dup 2) (match_op_dup 3 [(match_dup 1) (match_dup 2)])) (clobber (reg:CC FLAGS_REG))]) - (set (match_dup 0) (match_dup 2))] - "") + (set (match_dup 0) (match_dup 2))]) ;; Attempt to always use XOR for zeroing registers. (define_peephole2 @@ -17044,9 +16782,7 @@ && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (const_int 0)) (clobber (reg:CC FLAGS_REG))])] -{ - operands[0] = gen_lowpart (word_mode, operands[0]); -}) + "operands[0] = gen_lowpart (word_mode, operands[0]);") (define_peephole2 [(set (strict_low_part (match_operand 0 "register_operand" "")) @@ -17058,66 +16794,48 @@ [(parallel [(set (strict_low_part (match_dup 0)) (const_int 0)) (clobber (reg:CC FLAGS_REG))])]) -;; For HI and SI modes, or $-1,reg is smaller than mov $-1,reg. +;; For HI, SI and DI modes, or $-1,reg is smaller than mov $-1,reg. (define_peephole2 - [(set (match_operand 0 "register_operand" "") + [(set (match_operand:SWI248 0 "register_operand" "") (const_int -1))] - "(GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == SImode - || (GET_MODE (operands[0]) == DImode && TARGET_64BIT)) - && (optimize_insn_for_size_p () || TARGET_MOVE_M1_VIA_OR) + "(optimize_insn_for_size_p () || TARGET_MOVE_M1_VIA_OR) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (const_int -1)) (clobber (reg:CC FLAGS_REG))])] - "operands[0] = gen_lowpart (GET_MODE (operands[0]) == DImode ? DImode : SImode, - operands[0]);") +{ + if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (SImode)) + operands[0] = gen_lowpart (SImode, operands[0]); +}) + +;; Attempt to convert simple lea to add/shift. +;; These can be created by move expanders. -;; Attempt to convert simple leas to adds. These can be created by -;; move expanders. (define_peephole2 - [(set (match_operand:SI 0 "register_operand" "") - (plus:SI (match_dup 0) - (match_operand:SI 1 "nonmemory_operand" "")))] + [(set (match_operand:SWI48 0 "register_operand" "") + (plus:SWI48 (match_dup 0) + (match_operand:SWI48 1 "" "")))] "peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC FLAGS_REG))])] - "") + [(parallel [(set (match_dup 0) (plus:SWI48 (match_dup 0) (match_dup 1))) + (clobber (reg:CC FLAGS_REG))])]) (define_peephole2 [(set (match_operand:SI 0 "register_operand" "") (subreg:SI (plus:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "nonmemory_operand" "")) 0))] - "peep2_regno_dead_p (0, FLAGS_REG) && REGNO (operands[0]) == REGNO (operands[1])" + "TARGET_64BIT + && peep2_regno_dead_p (0, FLAGS_REG) + && REGNO (operands[0]) == REGNO (operands[1])" [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2))) (clobber (reg:CC FLAGS_REG))])] "operands[2] = gen_lowpart (SImode, operands[2]);") (define_peephole2 - [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_dup 0) - (match_operand:DI 1 "x86_64_general_operand" "")))] - "peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_peephole2 - [(set (match_operand:SI 0 "register_operand" "") - (mult:SI (match_dup 0) - (match_operand:SI 1 "const_int_operand" "")))] - "exact_log2 (INTVAL (operands[1])) >= 0 - && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));") - -(define_peephole2 - [(set (match_operand:DI 0 "register_operand" "") - (mult:DI (match_dup 0) - (match_operand:DI 1 "const_int_operand" "")))] + [(set (match_operand:SWI48 0 "register_operand" "") + (mult:SWI48 (match_dup 0) + (match_operand:SWI48 1 "const_int_operand" "")))] "exact_log2 (INTVAL (operands[1])) >= 0 && peep2_regno_dead_p (0, FLAGS_REG)" - [(parallel [(set (match_dup 0) (ashift:DI (match_dup 0) (match_dup 2))) + [(parallel [(set (match_dup 0) (ashift:SWI48 (match_dup 0) (match_dup 2))) (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));") @@ -17125,7 +16843,8 @@ [(set (match_operand:SI 0 "register_operand" "") (subreg:SI (mult:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "const_int_operand" "")) 0))] - "exact_log2 (INTVAL (operands[2])) >= 0 + "TARGET_64BIT + && exact_log2 (INTVAL (operands[2])) >= 0 && REGNO (operands[0]) == REGNO (operands[1]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2))) @@ -17133,12 +16852,13 @@ "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));") ;; The ESP adjustments can be done by the push and pop instructions. Resulting -;; code is shorter, since push is only 1 byte, while add imm, %esp 3 bytes. On -;; many CPUs it is also faster, since special hardware to avoid esp +;; code is shorter, since push is only 1 byte, while add imm, %esp is 3 bytes. +;; On many CPUs it is also faster, since special hardware to avoid esp ;; dependencies is present. -;; While some of these conversions may be done using splitters, we use peepholes -;; in order to allow combine_stack_adjustments pass to see nonobfuscated RTL. +;; While some of these conversions may be done using splitters, we use +;; peepholes in order to allow combine_stack_adjustments pass to see +;; nonobfuscated RTL. ;; Convert prologue esp subtractions to push. ;; We need register to push. In order to keep verify_flow_info happy we have @@ -17152,119 +16872,131 @@ ;; alternative when no register is available later. (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4" - [(clobber (match_dup 0)) - (parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) + "(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" + [(clobber (match_dup 1)) + (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) (clobber (mem:BLK (scratch)))])]) (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8" - [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) - (parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) + "(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" + [(clobber (match_dup 1)) + (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) + (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) (clobber (mem:BLK (scratch)))])]) ;; Convert esp subtractions to push. (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4" - [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))]) + "(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" + [(clobber (match_dup 1)) + (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8" - [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))]) + "(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" + [(clobber (match_dup 1)) + (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) + (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) ;; Convert epilogue deallocator to pop. (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_ADD_ESP_4" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) - (clobber (mem:BLK (scratch)))])] - "") + "(TARGET_SINGLE_POP || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" + [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) + (clobber (mem:BLK (scratch)))])]) -;; Two pops case is tricky, since pop causes dependency on destination register. -;; We use two registers if available. +;; Two pops case is tricky, since pop causes dependency +;; on destination register. We use two registers if available. (define_peephole2 - [(match_scratch:SI 0 "r") - (match_scratch:SI 1 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + [(match_scratch:P 1 "r") + (match_scratch:P 2 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_ADD_ESP_8" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + "(TARGET_DOUBLE_POP || optimize_insn_for_size_p ()) + && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" + [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 1) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] - "") + (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p ()" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + "optimize_insn_for_size_p () + && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" + [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] - "") + (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) ;; Convert esp additions to pop. (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] - "") + "INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" + [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) -;; Two pops case is tricky, since pop causes dependency on destination register. -;; We use two registers if available. +;; Two pops case is tricky, since pop causes dependency +;; on destination register. We use two registers if available. (define_peephole2 - [(match_scratch:SI 0 "r") - (match_scratch:SI 1 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + [(match_scratch:P 1 "r") + (match_scratch:P 2 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))]) - (parallel [(set (match_dup 1) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] - "") + "INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" + [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) + (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) (define_peephole2 - [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + [(match_scratch:P 1 "r") + (parallel [(set (reg:P SP_REG) + (plus:P (reg:P SP_REG) + (match_operand:P 0 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p ()" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))]) - (parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) - (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] - "") + "optimize_insn_for_size_p () + && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" + [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) + (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) ;; Convert compares with 1 to shorter inc/dec operations when CF is not ;; required and register dies. Similarly for 128 to -128. @@ -17281,144 +17013,28 @@ && peep2_reg_dead_p (1, operands[2])" [(parallel [(set (match_dup 0) (match_op_dup 1 [(match_dup 2) (match_dup 3)])) - (clobber (match_dup 2))])] - "") - -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4" - [(clobber (match_dup 0)) - (parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) - (clobber (mem:BLK (scratch)))])]) - -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8" - [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) - (parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) - (clobber (mem:BLK (scratch)))])]) - -;; Convert esp subtractions to push. -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) - (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4" - [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))]) - -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16))) - (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8" - [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))]) - -;; Convert epilogue deallocator to pop. -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_ADD_ESP_4" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) - (clobber (mem:BLK (scratch)))])] - "") - -;; Two pops case is tricky, since pop causes dependency on destination register. -;; We use two registers if available. -(define_peephole2 - [(match_scratch:DI 0 "r") - (match_scratch:DI 1 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () || !TARGET_ADD_ESP_8" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) - (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 1) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] - "") - -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p ()" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) - (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] - "") - -;; Convert esp additions to pop. -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) - (clobber (reg:CC FLAGS_REG))])] - "" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] - "") - -;; Two pops case is tricky, since pop causes dependency on destination register. -;; We use two registers if available. -(define_peephole2 - [(match_scratch:DI 0 "r") - (match_scratch:DI 1 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) - (clobber (reg:CC FLAGS_REG))])] - "" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))]) - (parallel [(set (match_dup 1) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] - "") - -(define_peephole2 - [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) - (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p ()" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))]) - (parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) - (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] - "") + (clobber (match_dup 2))])]) ;; Convert imul by three, five and nine into lea (define_peephole2 [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (mult:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "const_int_operand" ""))) + [(set (match_operand:SWI48 0 "register_operand" "") + (mult:SWI48 (match_operand:SWI48 1 "register_operand" "") + (match_operand:SWI48 2 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] "INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 5 || INTVAL (operands[2]) == 9" [(set (match_dup 0) - (plus:SI (mult:SI (match_dup 1) (match_dup 2)) - (match_dup 1)))] + (plus:SWI48 (mult:SWI48 (match_dup 1) (match_dup 2)) + (match_dup 1)))] "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);") (define_peephole2 [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (mult:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "const_int_operand" ""))) + [(set (match_operand:SWI48 0 "register_operand" "") + (mult:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "") + (match_operand:SWI48 2 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] "optimize_insn_for_speed_p () && (INTVAL (operands[2]) == 3 @@ -17426,69 +17042,23 @@ || INTVAL (operands[2]) == 9)" [(set (match_dup 0) (match_dup 1)) (set (match_dup 0) - (plus:SI (mult:SI (match_dup 0) (match_dup 2)) - (match_dup 0)))] - "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);") - -(define_peephole2 - [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (mult:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "TARGET_64BIT - && (INTVAL (operands[2]) == 3 - || INTVAL (operands[2]) == 5 - || INTVAL (operands[2]) == 9)" - [(set (match_dup 0) - (plus:DI (mult:DI (match_dup 1) (match_dup 2)) - (match_dup 1)))] + (plus:SWI48 (mult:SWI48 (match_dup 0) (match_dup 2)) + (match_dup 0)))] "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);") -(define_peephole2 - [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (mult:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "TARGET_64BIT - && optimize_insn_for_speed_p () - && (INTVAL (operands[2]) == 3 - || INTVAL (operands[2]) == 5 - || INTVAL (operands[2]) == 9)" - [(set (match_dup 0) (match_dup 1)) - (set (match_dup 0) - (plus:DI (mult:DI (match_dup 0) (match_dup 2)) - (match_dup 0)))] - "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);") - -;; Imul $32bit_imm, mem, reg is vector decoded, while +;; imul $32bit_imm, mem, reg is vector decoded, while ;; imul $32bit_imm, reg, reg is direct decoded. (define_peephole2 - [(match_scratch:DI 3 "r") - (parallel [(set (match_operand:DI 0 "register_operand" "") - (mult:DI (match_operand:DI 1 "memory_operand" "") - (match_operand:DI 2 "immediate_operand" ""))) + [(match_scratch:SWI48 3 "r") + (parallel [(set (match_operand:SWI48 0 "register_operand" "") + (mult:SWI48 (match_operand:SWI48 1 "memory_operand" "") + (match_operand:SWI48 2 "immediate_operand" ""))) (clobber (reg:CC FLAGS_REG))])] "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p () && !satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 1)) - (parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_peephole2 - [(match_scratch:SI 3 "r") - (parallel [(set (match_operand:SI 0 "register_operand" "") - (mult:SI (match_operand:SI 1 "memory_operand" "") - (match_operand:SI 2 "immediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p () - && !satisfies_constraint_K (operands[2])" - [(set (match_dup 3) (match_dup 1)) - (parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2))) - (clobber (reg:CC FLAGS_REG))])] - "") + (parallel [(set (match_dup 0) (mult:SWI48 (match_dup 3) (match_dup 2))) + (clobber (reg:CC FLAGS_REG))])]) (define_peephole2 [(match_scratch:SI 3 "r") @@ -17497,59 +17067,29 @@ (mult:SI (match_operand:SI 1 "memory_operand" "") (match_operand:SI 2 "immediate_operand" "")))) (clobber (reg:CC FLAGS_REG))])] - "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p () + "TARGET_64BIT + && TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p () && !satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 1)) (parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2)))) - (clobber (reg:CC FLAGS_REG))])] - "") + (clobber (reg:CC FLAGS_REG))])]) ;; imul $8/16bit_imm, regmem, reg is vector decoded. ;; Convert it into imul reg, reg ;; It would be better to force assembler to encode instruction using long ;; immediate, but there is apparently no way to do so. (define_peephole2 - [(parallel [(set (match_operand:DI 0 "register_operand" "") - (mult:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))]) - (match_scratch:DI 3 "r")] - "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p () - && satisfies_constraint_K (operands[2])" - [(set (match_dup 3) (match_dup 2)) - (parallel [(set (match_dup 0) (mult:DI (match_dup 0) (match_dup 3))) - (clobber (reg:CC FLAGS_REG))])] -{ - if (!rtx_equal_p (operands[0], operands[1])) - emit_move_insn (operands[0], operands[1]); -}) - -(define_peephole2 - [(parallel [(set (match_operand:SI 0 "register_operand" "") - (mult:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "const_int_operand" ""))) + [(parallel [(set (match_operand:SWI248 0 "register_operand" "") + (mult:SWI248 + (match_operand:SWI248 1 "nonimmediate_operand" "") + (match_operand:SWI248 2 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))]) - (match_scratch:SI 3 "r")] + (match_scratch:SWI248 3 "r")] "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p () && satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 2)) - (parallel [(set (match_dup 0) (mult:SI (match_dup 0) (match_dup 3))) - (clobber (reg:CC FLAGS_REG))])] -{ - if (!rtx_equal_p (operands[0], operands[1])) - emit_move_insn (operands[0], operands[1]); -}) - -(define_peephole2 - [(parallel [(set (match_operand:HI 0 "register_operand" "") - (mult:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:HI 2 "immediate_operand" ""))) - (clobber (reg:CC FLAGS_REG))]) - (match_scratch:HI 3 "r")] - "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p ()" - [(set (match_dup 3) (match_dup 2)) - (parallel [(set (match_dup 0) (mult:HI (match_dup 0) (match_dup 3))) + (parallel [(set (match_dup 0) (mult:SWI248 (match_dup 0) (match_dup 3))) (clobber (reg:CC FLAGS_REG))])] { if (!rtx_equal_p (operands[0], operands[1])) @@ -17863,66 +17403,40 @@ (match_operand 1 "memory_operand" "")] "" { + rtx (*insn)(rtx, rtx); + #ifdef TARGET_THREAD_SSP_OFFSET - if (TARGET_64BIT) - emit_insn (gen_stack_tls_protect_set_di (operands[0], - GEN_INT (TARGET_THREAD_SSP_OFFSET))); - else - emit_insn (gen_stack_tls_protect_set_si (operands[0], - GEN_INT (TARGET_THREAD_SSP_OFFSET))); + operands[1] = GEN_INT (TARGET_THREAD_SSP_OFFSET); + insn = (TARGET_64BIT + ? gen_stack_tls_protect_set_di + : gen_stack_tls_protect_set_si); #else - if (TARGET_64BIT) - emit_insn (gen_stack_protect_set_di (operands[0], operands[1])); - else - emit_insn (gen_stack_protect_set_si (operands[0], operands[1])); + insn = (TARGET_64BIT + ? gen_stack_protect_set_di + : gen_stack_protect_set_si); #endif + + emit_insn (insn (operands[0], operands[1])); DONE; }) -(define_insn "stack_protect_set_si" - [(set (match_operand:SI 0 "memory_operand" "=m") - (unspec:SI [(match_operand:SI 1 "memory_operand" "m")] UNSPEC_SP_SET)) - (set (match_scratch:SI 2 "=&r") (const_int 0)) +(define_insn "stack_protect_set_" + [(set (match_operand:P 0 "memory_operand" "=m") + (unspec:P [(match_operand:P 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:P 2 "=&r") (const_int 0)) (clobber (reg:CC FLAGS_REG))] "" - "mov{l}\t{%1, %2|%2, %1}\;mov{l}\t{%2, %0|%0, %2}\;xor{l}\t%2, %2" - [(set_attr "type" "multi")]) - -(define_insn "stack_protect_set_di" - [(set (match_operand:DI 0 "memory_operand" "=m") - (unspec:DI [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_SP_SET)) - (set (match_scratch:DI 2 "=&r") (const_int 0)) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT" - "mov{q}\t{%1, %2|%2, %1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" + "mov{}\t{%1, %2|%2, %1}\;mov{}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" [(set_attr "type" "multi")]) -(define_insn "stack_tls_protect_set_si" - [(set (match_operand:SI 0 "memory_operand" "=m") - (unspec:SI [(match_operand:SI 1 "const_int_operand" "i")] - UNSPEC_SP_TLS_SET)) - (set (match_scratch:SI 2 "=&r") (const_int 0)) +(define_insn "stack_tls_protect_set_" + [(set (match_operand:P 0 "memory_operand" "=m") + (unspec:P [(match_operand:P 1 "const_int_operand" "i")] + UNSPEC_SP_TLS_SET)) + (set (match_scratch:P 2 "=&r") (const_int 0)) (clobber (reg:CC FLAGS_REG))] "" - "mov{l}\t{%%gs:%P1, %2|%2, DWORD PTR gs:%P1}\;mov{l}\t{%2, %0|%0, %2}\;xor{l}\t%2, %2" - [(set_attr "type" "multi")]) - -(define_insn "stack_tls_protect_set_di" - [(set (match_operand:DI 0 "memory_operand" "=m") - (unspec:DI [(match_operand:DI 1 "const_int_operand" "i")] - UNSPEC_SP_TLS_SET)) - (set (match_scratch:DI 2 "=&r") (const_int 0)) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT" - { - /* The kernel uses a different segment register for performance reasons; a - system call would not have to trash the userspace segment register, - which would be expensive */ - if (ix86_cmodel != CM_KERNEL) - return "mov{q}\t{%%fs:%P1, %2|%2, QWORD PTR fs:%P1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"; - else - return "mov{q}\t{%%gs:%P1, %2|%2, QWORD PTR gs:%P1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"; - } + "mov{}\t{%@:%P1, %2|%2, PTR %@:%P1}\;mov{}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" [(set_attr "type" "multi")]) (define_expand "stack_protect_test" @@ -17933,71 +17447,44 @@ { rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG); + rtx (*insn)(rtx, rtx, rtx); + #ifdef TARGET_THREAD_SSP_OFFSET - if (TARGET_64BIT) - emit_insn (gen_stack_tls_protect_test_di (flags, operands[0], - GEN_INT (TARGET_THREAD_SSP_OFFSET))); - else - emit_insn (gen_stack_tls_protect_test_si (flags, operands[0], - GEN_INT (TARGET_THREAD_SSP_OFFSET))); + operands[1] = GEN_INT (TARGET_THREAD_SSP_OFFSET); + insn = (TARGET_64BIT + ? gen_stack_tls_protect_test_di + : gen_stack_tls_protect_test_si); #else - if (TARGET_64BIT) - emit_insn (gen_stack_protect_test_di (flags, operands[0], operands[1])); - else - emit_insn (gen_stack_protect_test_si (flags, operands[0], operands[1])); + insn = (TARGET_64BIT + ? gen_stack_protect_test_di + : gen_stack_protect_test_si); #endif + emit_insn (insn (flags, operands[0], operands[1])); + emit_jump_insn (gen_cbranchcc4 (gen_rtx_EQ (VOIDmode, flags, const0_rtx), flags, const0_rtx, operands[2])); DONE; }) -(define_insn "stack_protect_test_si" +(define_insn "stack_protect_test_" [(set (match_operand:CCZ 0 "flags_reg_operand" "") - (unspec:CCZ [(match_operand:SI 1 "memory_operand" "m") - (match_operand:SI 2 "memory_operand" "m")] + (unspec:CCZ [(match_operand:P 1 "memory_operand" "m") + (match_operand:P 2 "memory_operand" "m")] UNSPEC_SP_TEST)) - (clobber (match_scratch:SI 3 "=&r"))] + (clobber (match_scratch:P 3 "=&r"))] "" - "mov{l}\t{%1, %3|%3, %1}\;xor{l}\t{%2, %3|%3, %2}" - [(set_attr "type" "multi")]) - -(define_insn "stack_protect_test_di" - [(set (match_operand:CCZ 0 "flags_reg_operand" "") - (unspec:CCZ [(match_operand:DI 1 "memory_operand" "m") - (match_operand:DI 2 "memory_operand" "m")] - UNSPEC_SP_TEST)) - (clobber (match_scratch:DI 3 "=&r"))] - "TARGET_64BIT" - "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%2, %3|%3, %2}" + "mov{}\t{%1, %3|%3, %1}\;xor{}\t{%2, %3|%3, %2}" [(set_attr "type" "multi")]) -(define_insn "stack_tls_protect_test_si" +(define_insn "stack_tls_protect_test_" [(set (match_operand:CCZ 0 "flags_reg_operand" "") - (unspec:CCZ [(match_operand:SI 1 "memory_operand" "m") - (match_operand:SI 2 "const_int_operand" "i")] + (unspec:CCZ [(match_operand:P 1 "memory_operand" "m") + (match_operand:P 2 "const_int_operand" "i")] UNSPEC_SP_TLS_TEST)) - (clobber (match_scratch:SI 3 "=r"))] + (clobber (match_scratch:P 3 "=r"))] "" - "mov{l}\t{%1, %3|%3, %1}\;xor{l}\t{%%gs:%P2, %3|%3, DWORD PTR gs:%P2}" - [(set_attr "type" "multi")]) - -(define_insn "stack_tls_protect_test_di" - [(set (match_operand:CCZ 0 "flags_reg_operand" "") - (unspec:CCZ [(match_operand:DI 1 "memory_operand" "m") - (match_operand:DI 2 "const_int_operand" "i")] - UNSPEC_SP_TLS_TEST)) - (clobber (match_scratch:DI 3 "=r"))] - "TARGET_64BIT" - { - /* The kernel uses a different segment register for performance reasons; a - system call would not have to trash the userspace segment register, - which would be expensive */ - if (ix86_cmodel != CM_KERNEL) - return "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%%fs:%P2, %3|%3, QWORD PTR fs:%P2}"; - else - return "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%%gs:%P2, %3|%3, QWORD PTR gs:%P2}"; - } + "mov{}\t{%1, %3|%3, %1}\;xor{}\t{%@:%P2, %3|%3, PTR %@:%P2}" [(set_attr "type" "multi")]) (define_insn "sse4_2_crc32" @@ -18206,8 +17693,7 @@ (define_expand "lwp_llwpcb" [(unspec_volatile [(match_operand 0 "register_operand" "r")] UNSPECV_LLWP_INTRINSIC)] - "TARGET_LWP" - "") + "TARGET_LWP") (define_insn "*lwp_llwpcb1" [(unspec_volatile [(match_operand:P 0 "register_operand" "r")] @@ -18222,13 +17708,13 @@ [(set (match_operand 0 "register_operand" "=r") (unspec_volatile [(const_int 0)] UNSPECV_SLWP_INTRINSIC))] "TARGET_LWP" - { - if (TARGET_64BIT) - emit_insn (gen_lwp_slwpcbdi (operands[0])); - else - emit_insn (gen_lwp_slwpcbsi (operands[0])); - DONE; - }) +{ + if (TARGET_64BIT) + emit_insn (gen_lwp_slwpcbdi (operands[0])); + else + emit_insn (gen_lwp_slwpcbsi (operands[0])); + DONE; +}) (define_insn "lwp_slwpcb" [(set (match_operand:P 0 "register_operand" "=r") @@ -18268,8 +17754,7 @@ UNSPECV_LWPINS_INTRINSIC)) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") (eq:QI (reg:CCC FLAGS_REG) (const_int 0)))] - "TARGET_LWP" - "") + "TARGET_LWP") (define_insn "*lwp_lwpins3_1" [(set (reg:CCC FLAGS_REG) diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 236082da492..38a53f616c7 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -1,6 +1,7 @@ ; Options for the IA-32 and AMD64 ports of the compiler. -; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +; Copyright (C) 2005, 2006, 2007, 2008, 2009, +; 2010 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -18,6 +19,10 @@ ; along with GCC; see the file COPYING3. If not see ; . +; Bit flags that specify the ISA we are compiling for. +Variable +int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT + ;; Definitions to add to the cl_target_option structure ;; -march= processor TargetSave @@ -112,6 +117,9 @@ mcmodel= Target RejectNegative Joined Var(ix86_cmodel_string) Use given x86-64 code model +mcpu= +Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is deprecated; use %<-mtune=%> or %<-march=%> instead) + mfancy-math-387 Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save Generate sin, cos, sqrt for FPU @@ -145,7 +153,7 @@ Target Report Mask(INLINE_STRINGOPS_DYNAMICALLY) Save Inline memset/memcpy string operations, but perform inline version only for small blocks mintel-syntax -Target Undocumented +Target Undocumented Alias(masm=, intel, att) Warn(%<-mintel-syntax%> and %<-mno-intel-syntax%> are deprecated; use %<-masm=intel%> and %<-masm=att%> instead) ;; Deprecated mms-bitfields @@ -250,6 +258,11 @@ Enable automatic generation of fused floating point multiply-add instructions if the ISA supports such instructions. The -mfused-madd option is on by default. +mdispatch-scheduler +Target RejectNegative Var(flag_dispatch_scheduler) +Do dispatch scheduling if processor is bdver1 and Haifa scheduling +is selected. + ;; ISA support m32 @@ -379,3 +392,7 @@ Support F16C built-in functions and code generation mfentry Target Report Var(flag_fentry) Init(-1) Emit profiling counter call at function entry before prologue. + +m8bit-idiv +Target Report Mask(USE_8BIT_IDIV) Save +Expand 32bit/64bit integer divide into 8bit unsigned integer divide with run-time check diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h index 36ee3709261..415f7a3702b 100644 --- a/gcc/config/i386/linux-unwind.h +++ b/gcc/config/i386/linux-unwind.h @@ -106,7 +106,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context, signal-turned-exceptions for them. There's also no configure-run for the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the target libc version macro should be enough. */ -#if !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0) +#if defined __GLIBC__ && !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0) #include #include diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 33b4dc9cd8f..fda73d21107 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -42,7 +42,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* The svr4 ABI for the i386 says that records and unions are returned in memory. In the 64bit compilation we will turn this flag off in - override_options, as we never do pcc_struct_return scheme on this target. */ + ix86_option_override_internal, as we never do pcc_struct_return + scheme on this target. */ #undef DEFAULT_PCC_STRUCT_RETURN #define DEFAULT_PCC_STRUCT_RETURN 1 diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index b3277fcfe49..0b0de2d143c 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -77,7 +77,7 @@ along with GCC; see the file COPYING3. If not see kernel32. */ #undef LIB_SPEC #define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \ - -luser32 -lkernel32 -ladvapi32 -lshell32" + -ladvapi32 -lshell32 -luser32 -lkernel32" /* Weak symbols do not get resolved if using a Windows dll import lib. Make the unwind registration references strong undefs. */ @@ -135,14 +135,6 @@ along with GCC; see the file COPYING3. If not see #define STANDARD_STARTFILE_PREFIX_2 "" #endif -/* Put all *tf routines in libgcc. */ -#undef LIBGCC2_HAS_TF_MODE -#define LIBGCC2_HAS_TF_MODE 1 -#undef LIBGCC2_TF_CEXT -#define LIBGCC2_TF_CEXT q -#undef TF_SIZE -#define TF_SIZE 113 - /* Output STRING, a string representing a filename, to FILE. We canonicalize it to be in Unix format (backslashes are replaced forward slashes. */ diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index af19732624a..8053bc043fb 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -65,9 +65,9 @@ (define_insn "*mov_internal_rex64" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=rm,r,!?y,!?y ,m ,!y,*Y2,x,x ,m,r,Yi") + "=rm,r,!?y,!y,!?y,m ,!y ,*Y2,x,x ,m,r ,Yi") (match_operand:MMXMODEI8 1 "vector_move_operand" - "Cr ,m,C ,!?ym,!?y,*Y2,!y,C,xm,x,Yi,r"))] + "Cr ,m,C ,!y,m ,!?y,*Y2,!y ,C,xm,x,Yi,r"))] "TARGET_64BIT && TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -76,6 +76,7 @@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} %vpxor\t%0, %d0 @@ -83,31 +84,32 @@ %vmovq\t{%1, %0|%0, %1} %vmovq\t{%1, %0|%0, %1} %vmovq\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov") - (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,*,*,1,1,*,1,*,*,*") - (set_attr "prefix_data16" "*,*,*,*,*,*,*,*,*,1,1,1") + [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov") + (set_attr "unit" "*,*,*,*,*,*,mmx,mmx,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,*,*,1,1,*,1,*,*,*") + (set_attr "prefix_data16" "*,*,*,*,*,*,*,*,*,*,1,1,1") (set (attr "prefix_rex") - (if_then_else (eq_attr "alternative" "8,9") + (if_then_else (eq_attr "alternative" "9,10") (symbol_ref "x86_extended_reg_mentioned_p (insn)") (const_string "*"))) (set (attr "prefix") - (if_then_else (eq_attr "alternative" "7,8,9,10,11") + (if_then_else (eq_attr "alternative" "8,9,10,11,12") (const_string "maybe_vex") (const_string "orig"))) (set_attr "mode" "DI")]) (define_insn "*mov_internal_avx" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=!?y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,r ,m") + "=!?y,!y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,r ,m") (match_operand:MMXMODEI8 1 "vector_move_operand" - "C ,!ym,!?y,*Y2,!y ,C ,*Y2m,*Y2,irm,r"))] + "C ,!y,m ,!?y,*Y2,!y ,C ,*Y2m,*Y2,irm,r"))] "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} vpxor\t%0, %0, %0 @@ -115,26 +117,27 @@ vmovq\t{%1, %0|%0, %1} # #" - [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,*,*") - (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,1,1,*,*,*,*,*") + [(set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,1,1,*,*,*,*,*") (set (attr "prefix") - (if_then_else (eq_attr "alternative" "5,6,7") + (if_then_else (eq_attr "alternative" "6,7,8") (const_string "vex") (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,DI,DI,DI")]) + (set_attr "mode" "DI,DI,DI,DI,DI,DI,TI,DI,DI,DI,DI")]) (define_insn "*mov_internal" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=!?y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,*x,*x,*x,m ,r ,m") + "=!?y,!y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,*x,*x,*x,m ,r ,m") (match_operand:MMXMODEI8 1 "vector_move_operand" - "C ,!ym,!?y,*Y2,!y ,C ,*Y2m,*Y2,C ,*x,m ,*x,irm,r"))] + "C ,!y,m ,!?y,*Y2,!y ,C ,*Y2m,*Y2,C ,*x,m ,*x,irm,r"))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} pxor\t%0, %0 @@ -146,11 +149,11 @@ movlps\t{%1, %0|%0, %1} # #" - [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov,*,*") - (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,1,1,*,1,*,*,*,*,*,*,*") - (set_attr "prefix_data16" "*,*,*,*,*,*,*,1,*,*,*,*,*,*") - (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + [(set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,1,1,*,1,*,*,*,*,*,*,*") + (set_attr "prefix_data16" "*,*,*,*,*,*,*,*,1,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,DI,TI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) (define_expand "movv2sf" [(set (match_operand:V2SF 0 "nonimmediate_operand" "") @@ -163,9 +166,9 @@ (define_insn "*movv2sf_internal_rex64_avx" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=rm,r ,!?y,!?y ,m ,!y,Y2,x,x,x,m,r,x") + "=rm,r,!?y,!y,!?y,m ,!y,Y2,x,x,x,m,r,x") (match_operand:V2SF 1 "vector_move_operand" - "Cr ,m ,C ,!?ym,!y,Y2,!y,C,x,m,x,x,r"))] + "Cr ,m,C ,!y,m ,!?y,Y2,!y,C,x,m,x,x,r"))] "TARGET_64BIT && TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -174,6 +177,7 @@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} vxorps\t%0, %0, %0 @@ -182,21 +186,21 @@ vmovlps\t{%1, %0|%0, %1} vmovq\t{%1, %0|%0, %1} vmovq\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") - (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,*,*,1,1,*,*,*,*,*,*") - (set_attr "length_vex" "*,*,*,*,*,*,*,*,*,*,*,4,4") + [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") + (set_attr "unit" "*,*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,*,*,1,1,*,*,*,*,*,*") + (set_attr "length_vex" "*,*,*,*,*,*,*,*,*,*,*,*,4,4") (set (attr "prefix") - (if_then_else (eq_attr "alternative" "7,8,9,10,11,12") + (if_then_else (eq_attr "alternative" "8,9,10,11,12,13") (const_string "vex") (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) (define_insn "*movv2sf_internal_rex64" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=rm,r ,!?y,!?y ,m ,!y,*Y2,x,x,x,m,r,Yi") + "=rm,r,!?y,!y,!?y,m ,!y ,*Y2,x,x,x,m,r ,Yi") (match_operand:V2SF 1 "vector_move_operand" - "Cr ,m ,C ,!?ym,!y,*Y2,!y,C,x,m,x,Yi,r"))] + "Cr ,m,C ,!y,m ,!?y,*Y2,!y ,C,x,m,x,Yi,r"))] "TARGET_64BIT && TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -205,6 +209,7 @@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} xorps\t%0, %0 @@ -213,22 +218,23 @@ movlps\t{%1, %0|%0, %1} movd\t{%1, %0|%0, %1} movd\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") - (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,*,*,1,1,*,*,*,*,*,*") - (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") + (set_attr "unit" "*,*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,*,*,1,1,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) (define_insn "*movv2sf_internal_avx" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=!?y,!?y ,m ,!y ,*Y2,*x,*x,*x,m ,r ,m") + "=!?y,!y,!?y,m ,!y ,*Y2,*x,*x,*x,m ,r ,m") (match_operand:V2SF 1 "vector_move_operand" - "C ,!?ym,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] + "C ,!y,m ,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} vxorps\t%0, %0, %0 @@ -237,26 +243,27 @@ vmovlps\t{%1, %0|%0, %1} # #" - [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") - (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,1,1,*,*,*,*,*,*") + [(set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,1,1,*,*,*,*,*,*") (set (attr "prefix") - (if_then_else (eq_attr "alternative" "5,6,7,8") + (if_then_else (eq_attr "alternative" "6,7,8,9") (const_string "vex") (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + (set_attr "mode" "DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) (define_insn "*movv2sf_internal" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=!?y,!?y ,m ,!y ,*Y2,*x,*x,*x,m ,r ,m") + "=!?y,!y,!?y,m ,!y ,*Y2,*x,*x,*x,m ,r ,m") (match_operand:V2SF 1 "vector_move_operand" - "C ,!?ym,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] + "C ,!y,m ,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} movdq2q\t{%1, %0|%0, %1} movq2dq\t{%1, %0|%0, %1} xorps\t%0, %0 @@ -265,10 +272,10 @@ movlps\t{%1, %0|%0, %1} # #" - [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") - (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,1,1,*,*,*,*,*,*") - (set_attr "mode" "DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + [(set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "prefix_rep" "*,*,*,*,1,1,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) ;; %%% This multiword shite has got to go. (define_split @@ -334,15 +341,13 @@ [(set (match_operand:V2SF 0 "register_operand" "") (minus:V2SF (match_operand:V2SF 1 "register_operand" "") (match_operand:V2SF 2 "nonimmediate_operand" "")))] - "TARGET_3DNOW" - "") + "TARGET_3DNOW") (define_expand "mmx_subrv2sf3" [(set (match_operand:V2SF 0 "register_operand" "") (minus:V2SF (match_operand:V2SF 2 "register_operand" "") (match_operand:V2SF 1 "nonimmediate_operand" "")))] - "TARGET_3DNOW" - "") + "TARGET_3DNOW") (define_insn "*mmx_subv2sf3" [(set (match_operand:V2SF 0 "register_operand" "=y,y") @@ -1616,8 +1621,7 @@ (match_operand:V8QI 2 "register_operand" "") (match_dup 0)] UNSPEC_MASKMOV))] - "TARGET_SSE || TARGET_3DNOW_A" - "") + "TARGET_SSE || TARGET_3DNOW_A") (define_insn "*mmx_maskmovq" [(set (mem:V8QI (match_operand:SI 0 "register_operand" "D")) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index e5fea4a29d9..56a92bd5f3e 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -18,22 +18,22 @@ ;; along with GCC; see the file COPYING3. If not see ;; . -;; Return nonzero if OP is either a i387 or SSE fp register. +;; Return true if OP is either a i387 or SSE fp register. (define_predicate "any_fp_register_operand" (and (match_code "reg") (match_test "ANY_FP_REGNO_P (REGNO (op))"))) -;; Return nonzero if OP is an i387 fp register. +;; Return true if OP is an i387 fp register. (define_predicate "fp_register_operand" (and (match_code "reg") (match_test "FP_REGNO_P (REGNO (op))"))) -;; Return nonzero if OP is a non-fp register_operand. +;; Return true if OP is a non-fp register_operand. (define_predicate "register_and_not_any_fp_reg_operand" (and (match_code "reg") (not (match_test "ANY_FP_REGNO_P (REGNO (op))")))) -;; Return nonzero if OP is a register operand other than an i387 fp register. +;; Return true if OP is a register operand other than an i387 fp register. (define_predicate "register_and_not_fp_reg_operand" (and (match_code "reg") (not (match_test "FP_REGNO_P (REGNO (op))")))) @@ -43,6 +43,11 @@ (and (match_code "reg") (match_test "MMX_REGNO_P (REGNO (op))"))) +;; True if the operand is an SSE register. +(define_predicate "sse_reg_operand" + (and (match_code "reg") + (match_test "SSE_REGNO_P (REGNO (op))"))) + ;; True if the operand is a Q_REGS class register. (define_predicate "q_regs_operand" (match_operand 0 "register_operand") @@ -58,18 +63,19 @@ { if ((!TARGET_64BIT || GET_MODE (op) != DImode) && GET_MODE (op) != SImode && GET_MODE (op) != HImode) - return 0; + return false; if (GET_CODE (op) == SUBREG) op = SUBREG_REG (op); /* Be careful to accept only registers having upper parts. */ - return REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) < 4; + return (REG_P (op) + && (REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) <= BX_REG)); }) ;; Return true if op is the AX register. (define_predicate "ax_reg_operand" (and (match_code "reg") - (match_test "REGNO (op) == 0"))) + (match_test "REGNO (op) == AX_REG"))) ;; Return true if op is the flags register. (define_predicate "flags_reg_operand" @@ -92,17 +98,20 @@ ;; Return true if op is not xmm0 register. (define_predicate "reg_not_xmm0_operand" - (and (match_operand 0 "register_operand") - (match_test "!REG_P (op) - || REGNO (op) != FIRST_SSE_REG"))) + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return !REG_P (op) || REGNO (op) != FIRST_SSE_REG; +}) ;; As above, but allow nonimmediate operands. (define_predicate "nonimm_not_xmm0_operand" - (and (match_operand 0 "nonimmediate_operand") - (match_test "!REG_P (op) - || REGNO (op) != FIRST_SSE_REG"))) + (ior (match_operand 0 "memory_operand") + (match_operand 0 "reg_not_xmm0_operand"))) -;; Return 1 if VALUE can be stored in a sign extended immediate field. +;; Return true if VALUE can be stored in a sign extended immediate field. (define_predicate "x86_64_immediate_operand" (match_code "const_int,symbol_ref,label_ref,const") { @@ -116,7 +125,7 @@ to be at least 32 and this all acceptable constants are represented as CONST_INT. */ if (HOST_BITS_PER_WIDE_INT == 32) - return 1; + return true; else { HOST_WIDE_INT val = trunc_int_for_mode (INTVAL (op), DImode); @@ -150,7 +159,7 @@ case UNSPEC_DTPOFF: case UNSPEC_GOTNTPOFF: case UNSPEC_NTPOFF: - return 1; + return true; default: break; } @@ -162,16 +171,16 @@ HOST_WIDE_INT offset; if (ix86_cmodel == CM_LARGE) - return 0; + return false; if (!CONST_INT_P (op2)) - return 0; + return false; offset = trunc_int_for_mode (INTVAL (op2), DImode); switch (GET_CODE (op1)) { case SYMBOL_REF: /* TLS symbols are not constant. */ if (SYMBOL_REF_TLS_MODEL (op1)) - return 0; + return false; /* For CM_SMALL assume that latest object is 16MB before end of 31bits boundary. We may also accept pretty large negative constants knowing that all objects are @@ -181,7 +190,7 @@ && !SYMBOL_REF_FAR_ADDR_P (op1))) && offset < 16*1024*1024 && trunc_int_for_mode (offset, SImode) == offset) - return 1; + return true; /* For CM_KERNEL we know that all object resist in the negative half of 32bits address space. We may not accept negative offsets, since they may be just off @@ -189,7 +198,7 @@ if (ix86_cmodel == CM_KERNEL && offset > 0 && trunc_int_for_mode (offset, SImode) == offset) - return 1; + return true; break; case LABEL_REF: @@ -198,11 +207,11 @@ if ((ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM) && offset < 16*1024*1024 && trunc_int_for_mode (offset, SImode) == offset) - return 1; + return true; if (ix86_cmodel == CM_KERNEL && offset > 0 && trunc_int_for_mode (offset, SImode) == offset) - return 1; + return true; break; case UNSPEC: @@ -212,7 +221,7 @@ case UNSPEC_NTPOFF: if (offset > 0 && trunc_int_for_mode (offset, SImode) == offset) - return 1; + return true; } break; @@ -226,10 +235,10 @@ gcc_unreachable (); } - return 0; + return false; }) -;; Return 1 if VALUE can be stored in the zero extended immediate field. +;; Return true if VALUE can be stored in the zero extended immediate field. (define_predicate "x86_64_zext_immediate_operand" (match_code "const_double,const_int,symbol_ref,label_ref,const") { @@ -239,7 +248,7 @@ if (HOST_BITS_PER_WIDE_INT == 32) return (GET_MODE (op) == VOIDmode && !CONST_DOUBLE_HIGH (op)); else - return 0; + return false; case CONST_INT: if (HOST_BITS_PER_WIDE_INT == 32) @@ -269,13 +278,13 @@ rtx op2 = XEXP (XEXP (op, 0), 1); if (ix86_cmodel == CM_LARGE) - return 0; + return false; switch (GET_CODE (op1)) { case SYMBOL_REF: /* TLS symbols are not constant. */ if (SYMBOL_REF_TLS_MODEL (op1)) - return 0; + return false; /* For small code model we may accept pretty large positive offsets, since one bit is available for free. Negative offsets are limited by the size of NULL pointer area @@ -286,7 +295,7 @@ && CONST_INT_P (op2) && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 && trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2)) - return 1; + return true; /* ??? For the kernel, we may accept adjustment of -0x10000000, since we know that it will just convert negative address space to positive, but perhaps this @@ -300,11 +309,11 @@ && CONST_INT_P (op2) && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 && trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2)) - return 1; + return true; break; default: - return 0; + return false; } } break; @@ -312,17 +321,17 @@ default: gcc_unreachable (); } - return 0; + return false; }) -;; Return nonzero if OP is general operand representable on x86_64. +;; Return true if OP is general operand representable on x86_64. (define_predicate "x86_64_general_operand" (if_then_else (match_test "TARGET_64BIT") (ior (match_operand 0 "nonimmediate_operand") (match_operand 0 "x86_64_immediate_operand")) (match_operand 0 "general_operand"))) -;; Return nonzero if OP is general operand representable on x86_64 +;; Return true if OP is general operand representable on x86_64 ;; as either sign extended or zero extended constant. (define_predicate "x86_64_szext_general_operand" (if_then_else (match_test "TARGET_64BIT") @@ -331,14 +340,14 @@ (match_operand 0 "x86_64_zext_immediate_operand")) (match_operand 0 "general_operand"))) -;; Return nonzero if OP is nonmemory operand representable on x86_64. +;; Return true if OP is nonmemory operand representable on x86_64. (define_predicate "x86_64_nonmemory_operand" (if_then_else (match_test "TARGET_64BIT") (ior (match_operand 0 "register_operand") (match_operand 0 "x86_64_immediate_operand")) (match_operand 0 "nonmemory_operand"))) -;; Return nonzero if OP is nonmemory operand representable on x86_64. +;; Return true if OP is nonmemory operand representable on x86_64. (define_predicate "x86_64_szext_nonmemory_operand" (if_then_else (match_test "TARGET_64BIT") (ior (match_operand 0 "register_operand") @@ -352,7 +361,7 @@ (match_code "const,symbol_ref,label_ref") { if (!flag_pic) - return 0; + return false; /* Rule out relocations that translate into 64bit constants. */ if (TARGET_64BIT && GET_CODE (op) == CONST) { @@ -362,13 +371,13 @@ if (GET_CODE (op) == UNSPEC && (XINT (op, 1) == UNSPEC_GOTOFF || XINT (op, 1) == UNSPEC_GOT)) - return 0; + return false; } return symbolic_operand (op, mode); }) -;; Return nonzero if OP is nonmemory operand acceptable by movabs patterns. +;; Return true if OP is nonmemory operand acceptable by movabs patterns. (define_predicate "x86_64_movabs_operand" (if_then_else (match_test "!TARGET_64BIT || !flag_pic") (match_operand 0 "nonmemory_operand") @@ -376,7 +385,7 @@ (and (match_operand 0 "const_double_operand") (match_test "GET_MODE_SIZE (mode) <= 8"))))) -;; Returns nonzero if OP is either a symbol reference or a sum of a symbol +;; Return true if OP is either a symbol reference or a sum of a symbol ;; reference and a constant. (define_predicate "symbolic_operand" (match_code "symbol_ref,label_ref,const") @@ -385,7 +394,7 @@ { case SYMBOL_REF: case LABEL_REF: - return 1; + return true; case CONST: op = XEXP (op, 0); @@ -395,25 +404,25 @@ && (XINT (op, 1) == UNSPEC_GOT || XINT (op, 1) == UNSPEC_GOTOFF || XINT (op, 1) == UNSPEC_GOTPCREL))) - return 1; + return true; if (GET_CODE (op) != PLUS || !CONST_INT_P (XEXP (op, 1))) - return 0; + return false; op = XEXP (op, 0); if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) - return 1; + return true; /* Only @GOTOFF gets offsets. */ if (GET_CODE (op) != UNSPEC || XINT (op, 1) != UNSPEC_GOTOFF) - return 0; + return false; op = XVECEXP (op, 0, 0); if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) - return 1; - return 0; + return true; + return false; default: gcc_unreachable (); @@ -430,16 +439,16 @@ op = XEXP (XEXP (op, 0), 0); if (GET_CODE (op) == LABEL_REF) - return 1; + return true; if (GET_CODE (op) != SYMBOL_REF) - return 0; + return false; - if (SYMBOL_REF_TLS_MODEL (op) != 0) - return 0; + if (SYMBOL_REF_TLS_MODEL (op)) + return false; if (SYMBOL_REF_LOCAL_P (op)) - return 1; + return true; /* There is, however, a not insubstantial body of code in the rest of the compiler that assumes it can just stick the results of @@ -448,9 +457,9 @@ always create a DECL an invoke targetm.encode_section_info. */ if (strncmp (XSTR (op, 0), internal_label_prefix, internal_label_prefix_len) == 0) - return 1; + return true; - return 0; + return false; }) ;; Test for a legitimate @GOTOFF operand. @@ -468,7 +477,7 @@ ;; Test for various thread-local symbols. (define_predicate "tls_symbolic_operand" (and (match_code "symbol_ref") - (match_test "SYMBOL_REF_TLS_MODEL (op) != 0"))) + (match_test "SYMBOL_REF_TLS_MODEL (op)"))) (define_predicate "tls_modbase_operand" (and (match_code "symbol_ref") @@ -514,7 +523,7 @@ op = SUBREG_REG (op); if (!TARGET_64BIT && op == stack_pointer_rtx) - return 0; + return false; return register_no_elim_operand (op, mode); }) @@ -630,13 +639,13 @@ return val <= 255*8 && val % 8 == 0; }) -;; Return nonzero if OP is CONST_INT >= 1 and <= 31 (a valid operand +;; Return true if OP is CONST_INT >= 1 and <= 31 (a valid operand ;; for shift & compare patterns, as shifting by 0 does not change flags). (define_predicate "const_1_to_31_operand" (and (match_code "const_int") (match_test "IN_RANGE (INTVAL (op), 1, 31)"))) -;; Return nonzero if OP is CONST_INT >= 1 and <= 63 (a valid operand +;; Return true if OP is CONST_INT >= 1 and <= 63 (a valid operand ;; for 64bit shift & compare patterns, as shifting by 0 does not change flags). (define_predicate "const_1_to_63_operand" (and (match_code "const_int") @@ -708,7 +717,7 @@ /* On Pentium4, the inc and dec operations causes extra dependency on flag registers, since carry flag is not set. */ if (!TARGET_USE_INCDEC && !optimize_insn_for_size_p ()) - return 0; + return false; return op == const1_rtx || op == constm1_rtx; }) @@ -738,7 +747,7 @@ op = maybe_get_pool_constant (op); if (!(op && GET_CODE (op) == CONST_VECTOR)) - return 0; + return false; n_elts = CONST_VECTOR_NUNITS (op); @@ -746,9 +755,9 @@ { rtx elt = CONST_VECTOR_ELT (op, n_elts); if (elt != CONST0_RTX (GET_MODE_INNER (GET_MODE (op)))) - return 0; + return false; } - return 1; + return true; }) /* Return true if operand is a vector constant that is all ones. */ @@ -765,28 +774,28 @@ { rtx x = CONST_VECTOR_ELT (op, i); if (x != constm1_rtx) - return 0; + return false; } - return 1; + return true; } - return 0; + return false; }) -; Return 1 when OP is operand acceptable for standard SSE move. +; Return true when OP is operand acceptable for standard SSE move. (define_predicate "vector_move_operand" (ior (match_operand 0 "nonimmediate_operand") (match_operand 0 "const0_operand"))) -;; Return 1 when OP is nonimmediate or standard SSE constant. +;; Return true when OP is nonimmediate or standard SSE constant. (define_predicate "nonimmediate_or_sse_const_operand" (match_operand 0 "general_operand") { if (nonimmediate_operand (op, mode)) - return 1; + return true; if (standard_sse_constant_p (op) > 0) - return 1; - return 0; + return true; + return false; }) ;; Return true if OP is a register or a zero. @@ -807,7 +816,7 @@ return parts.seg == SEG_DEFAULT; }) -;; Return nonzero if the rtx is known to be at least 32 bits aligned. +;; Return true if the rtx is known to be at least 32 bits aligned. (define_predicate "aligned_operand" (match_operand 0 "general_operand") { @@ -816,26 +825,26 @@ /* Registers and immediate operands are always "aligned". */ if (!MEM_P (op)) - return 1; + return true; /* All patterns using aligned_operand on memory operands ends up in promoting memory operand to 64bit and thus causing memory mismatch. */ if (TARGET_MEMORY_MISMATCH_STALL && !optimize_insn_for_size_p ()) - return 0; + return false; /* Don't even try to do any aligned optimizations with volatiles. */ if (MEM_VOLATILE_P (op)) - return 0; + return false; if (MEM_ALIGN (op) >= 32) - return 1; + return true; op = XEXP (op, 0); /* Pushes and pops are only valid on the stack pointer. */ if (GET_CODE (op) == PRE_DEC || GET_CODE (op) == POST_INC) - return 1; + return true; /* Decode the address. */ ok = ix86_decompose_address (op, &parts); @@ -845,25 +854,25 @@ if (parts.index) { if (REGNO_POINTER_ALIGN (REGNO (parts.index)) * parts.scale < 32) - return 0; + return false; } if (parts.base) { if (REGNO_POINTER_ALIGN (REGNO (parts.base)) < 32) - return 0; + return false; } if (parts.disp) { if (!CONST_INT_P (parts.disp) - || (INTVAL (parts.disp) & 3) != 0) - return 0; + || (INTVAL (parts.disp) & 3)) + return false; } /* Didn't find one -- this must be an aligned address. */ - return 1; + return true; }) -;; Returns 1 if OP is memory operand with a displacement. +;; Return true if OP is memory operand with a displacement. (define_predicate "memory_displacement_operand" (match_operand 0 "memory_operand") { @@ -875,7 +884,7 @@ return parts.disp != NULL_RTX; }) -;; Returns 1 if OP is memory operand with a displacement only. +;; Return true if OP is memory operand with a displacement only. (define_predicate "memory_displacement_only_operand" (match_operand 0 "memory_operand") { @@ -883,18 +892,18 @@ int ok; if (TARGET_64BIT) - return 0; + return false; ok = ix86_decompose_address (XEXP (op, 0), &parts); gcc_assert (ok); if (parts.base || parts.index) - return 0; + return false; return parts.disp != NULL_RTX; }) -;; Returns 1 if OP is memory operand which will need zero or +;; Return true if OP is memory operand which will need zero or ;; one register at most, not counting stack pointer or frame pointer. (define_predicate "cmpxchg8b_pic_memory_operand" (match_operand 0 "memory_operand") @@ -909,26 +918,26 @@ || parts.base == frame_pointer_rtx || parts.base == hard_frame_pointer_rtx || parts.base == stack_pointer_rtx) - return 1; + return true; if (parts.index == NULL_RTX || parts.index == arg_pointer_rtx || parts.index == frame_pointer_rtx || parts.index == hard_frame_pointer_rtx || parts.index == stack_pointer_rtx) - return 1; + return true; - return 0; + return false; }) -;; Returns 1 if OP is memory operand that cannot be represented +;; Return true if OP is memory operand that cannot be represented ;; by the modRM array. (define_predicate "long_memory_operand" (and (match_operand 0 "memory_operand") - (match_test "memory_address_length (op) != 0"))) + (match_test "memory_address_length (op)"))) -;; Return 1 if OP is a comparison operator that can be issued by fcmov. +;; Return true if OP is a comparison operator that can be issued by fcmov. (define_predicate "fcmov_comparison_operator" (match_operand 0 "comparison_operator") { @@ -938,7 +947,7 @@ if (inmode == CCFPmode || inmode == CCFPUmode) { if (!ix86_trivial_fp_comparison_operator (op, mode)) - return 0; + return false; code = ix86_fp_compare_code_to_integer (code); } /* i387 supports just limited amount of conditional codes. */ @@ -947,17 +956,17 @@ case LTU: case GTU: case LEU: case GEU: if (inmode == CCmode || inmode == CCFPmode || inmode == CCFPUmode || inmode == CCCmode) - return 1; - return 0; + return true; + return false; case ORDERED: case UNORDERED: case EQ: case NE: - return 1; + return true; default: - return 0; + return false; } }) -;; Return 1 if OP is a comparison that can be used in the CMPSS/CMPPS insns. +;; Return true if OP is a comparison that can be used in the CMPSS/CMPPS insns. ;; The first set are supported directly; the second set can't be done with ;; full IEEE support, i.e. NaNs. ;; @@ -969,7 +978,7 @@ (define_special_predicate "sse_comparison_operator" (match_code "eq,lt,le,unordered,ne,unge,ungt,ordered")) -;; Return 1 if OP is a comparison operator that can be issued by +;; Return true if OP is a comparison operator that can be issued by ;; avx predicate generation instructions (define_predicate "avx_comparison_float_operator" (match_code "ne,eq,ge,gt,le,lt,unordered,ordered,uneq,unge,ungt,unle,unlt,ltgt")) @@ -983,7 +992,7 @@ (define_predicate "bt_comparison_operator" (match_code "ne,eq")) -;; Return 1 if OP is a valid comparison operator in valid mode. +;; Return true if OP is a valid comparison operator in valid mode. (define_predicate "ix86_comparison_operator" (match_operand 0 "comparison_operator") { @@ -996,30 +1005,31 @@ switch (code) { case EQ: case NE: - return 1; + return true; case LT: case GE: if (inmode == CCmode || inmode == CCGCmode || inmode == CCGOCmode || inmode == CCNOmode) - return 1; - return 0; + return true; + return false; case LTU: case GTU: case LEU: case GEU: if (inmode == CCmode || inmode == CCCmode) - return 1; - return 0; + return true; + return false; case ORDERED: case UNORDERED: if (inmode == CCmode) - return 1; - return 0; + return true; + return false; case GT: case LE: if (inmode == CCmode || inmode == CCGCmode || inmode == CCNOmode) - return 1; - return 0; + return true; + return false; default: - return 0; + return false; } }) -;; Return 1 if OP is a valid comparison operator testing carry flag to be set. +;; Return true if OP is a valid comparison operator +;; testing carry flag to be set. (define_predicate "ix86_carry_flag_operator" (match_code "ltu,lt,unlt,gtu,gt,ungt,le,unle,ge,unge,ltgt,uneq") { @@ -1029,22 +1039,22 @@ if (inmode == CCFPmode || inmode == CCFPUmode) { if (!ix86_trivial_fp_comparison_operator (op, mode)) - return 0; + return false; code = ix86_fp_compare_code_to_integer (code); } else if (inmode == CCCmode) return code == LTU || code == GTU; else if (inmode != CCmode) - return 0; + return false; return code == LTU; }) -;; Return 1 if this comparison only requires testing one flag bit. +;; Return true if this comparison only requires testing one flag bit. (define_predicate "ix86_trivial_fp_comparison_operator" (match_code "gt,ge,unlt,unle,uneq,ltgt,ordered,unordered")) -;; Return 1 if we know how to do this comparison. Others require +;; Return true if we know how to do this comparison. Others require ;; testing more than one flag bit, and we let the generic middle-end ;; code do that. (define_predicate "ix86_fp_comparison_operator" @@ -1058,7 +1068,7 @@ (match_operand 0 "comparison_operator") { enum rtx_code code = GET_CODE (op); - int ret; + bool ret; PUT_CODE (op, swap_condition (code)); ret = ix86_fp_comparison_operator (op, mode); @@ -1098,7 +1108,7 @@ (define_predicate "commutative_operator" (match_code "plus,mult,and,ior,xor,smin,smax,umin,umax")) -;; Return 1 if OP is a binary operator that can be promoted to wider mode. +;; 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") (and (match_code "mult") @@ -1110,19 +1120,19 @@ (define_predicate "absneg_operator" (match_code "abs,neg")) -;; Return 1 if OP is misaligned memory operand +;; Return true if OP is misaligned memory operand (define_predicate "misaligned_operand" (and (match_code "mem") (match_test "MEM_ALIGN (op) < GET_MODE_ALIGNMENT (mode)"))) -;; Return 1 if OP is a emms operation, known to be a PARALLEL. +;; Return true if OP is a emms operation, known to be a PARALLEL. (define_predicate "emms_operation" (match_code "parallel") { unsigned i; if (XVECLEN (op, 0) != 17) - return 0; + return false; for (i = 0; i < 8; i++) { @@ -1132,7 +1142,7 @@ || GET_CODE (SET_DEST (elt)) != REG || GET_MODE (SET_DEST (elt)) != XFmode || REGNO (SET_DEST (elt)) != FIRST_STACK_REG + i) - return 0; + return false; elt = XVECEXP (op, 0, i+9); @@ -1140,19 +1150,19 @@ || GET_CODE (SET_DEST (elt)) != REG || GET_MODE (SET_DEST (elt)) != DImode || REGNO (SET_DEST (elt)) != FIRST_MMX_REG + i) - return 0; + return false; } - return 1; + return true; }) -;; Return 1 if OP is a vzeroall operation, known to be a PARALLEL. +;; Return true if OP is a vzeroall operation, known to be a PARALLEL. (define_predicate "vzeroall_operation" (match_code "parallel") { unsigned i, nregs = TARGET_64BIT ? 16 : 8; if ((unsigned) XVECLEN (op, 0) != 1 + nregs) - return 0; + return false; for (i = 0; i < nregs; i++) { @@ -1163,19 +1173,19 @@ || GET_MODE (SET_DEST (elt)) != V8SImode || REGNO (SET_DEST (elt)) != SSE_REGNO (i) || SET_SRC (elt) != CONST0_RTX (V8SImode)) - return 0; + return false; } - return 1; + return true; }) -;; Return 1 if OP is a vzeroupper operation, known to be a PARALLEL. +;; Return true if OP is a vzeroupper operation, known to be a PARALLEL. (define_predicate "vzeroupper_operation" (match_code "parallel") { unsigned i, nregs = TARGET_64BIT ? 16 : 8; if ((unsigned) XVECLEN (op, 0) != 1 + nregs) - return 0; + return false; for (i = 0; i < nregs; i++) { @@ -1185,12 +1195,12 @@ || GET_CODE (SET_DEST (elt)) != REG || GET_MODE (SET_DEST (elt)) != V8SImode || REGNO (SET_DEST (elt)) != SSE_REGNO (i)) - return 0; + return false; } - return 1; + return true; }) -;; Return 1 if OP is a parallel for a vpermilp[ds] permute. +;; Return true if OP is a parallel for a vpermilp[ds] permute. ;; ??? It would be much easier if the PARALLEL for a VEC_SELECT ;; had a mode, but it doesn't. So we have 4 copies and install ;; the mode by hand. @@ -1211,7 +1221,7 @@ (and (match_code "parallel") (match_test "avx_vpermilp_parallel (op, V2DFmode)"))) -;; Return 1 if OP is a parallel for a vperm2f128 permute. +;; Return true if OP is a parallel for a vperm2f128 permute. (define_predicate "avx_vperm2f128_v8sf_operand" (and (match_code "parallel") @@ -1225,7 +1235,7 @@ (and (match_code "parallel") (match_test "avx_vperm2f128_parallel (op, V4DFmode)"))) -;; Return 1 if OP is a parallel for a vbroadcast permute. +;; Return true if OP is a parallel for a vbroadcast permute. (define_predicate "avx_vbroadcast_operand" (and (match_code "parallel") diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 3f756d9b636..0a116aa8370 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -19,6 +19,9 @@ ;; . +;; Instruction suffix for sign and zero extensions. +(define_code_attr extsuffix [(sign_extend "sx") (zero_extend "zx")]) + ;; 16 byte integral modes handled by SSE (define_mode_iterator SSEMODEI [V16QI V8HI V4SI V2DI]) @@ -505,30 +508,26 @@ (unspec:SSEMODEF2P [(match_operand:SSEMODEF2P 1 "register_operand" "")] UNSPEC_MOVNT))] - "SSE_VEC_FLOAT_MODE_P (mode)" - "") + "SSE_VEC_FLOAT_MODE_P (mode)") (define_expand "storent" [(set (match_operand:MODEF 0 "memory_operand" "") (unspec:MODEF [(match_operand:MODEF 1 "register_operand" "")] UNSPEC_MOVNT))] - "TARGET_SSE4A" - "") + "TARGET_SSE4A") (define_expand "storentv2di" [(set (match_operand:V2DI 0 "memory_operand" "") (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "")] UNSPEC_MOVNT))] - "TARGET_SSE2" - "") + "TARGET_SSE2") (define_expand "storentsi" [(set (match_operand:SI 0 "memory_operand" "") (unspec:SI [(match_operand:SI 1 "register_operand" "")] UNSPEC_MOVNT))] - "TARGET_SSE2" - "") + "TARGET_SSE2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -731,8 +730,7 @@ [(set (match_operand:V2DF 0 "register_operand" "") (div:V2DF (match_operand:V2DF 1 "register_operand" "") (match_operand:V2DF 2 "nonimmediate_operand" "")))] - "TARGET_SSE2" - "") + "TARGET_SSE2") (define_insn "*avx_div3" [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x") @@ -3103,10 +3101,8 @@ (vec_select:V2SF (match_dup 2) (parallel [(const_int 0) (const_int 1)]))))] - "TARGET_SSE2" -{ - operands[2] = gen_reg_rtx (V4SFmode); -}) + "TARGET_SSE2" + "operands[2] = gen_reg_rtx (V4SFmode);") (define_expand "vec_unpacks_lo_v4sf" [(set (match_operand:V2DF 0 "register_operand" "") @@ -3177,8 +3173,8 @@ (vec_select:V2SI (match_dup 2) (parallel [(const_int 0) (const_int 1)]))))] - "TARGET_SSE2" - "operands[2] = gen_reg_rtx (V4SImode);") + "TARGET_SSE2" + "operands[2] = gen_reg_rtx (V4SImode);") (define_expand "vec_unpacks_float_lo_v4si" [(set (match_operand:V2DF 0 "register_operand" "") @@ -3207,7 +3203,7 @@ (and:V2DF (match_dup 7) (match_dup 4))) (set (match_operand:V2DF 0 "register_operand" "") (plus:V2DF (match_dup 6) (match_dup 8)))] - "TARGET_SSE2" + "TARGET_SSE2" { REAL_VALUE_TYPE TWO32r; rtx x; @@ -4464,8 +4460,7 @@ (match_dup 1)) (parallel [(const_int 0) (const_int 4) (const_int 2) (const_int 6)])))] - "TARGET_AVX" - "") + "TARGET_AVX") (define_expand "avx_unpcklpd256" [(set (match_operand:V4DF 0 "register_operand" "") @@ -4475,8 +4470,7 @@ (match_operand:V4DF 2 "nonimmediate_operand" "")) (parallel [(const_int 0) (const_int 4) (const_int 2) (const_int 6)])))] - "TARGET_AVX" - "") + "TARGET_AVX") (define_insn "*avx_unpcklpd256" [(set (match_operand:V4DF 0 "register_operand" "=x,x") @@ -4810,9 +4804,7 @@ (parallel [(const_int 1)])))] "TARGET_SSE2 && reload_completed" [(set (match_dup 0) (match_dup 1))] -{ - operands[1] = adjust_address (operands[1], DFmode, 8); -}) + "operands[1] = adjust_address (operands[1], DFmode, 8);") ;; Avoid combining registers from different units in a single alternative, ;; see comment above inline_secondary_memory_needed function in i386.c @@ -4907,9 +4899,7 @@ (match_operand:DF 1 "register_operand" "")))] "TARGET_SSE2 && reload_completed" [(set (match_dup 0) (match_dup 1))] -{ - operands[0] = adjust_address (operands[0], DFmode, 8); -}) + "operands[0] = adjust_address (operands[0], DFmode, 8);") (define_expand "sse2_loadlpd_exp" [(set (match_operand:V2DF 0 "nonimmediate_operand" "") @@ -4972,9 +4962,7 @@ (vec_select:DF (match_dup 0) (parallel [(const_int 1)]))))] "TARGET_SSE2 && reload_completed" [(set (match_dup 0) (match_dup 1))] -{ - operands[0] = adjust_address (operands[0], DFmode, 8); -}) + "operands[0] = adjust_address (operands[0], DFmode, 8);") ;; Not sure these two are ever used, but it doesn't hurt to have ;; them. -aoliva @@ -5243,92 +5231,47 @@ (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) -(define_expand "smulv8hi3_highpart" - [(set (match_operand:V8HI 0 "register_operand" "") - (truncate:V8HI - (lshiftrt:V8SI - (mult:V8SI - (sign_extend:V8SI - (match_operand:V8HI 1 "nonimmediate_operand" "")) - (sign_extend:V8SI - (match_operand:V8HI 2 "nonimmediate_operand" ""))) - (const_int 16))))] - "TARGET_SSE2" - "ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);") - -(define_insn "*avxv8hi3_highpart" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (truncate:V8HI - (lshiftrt:V8SI - (mult:V8SI - (sign_extend:V8SI - (match_operand:V8HI 1 "nonimmediate_operand" "%x")) - (sign_extend:V8SI - (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) - (const_int 16))))] - "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)" - "vpmulhw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "sseimul") - (set_attr "prefix" "vex") - (set_attr "mode" "TI")]) - -(define_insn "*smulv8hi3_highpart" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (truncate:V8HI - (lshiftrt:V8SI - (mult:V8SI - (sign_extend:V8SI - (match_operand:V8HI 1 "nonimmediate_operand" "%0")) - (sign_extend:V8SI - (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) - (const_int 16))))] - "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" - "pmulhw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "prefix_data16" "1") - (set_attr "mode" "TI")]) - -(define_expand "umulv8hi3_highpart" +(define_expand "mulv8hi3_highpart" [(set (match_operand:V8HI 0 "register_operand" "") (truncate:V8HI (lshiftrt:V8SI (mult:V8SI - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 1 "nonimmediate_operand" "")) - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 2 "nonimmediate_operand" ""))) (const_int 16))))] "TARGET_SSE2" "ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);") -(define_insn "*avx_umulv8hi3_highpart" +(define_insn "*avx_mulv8hi3_highpart" [(set (match_operand:V8HI 0 "register_operand" "=x") (truncate:V8HI (lshiftrt:V8SI (mult:V8SI - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 1 "nonimmediate_operand" "%x")) - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) (const_int 16))))] "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)" - "vpmulhuw\t{%2, %1, %0|%0, %1, %2}" + "vpmulhw\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseimul") (set_attr "prefix" "vex") (set_attr "mode" "TI")]) -(define_insn "*umulv8hi3_highpart" +(define_insn "*mulv8hi3_highpart" [(set (match_operand:V8HI 0 "register_operand" "=x") (truncate:V8HI (lshiftrt:V8SI (mult:V8SI - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 1 "nonimmediate_operand" "%0")) - (zero_extend:V8SI + (any_extend:V8SI (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) (const_int 16))))] "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" - "pmulhuw\t{%2, %0|%0, %2}" + "pmulhw\t{%2, %0|%0, %2}" [(set_attr "type" "sseimul") (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) @@ -6169,20 +6112,20 @@ if (TARGET_SSE4_1) ix86_fixup_binary_operands_no_copy (SMAX, mode, operands); else - { - rtx xops[6]; - bool ok; - - xops[0] = operands[0]; - xops[1] = operands[1]; - xops[2] = operands[2]; - xops[3] = gen_rtx_GT (VOIDmode, operands[1], operands[2]); - xops[4] = operands[1]; - xops[5] = operands[2]; - ok = ix86_expand_int_vcond (xops); - gcc_assert (ok); - DONE; - } + { + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[1]; + xops[2] = operands[2]; + xops[3] = gen_rtx_GT (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; + } }) (define_insn "*sse4_1_3" @@ -6225,20 +6168,20 @@ if (TARGET_SSE4_1) ix86_fixup_binary_operands_no_copy (UMAX, V4SImode, operands); else - { - rtx xops[6]; - bool ok; - - xops[0] = operands[0]; - xops[1] = operands[1]; - xops[2] = operands[2]; - xops[3] = gen_rtx_GTU (VOIDmode, operands[1], operands[2]); - xops[4] = operands[1]; - xops[5] = operands[2]; - ok = ix86_expand_int_vcond (xops); - gcc_assert (ok); - DONE; - } + { + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[1]; + xops[2] = operands[2]; + xops[3] = gen_rtx_GTU (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; + } }) (define_insn "*sse4_1_3" @@ -7355,9 +7298,7 @@ || MEM_P (operands [0]) || !GENERAL_REGNO_P (true_regnum (operands [0])))" [(set (match_dup 0) (match_dup 1))] -{ - operands[1] = gen_rtx_REG (SImode, REGNO (operands[1])); -}) + "operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]));") (define_insn_and_split "*vec_ext_v4si_mem" [(set (match_operand:SI 0 "register_operand" "=r") @@ -7380,8 +7321,7 @@ (vec_select:DI (match_operand:V2DI 1 "register_operand" "") (parallel [(const_int 0)])))] - "TARGET_SSE" - "") + "TARGET_SSE") (define_insn "*sse2_storeq_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,*r,r") @@ -7416,9 +7356,7 @@ || MEM_P (operands [0]) || !GENERAL_REGNO_P (true_regnum (operands [0])))" [(set (match_dup 0) (match_dup 1))] -{ - operands[1] = gen_rtx_REG (DImode, REGNO (operands[1])); -}) + "operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));") (define_insn "*vec_extractv2di_1_rex64_avx" [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x,r") @@ -8097,8 +8035,7 @@ (match_operand:V16QI 2 "register_operand" "") (match_dup 0)] UNSPEC_MASKMOV))] - "TARGET_SSE2" - "") + "TARGET_SSE2") (define_insn "*sse2_maskmovdqu" [(set (mem:V16QI (match_operand:SI 0 "register_operand" "D")) @@ -9592,32 +9529,11 @@ (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "sse4_1_extendv8qiv8hi2" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (sign_extend:V8HI - (vec_select:V8QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7)]))))] - "TARGET_SSE4_1" - "%vpmovsxbw\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_extendv8qiv8hi2" +(define_insn "sse4_1_v8qiv8hi2" [(set (match_operand:V8HI 0 "register_operand" "=x") - (sign_extend:V8HI + (any_extend:V8HI (vec_select:V8QI - (vec_duplicate:V16QI - (match_operand:V8QI 1 "nonimmediate_operand" "xm")) + (match_operand:V16QI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1) (const_int 2) @@ -9627,354 +9543,81 @@ (const_int 6) (const_int 7)]))))] "TARGET_SSE4_1" - "%vpmovsxbw\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_extendv4qiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (sign_extend:V4SI - (vec_select:V4QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovsxbd\t{%1, %0|%0, %1}" + "%vpmovbw\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*sse4_1_extendv4qiv4si2" +(define_insn "sse4_1_v4qiv4si2" [(set (match_operand:V4SI 0 "register_operand" "=x") - (sign_extend:V4SI + (any_extend:V4SI (vec_select:V4QI - (vec_duplicate:V16QI - (match_operand:V4QI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovsxbd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_extendv2qiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxbq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_extendv2qiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2QI - (vec_duplicate:V16QI - (match_operand:V2QI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxbq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_extendv4hiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (sign_extend:V4SI - (vec_select:V4HI - (match_operand:V8HI 1 "register_operand" "x") + (match_operand:V16QI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)]))))] "TARGET_SSE4_1" - "%vpmovsxwd\t{%1, %0|%0, %1}" + "%vpmovbd\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*sse4_1_extendv4hiv4si2" +(define_insn "sse4_1_v4hiv4si2" [(set (match_operand:V4SI 0 "register_operand" "=x") - (sign_extend:V4SI + (any_extend:V4SI (vec_select:V4HI - (vec_duplicate:V8HI - (match_operand:V2HI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovsxwd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_extendv2hiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2HI - (match_operand:V8HI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxwq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_extendv2hiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2HI - (vec_duplicate:V8HI - (match_operand:V8HI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxwq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_extendv2siv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2SI - (match_operand:V4SI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxdq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_extendv2siv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (sign_extend:V2DI - (vec_select:V2SI - (vec_duplicate:V4SI - (match_operand:V2SI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovsxdq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv8qiv8hi2" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (zero_extend:V8HI - (vec_select:V8QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7)]))))] - "TARGET_SSE4_1" - "%vpmovzxbw\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_zero_extendv8qiv8hi2" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (zero_extend:V8HI - (vec_select:V8QI - (vec_duplicate:V16QI - (match_operand:V8QI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7)]))))] - "TARGET_SSE4_1" - "%vpmovzxbw\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv4qiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (zero_extend:V4SI - (vec_select:V4QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovzxbd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_zero_extendv4qiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (zero_extend:V4SI - (vec_select:V4QI - (vec_duplicate:V16QI - (match_operand:V4QI 1 "nonimmediate_operand" "xm")) + (match_operand:V8HI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)]))))] "TARGET_SSE4_1" - "%vpmovzxbd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv2qiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI - (vec_select:V2QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovzxbq\t{%1, %0|%0, %1}" + "%vpmovwd\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*sse4_1_zero_extendv2qiv2di2" +(define_insn "sse4_1_v2qiv2di2" [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI + (any_extend:V2DI (vec_select:V2QI - (vec_duplicate:V16QI - (match_operand:V2QI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovzxbq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv4hiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (zero_extend:V4SI - (vec_select:V4HI - (match_operand:V8HI 1 "register_operand" "x") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovzxwd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*sse4_1_zero_extendv4hiv4si2" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (zero_extend:V4SI - (vec_select:V4HI - (vec_duplicate:V8HI - (match_operand:V4HI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)]))))] - "TARGET_SSE4_1" - "%vpmovzxwd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv2hiv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI - (vec_select:V2HI - (match_operand:V8HI 1 "register_operand" "x") + (match_operand:V16QI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1)]))))] "TARGET_SSE4_1" - "%vpmovzxwq\t{%1, %0|%0, %1}" + "%vpmovbq\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*sse4_1_zero_extendv2hiv2di2" +(define_insn "sse4_1_v2hiv2di2" [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI + (any_extend:V2DI (vec_select:V2HI - (vec_duplicate:V8HI - (match_operand:V2HI 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE4_1" - "%vpmovzxwq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "prefix_extra" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "sse4_1_zero_extendv2siv2di2" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI - (vec_select:V2SI - (match_operand:V4SI 1 "register_operand" "x") + (match_operand:V8HI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1)]))))] "TARGET_SSE4_1" - "%vpmovzxdq\t{%1, %0|%0, %1}" + "%vpmovwq\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*sse4_1_zero_extendv2siv2di2" +(define_insn "sse4_1_v2siv2di2" [(set (match_operand:V2DI 0 "register_operand" "=x") - (zero_extend:V2DI + (any_extend:V2DI (vec_select:V2SI - (vec_duplicate:V4SI - (match_operand:V2SI 1 "nonimmediate_operand" "xm")) + (match_operand:V4SI 1 "nonimmediate_operand" "xm") (parallel [(const_int 0) (const_int 1)]))))] "TARGET_SSE4_1" - "%vpmovzxdq\t{%1, %0|%0, %1}" + "%vpmovdq\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_vex") @@ -11844,9 +11487,7 @@ "&& reload_completed && REG_P (operands[1])" [(set (match_dup 2) (vec_duplicate: (match_dup 1))) (set (match_dup 0) (vec_concat:AVX256MODE24P (match_dup 2) (match_dup 2)))] -{ - operands[2] = gen_rtx_REG (mode, REGNO (operands[0])); -} + "operands[2] = gen_rtx_REG (mode, REGNO (operands[0]));" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "vex") diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin index 8fec6f761d7..a01219cfb9d 100644 --- a/gcc/config/i386/t-cygwin +++ b/gcc/config/i386/t-cygwin @@ -1,4 +1,4 @@ -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009, 2010 # Free Software Foundation, Inc. # # This file is part of GCC. @@ -24,7 +24,7 @@ LIBGCC2_INCLUDES += -I$(srcdir)/../winsup/include \ -I$(srcdir)/../winsup/cygwin/include cygwin1.o: $(srcdir)/config/i386/cygwin1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TM_P_H) + $(TM_H) $(TM_P_H) opts.h $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/i386/cygwin1.c @@ -34,7 +34,7 @@ cygwin2.o: $(srcdir)/config/i386/cygwin2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(srcdir)/config/i386/cygwin2.c # Cygwin-specific parts of LIB_SPEC -SHLIB_LC = -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 +SHLIB_LC = -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 # We have already included one of the t-{dw2,sjlj}-eh fragments for EH_MODEL SHLIB_EH_EXTENSION = $(subst -dw2,,-$(EH_MODEL)) diff --git a/gcc/config/i386/t-darwin b/gcc/config/i386/t-darwin index fb5bbe78c04..22323e4abee 100644 --- a/gcc/config/i386/t-darwin +++ b/gcc/config/i386/t-darwin @@ -2,3 +2,4 @@ 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-mingw-w32 b/gcc/config/i386/t-mingw-w32 index 62d6330fabb..fc0c1224bdd 100644 --- a/gcc/config/i386/t-mingw-w32 +++ b/gcc/config/i386/t-mingw-w32 @@ -6,7 +6,7 @@ MULTILIB_DIRNAMES = 64 32 MULTILIB_OSDIRNAMES = ../lib64 ../lib # MinGW-specific parts of LIB_SPEC -SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 +SHLIB_LC = -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 b0106e5e64b..d5b2d0e3d4d 100644 --- a/gcc/config/i386/t-mingw-w64 +++ b/gcc/config/i386/t-mingw-w64 @@ -6,7 +6,7 @@ MULTILIB_DIRNAMES = 64 32 MULTILIB_OSDIRNAMES = ../lib ../lib32 # MinGW-specific parts of LIB_SPEC -SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 +SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib diff --git a/gcc/config/i386/t-mingw32 b/gcc/config/i386/t-mingw32 index bfe15069c68..b6f5e8cbb2a 100644 --- a/gcc/config/i386/t-mingw32 +++ b/gcc/config/i386/t-mingw32 @@ -2,4 +2,4 @@ NATIVE_SYSTEM_HEADER_DIR = /mingw/include # MinGW-specific parts of LIB_SPEC -SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 +SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 diff --git a/gcc/config/ia64/div.md b/gcc/config/ia64/div.md index f443a28e7ec..7c9b31d0dc5 100644 --- a/gcc/config/ia64/div.md +++ b/gcc/config/ia64/div.md @@ -37,7 +37,7 @@ (define_insn "addrf3_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (plus:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -52,7 +52,7 @@ (define_insn "subrf3_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (minus:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -67,7 +67,7 @@ (define_insn "mulrf3_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (mult:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -84,7 +84,7 @@ (define_insn "nmulrf3_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (neg:RF (mult:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -101,7 +101,7 @@ (define_insn "m1addrf4_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (plus:RF (mult:RF @@ -118,7 +118,7 @@ (define_insn "m1subrf4_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (minus:RF (mult:RF @@ -137,7 +137,7 @@ (define_insn "m2addrf4_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (plus:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -154,7 +154,7 @@ (define_insn "m2subrf4_cond" [(set (match_operand:RF 0 "fr_register_operand" "=f,f") - (if_then_else:RF (ne:RF (match_operand:BI 1 "register_operand" "c,c") + (if_then_else:RF (ne:RF (match_operand:CCI 1 "register_operand" "c,c") (const_int 0)) (minus:RF (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG,fG") @@ -255,8 +255,8 @@ (unspec:RF [(match_operand:RF 1 "fr_reg_or_fp01_operand" "fG") (match_operand:RF 2 "fr_reg_or_fp01_operand" "fG")] UNSPEC_FR_RECIP_APPROX_RES)) - (set (match_operand:BI 3 "register_operand" "=c") - (unspec:BI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) + (set (match_operand:CCI 3 "register_operand" "=c") + (unspec:CCI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) (use (match_operand:SI 4 "const_int_operand" ""))] "" "frcpa.s%4 %0, %3 = %F1, %F2" @@ -297,7 +297,7 @@ rtx q = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); rtx q_res = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status0 = CONST0_RTX (SImode); @@ -345,7 +345,7 @@ rtx q1 = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); rtx q_res = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status0 = CONST0_RTX (SImode); @@ -414,7 +414,7 @@ rtx y3 = gen_reg_rtx (RFmode); rtx q = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status0 = CONST0_RTX (SImode); @@ -471,7 +471,7 @@ rtx e3 = gen_reg_rtx (RFmode); rtx q = gen_reg_rtx (RFmode); rtx r1 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status0 = CONST0_RTX (SImode); @@ -535,7 +535,7 @@ rtx q = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); rtx r1 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status0 = CONST0_RTX (SImode); @@ -702,7 +702,7 @@ rtx e1 = gen_reg_rtx (RFmode); rtx q = gen_reg_rtx (RFmode); rtx q1 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status1 = CONST1_RTX (SImode); @@ -844,7 +844,7 @@ rtx q1 = gen_reg_rtx (RFmode); rtx q2 = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status1 = CONST1_RTX (SImode); @@ -888,7 +888,7 @@ rtx e1 = gen_reg_rtx (RFmode); rtx q2 = gen_reg_rtx (RFmode); rtx r = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx status1 = CONST1_RTX (SImode); @@ -920,8 +920,8 @@ [(set (match_operand:RF 0 "fr_register_operand" "=f") (unspec:RF [(match_operand:RF 1 "fr_reg_or_fp01_operand" "fG")] UNSPEC_FR_SQRT_RECIP_APPROX_RES)) - (set (match_operand:BI 2 "register_operand" "=c") - (unspec:BI [(match_dup 1)] UNSPEC_FR_SQRT_RECIP_APPROX)) + (set (match_operand:CCI 2 "register_operand" "=c") + (unspec:CCI [(match_dup 1)] UNSPEC_FR_SQRT_RECIP_APPROX)) (use (match_operand:SI 3 "const_int_operand" ""))] "" "frsqrta.s%3 %0, %2 = %F1" @@ -958,7 +958,7 @@ rtx h = gen_reg_rtx (RFmode); rtx d = gen_reg_rtx (RFmode); rtx g2 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx c1 = ia64_dconst_0_5(); @@ -1021,7 +1021,7 @@ rtx h = gen_reg_rtx (RFmode); rtx h1 = gen_reg_rtx (RFmode); rtx d = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx one = CONST1_RTX (RFmode); rtx c1 = ia64_dconst_0_5(); @@ -1104,7 +1104,7 @@ rtx h2 = gen_reg_rtx (RFmode); rtx d = gen_reg_rtx (RFmode); rtx d1 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx c1 = ia64_dconst_0_5(); rtx reg_df_c1 = gen_reg_rtx (DFmode); @@ -1171,7 +1171,7 @@ rtx h3 = gen_reg_rtx (RFmode); rtx d = gen_reg_rtx (RFmode); rtx d1 = gen_reg_rtx (RFmode); - rtx cond = gen_reg_rtx (BImode); + rtx cond = gen_reg_rtx (CCImode); rtx zero = CONST0_RTX (RFmode); rtx c1 = ia64_dconst_0_5(); rtx reg_df_c1 = gen_reg_rtx (DFmode); diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h index 0a5af40f489..8a3ff4b8b08 100644 --- a/gcc/config/ia64/ia64-protos.h +++ b/gcc/config/ia64/ia64-protos.h @@ -59,7 +59,6 @@ extern void ia64_print_operand (FILE *, rtx, int); extern enum reg_class ia64_preferred_reload_class (rtx, enum reg_class); extern enum reg_class ia64_secondary_reload_class (enum reg_class, enum machine_mode, rtx); -extern void process_for_unwind_directive (FILE *, rtx); extern const char *get_bundle_name (int); #endif /* RTX_CODE */ @@ -100,7 +99,6 @@ extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *); extern void ia64_output_function_profiler (FILE *, int); extern void ia64_profile_hook (int); -extern void ia64_optimization_options (int, int); extern void ia64_init_expanders (void); extern rtx ia64_dconst_0_5 (void); diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 45a68cf5f44..d02d2b8fc3f 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -202,6 +202,7 @@ static rtx gen_fr_spill_x (rtx, rtx, rtx); static rtx gen_fr_restore_x (rtx, rtx, rtx); static void ia64_option_override (void); +static void ia64_option_optimization (int, int); static bool ia64_can_eliminate (const int, const int); static enum machine_mode hfa_element_mode (const_tree, bool); static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, @@ -247,6 +248,10 @@ static int ia64_sched_reorder (FILE *, int, rtx *, int *, int); static int ia64_sched_reorder2 (FILE *, int, rtx *, int *, int); static int ia64_variable_issue (FILE *, int, rtx, int); +static void ia64_asm_unwind_emit (FILE *, rtx); +static void ia64_asm_emit_except_personality (rtx); +static void ia64_asm_init_sections (void); + static struct bundle_state *get_free_bundle_state (void); static void free_bundle_state (struct bundle_state *); static void initiate_bundle_states (void); @@ -357,6 +362,8 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE ia64_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION ia64_option_optimization #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue @@ -521,7 +528,11 @@ static const struct attribute_spec ia64_attribute_table[] = #define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg #undef TARGET_ASM_UNWIND_EMIT -#define TARGET_ASM_UNWIND_EMIT process_for_unwind_directive +#define TARGET_ASM_UNWIND_EMIT ia64_asm_unwind_emit +#undef TARGET_ASM_EMIT_EXCEPT_PERSONALITY +#define TARGET_ASM_EMIT_EXCEPT_PERSONALITY ia64_asm_emit_except_personality +#undef TARGET_ASM_INIT_SECTIONS +#define TARGET_ASM_INIT_SECTIONS ia64_asm_init_sections #undef TARGET_SCALAR_MODE_SUPPORTED_P #define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p @@ -2306,7 +2317,7 @@ ia64_file_start (void) { /* Variable tracking should be run after all optimizations which change order of insns. It also needs a valid CFG. This can't be done in - ia64_override_options, because flag_var_tracking is finalized after + ia64_option_override, because flag_var_tracking is finalized after that. */ ia64_flag_var_tracking = flag_var_tracking; flag_var_tracking = 0; @@ -3097,6 +3108,9 @@ ia64_expand_prologue (void) ia64_compute_frame_size (get_frame_size ()); last_scratch_gr_reg = 15; + if (flag_stack_usage) + current_function_static_stack_size = current_frame_info.total_size; + if (dump_file) { fprintf (dump_file, "ia64 frame related registers " @@ -9842,8 +9856,8 @@ process_set (FILE *asm_out_file, rtx pat, rtx insn, bool unwind, bool frame) /* This function looks at a single insn and emits any directives required to unwind this insn. */ -void -process_for_unwind_directive (FILE *asm_out_file, rtx insn) +static void +ia64_asm_unwind_emit (FILE *asm_out_file, rtx insn) { bool unwind = (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)); @@ -9906,6 +9920,24 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn) } } +/* Implement TARGET_ASM_EMIT_EXCEPT_PERSONALITY. */ + +static void +ia64_asm_emit_except_personality (rtx personality) +{ + fputs ("\t.personality\t", asm_out_file); + output_addr_const (asm_out_file, personality); + fputc ('\n', asm_out_file); +} + +/* Implement TARGET_ASM_INITIALIZE_SECTIONS. */ + +static void +ia64_asm_init_sections (void) +{ + exception_section = get_unnamed_section (0, output_section_asm_op, + "\t.handlerdata"); +} enum ia64_builtins { @@ -10690,10 +10722,14 @@ ia64_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty } /* Implement overriding of the optimization options. */ -void -ia64_optimization_options (int level ATTRIBUTE_UNUSED, - int size ATTRIBUTE_UNUSED) +static void +ia64_option_optimization (int level ATTRIBUTE_UNUSED, + int size ATTRIBUTE_UNUSED) { +#ifdef SUBTARGET_OPTIMIZATION_OPTIONS + SUBTARGET_OPTIMIZATION_OPTIONS; +#endif + /* Let the scheduler form additional regions. */ set_param_value ("max-sched-extend-regions-iters", 2); diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index b43d075f3c1..dbb5ebd434b 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -118,14 +118,6 @@ enum processor_type }; extern enum processor_type ia64_tune; - -/* Some machines may desire to change what optimizations are performed for - various optimization levels. This macro, if defined, is executed once just - after the optimization level is determined and before the remainder of the - command options have been parsed. Values set in this macro are used as the - default values for the other command line options. */ - -/* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */ /* Driver configuration */ @@ -646,7 +638,7 @@ while (0) #define HARD_REGNO_NREGS(REGNO, MODE) \ ((REGNO) == PR_REG (0) && (MODE) == DImode ? 64 \ : PR_REGNO_P (REGNO) && (MODE) == BImode ? 2 \ - : PR_REGNO_P (REGNO) && (MODE) == CCImode ? 1 \ + : (PR_REGNO_P (REGNO) || GR_REGNO_P (REGNO)) && (MODE) == CCImode ? 1\ : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1 \ : FR_REGNO_P (REGNO) && (MODE) == RFmode ? 1 \ : FR_REGNO_P (REGNO) && (MODE) == XCmode ? 2 \ @@ -664,7 +656,7 @@ while (0) : PR_REGNO_P (REGNO) ? \ (MODE) == BImode || GET_MODE_CLASS (MODE) == MODE_CC \ : GR_REGNO_P (REGNO) ? \ - (MODE) != CCImode && (MODE) != XFmode && (MODE) != XCmode && (MODE) != RFmode \ + (MODE) != XFmode && (MODE) != XCmode && (MODE) != RFmode \ : AR_REGNO_P (REGNO) ? (MODE) == DImode \ : BR_REGNO_P (REGNO) ? (MODE) == DImode \ : 0) @@ -1897,8 +1889,4 @@ struct GTY(()) machine_function /* Switch on code for querying unit reservations. */ #define CPU_UNITS_QUERY 1 -/* Define this to change the optimizations performed by default. */ -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - ia64_optimization_options ((LEVEL), (SIZE)) - /* End of ia64.h */ diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index aa262487808..db1d2d2f608 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -217,17 +217,34 @@ ;; Set of a single predicate register. This is only used to implement ;; pr-to-pr move and complement. -(define_insn "*movcci" - [(set (match_operand:CCI 0 "register_operand" "=c,c,c") - (match_operand:CCI 1 "nonmemory_operand" "O,n,c"))] +(define_insn "movcci" + [(set (match_operand:CCI 0 "destination_operand" "=c,c,?c,?*r, c,*r,*m,*r") + (match_operand:CCI 1 "move_operand" " O,n, c, c,*r,*m,*r,*r"))] "" "@ cmp.ne %0, p0 = r0, r0 cmp.eq %0, p0 = r0, r0 - (%1) cmp.eq.unc %0, p0 = r0, r0" - [(set_attr "itanium_class" "icmp") + (%1) cmp.eq.unc %0, p0 = r0, r0 + # + tbit.nz %0, p0 = %1, 0 + ld1%O1 %0 = %1%P1 + st1%Q0 %0 = %1%P0 + mov %0 = %1" + [(set_attr "itanium_class" "icmp,icmp,icmp,unknown,tbit,ld,st,ialu") (set_attr "predicable" "no")]) +(define_split + [(set (match_operand:CCI 0 "register_operand" "") + (match_operand:CCI 1 "register_operand" ""))] + "reload_completed + && GET_CODE (operands[0]) == REG && GR_REGNO_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))" + [(set (match_dup 2) (const_int 0)) + (cond_exec (ne (match_dup 3) (const_int 0)) + (set (match_dup 2) (const_int 1)))] + "operands[2] = gen_rtx_REG (BImode, REGNO (operands[0])); + operands[3] = gen_rtx_REG (BImode, REGNO (operands[1]));") + (define_insn "movbi" [(set (match_operand:BI 0 "destination_operand" "=c,c,?c,?*r, c,*r,*r,*m,*r") (match_operand:BI 1 "move_operand" " O,n, c, c,*r, n,*m,*r,*r"))] @@ -3988,7 +4005,7 @@ [(match_operand:BI 2 "register_operand" "") (match_operand:BI 3 "const_int_operand" "")]))] "" - "ia64_expand_compare (&operands[0], &operands[1], &operands[2]);") + "ia64_expand_compare (&operands[1], &operands[2], &operands[3]);") (define_expand "cstoresi4" [(set (match_operand:DI 0 "gr_register_operand" "") diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h index 3d678ce5f85..e077e7d14f1 100644 --- a/gcc/config/ia64/vms.h +++ b/gcc/config/ia64/vms.h @@ -183,11 +183,10 @@ typedef struct crtl_name_spec } \ } while (0) -#undef OPTIMIZATION_OPTIONS -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ +#undef SUBTARGET_OPTIMIZATION_OPTIONS +#define SUBTARGET_OPTIMIZATION_OPTIONS \ do { \ flag_merge_constants = 0; \ - ia64_optimization_options ((LEVEL), (SIZE)); \ } while (0) /* Define this to be nonzero if static stack checking is supported. */ diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h index 56fd39e7bc6..971aadf4547 100644 --- a/gcc/config/iq2000/iq2000-protos.h +++ b/gcc/config/iq2000/iq2000-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler for iq2000. - Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -24,7 +24,6 @@ extern int iq2000_check_split (rtx, enum machine_mode); extern int iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int); extern const char * iq2000_fill_delay_slot (const char *, enum delay_type, rtx *, rtx); extern const char * iq2000_move_1word (rtx *, rtx, int); -extern void override_options (void); extern HOST_WIDE_INT iq2000_debugger_offset (rtx, HOST_WIDE_INT); extern void final_prescan_insn (rtx, rtx *, int); extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT); diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index b152d1a2529..dd2c927108f 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on Vitesse IQ2000 processors - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -147,6 +147,7 @@ static enum machine_mode gpr_mode; /* Initialize the GCC target structure. */ static struct machine_function* iq2000_init_machine_status (void); static bool iq2000_handle_option (size_t, const char *, int); +static void iq2000_option_override (void); static section *iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT); static void iq2000_init_builtins (void); @@ -182,6 +183,8 @@ static bool iq2000_print_operand_punct_valid_p (unsigned char code); #define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION iq2000_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE iq2000_option_override #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS iq2000_rtx_costs #undef TARGET_ADDRESS_COST @@ -1428,8 +1431,8 @@ iq2000_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) /* Detect any conflicts in the switches. */ -void -override_options (void) +static void +iq2000_option_override (void) { target_flags &= ~MASK_GPOPT; diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index 683eb9b8c61..6e670badc58 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -69,8 +69,6 @@ #define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr) #endif -#define OVERRIDE_OPTIONS override_options () - #define CAN_DEBUG_WITHOUT_FP /* Storage Layout. */ diff --git a/gcc/config/linux.h b/gcc/config/linux.h index e283a9a3305..7c0ca95db42 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -160,6 +160,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) /* Whether we have sincos that follows the GNU extension. */ -#define TARGET_HAS_SINCOS (OPTION_GLIBC | OPTION_BIONIC) +#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) #define TARGET_POSIX_IO diff --git a/gcc/config/lm32/lm32-protos.h b/gcc/config/lm32/lm32-protos.h index 70d97f0d1d8..51e191bab81 100644 --- a/gcc/config/lm32/lm32-protos.h +++ b/gcc/config/lm32/lm32-protos.h @@ -1,7 +1,7 @@ /* Prototypes of target machine functions, Lattice Mico32 architecture. Contributed by Jon Beniston - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -28,7 +28,6 @@ extern void lm32_print_operand (FILE *file, rtx op, int letter); extern void lm32_print_operand_address (FILE *file, rtx addr); extern rtx lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type, int named); -extern void lm32_override_options (void); extern HOST_WIDE_INT lm32_compute_initial_elimination_offset (int from, int to); extern int lm32_can_use_return (void); diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c index e601693a520..a0e9472c5ec 100644 --- a/gcc/config/lm32/lm32.c +++ b/gcc/config/lm32/lm32.c @@ -76,9 +76,12 @@ static bool lm32_legitimate_address_p (enum machine_mode mode, rtx x, bool strict); static HOST_WIDE_INT lm32_compute_frame_size (int size); static bool lm32_handle_option (size_t code, const char *arg, int value); +static void lm32_option_override (void); #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION lm32_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE lm32_option_override #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_bool_0 #undef TARGET_RTX_COSTS @@ -713,8 +716,8 @@ lm32_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value) } /* Override command line options. */ -void -lm32_override_options (void) +static void +lm32_option_override (void) { /* We must have sign-extend enabled if barrel-shift isn't. */ if (!TARGET_BARREL_SHIFT_ENABLED && !TARGET_SIGN_EXTEND_ENABLED) diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h index 0bf37455627..2698d40b896 100644 --- a/gcc/config/lm32/lm32.h +++ b/gcc/config/lm32/lm32.h @@ -68,8 +68,6 @@ #undef LIB_SPEC #define LIB_SPEC "%{!T*:-T sim.ld}" -#define OVERRIDE_OPTIONS lm32_override_options() - extern int target_flags; /* Add -G xx support. */ diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h index 3ebaa08b416..5d1c3bb9819 100644 --- a/gcc/config/m32c/m32c-protos.h +++ b/gcc/config/m32c/m32c-protos.h @@ -22,7 +22,6 @@ #define MM enum machine_mode #define UINT unsigned int -int m32c_class_likely_spilled_p (int); void m32c_conditional_register_usage (void); int m32c_const_ok_for_constraint_p (HOST_WIDE_INT, char, const char *); UINT m32c_dwarf_frame_regnum (int); @@ -46,12 +45,6 @@ int m32c_regno_ok_for_base_p (int); int m32c_trampoline_alignment (void); int m32c_trampoline_size (void); -#if defined(RTX_CODE) && defined(TREE_CODE) - -rtx m32c_function_arg (CUMULATIVE_ARGS *, MM, tree, int); - -#endif - #ifdef RTX_CODE int m32c_cannot_change_mode_class (MM, MM, int); @@ -75,7 +68,6 @@ rtx m32c_incoming_return_addr_rtx (void); int m32c_legitimate_constant_p (rtx); int m32c_legitimize_reload_address (rtx *, MM, int, int, int); int m32c_limit_reload_class (MM, int); -int m32c_memory_move_cost (MM, int, int); int m32c_modes_tieable_p (MM, MM); bool m32c_mov_ok (rtx *, MM); char * m32c_output_compare (rtx, rtx *); @@ -86,7 +78,6 @@ int m32c_prepare_shift (rtx *, int, int); void m32c_print_operand (FILE *, rtx, int); void m32c_print_operand_address (FILE *, rtx); int m32c_reg_ok_for_base_p (rtx, int); -int m32c_register_move_cost (MM, int, int); MM m32c_regno_reg_class (int); rtx m32c_return_addr_rtx (int); const char *m32c_scc_pattern (rtx *, RTX_CODE); @@ -98,7 +89,6 @@ int m32c_split_psi_p (rtx *); #ifdef TREE_CODE -void m32c_function_arg_advance (CUMULATIVE_ARGS *, MM, tree, int); tree m32c_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); void m32c_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int); bool m32c_promote_function_return (const_tree); diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 34e814a29a7..066d1a84886 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -73,8 +73,12 @@ static bool m32c_fixed_condition_code_regs (unsigned int *, unsigned int *); static struct machine_function *m32c_init_machine_status (void); static void m32c_insert_attributes (tree, tree *); static bool m32c_legitimate_address_p (enum machine_mode, rtx, bool); +static rtx m32_function_arg (CUMULATIVE_ARGS *, enum machine_mode + const_tree, bool); static bool m32c_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); +static void m32c_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static bool m32c_promote_prototypes (const_tree); static int m32c_pushm_popm (Push_Pop_Type); static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *); @@ -340,47 +344,33 @@ reduce_class (int original_class, int limiting_class, int returned_if_empty) return best; } -/* Returns TRUE If there are any registers that exist in both register - classes. */ -static int -classes_intersect (int class1, int class2) -{ - return class_contents[class1][0] & class_contents[class2][0]; -} - /* Used by m32c_register_move_cost to determine if a move is impossibly expensive. */ -static int -class_can_hold_mode (int rclass, enum machine_mode mode) +static bool +class_can_hold_mode (reg_class_t rclass, enum machine_mode mode) { /* Cache the results: 0=untested 1=no 2=yes */ static char results[LIM_REG_CLASSES][MAX_MACHINE_MODE]; - if (results[rclass][mode] == 0) + + if (results[(int) rclass][mode] == 0) { - int r, n, i; + int r; results[rclass][mode] = 1; for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) - if (class_contents[rclass][0] & (1 << r) + if (in_hard_reg_set_p (reg_class_contents[(int) rclass], mode, r) && HARD_REGNO_MODE_OK (r, mode)) { - int ok = 1; - n = HARD_REGNO_NREGS (r, mode); - for (i = 1; i < n; i++) - if (!(class_contents[rclass][0] & (1 << (r + i)))) - ok = 0; - if (ok) - { - results[rclass][mode] = 2; - break; - } + results[rclass][mode] = 2; + break; } } + #if DEBUG0 fprintf (stderr, "class %s can hold %s? %s\n", - class_names[rclass], mode_name[mode], + class_names[(int) rclass], mode_name[mode], (results[rclass][mode] == 2) ? "yes" : "no"); #endif - return results[rclass][mode] == 2; + return results[(int) rclass][mode] == 2; } /* Run-time Target Specification. */ @@ -740,7 +730,7 @@ m32c_preferred_reload_class (rtx x, int rclass) if (rclass == NO_REGS) rclass = GET_MODE (x) == QImode ? HL_REGS : R03_REGS; - if (classes_intersect (rclass, CR_REGS)) + if (reg_classes_intersect_p (rclass, CR_REGS)) { switch (GET_MODE (x)) { @@ -826,21 +816,26 @@ m32c_secondary_reload_class (int rclass, enum machine_mode mode, rtx x) if (mode == QImode && GET_CODE (x) == MEM && (cc & ~class_contents[R23_REGS][0]) == 0) return QI_REGS; - if (classes_intersect (rclass, CR_REGS) + if (reg_classes_intersect_p (rclass, CR_REGS) && GET_CODE (x) == REG && REGNO (x) >= SB_REGNO && REGNO (x) <= SP_REGNO) return TARGET_A16 ? HI_REGS : A_REGS; return NO_REGS; } -/* Implements CLASS_LIKELY_SPILLED_P. A_REGS is needed for address +/* Implements TARGET_CLASS_LIKELY_SPILLED_P. A_REGS is needed for address reloads. */ -int -m32c_class_likely_spilled_p (int regclass) + +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P m32c_class_likely_spilled_p + +static bool +m32c_class_likely_spilled_p (reg_class_t regclass) { if (regclass == A_REGS) - return 1; - return reg_class_size[regclass] == 1; + return true; + + return (reg_class_size[(int) regclass] == 1); } /* Implements CLASS_MAX_NREGS. We calculate this according to its @@ -1467,10 +1462,11 @@ m32c_push_rounding (int n) /* Passing Arguments in Registers */ -/* Implements FUNCTION_ARG. Arguments are passed partly in registers, - partly on stack. If our function returns a struct, a pointer to a - buffer for it is at the top of the stack (last thing pushed). The - first few real arguments may be in registers as follows: +/* Implements TARGET_FUNCTION_ARG. Arguments are passed partly in + registers, partly on stack. If our function returns a struct, a + pointer to a buffer for it is at the top of the stack (last thing + pushed). The first few real arguments may be in registers as + follows: R8C/M16C: arg1 in r1 if it's QI or HI (else it's pushed on stack) arg2 in r2 if it's HI (else pushed on stack) @@ -1483,9 +1479,11 @@ m32c_push_rounding (int n) Note that when arg1 doesn't fit in r1, arg2 may still be passed in r2 if it fits. */ -rtx +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG m32c_function_arg +static rtx m32c_function_arg (CUMULATIVE_ARGS * ca, - enum machine_mode mode, tree type, int named) + enum machine_mode mode, const_tree type, bool named) { /* Can return a reg, parallel, or 0 for stack */ rtx rv = NULL_RTX; @@ -1558,15 +1556,17 @@ m32c_init_cumulative_args (CUMULATIVE_ARGS * ca, ca->parm_num = 1; } -/* Implements FUNCTION_ARG_ADVANCE. force_mem is set for functions - returning structures, so we always reset that. Otherwise, we only - need to know the sequence number of the argument to know what to do - with it. */ -void +/* Implements TARGET_FUNCTION_ARG_ADVANCE. force_mem is set for + functions returning structures, so we always reset that. Otherwise, + we only need to know the sequence number of the argument to know what + to do with it. */ +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE m32c_function_arg_advance +static void m32c_function_arg_advance (CUMULATIVE_ARGS * ca, enum machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, - int named ATTRIBUTE_UNUSED) + const_tree type ATTRIBUTE_UNUSED, + bool named ATTRIBUTE_UNUSED) { if (ca->force_mem) ca->force_mem = 0; @@ -2096,19 +2096,29 @@ m32c_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) /* Describing Relative Costs of Operations */ -/* Implements REGISTER_MOVE_COST. We make impossible moves +/* Implements TARGET_REGISTER_MOVE_COST. We make impossible moves prohibitively expensive, like trying to put QIs in r2/r3 (there are no opcodes to do that). We also discourage use of mem* registers since they're really memory. */ -int -m32c_register_move_cost (enum machine_mode mode, int from, int to) + +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST m32c_register_move_cost + +static int +m32c_register_move_cost (enum machine_mode mode, reg_class_t from, + reg_class_t to) { int cost = COSTS_N_INSNS (3); - int cc = class_contents[from][0] | class_contents[to][0]; - /* FIXME: pick real values, but not 2 for now. */ - if (mode == QImode && (cc & class_contents[R23_REGS][0])) + HARD_REG_SET cc; + +/* FIXME: pick real values, but not 2 for now. */ + COPY_HARD_REG_SET (cc, reg_class_contents[(int) from]); + IOR_HARD_REG_SET (cc, reg_class_contents[(int) to]); + + if (mode == QImode + && hard_reg_set_intersect_p (cc, reg_class_contents[R23_REGS])) { - if (!(cc & ~class_contents[R23_REGS][0])) + if (hard_reg_set_subset_p (cc, reg_class_contents[R23_REGS])) cost = COSTS_N_INSNS (1000); else cost = COSTS_N_INSNS (80); @@ -2117,30 +2127,35 @@ m32c_register_move_cost (enum machine_mode mode, int from, int to) if (!class_can_hold_mode (from, mode) || !class_can_hold_mode (to, mode)) cost = COSTS_N_INSNS (1000); - if (classes_intersect (from, CR_REGS)) + if (reg_classes_intersect_p (from, CR_REGS)) cost += COSTS_N_INSNS (5); - if (classes_intersect (to, CR_REGS)) + if (reg_classes_intersect_p (to, CR_REGS)) cost += COSTS_N_INSNS (5); if (from == MEM_REGS || to == MEM_REGS) cost += COSTS_N_INSNS (50); - else if (classes_intersect (from, MEM_REGS) - || classes_intersect (to, MEM_REGS)) + else if (reg_classes_intersect_p (from, MEM_REGS) + || reg_classes_intersect_p (to, MEM_REGS)) cost += COSTS_N_INSNS (10); #if DEBUG0 fprintf (stderr, "register_move_cost %s from %s to %s = %d\n", - mode_name[mode], class_names[from], class_names[to], cost); + mode_name[mode], class_names[(int) from], class_names[(int) to], + cost); #endif return cost; } -/* Implements MEMORY_MOVE_COST. */ -int +/* Implements TARGET_MEMORY_MOVE_COST. */ + +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST m32c_memory_move_cost + +static int m32c_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, - int reg_class ATTRIBUTE_UNUSED, - int in ATTRIBUTE_UNUSED) + reg_class_t rclass ATTRIBUTE_UNUSED, + bool in ATTRIBUTE_UNUSED) { /* FIXME: pick real values. */ return COSTS_N_INSNS (10); diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h index 781d68cdbd5..c0eccb42d4f 100644 --- a/gcc/config/m32c/m32c.h +++ b/gcc/config/m32c/m32c.h @@ -421,8 +421,6 @@ enum reg_class #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true -#define CLASS_LIKELY_SPILLED_P(C) m32c_class_likely_spilled_p (C) - #define CLASS_MAX_NREGS(C,M) m32c_class_max_nregs (C, M) #define CANNOT_CHANGE_MODE_CLASS(F,T,C) m32c_cannot_change_mode_class(F,T,C) @@ -505,9 +503,6 @@ enum reg_class /* Passing Arguments in Registers */ -#define FUNCTION_ARG(CA,MODE,TYPE,NAMED) \ - m32c_function_arg (&(CA),MODE,TYPE,NAMED) - typedef struct m32c_cumulative_args { /* For address of return value buffer (structures are returned by @@ -523,8 +518,6 @@ typedef struct m32c_cumulative_args #define CUMULATIVE_ARGS m32c_cumulative_args #define INIT_CUMULATIVE_ARGS(CA,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \ m32c_init_cumulative_args (&(CA),FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) -#define FUNCTION_ARG_ADVANCE(CA,MODE,TYPE,NAMED) \ - m32c_function_arg_advance (&(CA),MODE,TYPE,NAMED) #define FUNCTION_ARG_BOUNDARY(MODE,TYPE) (TARGET_A16 ? 8 : 16) #define FUNCTION_ARG_REGNO_P(r) m32c_function_arg_regno_p (r) @@ -578,13 +571,6 @@ typedef struct m32c_cumulative_args #define REVERSIBLE_CC_MODE(MODE) 1 -/* Describing Relative Costs of Operations */ - -#define REGISTER_MOVE_COST(MODE,FROM,TO) \ - m32c_register_move_cost (MODE, FROM, TO) -#define MEMORY_MOVE_COST(MODE,CLASS,IN) \ - m32c_memory_move_cost (MODE, CLASS, IN) - /* Dividing the Output into Sections (Texts, Data, ...) */ #define TEXT_SECTION_ASM_OP ".text" diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 6d043734263..6748f04527c 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -63,10 +63,13 @@ enum m32r_sdata m32r_sdata = M32R_SDATA_DEFAULT; /* Forward declaration. */ static bool m32r_handle_option (size_t, const char *, int); +static void m32r_option_override (void); +static void m32r_option_optimization (int, int); static void init_reg_tables (void); static void block_move_call (rtx, rtx, rtx); static int m32r_is_insn (rtx); static rtx m32r_legitimize_address (rtx, rtx, enum machine_mode); +static bool m32r_mode_dependent_address_p (const_rtx); static tree m32r_handle_model_attribute (tree *, tree, tree, int, bool *); static void m32r_print_operand (FILE *, rtx, int); static void m32r_print_operand_address (FILE *, rtx); @@ -82,14 +85,22 @@ static int m32r_issue_rate (void); static void m32r_encode_section_info (tree, rtx, int); static bool m32r_in_small_data_p (const_tree); static bool m32r_return_in_memory (const_tree, const_tree); +static rtx m32r_function_value (const_tree, const_tree, bool); +static rtx m32r_libcall_value (enum machine_mode, const_rtx); +static bool m32r_function_value_regno_p (const unsigned int); static void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); static void init_idents (void); static bool m32r_rtx_costs (rtx, int, int, int *, bool speed); +static int m32r_memory_move_cost (enum machine_mode, reg_class_t, bool); static bool m32r_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +static rtx m32r_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static void m32r_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static bool m32r_can_eliminate (const int, const int); static void m32r_trampoline_init (rtx, tree, rtx); @@ -109,6 +120,8 @@ static const struct attribute_spec m32r_attribute_table[] = #undef TARGET_LEGITIMIZE_ADDRESS #define TARGET_LEGITIMIZE_ADDRESS m32r_legitimize_address +#undef TARGET_MODE_DEPENDENT_ADDRESS_P +#define TARGET_MODE_DEPENDENT_ADDRESS_P m32r_mode_dependent_address_p #undef TARGET_ASM_ALIGNED_HI_OP #define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t" @@ -139,12 +152,19 @@ static const struct attribute_spec m32r_attribute_table[] = #define TARGET_DEFAULT_TARGET_FLAGS TARGET_CPU_DEFAULT #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION m32r_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE m32r_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION m32r_option_optimization #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info #undef TARGET_IN_SMALL_DATA_P #define TARGET_IN_SMALL_DATA_P m32r_in_small_data_p + +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST m32r_memory_move_cost #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m32r_rtx_costs #undef TARGET_ADDRESS_COST @@ -154,6 +174,14 @@ static const struct attribute_spec m32r_attribute_table[] = #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY m32r_return_in_memory + +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE m32r_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE m32r_libcall_value +#undef TARGET_FUNCTION_VALUE_REGNO_P +#define TARGET_FUNCTION_VALUE_REGNO_P m32r_function_value_regno_p + #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS m32r_setup_incoming_varargs #undef TARGET_MUST_PASS_IN_STACK @@ -162,6 +190,10 @@ static const struct attribute_spec m32r_attribute_table[] = #define TARGET_PASS_BY_REFERENCE m32r_pass_by_reference #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES m32r_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG m32r_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE m32r_function_arg_advance #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE m32r_can_eliminate @@ -225,7 +257,7 @@ m32r_handle_option (size_t code, const char *arg, int value) } } -/* Called by OVERRIDE_OPTIONS to initialize various things. */ +/* Called by m32r_option_override to initialize various things. */ void m32r_init (void) @@ -242,6 +274,27 @@ m32r_init (void) g_switch_value = SDATA_DEFAULT_SIZE; } +static void +m32r_option_override (void) +{ + /* These need to be done at start up. + It's convenient to do them here. */ + m32r_init (); + SUBTARGET_OVERRIDE_OPTIONS; +} + +static void +m32r_option_optimization (int level, int size) +{ + if (level == 1) + flag_regmove = 1; + + if (size) + flag_omit_frame_pointer = 1; + + SUBTARGET_OPTIMIZATION_OPTIONS; +} + /* Vectors to keep interesting information about registers where it can easily be got. We use to use the actual mode value as the bit number, but there is (or may be) more than 32 modes now. Instead we use two tables: one @@ -1172,6 +1225,65 @@ m32r_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, return words * UNITS_PER_WORD; } +/* 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 ((unsigned int) int_size_in_bytes (TYPE)) \ + : ROUND_ADVANCE ((unsigned int) GET_MODE_SIZE (MODE))) + +/* Round CUM up to the necessary point for argument MODE/TYPE. */ +#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) (CUM) + +/* 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. */ +#define PASS_IN_REG_P(CUM, MODE, TYPE) \ + (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) < M32R_MAX_PARM_REGS) + +/* 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 M32R the first M32R_MAX_PARM_REGS args are normally in registers + and the rest are pushed. */ + +static rtx +m32r_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type ATTRIBUTE_UNUSED, + bool named ATTRIBUTE_UNUSED) +{ + return (PASS_IN_REG_P (*cum, mode, type) + ? gen_rtx_REG (mode, ROUND_ADVANCE_CUM (*cum, mode, type)) + : NULL_RTX); +} + +/* 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 +m32r_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) +{ + *cum = (ROUND_ADVANCE_CUM (*cum, mode, type) + + ROUND_ADVANCE_ARG (mode, type)); +} + /* Worker function for TARGET_RETURN_IN_MEMORY. */ static bool @@ -1180,6 +1292,35 @@ m32r_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) return m32r_pass_by_reference (NULL, TYPE_MODE (type), type, false); } +/* Worker function for TARGET_FUNCTION_VALUE. */ + +static rtx +m32r_function_value (const_tree valtype, + const_tree fn_decl_or_type ATTRIBUTE_UNUSED, + bool outgoing ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (TYPE_MODE (valtype), 0); +} + +/* Worker function for TARGET_LIBCALL_VALUE. */ + +static rtx +m32r_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (mode, 0); +} + +/* Worker function for TARGET_FUNCTION_VALUE_REGNO_P. + + ??? What about r1 in DI/DF values. */ + +static bool +m32r_function_value_regno_p (const unsigned int regno) +{ + return (regno == 0); +} + /* Do any needed setup for a variadic function. For the M32R, we must create a register parameter block, and then copy any anonymous arguments in registers to memory. @@ -1260,6 +1401,22 @@ m32r_issue_rate (void) /* Cost functions. */ +/* Implement TARGET_HANDLE_OPTION. + + Memory is 3 times as expensive as registers. + ??? Is that the right way to look at it? */ + +static int +m32r_memory_move_cost (enum machine_mode mode, + reg_class_t rclass ATTRIBUTE_UNUSED, + bool in ATTRIBUTE_UNUSED) +{ + if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD) + return 6; + else + return 12; +} + static bool m32r_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total, bool speed ATTRIBUTE_UNUSED) @@ -1917,6 +2074,17 @@ m32r_legitimize_address (rtx x, rtx orig_x ATTRIBUTE_UNUSED, else return x; } + +/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P. */ + +static bool +m32r_mode_dependent_address_p (const_rtx addr) +{ + if (GET_CODE (addr) == LO_SUM) + return true; + + return false; +} /* Nested function support. */ diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index 91d055bcb5b..c232a74258c 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, Renesas M32R cpu. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -302,48 +302,14 @@ extern enum m32r_sdata m32r_sdata; #define MULTILIB_DEFAULTS { "mmodel=small" SUBTARGET_MULTILIB_DEFAULTS } #endif -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - #ifndef SUBTARGET_OVERRIDE_OPTIONS #define SUBTARGET_OVERRIDE_OPTIONS #endif -#define OVERRIDE_OPTIONS \ - do \ - { \ - /* These need to be done at start up. \ - It's convenient to do them here. */ \ - m32r_init (); \ - SUBTARGET_OVERRIDE_OPTIONS \ - } \ - while (0) - #ifndef SUBTARGET_OPTIMIZATION_OPTIONS #define SUBTARGET_OPTIMIZATION_OPTIONS #endif -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - do \ - { \ - if (LEVEL == 1) \ - flag_regmove = TRUE; \ - \ - if (SIZE) \ - { \ - flag_omit_frame_pointer = TRUE; \ - } \ - \ - SUBTARGET_OPTIMIZATION_OPTIONS \ - } \ - while (0) - /* Define this macro if debugging can be performed even without a frame pointer. If this macro is defined, GCC will turn on the `-fomit-frame-pointer' option whenever `-O' is specified. */ @@ -843,54 +809,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; #define FUNCTION_ARG_REGNO_P(N) \ ((unsigned) (N) < M32R_MAX_PARM_REGS) -/* 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 ((unsigned int) int_size_in_bytes (TYPE)) \ - : ROUND_ADVANCE ((unsigned int) GET_MODE_SIZE (MODE))) - -/* Round CUM up to the necessary point for argument MODE/TYPE. */ -#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) (CUM) - -/* 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. */ -#define PASS_IN_REG_P(CUM, MODE, TYPE) \ - (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) < M32R_MAX_PARM_REGS) - -/* 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 M32R the first M32R_MAX_PARM_REGS args are normally in registers - and the rest are pushed. */ -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - (PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \ - ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ - : 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.) */ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - ((CUM) = (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \ - + ROUND_ADVANCE_ARG ((MODE), (TYPE)))) - /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, PARM_BOUNDARY is used for all arguments. */ @@ -903,21 +821,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; /* Function results. */ -/* Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0) - -/* Define how to find the value returned by a library function - assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) - -/* 1 if N is a possible register number for a function value - as seen by the caller. */ -/* ??? What about r1 in DI/DF values. */ -#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) - /* Tell GCC to use TARGET_RETURN_IN_MEMORY. */ #define DEFAULT_PCC_STRUCT_RETURN 0 @@ -1111,16 +1014,6 @@ L2: .word STATIC goto ADDR; \ } \ while (0) - -/* Go to LABEL if ADDR (a legitimate address expression) - has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - do \ - { \ - if (GET_CODE (ADDR) == LO_SUM) \ - goto LABEL; \ - } \ - while (0) /* Condition code usage. */ @@ -1130,16 +1023,6 @@ L2: .word STATIC /* Costs. */ -/* Compute extra cost of moving data between one register class - and another. */ -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 2 - -/* Compute the cost of moving data between registers and memory. */ -/* Memory is 3 times as expensive as registers. - ??? Is that the right way to look at it? */ -#define MEMORY_MOVE_COST(MODE,CLASS,IN_P) \ -(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12) - /* The cost of a branch insn. */ /* A value of 2 here causes GCC to avoid using branches in comparisons like while (a < N && a). Branches aren't that expensive on the M32R so diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h index d8ae8e078a9..e98c1909baf 100644 --- a/gcc/config/m68hc11/m68hc11-protos.h +++ b/gcc/config/m68hc11/m68hc11-protos.h @@ -20,8 +20,6 @@ along with GCC; see the file COPYING3. If not see . */ -extern int m68hc11_override_options (void); -extern int m68hc11_optimization_options (int,int); extern void m68hc11_conditional_register_usage (void); extern int hard_regno_mode_ok (int, enum machine_mode); extern int m68hc11_hard_regno_rename_ok (int, int); diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 2056375b6a6..ea60db6a35c 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -61,6 +61,7 @@ Note: #include "target-def.h" #include "df.h" +static void m68hc11_option_override (void); static void emit_move_after_reload (rtx, rtx, rtx); static rtx simplify_logical (enum machine_mode, int, rtx, rtx *); static void m68hc11_emit_logical (enum machine_mode, enum rtx_code, rtx *); @@ -293,10 +294,13 @@ static const struct attribute_spec m68hc11_attribute_table[] = #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT m68hc11_trampoline_init +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE m68hc11_option_override + struct gcc_target targetm = TARGET_INITIALIZER; -int -m68hc11_override_options (void) +static void +m68hc11_option_override (void) { memset (m68hc11_reg_valid_for_index, 0, sizeof (m68hc11_reg_valid_for_index)); @@ -361,7 +365,6 @@ m68hc11_override_options (void) if (TARGET_LONG_CALLS) current_function_far = 1; } - return 0; } diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index 2ea80a76396..f19180d4a1b 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -142,17 +142,6 @@ extern short *reg_renumber; /* def in local_alloc.c */ /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)") -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - -#define OVERRIDE_OPTIONS m68hc11_override_options () - /* Define cost parameters for a given processor variant. */ struct processor_costs { diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h index 08f8a91e691..ad02026309a 100644 --- a/gcc/config/m68k/m68k-protos.h +++ b/gcc/config/m68k/m68k-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. - Copyright (C) 2000, 2002, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2000, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -94,7 +94,6 @@ extern int flags_in_68881 (void); extern void m68k_expand_prologue (void); extern bool m68k_use_return_insn (void); extern void m68k_expand_epilogue (bool); -extern void override_options (void); extern const char *m68k_cpp_cpu_ident (const char *); extern const char *m68k_cpp_cpu_family (const char *); extern void init_68881_table (void); diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index d9032468ada..09b7ccbd86f 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -135,6 +135,7 @@ static int m68k_sched_first_cycle_multipass_dfa_lookahead (void); static bool m68k_can_eliminate (const int, const int); static bool m68k_legitimate_address_p (enum machine_mode, rtx, bool); static bool m68k_handle_option (size_t, const char *, int); +static void m68k_option_override (void); static rtx find_addr_reg (rtx); static const char *singlemove_string (rtx *); static void m68k_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, @@ -233,6 +234,9 @@ const char *m68k_library_id_string = "_current_shared_library_a5_offset_"; #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION m68k_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE m68k_option_override + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m68k_rtx_costs @@ -539,17 +543,10 @@ m68k_handle_option (size_t code, const char *arg, int value) } } -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ +/* Implement TARGET_OPTION_OVERRIDE. */ -void -override_options (void) +static void +m68k_option_override (void) { const struct m68k_target_selection *entry; unsigned long target_mask; diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index ac478619f73..75217bae231 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC for Motorola 680x0/ColdFire. Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -274,8 +274,6 @@ along with GCC; see the file COPYING3. If not see #define TUNE_MAC ((m68k_tune_flags & FL_CF_MAC) != 0) #define TUNE_EMAC ((m68k_tune_flags & FL_CF_EMAC) != 0) -#define OVERRIDE_OPTIONS override_options() - /* These are meant to be redefined in the host dependent files */ #define SUBTARGET_OVERRIDE_OPTIONS diff --git a/gcc/config/mcore/mcore-protos.h b/gcc/config/mcore/mcore-protos.h index 9be73236aa2..2093f16ec19 100644 --- a/gcc/config/mcore/mcore-protos.h +++ b/gcc/config/mcore/mcore-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in mcore.c - Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Nick Clifton (nickc@redhat.com) @@ -29,7 +29,6 @@ extern int mcore_initial_elimination_offset (int, int); extern int mcore_byte_offset (unsigned int); extern int mcore_halfword_offset (unsigned int); extern int mcore_const_trick_uses_not (HOST_WIDE_INT); -extern void mcore_override_options (void); extern int mcore_dllexport_name_p (const char *); extern int mcore_dllimport_name_p (const char *); extern int mcore_naked_function_p (void); diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index 68886934ff7..ce58827de3e 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -1,6 +1,6 @@ /* Output routines for Motorola MCore processor Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -46,11 +46,6 @@ #include "target-def.h" #include "df.h" -/* Maximum size we are allowed to grow the stack in a single operation. - If we want more, we must do it in increments of at most this size. - If this value is 0, we don't check at all. */ -int mcore_stack_increment = STACK_UNITS_MAXSTEP; - /* For dumping information about frame sizes. */ char * mcore_current_function_name = 0; long mcore_current_compilation_timestamp = 0; @@ -149,6 +144,8 @@ static int mcore_arg_partial_bytes (CUMULATIVE_ARGS *, tree, bool); static void mcore_asm_trampoline_template (FILE *); static void mcore_trampoline_init (rtx, tree, rtx); +static void mcore_option_override (void); +static void mcore_option_optimization (int, int); /* MCore specific attributes. */ @@ -225,6 +222,11 @@ static const struct attribute_spec mcore_attribute_table[] = #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT mcore_trampoline_init +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE mcore_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION mcore_option_optimization + struct gcc_target targetm = TARGET_INITIALIZER; /* Adjust the stack and return the number of bytes taken to do it. */ @@ -2679,13 +2681,41 @@ mcore_is_same_reg (rtx x, rtx y) return 0; } -void -mcore_override_options (void) +static void +mcore_option_override (void) { /* Only the m340 supports little endian code. */ if (TARGET_LITTLE_END && ! TARGET_M340) target_flags |= MASK_M340; } + +/* What options are we going to default to specific settings when + -O* happens; the user can subsequently override these settings. + + Omitting the frame pointer is a very good idea on the MCore. + Scheduling isn't worth anything on the current MCore implementation. */ + +static void +mcore_option_optimization (int level, int size) +{ + if (level) + { + flag_no_function_cse = 1; + flag_omit_frame_pointer = 1; + + if (level >= 2) + { + flag_caller_saves = 0; + flag_schedule_insns = 0; + flag_schedule_insns_after_reload = 0; + } + } + if (size) + { + target_flags &= ~MASK_HARDLIT; + } +} + /* Compute the number of word sized registers needed to hold a function argument of mode MODE and type TYPE. */ diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index 7421d5dbb85..5044811761b 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler, for Motorola M*CORE Processor. Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, - 2008, 2009 Free Software Foundation, Inc. + 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -85,36 +85,6 @@ extern char * mcore_current_function_name; /* The MCore ABI says that bitfields are unsigned by default. */ #define CC1_SPEC "-funsigned-bitfields" -/* What options are we going to default to specific settings when - -O* happens; the user can subsequently override these settings. - - Omitting the frame pointer is a very good idea on the MCore. - Scheduling isn't worth anything on the current MCore implementation. */ -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ -{ \ - if (LEVEL) \ - { \ - flag_no_function_cse = 1; \ - flag_omit_frame_pointer = 1; \ - \ - if (LEVEL >= 2) \ - { \ - flag_caller_saves = 0; \ - flag_schedule_insns = 0; \ - flag_schedule_insns_after_reload = 0; \ - } \ - } \ - if (SIZE) \ - { \ - target_flags &= ~MASK_HARDLIT; \ - } \ -} - -/* What options are we going to force to specific settings, - regardless of what the user thought he wanted. - We also use this for some post-processing of options. */ -#define OVERRIDE_OPTIONS mcore_override_options () - /* Target machine storage Layout. */ #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ diff --git a/gcc/config/mcore/mcore.opt b/gcc/config/mcore/mcore.opt index c445237301a..8e465d3a08c 100644 --- a/gcc/config/mcore/mcore.opt +++ b/gcc/config/mcore/mcore.opt @@ -63,8 +63,11 @@ mslow-bytes Target Report Mask(SLOW_BYTES) Prefer word accesses over byte accesses +; Maximum size we are allowed to grow the stack in a single operation. +; If we want more, we must do it in increments of at most this size. +; If this value is 0, we don't check at all. mstack-increment= -Target RejectNegative Joined UInteger Var(mcore_stack_increment) VarExists +Target RejectNegative Joined UInteger Var(mcore_stack_increment) Init(STACK_UNITS_MAXSTEP) Set the maximum amount for a single stack increment operation mwide-bitfields diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c index ac704496d5b..1c9651a0699 100644 --- a/gcc/config/mep/mep-pragma.c +++ b/gcc/config/mep/mep-pragma.c @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "tree.h" -#include "rtl.h" #include "diagnostic-core.h" #include "toplev.h" #include "c-family/c-pragma.h" @@ -39,6 +38,14 @@ along with GCC; see the file COPYING3. If not see enum cw_which { CW_AVAILABLE, CW_CALL_SAVED }; +/* This is normally provided by rtl.h but we can't include that file + here. It's safe to copy the definition here because we're only + using it internally; the value isn't passed to functions outside + this file. */ +#ifndef INVALID_REGNUM +#define INVALID_REGNUM (~(unsigned int) 0) +#endif + static enum cpp_ttype mep_pragma_lex (tree *valp) { @@ -201,8 +208,8 @@ mep_pragma_coprocessor_which (enum cw_which cw_which) } /* Fix up register class hierarchy. */ - save_register_info (); - reinit_regs (); + mep_save_register_info (); + mep_reinit_regs (); if (cfun == 0) { @@ -263,20 +270,34 @@ mep_pragma_coprocessor_subclass (void) enum cpp_ttype type; HARD_REG_SET set; int class_letter; - enum reg_class class; + enum reg_class rclass; type = mep_pragma_lex (&val); if (type != CPP_CHAR) goto syntax_error; class_letter = tree_low_cst (val, 1); if (class_letter >= 'A' && class_letter <= 'D') - class = class_letter - 'A' + USER0_REGS; + switch (class_letter) + { + case 'A': + rclass = USER0_REGS; + break; + case 'B': + rclass = USER1_REGS; + break; + case 'C': + rclass = USER2_REGS; + break; + case 'D': + rclass = USER3_REGS; + break; + } else { error ("#pragma GCC coprocessor subclass letter must be in [ABCD]"); return; } - if (reg_class_size[class] > 0) + if (reg_class_size[rclass] > 0) { error ("#pragma GCC coprocessor subclass '%c' already defined", class_letter); @@ -291,8 +312,8 @@ mep_pragma_coprocessor_subclass (void) return; /* Fix up register class hierarchy. */ - COPY_HARD_REG_SET (reg_class_contents[class], set); - init_regs (); + COPY_HARD_REG_SET (reg_class_contents[rclass], set); + mep_init_regs (); return; syntax_error: diff --git a/gcc/config/mep/mep-protos.h b/gcc/config/mep/mep-protos.h index 82be465ad04..4ab86b5faab 100644 --- a/gcc/config/mep/mep-protos.h +++ b/gcc/config/mep/mep-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in mep.c - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Red Hat Inc (dj@redhat.com) @@ -19,9 +19,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -extern void mep_conditional_register_usage (char *, char *); -extern void mep_optimization_options (void); -extern void mep_override_options (void); +extern void mep_conditional_register_usage (void); extern int mep_regno_reg_class (int); extern int mep_reg_class_from_constraint (int, const char *); extern bool mep_const_ok_for_letter_p (HOST_WIDE_INT, int); @@ -108,6 +106,14 @@ extern bool mep_have_copro_copro_moves_p; extern bool mep_cannot_change_mode_class (enum machine_mode, enum machine_mode, enum reg_class); +/* These are called from mep-pragmas (front end) and then call into + the RTL layer to re-initialize the register tables once we're done + changing them via pragmas. */ +extern void mep_save_register_info (void); +extern void mep_reinit_regs (void); +extern void mep_init_regs (void); + + extern int cgen_h_uint_6a1_immediate (rtx, enum machine_mode); extern int cgen_h_uint_7a1_immediate (rtx, enum machine_mode); extern int cgen_h_uint_8a1_immediate (rtx, enum machine_mode); diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index 1d83d8d76e2..712abbe5f2a 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -122,8 +122,6 @@ struct GTY(()) machine_function #define MEP_CONTROL_REG(x) \ (GET_CODE (x) == REG && ANY_CONTROL_REGNO_P (REGNO (x))) -static const struct attribute_spec mep_attribute_table[11]; - static GTY(()) section * based_section; static GTY(()) section * tinybss_section; static GTY(()) section * far_section; @@ -231,83 +229,6 @@ static tree mep_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); static bool mep_can_eliminate (const int, const int); static void mep_trampoline_init (rtx, tree, rtx); -/* Initialize the GCC target structure. */ - -#undef TARGET_ASM_FUNCTION_PROLOGUE -#define TARGET_ASM_FUNCTION_PROLOGUE mep_start_function -#undef TARGET_ATTRIBUTE_TABLE -#define TARGET_ATTRIBUTE_TABLE mep_attribute_table -#undef TARGET_COMP_TYPE_ATTRIBUTES -#define TARGET_COMP_TYPE_ATTRIBUTES mep_comp_type_attributes -#undef TARGET_INSERT_ATTRIBUTES -#define TARGET_INSERT_ATTRIBUTES mep_insert_attributes -#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P -#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P mep_function_attribute_inlinable_p -#undef TARGET_CAN_INLINE_P -#define TARGET_CAN_INLINE_P mep_can_inline_p -#undef TARGET_SECTION_TYPE_FLAGS -#define TARGET_SECTION_TYPE_FLAGS mep_section_type_flags -#undef TARGET_ASM_NAMED_SECTION -#define TARGET_ASM_NAMED_SECTION mep_asm_named_section -#undef TARGET_INIT_BUILTINS -#define TARGET_INIT_BUILTINS mep_init_builtins -#undef TARGET_EXPAND_BUILTIN -#define TARGET_EXPAND_BUILTIN mep_expand_builtin -#undef TARGET_SCHED_ADJUST_COST -#define TARGET_SCHED_ADJUST_COST mep_adjust_cost -#undef TARGET_SCHED_ISSUE_RATE -#define TARGET_SCHED_ISSUE_RATE mep_issue_rate -#undef TARGET_SCHED_REORDER -#define TARGET_SCHED_REORDER mep_sched_reorder -#undef TARGET_STRIP_NAME_ENCODING -#define TARGET_STRIP_NAME_ENCODING mep_strip_name_encoding -#undef TARGET_ASM_SELECT_SECTION -#define TARGET_ASM_SELECT_SECTION mep_select_section -#undef TARGET_ASM_UNIQUE_SECTION -#define TARGET_ASM_UNIQUE_SECTION mep_unique_section -#undef TARGET_ENCODE_SECTION_INFO -#define TARGET_ENCODE_SECTION_INFO mep_encode_section_info -#undef TARGET_FUNCTION_OK_FOR_SIBCALL -#define TARGET_FUNCTION_OK_FOR_SIBCALL mep_function_ok_for_sibcall -#undef TARGET_RTX_COSTS -#define TARGET_RTX_COSTS mep_rtx_cost -#undef TARGET_ADDRESS_COST -#define TARGET_ADDRESS_COST mep_address_cost -#undef TARGET_MACHINE_DEPENDENT_REORG -#define TARGET_MACHINE_DEPENDENT_REORG mep_reorg -#undef TARGET_SETUP_INCOMING_VARARGS -#define TARGET_SETUP_INCOMING_VARARGS mep_setup_incoming_varargs -#undef TARGET_PASS_BY_REFERENCE -#define TARGET_PASS_BY_REFERENCE mep_pass_by_reference -#undef TARGET_VECTOR_MODE_SUPPORTED_P -#define TARGET_VECTOR_MODE_SUPPORTED_P mep_vector_mode_supported_p -#undef TARGET_HANDLE_OPTION -#define TARGET_HANDLE_OPTION mep_handle_option -#undef TARGET_DEFAULT_TARGET_FLAGS -#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT -#undef TARGET_ALLOCATE_INITIAL_VALUE -#define TARGET_ALLOCATE_INITIAL_VALUE mep_allocate_initial_value -#undef TARGET_ASM_INIT_SECTIONS -#define TARGET_ASM_INIT_SECTIONS mep_asm_init_sections -#undef TARGET_RETURN_IN_MEMORY -#define TARGET_RETURN_IN_MEMORY mep_return_in_memory -#undef TARGET_NARROW_VOLATILE_BITFIELD -#define TARGET_NARROW_VOLATILE_BITFIELD mep_narrow_volatile_bitfield -#undef TARGET_EXPAND_BUILTIN_SAVEREGS -#define TARGET_EXPAND_BUILTIN_SAVEREGS mep_expand_builtin_saveregs -#undef TARGET_BUILD_BUILTIN_VA_LIST -#define TARGET_BUILD_BUILTIN_VA_LIST mep_build_builtin_va_list -#undef TARGET_EXPAND_BUILTIN_VA_START -#define TARGET_EXPAND_BUILTIN_VA_START mep_expand_va_start -#undef TARGET_GIMPLIFY_VA_ARG_EXPR -#define TARGET_GIMPLIFY_VA_ARG_EXPR mep_gimplify_va_arg_expr -#undef TARGET_CAN_ELIMINATE -#define TARGET_CAN_ELIMINATE mep_can_eliminate -#undef TARGET_TRAMPOLINE_INIT -#define TARGET_TRAMPOLINE_INIT mep_trampoline_init - -struct gcc_target targetm = TARGET_INITIALIZER; - #define WANT_GCC_DEFINITIONS #include "mep-intrin.h" #undef WANT_GCC_DEFINITIONS @@ -354,7 +275,7 @@ mep_set_leaf_registers (int enable) } void -mep_conditional_register_usage (char *fixed_regs, char *call_used_regs) +mep_conditional_register_usage (void) { int i; @@ -370,8 +291,8 @@ mep_conditional_register_usage (char *fixed_regs, char *call_used_regs) global_regs[i] = 1; } -void -mep_optimization_options (void) +static void +mep_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) { /* The first scheduling pass often increases register pressure and tends to result in more spill code. Only run it when specifically asked. */ @@ -381,8 +302,8 @@ mep_optimization_options (void) flag_omit_frame_pointer = 1; } -void -mep_override_options (void) +static void +mep_option_override (void) { if (flag_pic == 1) warning (OPT_fpic, "-fpic is not supported"); @@ -4302,6 +4223,30 @@ mep_file_cleanups (void) if (pragma_htab) htab_traverse (pragma_htab, note_unused_pragma_disinterrupt, NULL); } + +/* These three functions provide a bridge between the pramgas that + affect register classes, and the functions that maintain them. We + can't call those functions directly as pragma handling is part of + the front end and doesn't have direct access to them. */ + +void +mep_save_register_info (void) +{ + save_register_info (); +} + +void +mep_reinit_regs (void) +{ + reinit_regs (); +} + +void +mep_init_regs (void) +{ + init_regs (); +} + static int @@ -5629,7 +5574,7 @@ mep_invert_branch (rtx insn, rtx after) static void mep_reorg_erepeat (rtx insns) { - rtx insn, prev, label_before, l, x; + rtx insn, prev, l, x; int count; for (insn = insns; insn; insn = NEXT_INSN (insn)) @@ -5644,7 +5589,6 @@ mep_reorg_erepeat (rtx insns) print_rtl_single (dump_file, insn); } count = simplejump_p (insn) ? 0 : 1; - label_before = 0; for (prev = PREV_INSN (insn); prev; prev = PREV_INSN (prev)) { if (GET_CODE (prev) == CALL_INSN @@ -5733,8 +5677,6 @@ mep_reorg_erepeat (rtx insns) if (INSN_P (prev)) { count ++; - if (count == 2) - label_before = prev; } } } @@ -6332,7 +6274,6 @@ mep_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, const struct cgen_insn *cgen_insn; const struct insn_data_d *idata; unsigned int first_arg = 0; - tree return_type = void_type_node; unsigned int builtin_n_args; fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0); @@ -6354,7 +6295,7 @@ mep_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, if (cgen_insn->cret_p > 1) builtin_n_args ++; first_arg = 1; - return_type = mep_cgen_regnum_to_type (cgen_insn->regnums[0].type); + mep_cgen_regnum_to_type (cgen_insn->regnums[0].type); builtin_n_args --; } @@ -7415,5 +7356,86 @@ mep_asm_init_sections (void) "\t.section .ftext,\"ax\"\n\t.core"); } + +/* Initialize the GCC target structure. */ + +#undef TARGET_ASM_FUNCTION_PROLOGUE +#define TARGET_ASM_FUNCTION_PROLOGUE mep_start_function +#undef TARGET_ATTRIBUTE_TABLE +#define TARGET_ATTRIBUTE_TABLE mep_attribute_table +#undef TARGET_COMP_TYPE_ATTRIBUTES +#define TARGET_COMP_TYPE_ATTRIBUTES mep_comp_type_attributes +#undef TARGET_INSERT_ATTRIBUTES +#define TARGET_INSERT_ATTRIBUTES mep_insert_attributes +#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P +#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P mep_function_attribute_inlinable_p +#undef TARGET_CAN_INLINE_P +#define TARGET_CAN_INLINE_P mep_can_inline_p +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS mep_section_type_flags +#undef TARGET_ASM_NAMED_SECTION +#define TARGET_ASM_NAMED_SECTION mep_asm_named_section +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS mep_init_builtins +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN mep_expand_builtin +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST mep_adjust_cost +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE mep_issue_rate +#undef TARGET_SCHED_REORDER +#define TARGET_SCHED_REORDER mep_sched_reorder +#undef TARGET_STRIP_NAME_ENCODING +#define TARGET_STRIP_NAME_ENCODING mep_strip_name_encoding +#undef TARGET_ASM_SELECT_SECTION +#define TARGET_ASM_SELECT_SECTION mep_select_section +#undef TARGET_ASM_UNIQUE_SECTION +#define TARGET_ASM_UNIQUE_SECTION mep_unique_section +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO mep_encode_section_info +#undef TARGET_FUNCTION_OK_FOR_SIBCALL +#define TARGET_FUNCTION_OK_FOR_SIBCALL mep_function_ok_for_sibcall +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS mep_rtx_cost +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST mep_address_cost +#undef TARGET_MACHINE_DEPENDENT_REORG +#define TARGET_MACHINE_DEPENDENT_REORG mep_reorg +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS mep_setup_incoming_varargs +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE mep_pass_by_reference +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P mep_vector_mode_supported_p +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION mep_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE mep_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION mep_option_optimization +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_ALLOCATE_INITIAL_VALUE +#define TARGET_ALLOCATE_INITIAL_VALUE mep_allocate_initial_value +#undef TARGET_ASM_INIT_SECTIONS +#define TARGET_ASM_INIT_SECTIONS mep_asm_init_sections +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY mep_return_in_memory +#undef TARGET_NARROW_VOLATILE_BITFIELD +#define TARGET_NARROW_VOLATILE_BITFIELD mep_narrow_volatile_bitfield +#undef TARGET_EXPAND_BUILTIN_SAVEREGS +#define TARGET_EXPAND_BUILTIN_SAVEREGS mep_expand_builtin_saveregs +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST mep_build_builtin_va_list +#undef TARGET_EXPAND_BUILTIN_VA_START +#define TARGET_EXPAND_BUILTIN_VA_START mep_expand_va_start +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR mep_gimplify_va_arg_expr +#undef TARGET_CAN_ELIMINATE +#define TARGET_CAN_ELIMINATE mep_can_eliminate +#undef TARGET_TRAMPOLINE_INIT +#define TARGET_TRAMPOLINE_INIT mep_trampoline_init + +struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-mep.h" diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h index d3af0734951..1bebf3badb7 100644 --- a/gcc/config/mep/mep.h +++ b/gcc/config/mep/mep.h @@ -1,5 +1,5 @@ /* Definitions for Toshiba Media Processor - Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Red Hat, Inc. @@ -134,8 +134,6 @@ extern int target_flags; #define TARGET_VERSION fprintf (stderr, " (Toshiba Media Processor (MeP))"); -#define OVERRIDE_OPTIONS mep_override_options (); - /* The MeP config tool will add TARGET_OPTION_TRANSLATE_TABLE here. */ #define TARGET_OPTION_TRANSLATE_TABLE \ {"-mall-opts", "-maverage -mmult -mdiv -mbitops -mleadz \ @@ -165,8 +163,6 @@ extern int target_flags; /* end-coproc-selection-table */ #define CAN_DEBUG_WITHOUT_FP - -#define OPTIMIZATION_OPTIONS(LEVEL, FOR_SIZE) mep_optimization_options () #define BITS_BIG_ENDIAN 0 @@ -276,7 +272,7 @@ extern int target_flags; } #define CONDITIONAL_REGISTER_USAGE \ - mep_conditional_register_usage (fixed_regs, call_used_regs); + mep_conditional_register_usage (); #define REG_ALLOC_ORDER { \ /* core registers */ \ diff --git a/gcc/config/mep/t-mep b/gcc/config/mep/t-mep index 9608d6c46d3..b5b88498461 100644 --- a/gcc/config/mep/t-mep +++ b/gcc/config/mep/t-mep @@ -1,6 +1,6 @@ # -*- makefile -*- # GCC makefile fragment for MeP -# Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009 +# Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010 # Free Software Foundation, Inc. # Contributed by Red Hat Inc # @@ -22,7 +22,7 @@ # Force genpreds to be rebuilt in case MeP-Integrator changed the predicates -GTM_H = tm.h $(tm_file_list) $(srcdir)/config/mep/mep-intrin.h +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 diff --git a/gcc/config/mips/loongson.md b/gcc/config/mips/loongson.md index 11b197b3780..4f95c285ce5 100644 --- a/gcc/config/mips/loongson.md +++ b/gcc/config/mips/loongson.md @@ -411,7 +411,7 @@ [(set_attr "type" "fmul")]) ;; Shift left logical. -(define_insn "loongson_psll" +(define_insn "ashl3" [(set (match_operand:VWH 0 "register_operand" "=f") (ashift:VWH (match_operand:VWH 1 "register_operand" "f") (match_operand:SI 2 "register_operand" "f")))] @@ -420,7 +420,7 @@ [(set_attr "type" "fmul")]) ;; Shift right arithmetic. -(define_insn "loongson_psra" +(define_insn "ashr3" [(set (match_operand:VWH 0 "register_operand" "=f") (ashiftrt:VWH (match_operand:VWH 1 "register_operand" "f") (match_operand:SI 2 "register_operand" "f")))] @@ -429,7 +429,7 @@ [(set_attr "type" "fdiv")]) ;; Shift right logical. -(define_insn "loongson_psrl" +(define_insn "lshr3" [(set (match_operand:VWH 0 "register_operand" "=f") (lshiftrt:VWH (match_operand:VWH 1 "register_operand" "f") (match_operand:SI 2 "register_operand" "f")))] diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 6302c3a9db0..be2d6af0884 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -240,11 +240,7 @@ extern bool mips_expand_block_move (rtx, rtx, rtx); extern void mips_expand_synci_loop (rtx, rtx); extern void mips_init_cumulative_args (CUMULATIVE_ARGS *, tree); -extern void mips_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, - tree, int); -extern rtx mips_function_arg (const CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern int mips_function_arg_boundary (enum machine_mode, tree); +extern int mips_function_arg_boundary (enum machine_mode, const_tree); extern bool mips_pad_arg_upward (enum machine_mode, const_tree); extern bool mips_pad_reg_upward (enum machine_mode, tree); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index e3df2364887..d26990e593b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4701,7 +4701,7 @@ mips_init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype) static void mips_get_arg_info (struct mips_arg_info *info, const CUMULATIVE_ARGS *cum, - enum machine_mode mode, tree type, int named) + enum machine_mode mode, const_tree type, bool named) { bool doubleword_aligned_p; unsigned int num_bytes, num_words, max_regs; @@ -4834,11 +4834,11 @@ mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) return !TARGET_OLDABI; } -/* Implement FUNCTION_ARG. */ +/* Implement TARGET_FUNCTION_ARG. */ -rtx -mips_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named) +static rtx +mips_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named) { struct mips_arg_info info; @@ -4960,11 +4960,11 @@ mips_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, return gen_rtx_REG (mode, mips_arg_regno (&info, TARGET_HARD_FLOAT)); } -/* Implement FUNCTION_ARG_ADVANCE. */ +/* Implement TARGET_FUNCTION_ARG_ADVANCE. */ -void +static void mips_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named) + const_tree type, bool named) { struct mips_arg_info info; @@ -5013,7 +5013,7 @@ mips_arg_partial_bytes (CUMULATIVE_ARGS *cum, to STACK_BOUNDARY bits if the type requires it. */ int -mips_function_arg_boundary (enum machine_mode mode, tree type) +mips_function_arg_boundary (enum machine_mode mode, const_tree type) { unsigned int alignment; @@ -5346,7 +5346,7 @@ mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ local_cum = *cum; - FUNCTION_ARG_ADVANCE (local_cum, mode, type, true); + mips_function_arg_advance (&local_cum, mode, type, true); /* Found out how many registers we need to save. */ gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs; @@ -10078,6 +10078,9 @@ mips_expand_prologue (void) frame = &cfun->machine->frame; size = frame->total_size; + if (flag_stack_usage) + current_function_static_stack_size = size; + /* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP bytes beforehand; this is enough to cover the register save area without going out of range. */ @@ -11137,6 +11140,14 @@ mips_scalar_mode_supported_p (enum machine_mode mode) return default_scalar_mode_supported_p (mode); } +/* Implement TARGET_VECTORIZE_UNITS_PER_SIMD_WORD. */ + +static unsigned int +mips_units_per_simd_word (enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return TARGET_PAIRED_SINGLE_FLOAT ? 8 : UNITS_PER_WORD; +} + /* Implement TARGET_INIT_LIBFUNCS. */ #include "config/gofast.h" @@ -12711,6 +12722,12 @@ AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BUILTIN) #define CODE_FOR_loongson_pmulhuh CODE_FOR_umulv4hi3_highpart #define CODE_FOR_loongson_pmulhh CODE_FOR_smulv4hi3_highpart #define CODE_FOR_loongson_pmullh CODE_FOR_mulv4hi3 +#define CODE_FOR_loongson_psllh CODE_FOR_ashlv4hi3 +#define CODE_FOR_loongson_psllw CODE_FOR_ashlv2si3 +#define CODE_FOR_loongson_psrlh CODE_FOR_lshrv4hi3 +#define CODE_FOR_loongson_psrlw CODE_FOR_lshrv2si3 +#define CODE_FOR_loongson_psrah CODE_FOR_ashrv4hi3 +#define CODE_FOR_loongson_psraw CODE_FOR_ashrv2si3 #define CODE_FOR_loongson_psubw CODE_FOR_subv2si3 #define CODE_FOR_loongson_psubh CODE_FOR_subv4hi3 #define CODE_FOR_loongson_psubb CODE_FOR_subv8qi3 @@ -16335,6 +16352,20 @@ void mips_function_profiler (FILE *file) fprintf (file, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], reg_names[2]); } + +/* Implement TARGET_SHIFT_TRUNCATION_MASK. We want to keep the default + behaviour of TARGET_SHIFT_TRUNCATION_MASK for non-vector modes even + when TARGET_LOONGSON_2EF is true. */ + +static unsigned HOST_WIDE_INT +mips_shift_truncation_mask (enum machine_mode mode) +{ + if (TARGET_LOONGSON_2EF && VECTOR_MODE_P (mode)) + return 0; + + return GET_MODE_BITSIZE (mode) - 1; +} + /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -16469,6 +16500,10 @@ void mips_function_profiler (FILE *file) #define TARGET_CALLEE_COPIES mips_callee_copies #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES mips_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG mips_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE mips_function_arg_advance #undef TARGET_MODE_REP_EXTENDED #define TARGET_MODE_REP_EXTENDED mips_mode_rep_extended @@ -16479,6 +16514,9 @@ void mips_function_profiler (FILE *file) #undef TARGET_SCALAR_MODE_SUPPORTED_P #define TARGET_SCALAR_MODE_SUPPORTED_P mips_scalar_mode_supported_p +#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD +#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD mips_units_per_simd_word + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS mips_init_builtins #undef TARGET_EXPAND_BUILTIN @@ -16539,6 +16577,9 @@ void mips_function_profiler (FILE *file) #undef TARGET_ASM_OUTPUT_SOURCE_FILENAME #define TARGET_ASM_OUTPUT_SOURCE_FILENAME mips_output_filename +#undef TARGET_SHIFT_TRUNCATION_MASK +#define TARGET_SHIFT_TRUNCATION_MASK mips_shift_truncation_mask + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-mips.h" diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index c5519b0fc8b..4f44130c5a5 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -761,7 +761,9 @@ enum mips_code_readable_setting { /* A spec that infers the -mdsp setting from an -march argument. */ #define BASE_DRIVER_SELF_SPECS \ - "%{!mno-dsp:%{march=24ke*|march=34k*|march=74k*|march=1004k*: -mdsp}}" + "%{!mno-dsp: \ + %{march=24ke*|march=34k*|march=1004k*: -mdsp} \ + %{march=74k*:%{!mno-dspr2: -mdspr2 -mdsp}}}" #define DRIVER_SELF_SPECS BASE_DRIVER_SELF_SPECS @@ -1326,9 +1328,6 @@ enum mips_code_readable_setting { /* The number of bytes in a double. */ #define UNITS_PER_DOUBLE (TYPE_PRECISION (double_type_node) / BITS_PER_UNIT) -#define UNITS_PER_SIMD_WORD(MODE) \ - (TARGET_PAIRED_SINGLE_FLOAT ? 8 : UNITS_PER_WORD) - /* Set the sizes of the core types. */ #define SHORT_TYPE_SIZE 16 #define INT_TYPE_SIZE 32 @@ -2249,29 +2248,6 @@ typedef struct mips_args { #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ mips_init_cumulative_args (&CUM, FNTYPE) -/* 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.) */ - -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - mips_function_arg_advance (&CUM, MODE, TYPE, NAMED) - -/* 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). */ - -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - mips_function_arg (&CUM, MODE, TYPE, NAMED) - #define FUNCTION_ARG_BOUNDARY mips_function_arg_boundary #define FUNCTION_ARG_PADDING(MODE, TYPE) \ @@ -2444,9 +2420,10 @@ typedef struct mips_args { (often extended) would be needed for byte accesses. */ #define SLOW_BYTE_ACCESS (!TARGET_MIPS16) -/* Define this to be nonzero if shift instructions ignore all but the low-order - few bits. */ -#define SHIFT_COUNT_TRUNCATED 1 +/* Standard MIPS integer shifts truncate the shift amount to the + width of the shifted operand. However, Loongson vector shifts + do not truncate the shift amount at all. */ +#define SHIFT_COUNT_TRUNCATED (!TARGET_LOONGSON_2EF) /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits is done just by pretending it is already truncated. */ diff --git a/gcc/config/mips/sde.h b/gcc/config/mips/sde.h index d2a32967b75..29eaccc8724 100644 --- a/gcc/config/mips/sde.h +++ b/gcc/config/mips/sde.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. MIPS SDE version. - Copyright (C) 2003, 2004, 2007, 2008, 2009 + Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -42,13 +42,6 @@ along with GCC; see the file COPYING3. If not see things like LINK_SPEC easier to write. */ \ "%{!EB:%{!EL:%(endian_spec)}}", \ \ - /* -mcode-xonly is a traditional alias for -mcode-readable=pcrel and \ - -mno-data-in-code is a traditional alias for -mcode-readable=no. \ - The latter trumps the former. */ \ - "%{mno-data-in-code: -mcode-readable=no}", \ - "%{!mcode-readable=no: %{mcode-xonly: -mcode-readable=pcrel}}", \ - "%. + +; -mcode-xonly is a traditional alias for -mcode-readable=pcrel and +; -mno-data-in-code is a traditional alias for -mcode-readable=no. + +mno-data-in-code +Target RejectNegative Alias(mcode-readable=, no) + +mcode-xonly +Target RejectNegative Alias(mcode-readable=, pcrel) diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h index 9918fa8094d..d7e0a947004 100644 --- a/gcc/config/mmix/mmix-protos.h +++ b/gcc/config/mmix/mmix-protos.h @@ -19,7 +19,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -extern void mmix_override_options (void); extern void mmix_init_expanders (void); extern int mmix_eh_return_data_regno (int); extern int mmix_initial_elimination_offset (int, int); diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 8ed8b177fcb..293a2f5bde6 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -113,6 +113,8 @@ rtx mmix_compare_op1; /* Intermediate for insn output. */ static int mmix_output_destination_register; +static void mmix_option_override (void); +static void mmix_option_optimization (int, int); static void mmix_asm_output_source_filename (FILE *, const char *); static void mmix_output_shiftvalue_op_from_str (FILE *, const char *, HOST_WIDEST_INT); @@ -233,15 +235,20 @@ static void mmix_trampoline_init (rtx, tree, rtx); #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT mmix_trampoline_init +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE mmix_option_override +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION mmix_option_optimization + struct gcc_target targetm = TARGET_INITIALIZER; /* Functions that are expansions for target macros. See Target Macros in `Using and Porting GCC'. */ -/* OVERRIDE_OPTIONS. */ +/* TARGET_OPTION_OVERRIDE. */ -void -mmix_override_options (void) +static void +mmix_option_override (void) { /* Should we err or should we warn? Hmm. At least we must neutralize it. For example the wrong kind of case-tables will be generated with @@ -255,6 +262,18 @@ mmix_override_options (void) } } +/* TARGET_OPTION_OPTIMIZATION. */ + +static void +mmix_option_optimization (int level, int size) +{ + if (level >= 1) + flag_regmove = 1; + + if (size || level > 1) + flag_omit_frame_pointer = 1; +} + /* INIT_EXPANDERS. */ void diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 26447357e47..5908a754284 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -149,21 +149,6 @@ extern int target_flags; #define TARGET_VERSION \ fprintf (stderr, " (MMIX)") -#define OVERRIDE_OPTIONS mmix_override_options () - -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - do \ - { \ - if (LEVEL >= 1) \ - flag_regmove = TRUE; \ - \ - if (SIZE || LEVEL > 1) \ - { \ - flag_omit_frame_pointer = TRUE; \ - } \ - } \ - while (0) - /* This one will have to wait a little bit; right now we can't debug neither with or without a frame-pointer. */ /* #define CAN_DEBUG_WITHOUT_FP */ diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h index 47488c9b0ba..02a7942824a 100644 --- a/gcc/config/mn10300/mn10300-protos.h +++ b/gcc/config/mn10300/mn10300-protos.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10300 series - Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GCC. @@ -20,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #ifdef RTX_CODE -extern void mn10300_override_options (void); extern rtx legitimize_pic_address (rtx, rtx); extern int legitimate_pic_operand_p (rtx); extern void print_operand (FILE *, rtx, int); diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index b55ca37c00c..fe03742e7e4 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -69,6 +69,7 @@ enum processor_type mn10300_processor = PROCESSOR_DEFAULT; static bool mn10300_handle_option (size_t, const char *, int); +static void mn10300_option_override (void); static bool mn10300_legitimate_address_p (enum machine_mode, rtx, bool); static int mn10300_address_cost_1 (rtx, int *); static int mn10300_address_cost (rtx, bool); @@ -112,6 +113,8 @@ static bool mn10300_can_output_mi_thunk (const_tree, HOST_WIDE_INT, HOST_WIDE_IN #define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0 #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION mn10300_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE mn10300_option_override #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info @@ -177,10 +180,10 @@ mn10300_handle_option (size_t code, } } -/* Implement OVERRIDE_OPTIONS. */ +/* Implement TARGET_OPTION_OVERRIDE. */ -void -mn10300_override_options (void) +static void +mn10300_option_override (void) { if (TARGET_AM33) target_flags &= ~MASK_MULT_BUG; diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 1700f1a25be..56e2bc80792 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -60,8 +60,6 @@ extern enum processor_type mn10300_processor; #define PROCESSOR_DEFAULT PROCESSOR_MN10300 #endif -#define OVERRIDE_OPTIONS mn10300_override_options () - /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (MN10300)"); diff --git a/gcc/config/moxie/moxie-protos.h b/gcc/config/moxie/moxie-protos.h index 471fd99a67d..3c1027bee58 100644 --- a/gcc/config/moxie/moxie-protos.h +++ b/gcc/config/moxie/moxie-protos.h @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -extern void moxie_override_options (void); extern void moxie_expand_prologue (void); extern void moxie_expand_epilogue (void); extern int moxie_initial_elimination_offset (int, int); diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c index 512582e3273..cd2fb88decc 100644 --- a/gcc/config/moxie/moxie.c +++ b/gcc/config/moxie/moxie.c @@ -231,10 +231,10 @@ moxie_init_machine_status (void) } -/* The OVERRIDE_OPTIONS worker. +/* The TARGET_OPTION_OVERRIDE worker. All this curently does is set init_machine_status. */ -void -moxie_override_options (void) +static void +moxie_option_override (void) { /* Set the per-function-data initializer. */ init_machine_status = moxie_init_machine_status; @@ -567,6 +567,9 @@ moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT moxie_trampoline_init +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE moxie_option_override + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-moxie.h" diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h index 0a53b6b7216..1445202c332 100644 --- a/gcc/config/moxie/moxie.h +++ b/gcc/config/moxie/moxie.h @@ -303,8 +303,6 @@ enum reg_class pointer registers are already assumed to be used as needed. */ #define EPILOGUE_USES(R) (R == MOXIE_R5) -#define OVERRIDE_OPTIONS moxie_override_options () - /* Storage Layout */ #define BITS_BIG_ENDIAN 0 diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index e71d8a1e82c..8097c58cdbb 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -1,5 +1,6 @@ /* Prototypes for pa.c functions used in the md file & elsewhere. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -131,7 +132,6 @@ extern int integer_store_memory_operand (rtx, enum machine_mode); extern int ldil_cint_p (HOST_WIDE_INT); extern int zdepi_cint_p (unsigned HOST_WIDE_INT); -extern void override_options (void); extern void output_ascii (FILE *, const char *, int); extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int *); extern int and_mask_p (unsigned HOST_WIDE_INT); @@ -171,6 +171,7 @@ extern void pa_hpux_asm_output_external (FILE *, tree, const char *); extern bool pa_cannot_change_mode_class (enum machine_mode, enum machine_mode, enum reg_class); extern bool pa_modes_tieable_p (enum machine_mode, enum machine_mode); +extern HOST_WIDE_INT pa_initial_elimination_offset (int, int); extern const int magic_milli[]; extern int shadd_constant_p (int); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 6593e531dfa..754d27adc06 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -84,9 +84,12 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn) #endif #endif +static void pa_option_override (void); static void copy_reg_pointer (rtx, rtx); static void fix_range (const char *); static bool pa_handle_option (size_t, const char *, int); +static int hppa_register_move_cost (enum machine_mode mode, reg_class_t, + reg_class_t); static int hppa_address_cost (rtx, bool); static bool hppa_rtx_costs (rtx, int, int, int *, bool); static inline rtx force_mode (enum machine_mode, rtx); @@ -104,6 +107,8 @@ static void store_reg_modify (int, int, HOST_WIDE_INT); static void load_reg (int, HOST_WIDE_INT, int); static void set_reg_plus_d (int, int, HOST_WIDE_INT, int); static rtx pa_function_value (const_tree, const_tree, bool); +static rtx pa_libcall_value (enum machine_mode, const_rtx); +static bool pa_function_value_regno_p (const unsigned int); static void pa_output_function_prologue (FILE *, HOST_WIDE_INT); static void update_total_code_bytes (unsigned int); static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT); @@ -168,6 +173,9 @@ static void pa_asm_trampoline_template (FILE *); static void pa_trampoline_init (rtx, tree, rtx); static rtx pa_trampoline_adjust_address (rtx); static rtx pa_delegitimize_address (rtx); +static bool pa_print_operand_punct_valid_p (unsigned char); +static rtx pa_internal_arg_pointer (void); +static bool pa_can_eliminate (const int, const int); /* The following extra sections are only used for SOM. */ static GTY(()) section *som_readonly_data_section; @@ -213,6 +221,9 @@ static size_t n_deferred_plabels = 0; /* Initialize the GCC target structure. */ +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE pa_option_override + #undef TARGET_ASM_ALIGNED_HI_OP #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" #undef TARGET_ASM_ALIGNED_SI_OP @@ -235,6 +246,10 @@ static size_t n_deferred_plabels = 0; #undef TARGET_FUNCTION_VALUE #define TARGET_FUNCTION_VALUE pa_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE pa_libcall_value +#undef TARGET_FUNCTION_VALUE_REGNO_P +#define TARGET_FUNCTION_VALUE_REGNO_P pa_function_value_regno_p #undef TARGET_LEGITIMIZE_ADDRESS #define TARGET_LEGITIMIZE_ADDRESS hppa_legitimize_address @@ -269,6 +284,9 @@ static size_t n_deferred_plabels = 0; #define TARGET_ASM_FILE_END output_deferred_plabels #endif +#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P +#define TARGET_PRINT_OPERAND_PUNCT_VALID_P pa_print_operand_punct_valid_p + #if !defined(USE_COLLECT2) #undef TARGET_ASM_CONSTRUCTOR #define TARGET_ASM_CONSTRUCTOR pa_asm_out_constructor @@ -284,6 +302,8 @@ static size_t n_deferred_plabels = 0; #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS pa_init_builtins +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST hppa_register_move_cost #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS hppa_rtx_costs #undef TARGET_ADDRESS_COST @@ -342,6 +362,10 @@ static size_t n_deferred_plabels = 0; #define TARGET_TRAMPOLINE_ADJUST_ADDRESS pa_trampoline_adjust_address #undef TARGET_DELEGITIMIZE_ADDRESS #define TARGET_DELEGITIMIZE_ADDRESS pa_delegitimize_address +#undef TARGET_INTERNAL_ARG_POINTER +#define TARGET_INTERNAL_ARG_POINTER pa_internal_arg_pointer +#undef TARGET_CAN_ELIMINATE +#define TARGET_CAN_ELIMINATE pa_can_eliminate struct gcc_target targetm = TARGET_INITIALIZER; @@ -487,8 +511,10 @@ pa_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) } } -void -override_options (void) +/* Implement the TARGET_OPTION_OVERRIDE hook. */ + +static void +pa_option_override (void) { /* Unconditional branches in the delay slot are not compatible with dwarf2 call frame information. There is no benefit in using this optimization @@ -1297,6 +1323,32 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return orig; } +/* Implement the TARGET_REGISTER_MOVE_COST hook. + + Compute extra cost of moving data between one register class + and another. + + Make moves from SAR so expensive they should never happen. We used to + have 0xffff here, but that generates overflow in rare cases. + + Copies involving a FP register and a non-FP register are relatively + expensive because they must go through memory. + + Other copies are reasonably cheap. */ + +static int +hppa_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + reg_class_t from, reg_class_t to) +{ + if (from == SHIFT_REGS) + return 0x100; + else if ((FP_REG_CLASS_P (from) && ! FP_REG_CLASS_P (to)) + || (FP_REG_CLASS_P (to) && ! FP_REG_CLASS_P (from))) + return 16; + else + return 2; +} + /* For the HPPA, REG and REG+CONST is cost 0 and addresses involving symbolic constants are cost 2. @@ -3688,6 +3740,8 @@ hppa_expand_prologue (void) local_fsize += STARTING_FRAME_OFFSET; actual_fsize = compute_frame_size (size, &save_fregs); + if (flag_stack_usage) + current_function_static_stack_size = actual_fsize; /* Compute a few things we will use often. */ tmpreg = gen_rtx_REG (word_mode, 1); @@ -3714,11 +3768,11 @@ hppa_expand_prologue (void) pointer by actual_fsize bytes. Two versions, first handles small (<8k) frames. The second handles large (>=8k) frames. */ - insn = emit_move_insn (tmpreg, frame_pointer_rtx); + insn = emit_move_insn (tmpreg, hard_frame_pointer_rtx); if (DO_FRAME_NOTES) RTX_FRAME_RELATED_P (insn) = 1; - insn = emit_move_insn (frame_pointer_rtx, stack_pointer_rtx); + insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx); if (DO_FRAME_NOTES) RTX_FRAME_RELATED_P (insn) = 1; @@ -3762,7 +3816,7 @@ hppa_expand_prologue (void) GEN_INT (TARGET_64BIT ? -8 : -4)); emit_move_insn (gen_rtx_MEM (word_mode, addr), - frame_pointer_rtx); + hard_frame_pointer_rtx); } else emit_insn (gen_blockage ()); @@ -3805,7 +3859,7 @@ hppa_expand_prologue (void) if (regno == INVALID_REGNUM) break; - store_reg (regno, offset, FRAME_POINTER_REGNUM); + store_reg (regno, offset, HARD_FRAME_POINTER_REGNUM); offset += UNITS_PER_WORD; } } @@ -3813,7 +3867,7 @@ hppa_expand_prologue (void) for (i = 18; i >= 4; i--) if (df_regs_ever_live_p (i) && ! call_used_regs[i]) { - store_reg (i, offset, FRAME_POINTER_REGNUM); + store_reg (i, offset, HARD_FRAME_POINTER_REGNUM); offset += UNITS_PER_WORD; gr_saved++; } @@ -3902,8 +3956,8 @@ hppa_expand_prologue (void) save area. */ if (frame_pointer_needed) { - set_reg_plus_d (1, FRAME_POINTER_REGNUM, offset, 0); - base = frame_pointer_rtx; + set_reg_plus_d (1, HARD_FRAME_POINTER_REGNUM, offset, 0); + base = hard_frame_pointer_rtx; } else { @@ -4101,7 +4155,7 @@ hppa_expand_epilogue (void) ret_off = TARGET_64BIT ? -16 : -20; if (frame_pointer_needed) { - load_reg (2, ret_off, FRAME_POINTER_REGNUM); + load_reg (2, ret_off, HARD_FRAME_POINTER_REGNUM); ret_off = 0; } else @@ -4132,7 +4186,7 @@ hppa_expand_epilogue (void) if (regno == INVALID_REGNUM) break; - load_reg (regno, offset, FRAME_POINTER_REGNUM); + load_reg (regno, offset, HARD_FRAME_POINTER_REGNUM); offset += UNITS_PER_WORD; } } @@ -4140,7 +4194,7 @@ hppa_expand_epilogue (void) for (i = 18; i >= 4; i--) if (df_regs_ever_live_p (i) && ! call_used_regs[i]) { - load_reg (i, offset, FRAME_POINTER_REGNUM); + load_reg (i, offset, HARD_FRAME_POINTER_REGNUM); offset += UNITS_PER_WORD; } } @@ -4199,7 +4253,7 @@ hppa_expand_epilogue (void) { /* Adjust the register to index off of. */ if (frame_pointer_needed) - set_reg_plus_d (1, FRAME_POINTER_REGNUM, offset, 0); + set_reg_plus_d (1, HARD_FRAME_POINTER_REGNUM, offset, 0); else set_reg_plus_d (1, STACK_POINTER_REGNUM, offset, 0); @@ -4227,8 +4281,9 @@ hppa_expand_epilogue (void) { rtx delta = GEN_INT (-64); - set_reg_plus_d (STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM, 64, 0); - emit_insn (gen_pre_load (frame_pointer_rtx, stack_pointer_rtx, delta)); + set_reg_plus_d (STACK_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM, 64, 0); + emit_insn (gen_pre_load (hard_frame_pointer_rtx, + stack_pointer_rtx, delta)); } /* If we were deferring a callee register restore, do it now. */ else if (merge_sp_adjust_with_load) @@ -4801,6 +4856,20 @@ pa_adjust_insn_length (rtx insn, int length) return 0; } +/* Implement the TARGET_PRINT_OPERAND_PUNCT_VALID_P hook. */ + +static bool +pa_print_operand_punct_valid_p (unsigned char code) +{ + if (code == '@' + || code == '#' + || code == '*' + || code == '^') + return true; + + return false; +} + /* 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. */ @@ -5858,7 +5927,7 @@ pa_eh_return_handler_rtx (void) { rtx tmp; - tmp = gen_rtx_PLUS (word_mode, frame_pointer_rtx, + tmp = gen_rtx_PLUS (word_mode, hard_frame_pointer_rtx, TARGET_64BIT ? GEN_INT (-16) : GEN_INT (-20)); tmp = gen_rtx_MEM (word_mode, tmp); tmp->volatil = 1; @@ -9235,7 +9304,7 @@ pa_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, Small structures must be returned in a PARALLEL on PA64 in order to match the HP Compiler ABI. */ -rtx +static rtx pa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, bool outgoing ATTRIBUTE_UNUSED) @@ -9296,6 +9365,31 @@ pa_function_value (const_tree valtype, return gen_rtx_REG (valmode, 28); } +/* Implement the TARGET_LIBCALL_VALUE hook. */ + +static rtx +pa_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + if (! TARGET_SOFT_FLOAT + && (mode == SFmode || mode == DFmode)) + return gen_rtx_REG (mode, 32); + else + return gen_rtx_REG (mode, 28); +} + +/* Implement the TARGET_FUNCTION_VALUE_REGNO_P hook. */ + +static bool +pa_function_value_regno_p (const unsigned int regno) +{ + if (regno == 28 + || (! TARGET_SOFT_FLOAT && regno == 32)) + return true; + + return false; +} + /* Return the location of a parameter that is passed in a register or NULL if the parameter has any component that is passed in memory. @@ -10013,4 +10107,48 @@ pa_delegitimize_address (rtx orig_x) return x; } +static rtx +pa_internal_arg_pointer (void) +{ + /* The argument pointer and the hard frame pointer are the same in + the 32-bit runtime, so we don't need a copy. */ + if (TARGET_64BIT) + return copy_to_reg (virtual_incoming_args_rtx); + else + return virtual_incoming_args_rtx; +} + +/* Given FROM and TO register numbers, say whether this elimination is allowed. + Frame pointer elimination is automatically handled. */ + +static bool +pa_can_eliminate (const int from, const int to) +{ + /* The argument cannot be eliminated in the 64-bit runtime. */ + if (TARGET_64BIT && from == ARG_POINTER_REGNUM) + return false; + + return (from == HARD_FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM + ? ! frame_pointer_needed + : true); +} + +/* Define the offset between two registers, FROM to be eliminated and its + replacement TO, at the start of a routine. */ +HOST_WIDE_INT +pa_initial_elimination_offset (int from, int to) +{ + HOST_WIDE_INT offset; + + if ((from == HARD_FRAME_POINTER_REGNUM || from == FRAME_POINTER_REGNUM) + && to == STACK_POINTER_REGNUM) + offset = -compute_frame_size (get_frame_size (), 0); + else if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) + offset = 0; + else + gcc_unreachable (); + + return offset; +} + #include "gt-pa.h" diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 73116c5383e..ae768b2ed97 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -145,8 +145,6 @@ extern int flag_pa_unix; and the old mnemonics are dialect zero. */ #define ASSEMBLER_DIALECT (TARGET_PA_20 ? 1 : 0) -#define OVERRIDE_OPTIONS override_options () - /* Override some settings from dbxelf.h. */ /* We do not have to be compatible with dbx, so we enable gdb extensions @@ -346,8 +344,11 @@ typedef struct GTY(()) machine_function /* Register to use for pushing function arguments. */ #define STACK_POINTER_REGNUM 30 +/* Fixed register for local variable access. Always eliminated. */ +#define FRAME_POINTER_REGNUM (TARGET_64BIT ? 61 : 89) + /* Base register for access to local variables of the function. */ -#define FRAME_POINTER_REGNUM 3 +#define HARD_FRAME_POINTER_REGNUM 3 /* Don't allow hard registers to be renamed into r2 unless r2 is already live or already being saved (due to eh). */ @@ -355,15 +356,6 @@ typedef struct GTY(()) machine_function #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \ ((NEW_REG) != 2 || df_regs_ever_live_p (2) || crtl->calls_eh_return) -/* C statement to store the difference between the frame pointer - and the stack pointer values immediately after the function prologue. - - Note, we always pretend that this is a leaf function because if - it's not, there's no point in trying to eliminate the - frame pointer. If it is a leaf function, we guessed right! */ -#define INITIAL_FRAME_POINTER_OFFSET(VAR) \ - do {(VAR) = - compute_frame_size (get_frame_size (), 0);} while (0) - /* Base register for access to arguments of the function. */ #define ARG_POINTER_REGNUM (TARGET_64BIT ? 29 : 3) @@ -387,6 +379,31 @@ extern struct rtx_def *hppa_pic_save_rtx (void); is passed to a function. */ #define PA_STRUCT_VALUE_REGNUM 28 +/* Definitions for register eliminations. + + We have two registers that can be eliminated. First, the frame pointer + register can often be eliminated in favor of the stack pointer register. + Secondly, the argument pointer register can always be eliminated in the + 32-bit runtimes. */ + +/* This is an array of structures. Each structure initializes one pair + of eliminable registers. The "from" register number is given first, + followed by "to". Eliminations of the same "from" register are listed + in order of preference. + + The argument pointer cannot be eliminated in the 64-bit runtime. It + is the same register as the hard frame pointer in the 32-bit runtime. + So, it does not need to be listed. */ +#define ELIMINABLE_REGS \ +{{ HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { FRAME_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) = pa_initial_elimination_offset(FROM, TO)) + /* Describe how we implement __builtin_eh_return. */ #define EH_RETURN_DATA_REGNO(N) \ ((N) < 3 ? (N) + 20 : (N) == 3 ? 31 : INVALID_REGNUM) @@ -396,6 +413,10 @@ extern struct rtx_def *hppa_pic_save_rtx (void); /* Offset from the frame pointer register value to the top of stack. */ #define FRAME_POINTER_CFA_OFFSET(FNDECL) 0 +/* The maximum number of hard registers that can be saved in the call + frame. The soft frame pointer is not included. */ +#define DWARF_FRAME_REGISTERS (FIRST_PSEUDO_REGISTER - 1) + /* A C expression whose value is RTL representing the location of the incoming return address at the beginning of any function, before the prologue. You only need to define this macro if you want to support @@ -410,7 +431,7 @@ extern struct rtx_def *hppa_pic_save_rtx (void); Column 0 is not used but unfortunately its register size is set to 4 bytes (sizeof CCmode) so it can't be used on 64-bit targets. */ -#define DWARF_ALT_FRAME_RETURN_COLUMN FIRST_PSEUDO_REGISTER +#define DWARF_ALT_FRAME_RETURN_COLUMN (FIRST_PSEUDO_REGISTER - 1) /* This macro chooses the encoding of pointers embedded in the exception handling sections. If at all possible, this should be defined such @@ -554,20 +575,6 @@ extern struct rtx_def *hppa_pic_save_rtx (void); ? (STACK_POINTER_OFFSET) \ : ((STACK_POINTER_OFFSET) - crtl->outgoing_args_size)) -/* Define how to find the value returned by a library function - assuming the value has mode MODE. */ - -#define LIBCALL_VALUE(MODE) \ - gen_rtx_REG (MODE, \ - (! TARGET_SOFT_FLOAT \ - && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28)) - -/* 1 if N is a possible register number for a function value - as seen by the caller. */ - -#define FUNCTION_VALUE_REGNO_P(N) \ - ((N) == 28 || (! TARGET_SOFT_FLOAT && (N) == 32)) - /* Define a data type for recording info about an argument list during the scan of that argument list. This data type should @@ -793,12 +800,14 @@ extern int may_call_alloca; #define REGNO_OK_FOR_INDEX_P(X) \ ((X) && ((X) < 32 \ - || (X >= FIRST_PSEUDO_REGISTER \ + || ((X) == FRAME_POINTER_REGNUM) \ + || ((X) >= FIRST_PSEUDO_REGISTER \ && reg_renumber \ && (unsigned) reg_renumber[X] < 32))) #define REGNO_OK_FOR_BASE_P(X) \ ((X) && ((X) < 32 \ - || (X >= FIRST_PSEUDO_REGISTER \ + || ((X) == FRAME_POINTER_REGNUM) \ + || ((X) >= FIRST_PSEUDO_REGISTER \ && reg_renumber \ && (unsigned) reg_renumber[X] < 32))) #define REGNO_OK_FOR_FP_P(X) \ @@ -947,12 +956,16 @@ extern int may_call_alloca; /* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg. */ #define REG_OK_FOR_INDEX_P(X) \ - (REGNO (X) && (REGNO (X) < 32 || REGNO (X) >= FIRST_PSEUDO_REGISTER)) + (REGNO (X) && (REGNO (X) < 32 \ + || REGNO (X) == FRAME_POINTER_REGNUM \ + || REGNO (X) >= FIRST_PSEUDO_REGISTER)) /* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg. */ #define REG_OK_FOR_BASE_P(X) \ - (REGNO (X) && (REGNO (X) < 32 || REGNO (X) >= FIRST_PSEUDO_REGISTER)) + (REGNO (X) && (REGNO (X) < 32 \ + || REGNO (X) == FRAME_POINTER_REGNUM \ + || REGNO (X) >= FIRST_PSEUDO_REGISTER)) #else @@ -1331,22 +1344,6 @@ do { \ few bits. */ #define SHIFT_COUNT_TRUNCATED 1 -/* Compute extra cost of moving data between one register class - and another. - - Make moves from SAR so expensive they should never happen. We used to - have 0xffff here, but that generates overflow in rare cases. - - Copies involving a FP register and a non-FP register are relatively - expensive because they must go through memory. - - Other copies are reasonably cheap. */ -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ - (CLASS1 == SHIFT_REGS ? 0x100 \ - : FP_REG_CLASS_P (CLASS1) && ! FP_REG_CLASS_P (CLASS2) ? 16 \ - : FP_REG_CLASS_P (CLASS2) && ! FP_REG_CLASS_P (CLASS1) ? 16 \ - : 2) - /* Adjust the cost of branches. */ #define BRANCH_COST(speed_p, predictable_p) (pa_cpu == PROCESSOR_8000 ? 2 : 1) @@ -1524,9 +1521,6 @@ do { \ /* All HP assemblers use "!" to separate logical lines. */ #define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == '!') -#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ - ((CHAR) == '@' || (CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^') - /* 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. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index cfe843d40f1..a68989f4fdc 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -7073,10 +7073,10 @@ /* Restore the frame pointer. The virtual_stack_vars_rtx is saved instead of the hard_frame_pointer_rtx in the save area. As a result, an extra instruction is needed to adjust for the offset - of the virtual stack variables and the frame pointer. */ + of the virtual stack variables and the hard frame pointer. */ if (GET_CODE (fp) != REG) fp = force_reg (Pmode, fp); - emit_move_insn (virtual_stack_vars_rtx, fp); + emit_move_insn (hard_frame_pointer_rtx, plus_constant (fp, -8)); emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); @@ -8517,15 +8517,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" /* Restore the frame pointer. The virtual_stack_vars_rtx is saved instead of the hard_frame_pointer_rtx in the save area. We need - to adjust for the offset between these two values when we have - a nonlocal_goto pattern. When we don't have a nonlocal_goto - pattern, the receiver performs the adjustment. */ -#ifdef HAVE_nonlocal_goto - if (HAVE_nonlocal_goto) - emit_move_insn (virtual_stack_vars_rtx, force_reg (Pmode, fp)); - else -#endif - emit_move_insn (hard_frame_pointer_rtx, fp); + to adjust for the offset between these two values. */ + if (GET_CODE (fp) != REG) + fp = force_reg (Pmode, fp); + emit_move_insn (hard_frame_pointer_rtx, plus_constant (fp, -8)); /* This bit is the same as expand_builtin_longjmp. */ emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); @@ -9528,7 +9523,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { addr = gen_rtx_PLUS (word_mode, stack_pointer_rtx, GEN_INT (TARGET_64BIT ? -8 : -4)); - emit_move_insn (gen_rtx_MEM (word_mode, addr), frame_pointer_rtx); + emit_move_insn (gen_rtx_MEM (word_mode, addr), hard_frame_pointer_rtx); } if (!TARGET_64BIT && flag_pic) { diff --git a/gcc/config/pa/pa32-regs.h b/gcc/config/pa/pa32-regs.h index 4a2976c7a85..21aa71940a2 100644 --- a/gcc/config/pa/pa32-regs.h +++ b/gcc/config/pa/pa32-regs.h @@ -1,5 +1,5 @@ /* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008 Free Software Foundation, Inc. + 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -43,8 +43,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see has different fp units: define separate register sets for the 1.0 and 1.1 fp units. */ -#define FIRST_PSEUDO_REGISTER 89 /* 32 general regs + 56 fp regs + - + 1 shift reg */ +#define FIRST_PSEUDO_REGISTER 90 /* 32 general regs + 56 fp regs + + + 1 shift reg + frame pointer */ /* 1 for registers that have pervasive standard uses and are not available for the register allocator. @@ -96,7 +96,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ - 0} + /* shift register and soft frame pointer */ \ + 0, 1} /* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any @@ -117,7 +118,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 0, 0, 0, 0, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, \ - 1} + /* shift register and soft frame pointer */ \ + 1, 1} #define CONDITIONAL_REGISTER_USAGE \ { \ @@ -172,7 +174,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 3, 4, 5, 6, 7, 8, 9, 10, \ 11, 12, 13, 14, 15, 16, 17, 18, \ /* special registers. */ \ - 1, 30, 0, 88} + 1, 30, 0, 88, 89} /* Return number of consecutive hard regs needed starting at reg REGNO @@ -304,12 +306,12 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, #define REG_CLASS_CONTENTS \ {{0x00000000, 0x00000000, 0x00000000}, /* NO_REGS */ \ {0x00000002, 0x00000000, 0x00000000}, /* R1_REGS */ \ - {0xfffffffe, 0x00000000, 0x00000000}, /* GENERAL_REGS */ \ + {0xfffffffe, 0x00000000, 0x02000000}, /* GENERAL_REGS */ \ {0x00000000, 0xff000000, 0x00ffffff}, /* FPUPPER_REGS */ \ {0x00000000, 0xffffffff, 0x00ffffff}, /* FP_REGS */ \ - {0xfffffffe, 0xffffffff, 0x00ffffff}, /* GENERAL_OR_FP_REGS */ \ + {0xfffffffe, 0xffffffff, 0x02ffffff}, /* GENERAL_OR_FP_REGS */ \ {0x00000000, 0x00000000, 0x01000000}, /* SHIFT_REGS */ \ - {0xfffffffe, 0xffffffff, 0x01ffffff}} /* ALL_REGS */ + {0xfffffffe, 0xffffffff, 0x03ffffff}} /* ALL_REGS */ /* The following macro defines cover classes for Integrated Register Allocator. Cover classes is a set of non-intersected register @@ -336,7 +338,7 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, #define REGNO_REG_CLASS(REGNO) \ ((REGNO) == 0 ? NO_REGS \ : (REGNO) == 1 ? R1_REGS \ - : (REGNO) < 32 ? GENERAL_REGS \ + : (REGNO) < 32 || (REGNO) == 89 ? GENERAL_REGS \ : (REGNO) < 56 ? FP_REGS \ : (REGNO) < 88 ? FPUPPER_REGS \ : SHIFT_REGS) @@ -370,7 +372,7 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, "%fr20", "%fr20R", "%fr21", "%fr21R", "%fr22", "%fr22R", "%fr23", "%fr23R", \ "%fr24", "%fr24R", "%fr25", "%fr25R", "%fr26", "%fr26R", "%fr27", "%fr27R", \ "%fr28", "%fr28R", "%fr29", "%fr29R", "%fr30", "%fr30R", "%fr31", "%fr31R", \ - "SAR"} + "SAR", "sfp"} #define ADDITIONAL_REGISTER_NAMES \ {{"%fr4L",32}, {"%fr5L",34}, {"%fr6L",36}, {"%fr7L",38}, \ diff --git a/gcc/config/pa/pa64-regs.h b/gcc/config/pa/pa64-regs.h index 042e0c47c68..32e2fa2e677 100644 --- a/gcc/config/pa/pa64-regs.h +++ b/gcc/config/pa/pa64-regs.h @@ -1,5 +1,5 @@ /* Configuration for GCC-compiler for PA-RISC. - Copyright (C) 1999, 2000, 2003, 2004, 2007, 2008 + Copyright (C) 1999, 2000, 2003, 2004, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -38,8 +38,8 @@ along with GCC; see the file COPYING3. If not see issue as using the halves independently triggers false dependency stalls anyway. */ -#define FIRST_PSEUDO_REGISTER 61 /* 32 general regs + 28 fp regs + - + 1 shift reg */ +#define FIRST_PSEUDO_REGISTER 62 /* 32 general regs + 28 fp regs + + + 1 shift reg + frame pointer */ /* 1 for registers that have pervasive standard uses and are not available for the register allocator. @@ -79,8 +79,8 @@ along with GCC; see the file COPYING3. If not see 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, \ - /* shift register */ \ - 0} + /* shift register and soft frame pointer */ \ + 0, 1} /* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any @@ -98,8 +98,8 @@ along with GCC; see the file COPYING3. If not see 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, \ - /* shift register */ \ - 1} + /* shift register and soft frame pointer */ \ + 1, 1} #define CONDITIONAL_REGISTER_USAGE \ { \ @@ -137,7 +137,7 @@ along with GCC; see the file COPYING3. If not see 3, 4, 5, 6, 7, 8, 9, 10, \ 11, 12, 13, 14, 15, 16, 17, 18, \ /* special registers. */ \ - 1, 27, 30, 0, 60} + 1, 27, 30, 0, 60, 61} /* Return number of consecutive hard regs needed starting at reg REGNO @@ -235,12 +235,12 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, #define REG_CLASS_CONTENTS \ {{0x00000000, 0x00000000}, /* NO_REGS */ \ {0x00000002, 0x00000000}, /* R1_REGS */ \ - {0xfffffffe, 0x00000000}, /* GENERAL_REGS */ \ + {0xfffffffe, 0x20000000}, /* GENERAL_REGS */ \ {0x00000000, 0x00000000}, /* FPUPPER_REGS */ \ {0x00000000, 0x0fffffff}, /* FP_REGS */ \ - {0xfffffffe, 0x0fffffff}, /* GENERAL_OR_FP_REGS */ \ + {0xfffffffe, 0x2fffffff}, /* GENERAL_OR_FP_REGS */ \ {0x00000000, 0x10000000}, /* SHIFT_REGS */ \ - {0xfffffffe, 0x1fffffff}} /* ALL_REGS */ + {0xfffffffe, 0x3fffffff}} /* ALL_REGS */ /* The following macro defines cover classes for Integrated Register Allocator. Cover classes is a set of non-intersected register @@ -267,7 +267,7 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, #define REGNO_REG_CLASS(REGNO) \ ((REGNO) == 0 ? NO_REGS \ : (REGNO) == 1 ? R1_REGS \ - : (REGNO) < 32 ? GENERAL_REGS \ + : (REGNO) < 32 || (REGNO) == 61 ? GENERAL_REGS \ : (REGNO) < 60 ? FP_REGS \ : SHIFT_REGS) @@ -293,7 +293,7 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, "%fr4", "%fr5", "%fr6", "%fr7", "%fr8", "%fr9", "%fr10", "%fr11", \ "%fr12", "%fr13", "%fr14", "%fr15", "%fr16", "%fr17", "%fr18", "%fr19", \ "%fr20", "%fr21", "%fr22", "%fr23", "%fr24", "%fr25", "%fr26", "%fr27", \ - "%fr28", "%fr29", "%fr30", "%fr31", "SAR"} + "%fr28", "%fr29", "%fr30", "%fr31", "SAR", "sfp"} #define ADDITIONAL_REGISTER_NAMES \ {{"%cr11",60}} diff --git a/gcc/config/pdp11/pdp11-protos.h b/gcc/config/pdp11/pdp11-protos.h index 2c4bd22fde6..16c070df155 100644 --- a/gcc/config/pdp11/pdp11-protos.h +++ b/gcc/config/pdp11/pdp11-protos.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler, for the pdp-11 - Copyright (C) 2000, 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). This file is part of GCC. @@ -34,7 +35,7 @@ extern const char *output_move_quad (rtx *); extern const char *output_block_move (rtx *); extern const char *output_jump (enum rtx_code, int, int); extern void print_operand_address (FILE *, rtx); -extern int register_move_cost (enum reg_class, enum reg_class); +extern int pdp11_register_move_cost (enum reg_class, enum reg_class); #endif /* RTX_CODE */ extern void output_ascii (FILE *, const char *, int); diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index 186fbede3bd..2812e9509b1 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -145,6 +145,7 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED, /* rtx cc0_reg_rtx; - no longer needed? */ static bool pdp11_handle_option (size_t, const char *, int); +static void pdp11_option_optimization (int, int); static rtx find_addr_reg (rtx); static const char *singlemove_string (rtx *); static bool pdp11_assemble_integer (rtx, unsigned int, int); @@ -182,6 +183,8 @@ static void pdp11_trampoline_init (rtx, tree, rtx); (MASK_FPU | MASK_45 | MASK_ABSHI_BUILTIN | TARGET_UNIX_ASM_DEFAULT) #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION pdp11_handle_option +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION pdp11_option_optimization #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS pdp11_rtx_costs @@ -218,6 +221,21 @@ pdp11_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, } } +/* Implement TARGET_OPTION_OPTIMIZATION. */ + +static void +pdp11_option_optimization (int level, int size ATTRIBUTE_UNUSED) +{ + flag_finite_math_only = 0; + flag_trapping_math = 0; + flag_signaling_nans = 0; + if (level >= 3) + { + flag_omit_frame_pointer = 1; + /* flag_unroll_loops = 1; */ + } +} + /* Nonzero if OP is a valid second operand for an arithmetic insn. */ int @@ -1070,7 +1088,7 @@ static const int move_costs[N_REG_CLASSES][N_REG_CLASSES] = -- as we do here with 22 -- or not ? */ int -register_move_cost(enum reg_class c1, enum reg_class c2) +pdp11_register_move_cost (enum reg_class c1, enum reg_class c2) { return move_costs[(int)c1][(int)c2]; } diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index 006fb4cbd86..332e99db245 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -764,7 +764,7 @@ extern int may_call_alloca; /* cost of moving one register class to another */ #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ - register_move_cost (CLASS1, CLASS2) + pdp11_register_move_cost (CLASS1, CLASS2) /* Tell emit-rtl.c how to initialize special values on a per-function base. */ extern int optimize; @@ -949,28 +949,6 @@ extern struct rtx_def *cc0_reg_rtx; #define TRAMPOLINE_SIZE 8 #define TRAMPOLINE_ALIGNMENT 16 -/* Some machines may desire to change what optimizations are - performed for various optimization levels. This macro, if - defined, is executed once just after the optimization level is - determined and before the remainder of the command options have - been parsed. Values set in this macro are used as the default - values for the other command line options. - - LEVEL is the optimization level specified; 2 if -O2 is - specified, 1 if -O is specified, and 0 if neither is specified. */ - -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ -{ \ - flag_finite_math_only = 0; \ - flag_trapping_math = 0; \ - flag_signaling_nans = 0; \ - if (LEVEL >= 3) \ - { \ - flag_omit_frame_pointer = 1; \ - /* flag_unroll_loops = 1; */ \ - } \ -} - /* there is no point in avoiding branches on a pdp, since branches are really cheap - I just want to find out how much difference the BRANCH_COST macro makes in code */ diff --git a/gcc/config/picochip/picochip-protos.h b/gcc/config/picochip/picochip-protos.h index 268b80595e0..c80bf70b4b0 100644 --- a/gcc/config/picochip/picochip-protos.h +++ b/gcc/config/picochip/picochip-protos.h @@ -1,6 +1,6 @@ /* Prototypes for exported functions defined in picochip.c - Copyright (C) 2000, 2001, 2008 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by picoChip Designs Ltd. (http://www.picochip.com) Maintained by Daniel Towner (daniel.towner@picochip.com) and Hariharan Sandanagobalane (hariharan@picochip.com). @@ -91,7 +91,6 @@ extern void picochip_expand_epilogue (int is_sibling_call); extern void picochip_final_prescan_insn (rtx insn, rtx * operand, int num_operands); extern const char *picochip_asm_output_opcode (FILE * f, const char *ptr); -extern void picochip_override_options (void); extern int picochip_check_conditional_copy (rtx * operands); @@ -138,7 +137,7 @@ extern int picochip_flag_schedule_insns2; extern void picochip_asm_output_anchor (rtx symbol); /* Instruction set capability flags. These are initialised to the - appropriate values by picochip_override_options, once the user has + appropriate values by picochip_option_override, once the user has selected a CPU type. */ extern bool picochip_has_mul_unit; extern bool picochip_has_mac_unit; diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c index 30c49224a67..9bd2382915b 100644 --- a/gcc/config/picochip/picochip.c +++ b/gcc/config/picochip/picochip.c @@ -117,6 +117,8 @@ picochip_asm_named_section (const char *name, static rtx picochip_static_chain (const_tree, bool); +static void picochip_option_override (void); + /* Lookup table mapping a register number to the earliest containing class. Used by REGNO_REG_CLASS. */ const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER] = @@ -301,8 +303,11 @@ static char picochip_get_vliw_alu_id (void); #undef TARGET_STATIC_CHAIN #define TARGET_STATIC_CHAIN picochip_static_chain +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE picochip_option_override + #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE -#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_override_options +#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_option_override struct gcc_target targetm = TARGET_INITIALIZER; @@ -317,9 +322,13 @@ picochip_return_in_memory(const_tree type, const_tree fntype ATTRIBUTE_UNUSED) return ((unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 4); } -/* Allow certain command options to be overriden. */ -void -picochip_override_options (void) +/* Allow some options to be overriden. In particular, the 2nd + scheduling pass option is switched off, and a machine dependent + reorganisation ensures that it is run later on, after the second + jump optimisation. */ + +static void +picochip_option_override (void) { /* If we are optimizing for stack, dont let inliner to inline functions that could potentially increase stack size.*/ @@ -1760,7 +1769,7 @@ picochip_asm_file_start (void) /* Variable tracking should be run after all optimizations which change order of insns. It also needs a valid CFG. This can't be done in - picochip_override_options, because flag_var_tracking is finalized after + picochip_option_override, because flag_var_tracking is finalized after that. */ picochip_flag_var_tracking = flag_var_tracking; flag_var_tracking = 0; @@ -3138,40 +3147,68 @@ static void reorder_var_tracking_notes (void) { basic_block bb; + FOR_EACH_BB (bb) { - rtx insn, next; + rtx insn, next, last_insn = NULL_RTX; + rtx vliw_start = NULL_RTX; rtx queue = NULL_RTX; - for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = next) - { - next = NEXT_INSN (insn); + /* Iterate through the bb and find the last non-debug insn */ + for (insn = BB_HEAD (bb); insn != NEXT_INSN(BB_END (bb)); insn = NEXT_INSN(insn)) + { + if (NONDEBUG_INSN_P(insn)) + last_insn = insn; + } - if (NONDEBUG_INSN_P (insn)) - { - /* Emit queued up notes before the first instruction of a bundle. */ - if (GET_MODE (insn) == TImode) - { - while (queue) - { - rtx next_queue = PREV_INSN (queue); - NEXT_INSN (PREV_INSN(insn)) = queue; - PREV_INSN (queue) = PREV_INSN(insn); - PREV_INSN (insn) = queue; - NEXT_INSN (queue) = insn; - queue = next_queue; - } - } - } - else if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION) - { - rtx prev = PREV_INSN (insn); - PREV_INSN (next) = prev; - NEXT_INSN (prev) = next; + /* In all normal cases, queue up notes and emit them just before a TImode + instruction. For the last instruction, emit the queued notes just after + the last instruction. */ + for (insn = BB_HEAD (bb); insn != NEXT_INSN(BB_END (bb)); insn = next) + { + next = NEXT_INSN (insn); + + if (insn == last_insn) + { + while (queue) + { + rtx next_queue = PREV_INSN (queue); + PREV_INSN (NEXT_INSN(insn)) = queue; + NEXT_INSN(queue) = NEXT_INSN(insn); + PREV_INSN(queue) = insn; + NEXT_INSN(insn) = queue; + queue = next_queue; + } + /* There is no more to do for this bb. break*/ + break; + } + else if (NONDEBUG_INSN_P (insn)) + { + /* Emit queued up notes before the first instruction of a bundle. */ + if (GET_MODE (insn) == TImode) + { + while (queue) + { + rtx next_queue = PREV_INSN (queue); + NEXT_INSN (PREV_INSN(insn)) = queue; + PREV_INSN (queue) = PREV_INSN(insn); + PREV_INSN (insn) = queue; + NEXT_INSN (queue) = insn; + queue = next_queue; + } + } + } + else if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION) + { + rtx prev = PREV_INSN (insn); + PREV_INSN (next) = prev; + NEXT_INSN (prev) = next; PREV_INSN (insn) = queue; - queue = insn; - } - } + queue = insn; + } + } + /* Make sure we are not dropping debug instructions.*/ + gcc_assert (queue == NULL_RTX); } } @@ -3262,7 +3299,7 @@ picochip_reorg (void) for (insn = get_insns (); insn; insn = next_insn (insn)) { /* The prologue end must be moved to the end of the VLIW packet. */ - if (NOTE_KIND (insn) == NOTE_INSN_PROLOGUE_END) + if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_PROLOGUE_END) { prologue_end_note = insn; break; diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h index b4aec727df5..cf81f59bb53 100644 --- a/gcc/config/picochip/picochip.h +++ b/gcc/config/picochip/picochip.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler for picoChip - Copyright (C) 2001, 2008 Free Software Foundation, Inc. + Copyright (C) 2001, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by picoChip Designs Ltd. (http://www.picochip.com) Maintained by Daniel Towner (daniel.towner@picochip.com) and @@ -84,12 +84,6 @@ extern enum picochip_dfa_type picochip_schedule_type; #define TARGET_HAS_MAC_UNIT (picochip_has_mac_unit) #define TARGET_HAS_MULTIPLY (picochip_has_mac_unit || picochip_has_mul_unit) -/* Allow some options to be overriden. In particular, the 2nd - scheduling pass option is switched off, and a machine dependent - reorganisation ensures that it is run later on, after the second - jump optimisation. */ -#define OVERRIDE_OPTIONS picochip_override_options() - #define CAN_DEBUG_WITHOUT_FP 1 #define TARGET_VERSION fprintf(stderr, "(picoChip)"); diff --git a/gcc/config/picochip/picochip.md b/gcc/config/picochip/picochip.md index 6186eaa880b..b274c1ac77e 100644 --- a/gcc/config/picochip/picochip.md +++ b/gcc/config/picochip/picochip.md @@ -622,7 +622,7 @@ ; Match a branch instruction, created from a tstport/cbranch split. ; We use a "use" clause so GCC doesnt try to use this pattern generally. -(define_insn "*branch" +(define_insn "branch" [(set (pc) (if_then_else (match_operator 2 "comparison_operator" @@ -2511,22 +2511,38 @@ ;;============================================================================ ;; Define expand seems to consider the resulting two instructions to be -;; independent. It was moving the actual copy instruction further down -;; with a call instruction in between. The call was clobbering the CC -;; and hence the cond_copy was wrong. With a split, it works correctly. +;; independent. With a split, guarded by reload, it works correctly. (define_expand "movhicc" - [(set (reg:CC CC_REGNUM) (match_operand 1 "comparison_operator" "")) - (parallel [(set (match_operand:HI 0 "register_operand" "=r,r") - (if_then_else:HI (match_op_dup:HI 1 [(reg:CC CC_REGNUM) (const_int 0)]) - (match_operand:HI 2 "picochip_register_or_immediate_operand" "0,0") - (match_operand:HI 3 "picochip_register_or_immediate_operand" "r,i"))) - (use (match_dup 4))])] + [(set (match_operand:HI 0 "register_operand" "=r,r") + (if_then_else:HI (match_operand:HI 1 "" "") + (match_operand:HI 2 "register_operand" "0,0") + (match_operand:HI 3 "picochip_register_or_immediate_operand" "r,i")))] "" {if (!picochip_check_conditional_copy (operands)) FAIL; operands[4] = GEN_INT(GET_CODE(operands[1])); }) +(define_insn_and_split "*checked_movhicc" + [(set (match_operand:HI 0 "register_operand" "=r,r") + (if_then_else:HI (match_operator 1 "picochip_peephole_comparison_operator" + [(match_operand:HI 4 "register_operand" "r,r") + (match_operand:HI 5 "picochip_comparison_operand" "r,i")]) + (match_operand:HI 2 "register_operand" "0,0") + (match_operand:HI 3 "picochip_register_or_immediate_operand" "r,i")))] + "" + "#" + "reload_completed" + [(set (reg:CC CC_REGNUM) (match_dup 1)) + (parallel [(set (match_operand:HI 0 "register_operand" "=r,r") + (if_then_else:HI (match_op_dup:HI 1 [(reg:CC CC_REGNUM) (const_int 0)]) + (match_operand:HI 2 "picochip_register_or_immediate_operand" "0,0") + (match_operand:HI 3 "picochip_register_or_immediate_operand" "r,i"))) + (use (match_dup 6))])] + "{ + operands[6] = GEN_INT(GET_CODE(operands[0])); + }") + ;; We dont do any checks here. But this pattern is used only when movhicc ;; was checked. Put a "use" clause to make sure. (define_insn "*conditional_copy" @@ -2534,7 +2550,7 @@ (if_then_else:HI (match_operator:HI 4 "picochip_peephole_comparison_operator" [(reg:CC CC_REGNUM) (const_int 0)]) - (match_operand:HI 1 "picochip_register_or_immediate_operand" "0,0") + (match_operand:HI 1 "register_operand" "0,0") (match_operand:HI 2 "picochip_register_or_immediate_operand" "r,i"))) (use (match_operand:HI 3 "const_int_operand" ""))] "" diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h index bbe23373060..8e285decbe6 100644 --- a/gcc/config/rs6000/aix43.h +++ b/gcc/config/rs6000/aix43.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX version 4.3. Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). This file is part of GCC. @@ -20,14 +20,8 @@ along with GCC; see the file COPYING3. If not see . */ -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to - get control. */ +/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control in TARGET_OPTION_OVERRIDE. */ #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) #define SUBTARGET_OVERRIDE_OPTIONS \ diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h index 32bdbb41f28..90d504f61b6 100644 --- a/gcc/config/rs6000/aix51.h +++ b/gcc/config/rs6000/aix51.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V5. - Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008 + Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). @@ -20,14 +20,8 @@ along with GCC; see the file COPYING3. If not see . */ -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to - get control. */ +/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control in TARGET_OPTION_OVERRIDE. */ #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) #define SUBTARGET_OVERRIDE_OPTIONS \ diff --git a/gcc/config/rs6000/aix52.h b/gcc/config/rs6000/aix52.h index 8d6c2411621..a0fa2188697 100644 --- a/gcc/config/rs6000/aix52.h +++ b/gcc/config/rs6000/aix52.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V5.2. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). @@ -20,14 +20,8 @@ along with GCC; see the file COPYING3. If not see . */ -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to - get control. */ +/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control in TARGET_OPTION_OVERRIDE. */ #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) #define SUBTARGET_OVERRIDE_OPTIONS \ diff --git a/gcc/config/rs6000/aix53.h b/gcc/config/rs6000/aix53.h index b7b1eec9adf..381e0d662e0 100644 --- a/gcc/config/rs6000/aix53.h +++ b/gcc/config/rs6000/aix53.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V5.3. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). @@ -20,14 +20,8 @@ along with GCC; see the file COPYING3. If not see . */ -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to - get control. */ +/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control in TARGET_OPTION_OVERRIDE. */ #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) #define SUBTARGET_OVERRIDE_OPTIONS \ diff --git a/gcc/config/rs6000/aix61.h b/gcc/config/rs6000/aix61.h index 048486b108b..4f949cffe65 100644 --- a/gcc/config/rs6000/aix61.h +++ b/gcc/config/rs6000/aix61.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V6.1. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). @@ -20,14 +20,8 @@ along with GCC; see the file COPYING3. If not see . */ -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to - get control. */ +/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control in TARGET_OPTION_OVERRIDE. */ #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) #define SUBTARGET_OVERRIDE_OPTIONS \ diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 0e165ea7199..62eed2edc28 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -134,7 +134,7 @@ extern enum rs6000_cmodel cmodel; else \ { \ if (!rs6000_explicit_options.cmodel) \ - SET_CMODEL (CMODEL_LARGE); \ + SET_CMODEL (CMODEL_MEDIUM); \ if (cmodel != CMODEL_SMALL) \ { \ TARGET_NO_FP_IN_TOC = 0; \ @@ -162,10 +162,10 @@ extern enum rs6000_cmodel cmodel; #ifdef RS6000_BI_ARCH -#undef OVERRIDE_OPTIONS -#define OVERRIDE_OPTIONS \ - rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ - ? (char *) 0 : TARGET_CPU_DEFAULT) +#undef OPTION_TARGET_CPU_DEFAULT +#define OPTION_TARGET_CPU_DEFAULT \ + (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ + ? (char *) 0 : TARGET_CPU_DEFAULT) #endif diff --git a/gcc/config/rs6000/rs6000-modes.def b/gcc/config/rs6000/rs6000-modes.def index 216794647cf..724c947f14a 100644 --- a/gcc/config/rs6000/rs6000-modes.def +++ b/gcc/config/rs6000/rs6000-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. - Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2007, 2010 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -19,7 +19,7 @@ . */ /* 128-bit floating point. ABI_V4 uses IEEE quad, AIX/Darwin - adjust this in rs6000_override_options. */ + adjust this in rs6000_option_override_internal. */ FLOAT_MODE (TF, 16, ieee_quad_format); /* Add any extra modes needed to represent the condition code. diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 8708accd7ea..a5e055ed3cf 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -87,7 +87,6 @@ extern int extract_ME (rtx); extern void rs6000_output_function_entry (FILE *, const char *); extern void print_operand (FILE *, rtx, int); extern void print_operand_address (FILE *, rtx); -extern bool rs6000_output_addr_const_extra (FILE *, rtx); extern enum rtx_code rs6000_reverse_condition (enum machine_mode, enum rtx_code); extern void rs6000_emit_sISEL (enum machine_mode, rtx[]); @@ -129,6 +128,9 @@ extern void rs6000_emit_parity (rtx, rtx); extern rtx rs6000_machopic_legitimize_pic_address (rtx, enum machine_mode, rtx); +extern rtx rs6000_address_for_fpconvert (rtx); +extern rtx rs6000_allocate_stack_temp (enum machine_mode, bool, bool); +extern void rs6000_expand_convert_si_to_sfdf (rtx, rtx, bool); #endif /* RTX_CODE */ #ifdef TREE_CODE @@ -136,10 +138,7 @@ extern unsigned int rs6000_special_round_type_align (tree, unsigned int, unsigned int); extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int, unsigned int); -extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, - tree, int, int); -extern int function_arg_boundary (enum machine_mode, tree); -extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern int function_arg_boundary (enum machine_mode, const_tree); extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *); extern rtx rs6000_libcall_value (enum machine_mode); extern rtx rs6000_va_arg (tree, tree); @@ -153,8 +152,6 @@ extern enum direction function_arg_padding (enum machine_mode, const_tree); #endif /* TREE_CODE */ -extern void optimization_options (int, int); -extern void rs6000_override_options (const char *); extern int direct_return (void); extern int first_reg_to_save (void); extern int first_fp_reg_to_save (void); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 95968a8cd8b..55cb92fa4ad 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -996,6 +996,7 @@ static tree rs6000_builtin_vectorized_libmass (tree, tree, tree); static tree rs6000_builtin_vectorized_function (tree, tree, tree); static int rs6000_savres_strategy (rs6000_stack_t *, bool, int, int); static void rs6000_restore_saved_cr (rtx, int); +static bool rs6000_output_addr_const_extra (FILE *, rtx); static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT); static void rs6000_output_function_epilogue (FILE *, HOST_WIDE_INT); static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, @@ -1085,6 +1086,7 @@ static bool rs6000_builtin_support_vector_misalignment (enum int, bool); static int rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt, tree, int); +static unsigned int rs6000_units_per_simd_word (enum machine_mode); static void def_builtin (int, const char *, tree, int); static bool rs6000_vector_alignment_reachable (const_tree, bool); @@ -1133,6 +1135,8 @@ static rtx altivec_expand_vec_init_builtin (tree, tree, rtx); static rtx altivec_expand_vec_set_builtin (tree); static rtx altivec_expand_vec_ext_builtin (tree, rtx); static int get_element_number (tree, tree); +static void rs6000_option_override (void); +static void rs6000_option_optimization (int, int); static bool rs6000_handle_option (size_t, const char *, int); static void rs6000_parse_tls_size_option (void); static void rs6000_parse_yes_no_option (const char *, const char *, int *); @@ -1155,20 +1159,25 @@ static int rs6000_tls_symbol_ref_1 (rtx *, void *); static const char *rs6000_get_some_local_dynamic_name (void); static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *); static rtx rs6000_complex_function_value (enum machine_mode); -static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *, - enum machine_mode, tree); +static rtx rs6000_spe_function_arg (const CUMULATIVE_ARGS *, + enum machine_mode, const_tree); static void rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *, HOST_WIDE_INT, int); static void rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *, - tree, HOST_WIDE_INT); + const_tree, + HOST_WIDE_INT); static void rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *, HOST_WIDE_INT, rtx[], int *); static void rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *, const_tree, HOST_WIDE_INT, rtx[], int *); -static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, int, bool); -static rtx rs6000_mixed_function_arg (enum machine_mode, tree, int); +static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, bool, bool); +static rtx rs6000_mixed_function_arg (enum machine_mode, const_tree, int); +static void rs6000_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static rtx rs6000_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static void rs6000_move_block_from_reg (int regno, rtx x, int nregs); static void setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, @@ -1424,6 +1433,9 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue +#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA +#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA rs6000_output_addr_const_extra + #undef TARGET_LEGITIMIZE_ADDRESS #define TARGET_LEGITIMIZE_ADDRESS rs6000_legitimize_address @@ -1480,6 +1492,9 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST #define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST \ rs6000_builtin_vectorization_cost +#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD +#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD \ + rs6000_units_per_simd_word #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS rs6000_init_builtins @@ -1554,6 +1569,10 @@ static const struct attribute_spec rs6000_attribute_table[] = #define TARGET_PASS_BY_REFERENCE rs6000_pass_by_reference #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES rs6000_arg_partial_bytes +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE rs6000_function_arg_advance +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG rs6000_function_arg #undef TARGET_BUILD_BUILTIN_VA_LIST #define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list @@ -1579,6 +1598,12 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION rs6000_handle_option +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE rs6000_option_override + +#undef TARGET_OPTION_OPTIMIZATION +#define TARGET_OPTION_OPTIMIZATION rs6000_option_optimization + #undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION #define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \ rs6000_builtin_vectorized_function @@ -2384,8 +2409,8 @@ darwin_rs6000_override_options (void) /* Override command line options. Mostly we process the processor type and sometimes adjust other TARGET_ options. */ -void -rs6000_override_options (const char *default_cpu) +static void +rs6000_option_override_internal (const char *default_cpu) { size_t i, j; struct rs6000_cpu_select *ptr; @@ -2501,10 +2526,10 @@ rs6000_override_options (const char *default_cpu) POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP | MASK_MFPGPR | MASK_RECIP_PRECISION}, - {"power7", PROCESSOR_POWER7, + {"power7", PROCESSOR_POWER7, /* Don't add MASK_ISEL by default */ POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP | MASK_POPCNTD - | MASK_VSX| MASK_RECIP_PRECISION}, /* Don't add MASK_ISEL by default */ + | MASK_VSX | MASK_RECIP_PRECISION}, {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK}, {"powerpc64", PROCESSOR_POWERPC64, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}, @@ -2541,15 +2566,19 @@ rs6000_override_options (const char *default_cpu) ISA_2_1_MASKS = MASK_MFCRF, ISA_2_2_MASKS = (ISA_2_1_MASKS | MASK_POPCNTB | MASK_FPRND), - /* For ISA 2.05, do not add MFPGPR, since it isn't in ISA 2.06, and - don't add ALTIVEC, since in general it isn't a win on power6. */ - ISA_2_5_MASKS = (ISA_2_2_MASKS | MASK_CMPB | MASK_RECIP_PRECISION - | MASK_DFP), + /* For ISA 2.05, do not add MFPGPR, since it isn't in ISA 2.06, and don't + add ALTIVEC, since in general it isn't a win on power6. In ISA 2.04, + fsel, fre, fsqrt, etc. were no longer documented as optional. Group + masks by server and embedded. */ + ISA_2_5_MASKS_EMBEDDED = (ISA_2_2_MASKS | MASK_CMPB | MASK_RECIP_PRECISION + | MASK_PPC_GFXOPT | MASK_PPC_GPOPT), + ISA_2_5_MASKS_SERVER = (ISA_2_5_MASKS_EMBEDDED | MASK_DFP), /* For ISA 2.06, don't add ISEL, since in general it isn't a win, but altivec is a win so enable it. */ - ISA_2_6_MASKS = (ISA_2_5_MASKS | MASK_ALTIVEC | MASK_POPCNTD - | MASK_VSX | MASK_RECIP_PRECISION) + ISA_2_6_MASKS_EMBEDDED = (ISA_2_5_MASKS_EMBEDDED | MASK_POPCNTD), + ISA_2_6_MASKS_SERVER = (ISA_2_5_MASKS_SERVER | MASK_POPCNTD | MASK_ALTIVEC + | MASK_VSX) }; /* Numerous experiment shows that IRA based loop pressure @@ -2690,15 +2719,22 @@ rs6000_override_options (const char *default_cpu) { warning (0, msg); target_flags &= ~ MASK_VSX; + target_flags_explicit |= MASK_VSX; } } /* For the newer switches (vsx, dfp, etc.) set some of the older options, unless the user explicitly used the -mno-